dynamic_buffer.h v0.2.2
Reference-counted byte buffer library for efficient I/O operations
|
Functions for reading and writing buffers. More...
Functions | |
DB_DEF ssize_t | db_read_fd (db_buffer *buf_ptr, int fd, size_t max_bytes) |
Read data from file descriptor into buffer. | |
DB_DEF ssize_t | db_write_fd (db_buffer buf, int fd) |
Write buffer contents to file descriptor. | |
DB_DEF db_buffer | db_read_file (const char *filename) |
Read entire file into a new buffer. | |
DB_DEF bool | db_write_file (db_buffer buf, const char *filename) |
Write buffer contents to file. | |
Functions for reading and writing buffers.
Read data from file descriptor into buffer.
buf_ptr | Pointer to buffer (must not be NULL) |
fd | File descriptor to read from |
max_bytes | Maximum bytes to read (0 for no limit) |
Read entire file into a new buffer.
filename | Path to file to read |
Write buffer contents to file descriptor.
buf | Source buffer (must not be NULL) |
fd | File descriptor to write to |