nmsg 1.1.2
|
String buffers. More...
Go to the source code of this file.
Data Structures | |
struct | nmsg_strbuf_t |
String buffer. More... | |
Functions | |
struct nmsg_strbuf * | nmsg_strbuf_init (void) |
Initialize a string buffer. | |
void | nmsg_strbuf_destroy (struct nmsg_strbuf **sb) |
Destroy all resources associated with a string buffer. | |
nmsg_res | nmsg_strbuf_append_str_json (struct nmsg_strbuf *sb, const char *str, size_t len) |
Append to a string buffer. | |
nmsg_res | nmsg_strbuf_append_str (struct nmsg_strbuf *sb, const char *str, size_t len) |
Append to a string buffer. | |
nmsg_res | nmsg_strbuf_append (struct nmsg_strbuf *sb, const char *fmt,...) |
Append formatted string to a string buffer. | |
nmsg_res | nmsg_strbuf_reset (struct nmsg_strbuf *sb) |
Reset a string buffer. | |
size_t | nmsg_strbuf_len (struct nmsg_strbuf *sb) |
Find the length of the used portion of the string buffer. | |
String buffers.
Dynamically sized strings that may be appended to or reset.
Definition in file strbuf.h.
struct nmsg_strbuf * nmsg_strbuf_init | ( | void | ) |
Initialize a string buffer.
void nmsg_strbuf_destroy | ( | struct nmsg_strbuf ** | sb | ) |
Destroy all resources associated with a string buffer.
[in] | sb | pointer to string buffer. |
nmsg_res nmsg_strbuf_append_str_json | ( | struct nmsg_strbuf * | sb, |
const char * | str, | ||
size_t | len | ||
) |
Append to a string buffer.
Escape JSON special characters.
[in] | sb | string buffer. |
[in] | str | string to append. |
[in] | len | string length. |
nmsg_res nmsg_strbuf_append_str | ( | struct nmsg_strbuf * | sb, |
const char * | str, | ||
size_t | len | ||
) |
Append to a string buffer.
[in] | sb | string buffer. |
[in] | str | string to append. |
[in] | len | string length. |
nmsg_res nmsg_strbuf_append | ( | struct nmsg_strbuf * | sb, |
const char * | fmt, | ||
... | |||
) |
Append formatted string to a string buffer.
[in] | sb | string buffer. |
[in] | fmt | format string to be passed to vsnprintf. |
[in] | ... | arguments to vsnprintf. |
nmsg_res nmsg_strbuf_reset | ( | struct nmsg_strbuf * | sb | ) |
Reset a string buffer.
Resets the size of the internal buffer to the default size, but does not clear the contents of the buffer.
[in] | sb | string buffer. |
size_t nmsg_strbuf_len | ( | struct nmsg_strbuf * | sb | ) |
Find the length of the used portion of the string buffer.
[in] | sb | string buffer. |