Changeset 46ac986 in mainline
- Timestamp:
- 2011-07-11T21:57:54Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 221afc9e
- Parents:
- 12fb8498
- Location:
- uspace/lib/posix
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/stdio.c
r12fb8498 r46ac986 100 100 101 101 bool can_unget = 102 102 /* Provided character is legal. */ 103 103 c != EOF && 104 104 /* Stream is consistent. */ 105 105 !stream->error && 106 106 /* Stream is buffered. */ 107 107 stream->btype != _IONBF && 108 108 /* Last operation on the stream was a read operation. */ 109 109 stream->buf_state == _bs_read && 110 111 112 110 /* Stream buffer is already allocated (i.e. there was already carried 111 * out either write or read operation on the stream). This is probably 112 * redundant check but let's be safe. */ 113 113 stream->buf != NULL && 114 115 116 117 114 /* There is still space in the stream to retreat. POSIX demands the 115 * possibility to unget at least 1 character. It should be always 116 * possible, assuming the last operation on the stream read at least 1 117 * character, because the buffer is refilled in the lazily manner. */ 118 118 stream->buf_tail > stream->buf; 119 119 … … 230 230 * stream with a changed mode. NULL otherwise. 231 231 */ 232 FILE *posix_freopen( 233 const char *restrict filename, 234 const char *restrict mode, 235 FILE *restrict stream) 232 FILE *posix_freopen(const char *restrict filename, 233 const char *restrict mode, FILE *restrict stream) 236 234 { 237 235 assert(mode != NULL); -
uspace/lib/posix/stdio.h
r12fb8498 r46ac986 42 42 #include "limits.h" 43 43 44 /* Identifying the Terminal */ 44 45 #undef L_ctermid 45 46 #define L_ctermid PATH_MAX 47 extern char *posix_ctermid(char *s); 46 48 49 /* Error Recovery */ 47 50 extern void posix_clearerr(FILE *stream); 48 extern char *posix_ctermid(char *s);49 51 50 52 /* Input/Output */ … … 54 56 #define getc fgetc 55 57 extern int posix_ungetc(int c, FILE *stream); 56 57 58 extern ssize_t posix_getdelim(char **restrict lineptr, size_t *restrict n, 58 59 int delimiter, FILE *restrict stream); … … 61 62 62 63 /* Opening Streams */ 63 extern FILE *posix_freopen( 64 const char *restrict filename, 65 const char *restrict mode, 66 FILE *restrict stream); 67 68 /* Memory Streams */ 69 64 extern FILE *posix_freopen(const char *restrict filename, 65 const char *restrict mode, FILE *restrict stream); 70 66 extern FILE *posix_fmemopen(void *restrict buf, size_t size, 71 67 const char *restrict mode); … … 76 72 77 73 /* File Positioning */ 78 79 74 typedef struct _posix_fpos posix_fpos_t; 80 75 extern int posix_fsetpos(FILE *stream, const posix_fpos_t *pos); … … 85 80 extern posix_off_t posix_ftello(FILE *stream); 86 81 87 /* Formatted Input/Output */82 /* Formatted Output */ 88 83 extern int posix_dprintf(int fildes, const char *restrict format, ...) 89 84 PRINTF_ATTRIBUTE(2, 3); … … 93 88 extern int posix_vsprintf(char *restrict s, const char *restrict format, va_list ap); 94 89 90 /* Formatted Input */ 95 91 extern int posix_fscanf( 96 92 FILE *restrict stream, const char *restrict format, ...); … … 105 101 106 102 /* File Locking */ 107 108 103 extern void posix_flockfile(FILE *file); 109 104 extern int posix_ftrylockfile(FILE *file); 110 105 extern void posix_funlockfile(FILE *file); 111 112 106 extern int posix_getc_unlocked(FILE *stream); 113 107 extern int posix_getchar_unlocked(void); … … 121 115 #undef L_tmpnam 122 116 #define L_tmpnam PATH_MAX 123 124 117 extern char *posix_tmpnam(char *s); 125 118 126 119 #ifndef LIBPOSIX_INTERNAL 127 #define clearerr posix_clearerr128 120 #define ctermid posix_ctermid 129 121 122 #define clearerr posix_clearerr 123 130 124 #define ungetc posix_ungetc 131 132 125 #define getdelim posix_getdelim 133 126 #define getline posix_getline 134 127 135 128 #define freopen posix_freopen 136 137 129 #define fmemopen posix_fmemopen 138 130 #define open_memstream posix_open_memstream
Note:
See TracChangeset
for help on using the changeset viewer.