Changeset ef8bcc6 in mainline for uspace/lib/libc/include/stdio.h


Ignore:
Timestamp:
2009-06-15T21:46:21Z (16 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
953769f
Parents:
c07af37
Message:

Stdio stream buffering (only for writing a.t.m.) Issue: Do we need two moving delimiters (head, tail) to recover from error or is one moving data delimiter enough, like in the current implementation? (Where the buffer must be drained as a whole, cannot do it part at a time.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/include/stdio.h

    rc07af37 ref8bcc6  
    4242#define EOF  (-1)
    4343
     44/** Default size for stream I/O buffers */
     45#define BUFSIZ 4096
     46
    4447#define DEBUG(fmt, ...) \
    4548{ \
     
    5558        #define SEEK_END  2
    5659#endif
     60
     61enum _buffer_type {
     62        /** No buffering */
     63        _IONBF,
     64        /** Line buffering */
     65        _IOLBF,
     66        /** Full buffering */
     67        _IOFBF
     68};
    5769
    5870typedef struct {
     
    7486        /** Phone to the file provider */
    7587        int phone;
     88
     89        /** Buffering type */
     90        enum _buffer_type btype;
     91        /** Buffer */
     92        uint8_t *buf;
     93        /** Buffer size */
     94        size_t buf_size;
     95        /** Buffer I/O pointer */
     96        uint8_t *buf_head;
    7697} FILE;
    7798
     
    122143extern void clearerr(FILE *);
    123144
     145extern void setvbuf(FILE *, void *, int, size_t);
     146
    124147/* Misc file functions */
    125148extern int rename(const char *, const char *);
Note: See TracChangeset for help on using the changeset viewer.