Changeset 55092672 in mainline for uspace/lib/posix/include/posix/stdio.h
- Timestamp:
- 2018-06-15T13:06:18Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8338a81
- Parents:
- 1ae9c07
- git-author:
- Jiri Svoboda <jiri@…> (2018-06-14 22:05:23)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-06-15 13:06:18)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/include/posix/stdio.h
r1ae9c07 r55092672 40 40 41 41 #include "stddef.h" 42 #include "unistd.h"43 42 #include "libc/io/verify.h" 44 43 #include "sys/types.h" … … 46 45 #include "limits.h" 47 46 48 /*49 * These are the same as in HelenOS libc.50 * It would be possible to directly include <stdio.h> but51 * it is better not to pollute POSIX namespace with other functions52 * defined in that header.53 *54 * Because libposix is always linked with libc, providing only these55 * forward declarations ought to be enough.56 */57 #define EOF (-1)58 59 /** Size of buffers used in stdio header. */60 #define BUFSIZ 409661 62 /** Maximum size in bytes of the longest filename. */63 #define FILENAME_MAX 409664 65 typedef struct _IO_FILE FILE;66 67 extern FILE *stdin;68 extern FILE *stdout;69 extern FILE *stderr;70 71 extern int fgetc(FILE *);72 extern char *fgets(char *, int, FILE *);73 74 extern int getchar(void);75 extern char *gets(char *, size_t);76 77 extern int fputc(int, FILE *);78 extern int fputs(const char *, FILE *);79 80 extern int putchar(int);81 extern int puts(const char *);82 83 extern int fprintf(FILE *, const char *, ...) _HELENOS_PRINTF_ATTRIBUTE(2, 3);84 extern int vfprintf(FILE *, const char *, va_list);85 86 extern int printf(const char *, ...) _HELENOS_PRINTF_ATTRIBUTE(1, 2);87 extern int vprintf(const char *, va_list);88 89 extern int snprintf(char *, size_t, const char *, ...) _HELENOS_PRINTF_ATTRIBUTE(3, 4);90 #ifdef _GNU_SOURCE91 extern int vasprintf(char **, const char *, va_list);92 extern int asprintf(char **, const char *, ...) _HELENOS_PRINTF_ATTRIBUTE(2, 3);93 #endif94 extern int vsnprintf(char *, size_t, const char *, va_list);95 96 extern FILE *fopen(const char *, const char *);97 47 extern FILE *fdopen(int, const char *); 98 extern int fclose(FILE *);99 100 extern size_t fread(void *, size_t, size_t, FILE *);101 extern size_t fwrite(const void *, size_t, size_t, FILE *);102 103 extern void rewind(FILE *);104 extern int feof(FILE *);105 48 extern int fileno(FILE *); 106 107 extern int fflush(FILE *);108 extern int ferror(FILE *);109 extern void clearerr(FILE *);110 111 extern void setvbuf(FILE *, void *, int, size_t);112 extern void setbuf(FILE *, void *);113 114 /* POSIX specific stuff. */115 49 116 50 /* Identifying the Terminal */ … … 119 53 extern char *ctermid(char *s); 120 54 121 /* Error Recovery */122 extern void clearerr(FILE *stream);123 124 55 /* Input/Output */ 125 #undef putc126 #define putc fputc127 extern int fputs(const char *__restrict__ s, FILE *__restrict__ stream);128 #undef getc129 #define getc fgetc130 extern int ungetc(int c, FILE *stream);131 56 extern ssize_t getdelim(char **__restrict__ lineptr, size_t *__restrict__ n, 132 57 int delimiter, FILE *__restrict__ stream); 133 58 extern ssize_t getline(char **__restrict__ lineptr, size_t *__restrict__ n, 134 59 FILE *__restrict__ stream); 135 136 /* Opening Streams */137 extern FILE *freopen(const char *__restrict__ filename,138 const char *__restrict__ mode, FILE *__restrict__ stream);139 60 140 61 /* Error Messages */ … … 148 69 extern int fsetpos(FILE *stream, const fpos_t *pos); 149 70 extern int fgetpos(FILE *__restrict__ stream, fpos_t *__restrict__ pos); 150 extern int fseek(FILE *stream, long offset, int whence);151 71 extern int fseeko(FILE *stream, off_t offset, int whence); 152 extern long ftell(FILE *stream);153 72 extern off_t ftello(FILE *stream); 154 155 /* Flushing Buffers */156 extern int fflush(FILE *stream);157 73 158 74 /* Formatted Output */ … … 173 89 extern int putchar_unlocked(int c); 174 90 175 /* Deleting Files */176 extern int remove(const char *path);177 178 /* Renaming Files */179 extern int rename(const char *oldname, const char *newname);180 181 91 /* Temporary Files */ 182 92 #undef L_tmpnam … … 186 96 extern FILE *tmpfile(void); 187 97 188 189 98 #endif /* POSIX_STDIO_H_ */ 190 99
Note:
See TracChangeset
for help on using the changeset viewer.