Miscellaneous calls
[reactos.git] / posix / include / stdio.h
1 /* $Id: stdio.h,v 1.2 2002/02/20 09:17:54 hyperion Exp $
2 */
3 /*
4 * stdio.h
5 *
6 * standard buffered input/output. Conforming to the Single UNIX(r)
7 * Specification Version 2, System Interface & Headers Issue 5
8 *
9 * This file is part of the ReactOS Operating System.
10 *
11 * Contributors:
12 * Created by KJK::Hyperion <noog@libero.it>
13 *
14 * THIS SOFTWARE IS NOT COPYRIGHTED
15 *
16 * This source code is offered for use in the public domain. You may
17 * use, modify or distribute it freely.
18 *
19 * This code is distributed in the hope that it will be useful but
20 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
21 * DISCLAMED. This includes but is not limited to warranties of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23 *
24 */
25 #ifndef __STDIO_H_INCLUDED__
26 #define __STDIO_H_INCLUDED__
27
28 /* INCLUDES */
29 #include <stddef.h>
30 #include <stdarg.h>
31 #include <unistd.h>
32 #include <sys/types.h>
33
34 /* OBJECTS */
35 extern char *optarg;
36 extern int opterr;
37 extern int optind; /* LEGACY */
38 extern int optopt;
39
40 /* TYPES */
41 typedef struct __tagFILE
42 {
43 int _dummy;
44 } FILE;
45
46 typedef struct __tagfpos_t
47 {
48 int _dummy;
49 } fpos_t;
50
51
52 /* CONSTANTS */
53 /* Size of <stdio.h> buffers. */
54 #define BUFSIZ (0x10000)
55
56 /* Maximum size in bytes of the longest filename string that the implementation
57 guarantees can be opened. */
58 #define FILENAME_MAX (255)
59
60 /* Number of streams which the implementation guarantees can be open
61 simultaneously. The value will be at least eight. */
62 #define FOPEN_MAX (8)
63
64 /* Input/output fully buffered. */
65 #define _IOFBF (1)
66 /* Input/output line buffered. */
67 #define _IOLBF (2)
68 /* Input/output unbuffered. */
69 #define _IONBF (3)
70
71 /* Maximum size of character array to hold ctermid() output. */
72 #define L_ctermid (255)
73 /* Maximum size of character array to hold cuserid() output. (LEGACY) */
74 #define L_cuserid (255)
75 /* Maximum size of character array to hold tmpnam() output. */
76 #define L_tmpnam (255)
77
78 /* Minimum number of unique filenames generated by tmpnam(). Maximum number
79 of times an application can call tmpnam() reliably. The value of TMP_MAX
80 will be at least 10,000. */
81 #define TMP_MAX (0xFFFF)
82
83 /* End-of-file return value. */
84 #define EOF (-1)
85
86 /* default directory prefix for tempnam() */
87 #define P_tmpdir "/tmp/"
88
89 /* Standard error output stream. */
90 #define stderr ((FILE *)STDERR_FILENO)
91 /* Standard input stream. */
92 #define stdin ((FILE *)STDIN_FILENO)
93 /* Standard output stream. */
94 #define stdout ((FILE *)STDOUT_FILENO)
95
96 /* PROTOTYPES */
97 void clearerr(FILE *);
98 char *ctermid(char *);
99 char *cuserid(char *); /* LEGACY */
100 int fclose(FILE *);
101 FILE *fdopen(int, const char *);
102 int feof(FILE *);
103 int ferror(FILE *);
104 int fflush(FILE *);
105 int fgetc(FILE *);
106 int fgetpos(FILE *, fpos_t *);
107 char *fgets(char *, int, FILE *);
108 int fileno(FILE *);
109 void flockfile(FILE *);
110 FILE *fopen(const char *, const char *);
111 int fprintf(FILE *, const char *, ...);
112 int fputc(int, FILE *);
113 int fputs(const char *, FILE *);
114 size_t fread(void *, size_t, size_t, FILE *);
115 FILE *freopen(const char *, const char *, FILE *);
116 int fscanf(FILE *, const char *, ...);
117 int fseek(FILE *, long int, int);
118 int fseeko(FILE *, off_t, int);
119 int fsetpos(FILE *, const fpos_t *);
120 long int ftell(FILE *);
121 off_t ftello(FILE *);
122 int ftrylockfile(FILE *);
123 void funlockfile(FILE *);
124 size_t fwrite(const void *, size_t, size_t, FILE *);
125 int getc(FILE *);
126 int getchar(void);
127 int getc_unlocked(FILE *);
128 int getchar_unlocked(void);
129 int getopt(int, char * const[], const char *); /* LEGACY */
130 char *gets(char *);
131 int getw(FILE *);
132 int pclose(FILE *);
133 void perror(const char *);
134 FILE *popen(const char *, const char *);
135 int printf(const char *, ...);
136 int putc(int, FILE *);
137 int putchar(int);
138 int putc_unlocked(int, FILE *);
139 int putchar_unlocked(int);
140 int puts(const char *);
141 int putw(int, FILE *);
142 int remove(const char *);
143 int rename(const char *, const char *);
144 void rewind(FILE *);
145 int scanf(const char *, ...);
146 void setbuf(FILE *, char *);
147 int setvbuf(FILE *, char *, int, size_t);
148 int snprintf(char *, size_t, const char *, ...);
149 int sprintf(char *, const char *, ...);
150 int sscanf(const char *, const char *, int, ...);
151 char *tempnam(const char *, const char *);
152 FILE *tmpfile(void);
153 char *tmpnam(char *);
154 int ungetc(int, FILE *);
155 int vfprintf(FILE *, const char *, va_list);
156 int vprintf(const char *, va_list);
157 int vsnprintf(char *, size_t, const char *, va_list);
158 int vsprintf(char *, const char *, va_list);
159
160 /* MACROS */
161
162 #endif /* __STDIO_H_INCLUDED__ */
163
164 /* EOF */
165