Functions | |
int | u_buf_reserve (u_buf_t *ubuf, size_t size) |
Enlarge the underlaying memory block of the given buffer. | |
int | u_buf_append (u_buf_t *ubuf, void *data, size_t size) |
Append some data to the buffer. | |
int | u_buf_load (u_buf_t *ubuf, char *filename) |
Fill a buffer object with the content of a file. | |
int | u_buf_detach (u_buf_t *ubuf) |
Release buffer's underlaying memory block without freeing it. | |
size_t | u_buf_size (u_buf_t *ubuf) |
Return the size of memory block allocated by the buffer. | |
size_t | u_buf_len (u_buf_t *ubuf) |
Return the length of the buffer. | |
int | u_buf_clear (u_buf_t *ubuf) |
Clear a buffer. | |
int | u_buf_set (u_buf_t *ubuf, void *data, size_t size) |
Set the value of a buffer. | |
void * | u_buf_ptr (u_buf_t *ubuf) |
Return a pointer to the buffer internal momory block. | |
int | u_buf_free (u_buf_t *ubuf) |
Free a buffer. | |
int | u_buf_create (u_buf_t **pubuf) |
Create a new buffer. | |
int | u_string_trim (u_string_t *s) |
Remove leading and trailing blanks. | |
int | u_string_set_length (u_string_t *s, size_t len) |
Set the length of a string (shortening it). | |
size_t | u_string_len (u_string_t *s) |
Return the string length. | |
const char * | u_string_c (u_string_t *s) |
Return the string value. | |
int | u_string_copy (u_string_t *dst, u_string_t *src) |
Copy the value of a string to another. | |
int | u_string_clear (u_string_t *s) |
Clear a string. | |
int | u_string_create (const char *buf, size_t len, u_string_t **ps) |
Create a new string. | |
int | u_string_free (u_string_t *s) |
Free a string. | |
int | u_string_set (u_string_t *s, const char *buf, size_t len) |
Set the value of a string. | |
int | u_string_append (u_string_t *s, const char *buf, size_t len) |
Append a char* to a string. |
|
Append data of size size to the given buffer. If needed the buffer will be enlarged.
Definition at line 72 of file buf.c. References u_buf_reserve(). Referenced by u_buf_set(). |
|
Totally erase the content of the given buffer. The memory allocated by the buffer will not be released until u_buf_free() is called.
Definition at line 210 of file buf.c. Referenced by u_buf_load(), and u_buf_set(). |
|
Create a new buffer object and save its pointer to *ps.
Definition at line 296 of file buf.c. References u_zalloc(). |
|
Release the underlaying memory block of the given buffer without calling free() on it. The caller must free the buffer later on (probably after using it somwhow). Use u_buf_ptr() to get the pointer of the memory block, u_buf_size() to get its size and u_buf_len() to get its length.
|
|
Release all resources and free the given buffer object.
Definition at line 275 of file buf.c. References u_free(). |
|
Return the length of data store in the given buffer.
|
|
Open filename and copy its whole content into the given buffer.
Definition at line 104 of file buf.c. References u_buf_clear(), and u_buf_reserve(). |
|
Return a void* pointer to the memory block allocated by the buffer object.
|
|
Enlarge the buffer data block to (at least) size bytes.
Definition at line 35 of file buf.c. References u_realloc(). Referenced by u_buf_append(), and u_buf_load(). |
|
Set the value of ubuf to data. If needed the buffer object will alloc more memory to store the data value.
Definition at line 233 of file buf.c. References u_buf_append(), and u_buf_clear(). |
|
Return the size of memory block allocated by the buffer.
|
|
Append a char* value to the given string.
Definition at line 227 of file str.c. References u_realloc(). Referenced by u_string_copy(), u_string_create(), and u_string_set(). |
|
Return the const char* value of the given string object. Such const char* value cannot be modified, realloc'd or free'd.
|
|
Totally erase the content of the given string.
Definition at line 131 of file str.c. Referenced by u_string_copy(), and u_string_set(). |
|
Copy src string to dst string.
Definition at line 116 of file str.c. References u_string_append(), and u_string_clear(). |
|
Create a new string object and save its pointer to *ps. If buf is not NULL (and len > 0) the string will be initialized with the content of buf.
Definition at line 157 of file str.c. References u_string_append(), and u_zalloc(). |
|
Release all resources and free the given string object.
|
|
Return the length of the given string.
|
|
Set the value of s to buf.
Definition at line 210 of file str.c. References u_string_append(), and u_string_clear(). |
|
|
|
Remove leading and trailing blanks from the given string
Definition at line 41 of file str.c. References u_trim(). |