#include <strings.h>

Data Fields | |
| size_t | len |
| char | str [0] |
| struct ast_threadstorage * | ts |
| size_t | used |
Support for dynamic strings.
A dynamic string is just a C string prefixed by a few control fields that help setting/appending/extending it using a printf-like syntax.
One should never declare a variable with this type, but only a pointer to it, e.g.
struct ast_str *ds;
The pointer can be initialized with the following:
ds = ast_str_create(init_len); creates a malloc()'ed dynamic string;
ds = ast_str_alloca(init_len); creates a string on the stack (not very dynamic!).
ds = ast_str_thread_get(ts, init_len) creates a malloc()'ed dynamic string associated to the thread-local storage key ts
Finally, the string can be manipulated with the following:
ast_str_set(&buf, max_len, fmt, ...) ast_str_append(&buf, max_len, fmt, ...)
and their varargs variant
ast_str_set_va(&buf, max_len, ap) ast_str_append_va(&buf, max_len, ap)
Definition at line 344 of file strings.h.
| size_t len |
The current maximum length of the string
Definition at line 345 of file strings.h.
Referenced by add_sdp(), ast_str_thread_get(), handle_dbget(), load_config(), pbx_find_extension(), and pgsql_reconnect().
| char str[0] |
The string buffer
Definition at line 351 of file strings.h.
Referenced by __manager_event(), __queues_show(), _sip_show_peer(), action_createconfig(), action_userevent(), add_sdp(), ALLOC_COMMENT(), ast_agi_send(), ast_cli(), ast_eivr_getvariable(), ast_log(), ast_verbose(), astman_append(), build_peer(), check_auth(), cli_match_char_tree(), config_curl(), config_text_file_load(), dahdi_new(), destroy_curl(), destroy_pgsql(), dumpchan_exec(), function_sippeer(), handle_dbget(), handle_showchan(), httpd_helper_thread(), iax_parse_ies(), initreqprep(), load_column_config(), log_jack_status(), log_match_char_tree(), manager_log(), odbc_log(), pbx_find_extension(), pgsql_reconnect(), print_uptimestr(), realtime_curl(), realtime_ldap_base_ap(), realtime_multi_curl(), say_periodic_announcement(), show_channels_cb(), sip_send_mwi_to_peer(), sqlite3_log(), store_curl(), store_pgsql(), substitute_escapes(), transmit_fake_auth_response(), transmit_notify_with_mwi(), transmit_state_notify(), update_curl(), update_ldap(), userevent_exec(), and vars2manager().
struct ast_threadstorage* ts [read] |
What kind of storage is this ?
Definition at line 347 of file strings.h.
Referenced by ast_str_thread_get().
| size_t used |
Amount of space used
Definition at line 346 of file strings.h.
Referenced by add_sdp(), ALLOC_COMMENT(), ast_agi_send(), ast_str_thread_get(), build_peer(), CB_RESET(), config_text_file_load(), handle_dbget(), load_column_config(), load_config(), odbc_log(), print_uptimestr(), sqlite3_log(), substitute_escapes(), transmit_notify_with_mwi(), and transmit_state_notify().
1.5.6