|
#define | ___BUFFER_H 0 |
|
#define | buffer_new() buffer_new_with_capacity(NULL, 128) |
| buffer_new creates a new buffer with default heap More...
|
|
#define | buffer_create_with_heap(h, c) buffer_new_with_capacity(h, c) |
|
#define | buffer_append_with_int_type(b, d, t) buffer_append_bytes(b, (uint8_t*)&d, sizeof(t ## _t)) |
|
#define | buffer_append_int8(b, d) buffer_append_with_int_type(b, d, int8) |
|
#define | buffer_append_int16(b, d) buffer_append_with_int_type(b, d, int16) |
|
#define | buffer_append_int32(b, d) buffer_append_with_int_type(b, d, int32) |
|
#define | buffer_append_int64(b, d) buffer_append_with_int_type(b, d, int64) |
|
#define | buffer_append_uint8(b, d) buffer_append_with_int_type(b, d, uint8) |
|
#define | buffer_append_uint16(b, d) buffer_append_with_int_type(b, d, uint16) |
|
#define | buffer_append_uint32(b, d) buffer_append_with_int_type(b, d, uint32) |
|
#define | buffer_append_uint64(b, d) buffer_append_with_int_type(b, d, uint64) |
|
#define | buffer_read_with_int_type(b, t) ((t ## _t)buffer_read_ints(b, sizeof(t ## _t))) |
|
#define | buffer_read_int8(b) buffer_read_with_int_type(b, int8) |
|
#define | buffer_read_int16(b) buffer_read_with_int_type(b, int16) |
|
#define | buffer_read_int32(b) buffer_read_with_int_type(b, int32) |
|
#define | buffer_read_int64(b) buffer_read_with_int_type(b, int64) |
|
#define | buffer_read_uint8(b) buffer_read_with_int_type(b, uint8) |
|
#define | buffer_read_uint16(b) buffer_read_with_int_type(b, uint16) |
|
#define | buffer_read_uint32(b) buffer_read_with_int_type(b, uint32) |
|
#define | buffer_read_uint64(b) buffer_read_with_int_type(b, uint64) |
|
#define | buffer_write_all_into(b, d) buffer_write_slice_into(b, 0, buffer_get_length(b), d) |
|
#define | buffer_get_view(b, l) buffer_get_view_at_position(b, buffer_get_position(b), l) |
|
#define | BUFFER_IO_INPUT 0 |
|
#define | BUFFER_IO_OUTPUT 1 |
|
#define | BUFFER_IO_ERROR 2 |
|
#define | buffer_read_line(b) buffer_read_line_ext(b, '\\', '\n', NULL) |
|
|
buffer_t * | buffer_new_with_capacity (memory_heap_t *heap, uint64_t capacity) |
| buffer_new_with_capacity creates a new buffer with capacity More...
|
|
memory_heap_t * | buffer_get_heap (buffer_t *buffer) |
| buffer_get_heap returns heap of buffer More...
|
|
buffer_t * | buffer_append_byte (buffer_t *buffer, uint8_t data) |
| buffer_append_byte appends a byte to buffer More...
|
|
uint64_t | buffer_get_length (const buffer_t *buffer) |
| returns length of buffer More...
|
|
boolean_t | buffer_reset (buffer_t *buffer) |
| resets buffer, sets length and position to 0 and all bytes to 0, capacity stays same More...
|
|
uint64_t | buffer_get_capacity (buffer_t *buffer) |
| returns capacity of buffer More...
|
|
uint64_t | buffer_get_position (buffer_t *buffer) |
| returns position of buffer More...
|
|
buffer_t * | buffer_append_bytes (buffer_t *buffer, uint8_t *data, uint64_t length) |
| appends bytes to buffer More...
|
|
buffer_t * | buffer_append_buffer (buffer_t *buffer, buffer_t *appenden) |
| appends buffer to buffer More...
|
|
uint8_t * | buffer_get_bytes (buffer_t *buffer, uint64_t length) |
| returns a byte array from buffer with length, byte array is copied, position is advanced with length More...
|
|
uint8_t | buffer_get_byte (buffer_t *buffer) |
| returns a byte array from buffer with length, byte array is copied, position is advanced 1 More...
|
|
uint8_t * | buffer_get_all_bytes (buffer_t *buffer, uint64_t *length) |
| returns a byte array containing all bytes from buffer, byte array is copied, position is not advanced More...
|
|
uint8_t * | buffer_get_all_bytes_and_reset (buffer_t *buffer, uint64_t *length) |
| returns a byte array containing all bytes from buffer, byte array is copied, position is not advanced, buffer is resetted More...
|
|
uint8_t * | buffer_get_all_bytes_and_destroy (buffer_t *buffer, uint64_t *length) |
| returns a byte array containing all bytes from buffer, byte array is copied, position is not advanced, buffer is destroyed More...
|
|
boolean_t | buffer_seek (buffer_t *buffer, int64_t position, buffer_seek_direction_t direction) |
| changes position of buffer More...
|
|
int8_t | buffer_destroy (buffer_t *buffer) |
| destroys buffer More...
|
|
buffer_t * | buffer_encapsulate (uint8_t *data, uint64_t length) |
| returns a buffer encapsulating a byte array, byte array is not copied More...
|
|
uint64_t | buffer_remaining (buffer_t *buffer) |
| returns how many bytes are remaining in buffer (length - position) More...
|
|
uint8_t | buffer_peek_byte_at_position (buffer_t *buffer, uint64_t position) |
| returns a byte from buffer at position, position is not changed More...
|
|
uint8_t | buffer_peek_byte (buffer_t *buffer) |
| returns a byte from buffer at current position, position is not changed More...
|
|
uint64_t | buffer_peek_ints_at_position (buffer_t *buffer, uint64_t position, uint8_t bc) |
| returns an int from buffer at position, position is not changed More...
|
|
uint64_t | buffer_peek_ints (buffer_t *buffer, uint8_t bc) |
| returns an int from buffer at current position, position is not changed More...
|
|
uint64_t | buffer_read_ints (buffer_t *buffer, uint8_t bc) |
| returns an int from buffer with byte count, int is copied, position is advanced with byte count More...
|
|
boolean_t | buffer_set_readonly (buffer_t *buffer, boolean_t ro) |
| sets readonly flag of buffer More...
|
|
boolean_t | buffer_write_slice_into (buffer_t *buffer, uint64_t pos, uint64_t len, uint8_t *dest) |
| copies bytes from buffer to dest (should be at least length long), position is not changed More...
|
|
uint8_t * | buffer_get_view_at_position (const buffer_t *buffer, uint64_t position, uint64_t length) |
| returns a byte array from buffer with length, byte array is not copied, position is not changed More...
|
|
buffer_t * | buffer_get_io_buffer (uint64_t buffer_io_id) |
| returns a buffer for io buffer id, first three buffers are stdin, stdout, stderr More...
|
|
int64_t | buffer_printf (buffer_t *buffer, const char *format,...) |
| prints to buffer, returns number of bytes written More...
|
|
int64_t | buffer_vprintf (buffer_t *buffer, const char *format, va_list args) |
| prints to buffer, returns number of bytes written More...
|
|
buffer_t * | buffer_get_tmp_buffer_for_printf (void) |
| returns a temporary buffer for printf, before gui is initialized, this is a static buffer, after gui is initialized, this is a buffer allocated with malloc More...
|
|
void | buffer_reset_tmp_buffer_for_printf (void) |
| resets temporary buffer for printf
|
|
char_t * | buffer_read_line_ext (buffer_t *buffer, char_t line_continuation_char, char_t delimiter_char, uint64_t *length) |
| reads a line from buffer, line is null terminated, position is advanced More...
|
|
uint64_t | buffer_get_mark_position (buffer_t *buffer) |
|
boolean_t | buffer_set_mark_position (buffer_t *buffer, uint64_t position) |
|
buffer interface
This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.