1 | /* |
---|
2 | * stdio.h - User side syscalls definition. |
---|
3 | * |
---|
4 | * Author Alain Greiner (2016,2017) |
---|
5 | * |
---|
6 | * Copyright (c) UPMC Sorbonne Universites |
---|
7 | * |
---|
8 | * This file is part of ALMOS-MKH. |
---|
9 | * |
---|
10 | * ALMOS-MKH is free software; you can redistribute it and/or modify it |
---|
11 | * under the terms of the GNU General Public License as published by |
---|
12 | * the Free Software Foundation; version 2.0 of the License. |
---|
13 | * |
---|
14 | * ALMOS-MKH is distributed in the hope that it will be useful, but |
---|
15 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
17 | * General Public License for more details. |
---|
18 | * |
---|
19 | * You should have received a copy of the GNU General Public License |
---|
20 | * along with ALMOS-MKH; if not, write to the Free Software Foundation, |
---|
21 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
22 | */ |
---|
23 | |
---|
24 | #ifndef _STDIO_H_ |
---|
25 | #define _STDIO_H_ |
---|
26 | |
---|
27 | #include <almos-mkh/stdio.h> |
---|
28 | |
---|
29 | #define NULL (void *)0 |
---|
30 | /********************************************************************************************* |
---|
31 | * This function writes a formated string to the standard "stdout" stream. |
---|
32 | ********************************************************************************************* |
---|
33 | * @ returns number of characters written if success / returns -1 if failure. |
---|
34 | ********************************************************************************************/ |
---|
35 | int printf( const char * format, ... ); |
---|
36 | |
---|
37 | /********************************************************************************************* |
---|
38 | * This function writes one single character to the standard "stdout" stream. |
---|
39 | ********************************************************************************************* |
---|
40 | * @ returns written character code if success / returns 0 (EOF) if failure. |
---|
41 | ********************************************************************************************/ |
---|
42 | int putchar( int c ); |
---|
43 | |
---|
44 | /********************************************************************************************* |
---|
45 | * This function returns one single character from the standard "stdin" stream. |
---|
46 | ********************************************************************************************* |
---|
47 | * @ returns read character code if success / returns 0 (EOF) if failure. |
---|
48 | ********************************************************************************************/ |
---|
49 | int getchar(); |
---|
50 | |
---|
51 | /********************************************************************************************* |
---|
52 | * This function copies a formated string to a fixed size buffer. |
---|
53 | * it includes the NUL terminating character. |
---|
54 | * it cheks that the formated string fit in the buffer length. |
---|
55 | ********************************************************************************************* |
---|
56 | * @ string : pointer on target buffer. |
---|
57 | * @ length : max bumber of characters in target buffer. |
---|
58 | * @ format : formated string. |
---|
59 | * @ returns number of characters written if success / returns -1 if failure. |
---|
60 | ********************************************************************************************/ |
---|
61 | int snprintf( char * string, |
---|
62 | unsigned int length, |
---|
63 | const char * format, ... ); |
---|
64 | |
---|
65 | #endif // _STDIO_H_ |
---|