Common buffer management functions. More...
Go to the source code of this file.
Functions | |
| void | GNUNET_buffer_prealloc (struct GNUNET_Buffer *buf, size_t capacity) |
| Initialize a buffer with the given capacity. | |
| void | GNUNET_buffer_ensure_remaining (struct GNUNET_Buffer *buf, size_t n) |
| Make sure that at least n bytes remaining in the buffer. | |
| void | GNUNET_buffer_write (struct GNUNET_Buffer *buf, const char *data, size_t len) |
| Write bytes to the buffer. | |
| void | GNUNET_buffer_write_str (struct GNUNET_Buffer *buf, const char *str) |
| Write a 0-terminated string to a buffer, excluding the 0-terminator. | |
| char * | GNUNET_buffer_reap_str (struct GNUNET_Buffer *buf) |
| Clear the buffer and return the string it contained. | |
| void * | GNUNET_buffer_reap (struct GNUNET_Buffer *buf, size_t *size) |
| Clear the buffer and return its contents. | |
| void | GNUNET_buffer_clear (struct GNUNET_Buffer *buf) |
| Free the backing memory of the given buffer. | |
| void | GNUNET_buffer_write_path (struct GNUNET_Buffer *buf, const char *str) |
| Write a path component to a buffer, ensuring that there is exactly one slash between the previous contents of the buffer and the new string. | |
| void | GNUNET_buffer_write_fstr (struct GNUNET_Buffer *buf, const char *fmt,...) |
| Write a 0-terminated formatted string to a buffer, excluding the 0-terminator. | |
| void | GNUNET_buffer_write_vfstr (struct GNUNET_Buffer *buf, const char *fmt, va_list args) |
| Write a 0-terminated formatted string to a buffer, excluding the 0-terminator. | |
| void | GNUNET_buffer_write_data_encoded (struct GNUNET_Buffer *buf, const void *data, size_t data_len) |
| Write data encoded via GNUNET_STRINGS_data_to_string to the buffer. | |
Common buffer management functions.
Definition in file buffer.c.
| void GNUNET_buffer_write_fstr | ( | struct GNUNET_Buffer * | buf, |
| const char * | fmt, | ||
| ... | |||
| ) |
Write a 0-terminated formatted string to a buffer, excluding the 0-terminator.
Grows the buffer if necessary.
| buf | the buffer to write to |
| fmt | format string |
| ... | format arguments |
Definition at line 210 of file buffer.c.
References GNUNET_buffer_write_vfstr().