allow reading/writing the camouflage
[xonotic/d0_blind_id.git] / d0_iobuf.h
1 #ifndef __D0_IOBUF_H__
2 #define __D0_IOBUF_H__
3
4 #include "d0.h"
5
6 typedef struct d0_iobuf_s d0_iobuf_t;
7
8 WARN_UNUSED_RESULT d0_iobuf_t *d0_iobuf_open_read(const void *buf, size_t len); // note: can read AND write!
9 WARN_UNUSED_RESULT d0_iobuf_t *d0_iobuf_open_write(void *buf, size_t len); // note: can read AND write!
10 WARN_UNUSED_RESULT BOOL d0_iobuf_conv_base64_in(d0_iobuf_t *buf);
11 WARN_UNUSED_RESULT BOOL d0_iobuf_conv_base64_out(d0_iobuf_t *buf);
12 BOOL d0_iobuf_close(d0_iobuf_t *buf, size_t *len); // don't warn
13 WARN_UNUSED_RESULT size_t d0_iobuf_write_raw(d0_iobuf_t *buf, const void *s, size_t n);
14 WARN_UNUSED_RESULT size_t d0_iobuf_read_raw(d0_iobuf_t *buf, void *s, size_t n);
15 WARN_UNUSED_RESULT BOOL d0_iobuf_write_packet(d0_iobuf_t *buf, const void *s, size_t n);
16 WARN_UNUSED_RESULT BOOL d0_iobuf_read_packet(d0_iobuf_t *buf, void *s, size_t *n);
17
18 #endif