Changeset fdf97f6 in mainline for uspace/lib/posix/include/posix/stdio.h
- Timestamp:
- 2013-02-25T19:11:50Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1935591
- Parents:
- c84f1a4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/include/posix/stdio.h
rc84f1a4 rfdf97f6 37 37 #define POSIX_STDIO_H_ 38 38 39 #ifndef __POSIX_DEF__ 40 #define __POSIX_DEF__(x) x 41 /* DEBUG macro does not belong to POSIX stdio.h. Its unconditional 42 * definition in the native stdio.h causes unexpected behaviour of 43 * applications which uses their own DEBUG macro (e.g. debugging 44 * output is printed even if not desirable). */ 45 #undef DEBUG 46 #endif 47 39 48 #include "stddef.h" 40 49 #include "unistd.h" … … 97 106 extern size_t fwrite(const void *, size_t, size_t, FILE *); 98 107 99 extern int fseek(FILE *, off64_t, int);100 108 extern void rewind(FILE *); 101 extern off64_t ftell(FILE *);102 109 extern int feof(FILE *); 103 110 extern int fileno(FILE *); … … 115 122 #undef L_ctermid 116 123 #define L_ctermid PATH_MAX 117 extern char * posix_ctermid(char *s);124 extern char *__POSIX_DEF__(ctermid)(char *s); 118 125 119 126 /* Error Recovery */ 120 extern void posix_clearerr(FILE *stream);127 extern void __POSIX_DEF__(clearerr)(FILE *stream); 121 128 122 129 /* Input/Output */ 123 130 #undef putc 124 131 #define putc fputc 125 extern int posix_fputs(const char *restrict s, FILE *restrict stream);132 extern int __POSIX_DEF__(fputs)(const char *restrict s, FILE *restrict stream); 126 133 #undef getc 127 134 #define getc fgetc 128 extern int posix_ungetc(int c, FILE *stream);129 extern ssize_t posix_getdelim(char **restrict lineptr, size_t *restrict n,135 extern int __POSIX_DEF__(ungetc)(int c, FILE *stream); 136 extern ssize_t __POSIX_DEF__(getdelim)(char **restrict lineptr, size_t *restrict n, 130 137 int delimiter, FILE *restrict stream); 131 extern ssize_t posix_getline(char **restrict lineptr, size_t *restrict n,138 extern ssize_t __POSIX_DEF__(getline)(char **restrict lineptr, size_t *restrict n, 132 139 FILE *restrict stream); 133 140 134 141 /* Opening Streams */ 135 extern FILE * posix_freopen(const char *restrict filename,142 extern FILE *__POSIX_DEF__(freopen)(const char *restrict filename, 136 143 const char *restrict mode, FILE *restrict stream); 137 144 138 145 /* Error Messages */ 139 extern void posix_perror(const char *s);146 extern void __POSIX_DEF__(perror)(const char *s); 140 147 141 148 /* File Positioning */ 142 typedef struct _posix_fpos posix_fpos_t;143 extern int posix_fsetpos(FILE *stream, const posix_fpos_t*pos);144 extern int posix_fgetpos(FILE *restrict stream, posix_fpos_t*restrict pos);145 extern int posix_fseek(FILE *stream, long offset, int whence);146 extern int posix_fseeko(FILE *stream, posix_off_toffset, int whence);147 extern long posix_ftell(FILE *stream);148 extern posix_off_t posix_ftello(FILE *stream);149 typedef struct _posix_fpos __POSIX_DEF__(fpos_t); 150 extern int __POSIX_DEF__(fsetpos)(FILE *stream, const __POSIX_DEF__(fpos_t) *pos); 151 extern int __POSIX_DEF__(fgetpos)(FILE *restrict stream, __POSIX_DEF__(fpos_t) *restrict pos); 152 extern int __POSIX_DEF__(fseek)(FILE *stream, long offset, int whence); 153 extern int __POSIX_DEF__(fseeko)(FILE *stream, __POSIX_DEF__(off_t) offset, int whence); 154 extern long __POSIX_DEF__(ftell)(FILE *stream); 155 extern __POSIX_DEF__(off_t) __POSIX_DEF__(ftello)(FILE *stream); 149 156 150 157 /* Flushing Buffers */ 151 extern int posix_fflush(FILE *stream);158 extern int __POSIX_DEF__(fflush)(FILE *stream); 152 159 153 160 /* Formatted Output */ 154 extern int posix_dprintf(int fildes, const char *restrict format, ...)161 extern int __POSIX_DEF__(dprintf)(int fildes, const char *restrict format, ...) 155 162 PRINTF_ATTRIBUTE(2, 3); 156 extern int posix_vdprintf(int fildes, const char *restrict format, va_list ap);157 extern int posix_sprintf(char *restrict s, const char *restrict format, ...)163 extern int __POSIX_DEF__(vdprintf)(int fildes, const char *restrict format, va_list ap); 164 extern int __POSIX_DEF__(sprintf)(char *restrict s, const char *restrict format, ...) 158 165 PRINTF_ATTRIBUTE(2, 3); 159 extern int posix_vsprintf(char *restrict s, const char *restrict format, va_list ap);166 extern int __POSIX_DEF__(vsprintf)(char *restrict s, const char *restrict format, va_list ap); 160 167 161 168 /* Formatted Input */ 162 extern int posix_fscanf(169 extern int __POSIX_DEF__(fscanf)( 163 170 FILE *restrict stream, const char *restrict format, ...); 164 extern int posix_vfscanf(171 extern int __POSIX_DEF__(vfscanf)( 165 172 FILE *restrict stream, const char *restrict format, va_list arg); 166 extern int posix_scanf(const char *restrict format, ...);167 extern int posix_vscanf(const char *restrict format, va_list arg);168 extern int posix_sscanf(173 extern int __POSIX_DEF__(scanf)(const char *restrict format, ...); 174 extern int __POSIX_DEF__(vscanf)(const char *restrict format, va_list arg); 175 extern int __POSIX_DEF__(sscanf)( 169 176 const char *restrict s, const char *restrict format, ...); 170 extern int posix_vsscanf(177 extern int __POSIX_DEF__(vsscanf)( 171 178 const char *restrict s, const char *restrict format, va_list arg); 172 179 173 180 /* File Locking */ 174 extern void posix_flockfile(FILE *file);175 extern int posix_ftrylockfile(FILE *file);176 extern void posix_funlockfile(FILE *file);177 extern int posix_getc_unlocked(FILE *stream);178 extern int posix_getchar_unlocked(void);179 extern int posix_putc_unlocked(int c, FILE *stream);180 extern int posix_putchar_unlocked(int c);181 extern void __POSIX_DEF__(flockfile)(FILE *file); 182 extern int __POSIX_DEF__(ftrylockfile)(FILE *file); 183 extern void __POSIX_DEF__(funlockfile)(FILE *file); 184 extern int __POSIX_DEF__(getc_unlocked)(FILE *stream); 185 extern int __POSIX_DEF__(getchar_unlocked)(void); 186 extern int __POSIX_DEF__(putc_unlocked)(int c, FILE *stream); 187 extern int __POSIX_DEF__(putchar_unlocked)(int c); 181 188 182 189 /* Deleting Files */ 183 extern int posix_remove(const char *path);190 extern int __POSIX_DEF__(remove)(const char *path); 184 191 185 192 /* Renaming Files */ 186 extern int posix_rename(const char *old, const char *new);193 extern int __POSIX_DEF__(rename)(const char *old, const char *new); 187 194 188 195 /* Temporary Files */ 189 196 #undef L_tmpnam 190 197 #define L_tmpnam PATH_MAX 191 extern char *posix_tmpnam(char *s); 192 extern char *posix_tempnam(const char *dir, const char *pfx); 193 extern FILE *posix_tmpfile(void); 194 195 #ifndef LIBPOSIX_INTERNAL 196 /* DEBUG macro does not belong to POSIX stdio.h. Its unconditional 197 * definition in the native stdio.h causes unexpected behaviour of 198 * applications which uses their own DEBUG macro (e.g. debugging 199 * output is printed even if not desirable). */ 200 #undef DEBUG 201 202 #define ctermid posix_ctermid 203 204 #define clearerr posix_clearerr 205 206 #define fputs posix_fputs 207 #define ungetc posix_ungetc 208 #define getdelim posix_getdelim 209 #define getline posix_getline 210 211 #define freopen posix_freopen 212 213 #define perror posix_perror 214 215 #define fpos_t posix_fpos_t 216 #define fsetpos posix_fsetpos 217 #define fgetpos posix_fgetpos 218 #define fseek posix_fseek 219 #define fseeko posix_fseeko 220 #define ftell posix_ftell 221 #define ftello posix_ftello 222 223 #define fflush posix_fflush 224 225 #define dprintf posix_dprintf 226 #define vdprintf posix_vdprintf 227 #define sprintf posix_sprintf 228 #define vsprintf posix_vsprintf 229 230 #define fscanf posix_fscanf 231 #define vfscanf posix_vfscanf 232 #define vscanf posix_vscanf 233 #define scanf posix_scanf 234 #define sscanf posix_sscanf 235 #define vsscanf posix_vsscanf 236 237 #define flockfile posix_flockfile 238 #define ftrylockfile posix_ftrylockfile 239 #define funlockfile posix_funlockfile 240 241 #define getc_unlocked posix_getc_unlocked 242 #define getchar_unlocked posix_getchar_unlocked 243 #define putc_unlocked posix_putc_unlocked 244 #define putchar_unlocked posix_putchar_unlocked 245 246 #define remove posix_remove 247 248 #define rename posix_rename 249 250 #define tmpnam posix_tmpnam 251 #define tempnam posix_tempnam 252 #define tmpfile posix_tmpfile 253 #endif 198 extern char *__POSIX_DEF__(tmpnam)(char *s); 199 extern char *__POSIX_DEF__(tempnam)(const char *dir, const char *pfx); 200 extern FILE *__POSIX_DEF__(tmpfile)(void); 201 254 202 255 203 #endif /* POSIX_STDIO_H_ */
Note:
See TracChangeset
for help on using the changeset viewer.