Lely core libraries
2.3.4
|
Go to the documentation of this file.
27 #ifndef LELY_UTIL_FRBUF_H_
28 #define LELY_UTIL_FRBUF_H_
46 void *__frbuf_alloc(
void);
47 void __frbuf_free(
void *ptr);
48 struct __frbuf *__frbuf_init(
struct __frbuf *buf,
const char *filename);
49 void __frbuf_fini(
struct __frbuf *buf);
166 #endif // !LELY_UTIL_FRBUF_H_
ssize_t frbuf_pread(frbuf_t *buf, void *ptr, size_t size, intmax_t pos)
Reads bytes from the specified position in a read file buffer.
ssize_t frbuf_read(frbuf_t *buf, void *ptr, size_t size)
Reads bytes from the current position in a read file buffer.
frbuf_t * frbuf_create(const char *filename)
Creates a new read file buffer.
const void * frbuf_map(frbuf_t *buf, intmax_t pos, size_t *psize)
Maps (part of) the contents of a read file buffer to memory.
int frbuf_unmap(frbuf_t *buf)
Unmaps the current memory map of a read file buffer, if it exists.
void frbuf_destroy(frbuf_t *buf)
Destroys a read file buffer.
intmax_t frbuf_get_size(frbuf_t *buf)
Returns the size (in bytes) of the a read file buffer, or -1 on error.
intmax_t frbuf_set_pos(frbuf_t *buf, intmax_t pos)
Sets the current offset (in bytes) of a read file buffer with respect to the beginning of the file.
An read file buffer struct.
intmax_t frbuf_get_pos(frbuf_t *buf)
Returns the current offset (in bytes) of a read file buffer with respect to the beginning of the file...