]>
git.saurik.com Git - redis.git/blob - src/rio.h
9 * Since this functions do not tolerate short writes or reads the return
10 * value is simplified to: zero on error, non zero on complete success. */
11 size_t (*read
)(struct _rio
*, void *buf
, size_t len
);
12 size_t (*write
)(struct _rio
*, const void *buf
, size_t len
);
13 off_t (*tell
)(struct _rio
*);
15 /* Backend-specific vars. */
27 typedef struct _rio rio
;
29 #define rioWrite(rio,buf,len) ((rio)->write((rio),(buf),(len)))
30 #define rioRead(rio,buf,len) ((rio)->read((rio),(buf),(len)))
32 void rioInitWithFile(rio
*r
, FILE *fp
);
33 void rioInitWithBuffer(rio
*r
, sds s
);
35 size_t rioWriteBulkCount(rio
*r
, char prefix
, int count
);
36 size_t rioWriteBulkString(rio
*r
, const char *buf
, size_t len
);
37 size_t rioWriteBulkLongLong(rio
*r
, long long l
);
38 size_t rioWriteBulkDouble(rio
*r
, double d
);