Changeset 04803bf in mainline for uspace/lib/c/include/stdio.h
- Timestamp:
- 2011-03-21T22:00:17Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 143932e3
- Parents:
- b50b5af2 (diff), 7308e84 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/stdio.h
rb50b5af2 r04803bf 38 38 #include <sys/types.h> 39 39 #include <stdarg.h> 40 #include <str ing.h>40 #include <str.h> 41 41 #include <adt/list.h> 42 43 #ifndef NVERIFY_PRINTF 44 45 #define PRINTF_ATTRIBUTE(start, end) \ 46 __attribute__((format(gnu_printf, start, end))) 47 48 #else /* NVERIFY_PRINTF */ 49 50 #define PRINTF_ATTRIBUTE(start, end) 51 52 #endif /* NVERIFY_PRINTF */ 42 53 43 54 #define EOF (-1) … … 56 67 #ifndef SEEK_SET 57 68 #define SEEK_SET 0 69 #endif 70 71 #ifndef SEEK_CUR 58 72 #define SEEK_CUR 1 73 #endif 74 75 #ifndef SEEK_END 59 76 #define SEEK_END 2 60 77 #endif … … 69 86 }; 70 87 88 enum _buffer_state { 89 /** Buffer is empty */ 90 _bs_empty, 91 92 /** Buffer contains data to be written */ 93 _bs_write, 94 95 /** Buffer contains prefetched data for reading */ 96 _bs_read 97 }; 98 71 99 typedef struct { 72 100 /** Linked list pointer. */ … … 88 116 int phone; 89 117 118 /** 119 * Non-zero if the stream needs sync on fflush(). XXX change 120 * console semantics so that sync is not needed. 121 */ 122 int need_sync; 123 90 124 /** Buffering type */ 91 125 enum _buffer_type btype; 126 92 127 /** Buffer */ 93 128 uint8_t *buf; 129 94 130 /** Buffer size */ 95 131 size_t buf_size; 132 133 /** Buffer state */ 134 enum _buffer_state buf_state; 135 96 136 /** Buffer I/O pointer */ 97 137 uint8_t *buf_head; 138 139 /** Points to end of occupied space when in read mode. */ 140 uint8_t *buf_tail; 98 141 } FILE; 99 142 … … 104 147 /* Character and string input functions */ 105 148 extern int fgetc(FILE *); 106 extern char *fgets(char *, size_t, FILE *);149 extern char *fgets(char *, int, FILE *); 107 150 108 151 extern int getchar(void); … … 117 160 118 161 /* Formatted string output functions */ 119 extern int fprintf(FILE *, const char*, ...); 162 extern int fprintf(FILE *, const char*, ...) 163 PRINTF_ATTRIBUTE(2, 3); 120 164 extern int vfprintf(FILE *, const char *, va_list); 121 165 122 extern int printf(const char *, ...); 166 extern int printf(const char *, ...) 167 PRINTF_ATTRIBUTE(1, 2); 123 168 extern int vprintf(const char *, va_list); 124 169 125 extern int snprintf(char *, size_t , const char *, ...); 126 extern int asprintf(char **, const char *, ...); 170 extern int snprintf(char *, size_t , const char *, ...) 171 PRINTF_ATTRIBUTE(3, 4); 172 extern int asprintf(char **, const char *, ...) 173 PRINTF_ATTRIBUTE(2, 3); 127 174 extern int vsnprintf(char *, size_t, const char *, va_list); 128 175 … … 135 182 extern size_t fwrite(const void *, size_t, size_t, FILE *); 136 183 137 extern int fseek(FILE *, long, int);184 extern int fseek(FILE *, off64_t, int); 138 185 extern void rewind(FILE *); 139 extern int ftell(FILE *);186 extern off64_t ftell(FILE *); 140 187 extern int feof(FILE *); 188 extern int fileno(FILE *); 141 189 142 190 extern int fflush(FILE *);
Note:
See TracChangeset
for help on using the changeset viewer.