ucx/memstream.h

changeset 57
e18157c52985
parent 56
76caac0da4a0
child 58
733f22fca61a
equal deleted inserted replaced
56:76caac0da4a0 57:e18157c52985
9 extern "C" { 9 extern "C" {
10 #endif 10 #endif
11 11
12 12
13 /* as FILE is opaque, we don't do evil hacks but provide an alternative */ 13 /* as FILE is opaque, we don't do evil hacks but provide an alternative */
14 struct _UcxMemstream; /* cauz we are mad about it, we make it opaque, too */ 14 typedef struct UcxMemstream UcxMemstream;
15 typedef struct _UcxMemstream UcxMemstream;
16 15
17 UcxMemstream *ucx_memopen(void *space, size_t length); 16 UcxMemstream *ucx_memopen(void *space, size_t length);
18 void ucx_memclose(UcxMemstream* stream); 17 void ucx_memclose(UcxMemstream* stream);
19 18
20 /* 19 /*
27 * ucx_memseek returns 0 on success and -1 if the new position is beyond the 26 * ucx_memseek returns 0 on success and -1 if the new position is beyond the
28 * bounds of the allocated buffer. In that case the position of the stream 27 * bounds of the allocated buffer. In that case the position of the stream
29 * remains unchanged. 28 * remains unchanged.
30 * 29 *
31 */ 30 */
32 int ucx_memseek(UcxMemstream *stream, long offset, int whence); 31 int ucx_memseek(UcxMemstream *stream, off_t offset, int whence);
33 size_t ucx_memtell(UcxMemstream *stream); 32 size_t ucx_memtell(UcxMemstream *stream);
34 33
35 /* 34 /*
36 * returns non-zero, iff the current stream position has exceeded the last 35 * returns non-zero, iff the current stream position has exceeded the last
37 * available byte of the underlying buffer 36 * available byte of the underlying buffer

mercurial