Changeset 01cc7b4 in mainline for uspace/lib/c/generic/private/stdio.h


Ignore:
Timestamp:
2018-06-13T10:59:47Z (6 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f47a905
Parents:
ed18e14
git-author:
Jiri Svoboda <jiri@…> (2018-06-11 18:54:14)
git-committer:
Jiri Svoboda <jiri@…> (2018-06-13 10:59:47)
Message:

Implement sscanf via virtualizing FILE and implementing string backend for FILE.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/private/stdio.h

    red18e14 r01cc7b4  
    3939#include <stdio.h>
    4040#include <async.h>
     41#include <stddef.h>
    4142
    4243/** Maximum characters that can be pushed back by ungetc() */
    4344#define UNGETC_MAX 1
     45
     46/** Stream operations */
     47typedef struct {
     48        /** Read from stream */
     49        size_t (*read)(void *buf, size_t size, size_t nmemb, FILE *stream);
     50        /** Write to stream */
     51        size_t (*write)(const void *buf, size_t size, size_t nmemb,
     52            FILE *stream);
     53        /** Flush stream */
     54        int (*flush)(FILE *stream);
     55} __stream_ops_t;
    4456
    4557struct _IO_FILE {
     
    4759        link_t link;
    4860
     61        /** Stream operations */
     62        __stream_ops_t *ops;
     63
    4964        /** Underlying file descriptor. */
    5065        int fd;
     66
     67        /** Instance argument */
     68        void *arg;
    5169
    5270        /** File position. */
     
    5876        /** End-of-file indicator. */
    5977        int eof;
    60 
    61         /** KIO indicator */
    62         int kio;
    6378
    6479        /** Session to the file provider */
Note: See TracChangeset for help on using the changeset viewer.