Go to the source code of this file.
|
ar_stream * | ar_open_stream (void *data, ar_stream_close_fn close, ar_stream_read_fn read, ar_stream_seek_fn seek, ar_stream_tell_fn tell) |
|
void | ar_close (ar_stream *stream) |
|
size_t | ar_read (ar_stream *stream, void *buffer, size_t count) |
|
bool | ar_seek (ar_stream *stream, off64_t offset, int origin) |
|
bool | ar_skip (ar_stream *stream, off64_t count) |
|
off64_t | ar_tell (ar_stream *stream) |
|
static void | file_close (void *data) |
|
static size_t | file_read (void *data, void *buffer, size_t count) |
|
static bool | file_seek (void *data, off64_t offset, int origin) |
|
static off64_t | file_tell (void *data) |
|
ar_stream * | ar_open_file (const char *path) |
|
static void | memory_close (void *data) |
|
static size_t | memory_read (void *data, void *buffer, size_t count) |
|
static bool | memory_seek (void *data, off64_t offset, int origin) |
|
static off64_t | memory_tell (void *data) |
|
ar_stream * | ar_open_memory (const void *data, size_t datalen) |
|
Definition at line 86 of file stream.c.
88 FILE *f = path ? fopen(path,
"rb") : NULL;
ar_stream* ar_open_memory |
( |
const void * |
data, |
|
|
size_t |
datalen |
|
) |
| |
size_t ar_read |
( |
ar_stream * |
stream, |
|
|
void * |
buffer, |
|
|
size_t |
count |
|
) |
| |
Definition at line 28 of file stream.c.
30 return stream->
read(stream->
data, buffer, count);
Definition at line 38 of file stream.c.
40 return stream->
seek(stream->
data, count, SEEK_CUR);
static void file_close |
( |
void * |
data) | |
|
|
static |
static size_t file_read |
( |
void * |
data, |
|
|
void * |
buffer, |
|
|
size_t |
count |
|
) |
| |
|
static |
Definition at line 55 of file stream.c.
57 return fread(buffer, 1, count,
data);
static bool file_seek |
( |
void * |
data, |
|
|
off64_t |
offset, |
|
|
int |
origin |
|
) |
| |
|
static |
Definition at line 60 of file stream.c.
65 #if _POSIX_C_SOURCE >= 200112L
66 if (
sizeof(off_t) == 8)
static off64_t file_tell |
( |
void * |
data) | |
|
|
static |
Definition at line 75 of file stream.c.
78 return _ftelli64(
data);
79 #elif _POSIX_C_SOURCE >= 200112L
static void memory_close |
( |
void * |
data) | |
|
|
static |
static size_t memory_read |
( |
void * |
data, |
|
|
void * |
buffer, |
|
|
size_t |
count |
|
) |
| |
|
static |
static bool memory_seek |
( |
void * |
data, |
|
|
off64_t |
offset, |
|
|
int |
origin |
|
) |
| |
|
static |
Definition at line 128 of file stream.c.
131 if (origin == SEEK_CUR)
133 else if (origin == SEEK_END)
static off64_t memory_tell |
( |
void * |
data) | |
|
|
static |