String manipulation functions. More...


Go to the source code of this file.
Data Structures | |
| struct | ast_str |
| The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field to indicate the type of storage. Three special constants indicate malloc, ast_alloca() or static variables, all other values indicate a struct ast_threadstorage pointer. More... | |
Defines | |
| #define | __AST_STR_LEN len |
| #define | __AST_STR_STR str |
| #define | __AST_STR_TS ts |
| #define | __AST_STR_USED used |
| #define | _DB1(x) |
| #define | AS_OR(a, b) (a && ast_str_strlen(a)) ? ast_str_buffer(a) : (b) |
| #define | ast_str_alloca(init_len) |
| #define | DS_ALLOCA ((struct ast_threadstorage *)2) |
| #define | DS_MALLOC ((struct ast_threadstorage *)1) |
| #define | DS_STATIC ((struct ast_threadstorage *)3) /* not supported yet */ |
| #define | S_COR(a, b, c) ({typeof(&((b)[0])) __x = (b); (a) && !ast_strlen_zero(__x) ? (__x) : (c);}) |
| returns the equivalent of logic or for strings, with an additional boolean check: second one if not empty and first one is true, otherwise third one. example: S_COR(usewidget, widget, "<no widget>") | |
| #define | S_OR(a, b) ({typeof(&((a)[0])) __x = (a); ast_strlen_zero(__x) ? (b) : __x;}) |
| returns the equivalent of logic or for strings: first one if not empty, otherwise second one. | |
Enumerations | |
| enum | { AST_DYNSTR_BUILD_FAILED = -1, AST_DYNSTR_BUILD_RETRY = -2 } |
| Error codes from __ast_str_helper() The undelying processing to manipulate dynamic string is done by __ast_str_helper(), which can return a success or a permanent failure (e.g. no memory). More... | |
Functions | |
| int | __ast_str_helper (struct ast_str **buf, ssize_t max_len, int append, const char *fmt, va_list ap) |
| Core functionality of ast_str_(set|append)_va. | |
| char * | __ast_str_helper2 (struct ast_str **buf, ssize_t max_len, const char *src, size_t maxsrc, int append, int escapecommas) |
| int | ast_build_string (char **buffer, size_t *space, const char *fmt,...) |
| Build a string in a buffer, designed to be called repeatedly. | |
| int | ast_build_string_va (char **buffer, size_t *space, const char *fmt, va_list ap) |
| Build a string in a buffer, designed to be called repeatedly. | |
| int | ast_check_digits (const char *arg) |
| Check if a string is only digits. | |
| void | ast_copy_string (char *dst, const char *src, size_t size) |
| Size-limited null-terminating string copy. | |
| int attribute_pure | ast_false (const char *val) |
| Make sure something is false. Determine if a string containing a boolean value is "false". This function checks to see whether a string passed to it is an indication of an "false" value. It checks to see if the string is "no", "false", "n", "f", "off" or "0". | |
| int | ast_get_time_t (const char *src, time_t *dst, time_t _default, int *consumed) |
| get values from config variables. | |
| int | ast_get_timeval (const char *src, struct timeval *tv, struct timeval _default, int *consumed) |
| get values from config variables. | |
| void | ast_join (char *s, size_t len, const char *const w[]) |
| int | ast_regex_string_to_regex_pattern (const char *regex_string, struct ast_str **regex_pattern) |
| Given a string regex_string in the form of "/regex/", convert it into the form of "regex". | |
| char * | ast_skip_blanks (const char *str) |
| Gets a pointer to the first non-whitespace character in a string. | |
| char * | ast_skip_nonblanks (const char *str) |
| Gets a pointer to first whitespace character in a string. | |
| int | ast_str_append (struct ast_str **buf, ssize_t max_len, const char *fmt,...) |
| Append to a thread local dynamic string. | |
| char * | ast_str_append_escapecommas (struct ast_str **buf, ssize_t maxlen, const char *src, size_t maxsrc) |
| Append a non-NULL terminated substring to the end of a dynamic string, with escaping of commas. | |
| char * | ast_str_append_substr (struct ast_str **buf, ssize_t maxlen, const char *src, size_t maxsrc) |
| Append a non-NULL terminated substring to the end of a dynamic string. | |
| int | ast_str_append_va (struct ast_str **buf, ssize_t max_len, const char *fmt, va_list ap) |
| Append to a dynamic string using a va_list. | |
| char * | ast_str_buffer (const struct ast_str *buf) |
| Returns the string buffer within the ast_str buf. | |
| static force_inline int attribute_pure | ast_str_case_hash (const char *str) |
| Compute a hash value on a case-insensitive string. | |
| int | ast_str_copy_string (struct ast_str **dst, struct ast_str *src) |
| struct ast_str * | ast_str_create (size_t init_len) |
| Create a malloc'ed dynamic length string. | |
| static force_inline int attribute_pure | ast_str_hash (const char *str) |
| Compute a hash value on a string. | |
| static force_inline int | ast_str_hash_add (const char *str, int hash) |
| Compute a hash value on a string. | |
| int | ast_str_make_space (struct ast_str **buf, size_t new_len) |
| void | ast_str_reset (struct ast_str *buf) |
| Reset the content of a dynamic string. Useful before a series of ast_str_append. | |
| int | ast_str_set (struct ast_str **buf, ssize_t max_len, const char *fmt,...) |
| Set a dynamic string using variable arguments. | |
| char * | ast_str_set_escapecommas (struct ast_str **buf, ssize_t maxlen, const char *src, size_t maxsrc) |
| Set a dynamic string to a non-NULL terminated substring, with escaping of commas. | |
| char * | ast_str_set_substr (struct ast_str **buf, ssize_t maxlen, const char *src, size_t maxsrc) |
| Set a dynamic string to a non-NULL terminated substring. | |
| int | ast_str_set_va (struct ast_str **buf, ssize_t max_len, const char *fmt, va_list ap) |
| Set a dynamic string from a va_list. | |
| size_t | ast_str_size (const struct ast_str *buf) |
| Returns the current maximum length (without reallocation) of the current buffer. | |
| size_t | ast_str_strlen (const struct ast_str *buf) |
| Returns the current length of the string stored within buf. | |
| struct ast_str * | ast_str_thread_get (struct ast_threadstorage *ts, size_t init_len) |
| Retrieve a thread locally stored dynamic string. | |
| void | ast_str_trim_blanks (struct ast_str *buf) |
| Trims trailing whitespace characters from an ast_str string. | |
| char * | ast_str_truncate (struct ast_str *buf, ssize_t len) |
| Truncates the enclosed string to the given length. | |
| void | ast_str_update (struct ast_str *buf) |
| Update the length of the buffer, after using ast_str merely as a buffer. | |
| char * | ast_strip (char *s) |
| Strip leading/trailing whitespace from a string. | |
| char * | ast_strip_quoted (char *s, const char *beg_quotes, const char *end_quotes) |
| Strip leading/trailing whitespace and quotes from a string. | |
| static force_inline int attribute_pure | ast_strlen_zero (const char *s) |
| char * | ast_tech_to_upper (char *dev_str) |
| Convert the tech portion of a device string to upper case. | |
| char * | ast_trim_blanks (char *str) |
| Trims trailing whitespace characters from a string. | |
| int attribute_pure | ast_true (const char *val) |
| Make sure something is true. Determine if a string containing a boolean value is "true". This function checks to see whether a string passed to it is an indication of an "true" value. It checks to see if the string is "yes", "true", "y", "t", "on" or "1". | |
| char * | ast_unescape_c (char *s) |
| Convert some C escape sequences. | |
| char * | ast_unescape_semicolon (char *s) |
| Strip backslash for "escaped" semicolons, the string to be stripped (will be modified). | |
String manipulation functions.
Definition in file strings.h.
| #define __AST_STR_LEN len |
| #define __AST_STR_STR str |
| #define __AST_STR_TS ts |
| #define __AST_STR_USED used |
| #define AS_OR | ( | a, | |
| b | |||
| ) | (a && ast_str_strlen(a)) ? ast_str_buffer(a) : (b) |
Definition at line 47 of file strings.h.
Referenced by msg_route().
| #define ast_str_alloca | ( | init_len | ) |
Definition at line 623 of file strings.h.
Referenced by __ast_manager_event_multichan(), __iax2_show_peers(), __queues_show(), _sip_show_peer(), action_createconfig(), action_listcommands(), action_login(), add_cc_call_info_to_response(), add_ip_ie(), add_rpid(), add_sdp(), add_timeval_ie(), alloc_event(), aocmessage_get_unit_entry(), app_exec(), ast_eivr_getvariable(), ast_str_encode_mime(), ast_var_channels_table(), build_peer(), cc_extension_monitor_init(), cc_generic_agent_start_monitoring(), chanavail_exec(), cli_alias_passthrough(), cli_match_char_tree(), construct_pidf_body(), do_magic_pickup(), func_channel_read(), function_realtime_read(), function_realtime_readdestroy(), function_sippeer(), generate_uri(), handle_call_token(), handle_cli_iax2_show_peer(), handle_cli_indication_show(), handle_show_chanvar(), handle_show_translation_path(), handle_showchan(), handle_showmanager(), handle_showmancmd(), handle_showmancmds(), hashkeys_read(), hashkeys_read2(), initreqprep(), log_jack_status(), manager_iax2_show_peer_list(), peers_data_provider_get(), print_uptimestr(), process_sdp(), record_thread(), sendtext_exec(), serialize_showchan(), show_channels_cb(), sig_pri_start_pri(), sip_send_mwi_to_peer(), sip_show_sched(), transmit_info_with_aoc(), transmit_notify_with_mwi(), transmit_state_notify(), and wait_for_answer().
| #define DS_ALLOCA ((struct ast_threadstorage *)2) |
| #define DS_MALLOC ((struct ast_threadstorage *)1) |
| #define DS_STATIC ((struct ast_threadstorage *)3) /* not supported yet */ |
| #define S_COR | ( | a, | |
| b, | |||
| c | |||
| ) | ({typeof(&((b)[0])) __x = (b); (a) && !ast_strlen_zero(__x) ? (__x) : (c);}) |
returns the equivalent of logic or for strings, with an additional boolean check: second one if not empty and first one is true, otherwise third one. example: S_COR(usewidget, widget, "<no widget>")
Definition at line 83 of file strings.h.
Referenced by __analog_handle_event(), __ast_goto_if_exists(), __ast_pbx_run(), _macro_exec(), _skinny_show_line(), acf_isexten_exec(), action_agents(), action_confbridgelist_item(), action_coreshowchannels(), action_meetmelist(), action_status(), add_rpid(), analog_call(), analog_ss_thread(), ast_app_dtget(), ast_bridge_call(), ast_cel_report_event(), ast_channel_set_caller_event(), ast_hangup(), ast_pbx_h_exten_run(), ast_setstate(), background_detect_exec(), builtin_automixmonitor(), builtin_automonitor(), collect_digits(), conf_run(), console_call(), console_transfer(), copy_message(), dahdi_handle_dtmf(), dahdi_handle_event(), dial_exec_full(), disa_exec(), do_forward(), fax_detect_framehook(), find_matching_endwhile(), findmeexec(), forward_message(), gosub_exec(), gosub_run(), handle_chanlist(), handle_cli_confbridge_list_item(), handle_cli_misdn_show_channels(), handle_gosub(), handle_setpriority(), handle_showchan(), isAnsweringMachine(), isexten_function_read(), join_queue(), launch_monitor_thread(), leave_voicemail(), local_call(), manager_bridge_event(), manager_parking_status(), manager_queues_status(), meetme_show_cmd(), mgcp_call(), mgcp_hangup(), mgcp_ss(), minivm_greet_exec(), minivm_notify_exec(), misdn_copy_redirecting_from_ast(), misdn_get_connected_line(), misdn_write(), my_handle_dtmf(), my_set_callerid(), ospauth_exec(), osplookup_exec(), oss_call(), park_call_full(), parkandannounce_exec(), parked_call_exec(), party_id_read(), pbx_builtin_background(), pbx_builtin_waitexten(), pbx_parseable_goto(), phase_e_handler(), post_manager_event(), process_ast_dsp(), process_sdp(), push_callinfo(), queue_exec(), readexten_exec(), release_chan(), report_new_callerid(), ring_entry(), send_callinfo(), send_join_event(), send_leave_event(), senddialevent(), serialize_showchan(), set_one_cid(), setup_env(), sig_pri_call(), sig_pri_event_party_id(), sip_read(), sms_exec(), socket_process_helper(), state_notify_build_xml(), try_calling(), unistim_indicate(), update_connectedline(), valid_exit(), vm_authenticate(), waitstream_core(), and write_metadata().
| #define S_OR | ( | a, | |
| b | |||
| ) | ({typeof(&((a)[0])) __x = (a); ast_strlen_zero(__x) ? (b) : __x;}) |
returns the equivalent of logic or for strings: first one if not empty, otherwise second one.
Definition at line 77 of file strings.h.
Referenced by __analog_handle_event(), __ast_channel_alloc_ap(), __ast_cli_register(), __ssl_setup(), _sip_show_peer(), _skinny_show_device(), _skinny_show_line(), acf_curl_helper(), acf_if(), acf_transaction_write(), acf_vm_info(), action_agents(), action_coreshowchannels(), action_getvar(), action_messagesend(), action_reload(), action_setvar(), action_status(), add_peer_mailboxes(), add_peer_mwi_subs(), agent_hangup(), aji_handle_presence(), aji_initialize(), alloc_event(), analog_hangup(), analog_ss_thread(), app_exec(), append_row_to_cfg(), array(), ast_async_goto(), ast_bridge_call(), ast_bridge_timelimit(), ast_bt_get_symbols(), ast_call_forward(), ast_cc_call_init(), ast_cdr_end(), ast_cdr_init(), ast_cdr_serialize_variables(), ast_cdr_setapp(), ast_cdr_update(), ast_cel_fill_record(), ast_cel_get_ama_flag_name(), ast_cel_get_type_name(), ast_cel_report_event(), ast_channel_connected_line_macro(), ast_channel_connected_line_sub(), ast_channel_redirecting_macro(), ast_channel_redirecting_sub(), ast_cli_command_full(), ast_do_masquerade(), ast_hangup(), ast_msg_send(), ast_play_and_record_full(), ast_queue_log(), ast_rtp_dtls_set_configuration(), ast_sockaddr_parse(), ast_sockaddr_resolve(), authenticate(), build_callid_pvt(), build_callid_registry(), build_peer(), build_profile(), build_route(), builtin_automixmonitor(), builtin_automonitor(), calltoken_required(), cc_generic_agent_init(), cc_interfaces_datastore_init(), cdr_handler(), check_auth(), check_post(), cli_fax_show_sessions(), cli_odbc_write(), common_exec(), conf_get_sound(), config_curl(), config_handler(), config_parse_variables(), create_dynamic_parkinglot(), create_queue_member(), dahdi_handle_dtmf(), dahdi_handle_event(), dahdi_hangup(), dahdi_show_channel(), dial_exec_full(), do_forward(), dundi_exec(), enable_jack_hook(), execif_exec(), extensionstate_update(), fast_originate(), fax_detect_framehook(), feature_check(), feature_interpret(), file_write(), find_conf(), forward_message(), generic_recall(), get_also_info(), get_cached_mwi(), get_cid_name(), get_destination(), get_parkingtime(), get_rdnis(), get_refer_info(), gosub_run(), goto_exten(), gtalk_add_candidate(), gtalk_newcall(), gtalk_parser(), gtalk_response(), gtalk_ringing_ack(), gtalk_show_settings(), handle_call_token(), handle_chanlist(), handle_cli_agi_show(), handle_cli_check_permissions(), handle_cli_config_list(), handle_cli_iax2_show_channels(), handle_cli_moh_show_classes(), handle_debug(), handle_gosub(), handle_manager_show_settings(), handle_request_invite(), handle_request_subscribe(), handle_response_register(), handle_show_function(), handle_show_functions(), handle_show_settings(), handle_showchan(), handle_showmancmd(), handle_skinny_show_settings(), handle_verbose(), hashtab_compare_exten_labels(), hashtab_hash_labels(), help1(), help_workhorse(), hints_data_provider_get(), iftime(), init_logger_chain(), init_pvt(), jingle_new(), leave_voicemail(), load_module(), local_read(), login_exec(), make_email_file(), manage_parked_call(), manager_dbput(), manager_queue_log_custom(), manager_queue_reload(), manager_set_defaults(), manager_show_registry(), misdn_cfg_get(), misdn_copy_redirecting_from_ast(), misdn_get_connected_line(), msg_create_from_file(), msg_send_exec(), mstime(), my_distinctive_ring(), my_handle_dtmf(), npval(), on_dns_update_registry(), originate_exec(), oss_call(), park_call_exec(), park_call_full(), park_space_reserve(), pbx_builtin_execiftime(), pbx_builtin_waitexten(), pbx_exec(), pbx_extension_helper(), pbx_load_config(), peer_mailboxes_to_str(), pgsql_reconnect(), phase_e_handler(), play_mailbox_owner(), play_moh_exec(), prep_email_sub_vars(), presence_state_event(), pri_dchannel(), print_app_docs(), process_ast_dsp(), process_sdp(), process_text_line(), queue_exec(), realtime_common(), realtime_curl(), realtime_destroy_handler(), realtime_directory(), realtime_exec(), realtime_handler(), realtime_multi_curl(), realtime_multi_handler(), realtime_store_handler(), realtime_update2_handler(), realtime_update_handler(), receivefax_exec(), register_exten(), register_group_feature(), register_peer_exten(), reload_config(), report_fax_status(), return_exec(), ring_entry(), row_to_varlist(), rt_handle_member_record(), run_externnotify(), select_entry(), send_provisional_keepalive_full(), sendfax_exec(), sendpage(), serialize_showchan(), set_channel_variables(), set_config(), set_member_paused(), set_one_cid(), setsubstate(), setup_env(), shared_write(), show_channels_cb(), sig_pri_event_party_id(), sig_pri_indicate(), sig_pri_send_mwi_indication(), sip_msg_send(), sip_parse_register_line(), sip_read(), sip_show_domains(), sip_show_settings(), sip_uri_cmp(), sla_show_stations(), sla_show_trunks(), sms_exec(), sms_log(), socket_process_helper(), start_moh_exec(), state_notify_build_xml(), static_callback(), testtime_write(), transmit_notify_with_mwi(), transmit_register(), unregister_exten(), wait_for_answer(), xmpp_client_reconnect(), xmpp_client_set_group_presence(), xmpp_pak_message(), and xmpp_pak_presence().
| anonymous enum |
Error codes from __ast_str_helper() The undelying processing to manipulate dynamic string is done by __ast_str_helper(), which can return a success or a permanent failure (e.g. no memory).
| AST_DYNSTR_BUILD_FAILED |
An error has occurred and the contents of the dynamic string are undefined |
| AST_DYNSTR_BUILD_RETRY |
The buffer size for the dynamic string had to be increased, and __ast_str_helper() needs to be called again after a va_end() and va_start(). This return value is legacy and will no longer be used. |
Definition at line 715 of file strings.h.
{
/*! An error has occurred and the contents of the dynamic string
* are undefined */
AST_DYNSTR_BUILD_FAILED = -1,
/*! The buffer size for the dynamic string had to be increased, and
* __ast_str_helper() needs to be called again after
* a va_end() and va_start(). This return value is legacy and will
* no longer be used.
*/
AST_DYNSTR_BUILD_RETRY = -2
};
| int __ast_str_helper | ( | struct ast_str ** | buf, |
| ssize_t | max_len, | ||
| int | append, | ||
| const char * | fmt, | ||
| va_list | ap | ||
| ) |
Core functionality of ast_str_(set|append)_va.
The arguments to this function are the same as those described for ast_str_set_va except for an addition argument, append. If append is non-zero, this will append to the current string instead of writing over it.
AST_DYNSTR_BUILD_RETRY is a legacy define. It should probably never again be used.
A return of AST_DYNSTR_BUILD_FAILED indicates a memory allocation error.
A return value greater than or equal to zero indicates the number of characters that have been written, not including the terminating '\0'. In the append case, this only includes the number of characters appended.
core handler for dynamic strings. This is not meant to be called directly, but rather through the various wrapper macros ast_str_set(...) ast_str_append(...) ast_str_set_va(...) ast_str_append_va(...)
Definition at line 59 of file strings.c.
References AST_DYNSTR_BUILD_FAILED, ast_str_make_space(), ast_verbose(), and len().
Referenced by ast_str_set_va().
{
int res, need;
int offset = (append && (*buf)->__AST_STR_LEN) ? (*buf)->__AST_STR_USED : 0;
va_list aq;
do {
if (max_len < 0) {
max_len = (*buf)->__AST_STR_LEN; /* don't exceed the allocated space */
}
/*
* Ask vsnprintf how much space we need. Remember that vsnprintf
* does not count the final <code>'\0'</code> so we must add 1.
*/
va_copy(aq, ap);
res = vsnprintf((*buf)->__AST_STR_STR + offset, (*buf)->__AST_STR_LEN - offset, fmt, aq);
need = res + offset + 1;
/*
* If there is not enough space and we are below the max length,
* reallocate the buffer and return a message telling to retry.
*/
if (need > (*buf)->__AST_STR_LEN && (max_len == 0 || (*buf)->__AST_STR_LEN < max_len) ) {
int len = (int)(*buf)->__AST_STR_LEN;
if (max_len && max_len < need) { /* truncate as needed */
need = max_len;
} else if (max_len == 0) { /* if unbounded, give more room for next time */
need += 16 + need / 4;
}
if (0) { /* debugging */
ast_verbose("extend from %d to %d\n", len, need);
}
if (
#if (defined(MALLOC_DEBUG) && !defined(STANDALONE))
_ast_str_make_space(buf, need, file, lineno, function)
#else
ast_str_make_space(buf, need)
#endif
) {
ast_verbose("failed to extend from %d to %d\n", len, need);
va_end(aq);
return AST_DYNSTR_BUILD_FAILED;
}
(*buf)->__AST_STR_STR[offset] = '\0'; /* Truncate the partial write. */
/* Restart va_copy before calling vsnprintf() again. */
va_end(aq);
continue;
}
va_end(aq);
break;
} while (1);
/* update space used, keep in mind the truncation */
(*buf)->__AST_STR_USED = (res + offset > (*buf)->__AST_STR_LEN) ? (*buf)->__AST_STR_LEN - 1: res + offset;
return res;
}
| char* __ast_str_helper2 | ( | struct ast_str ** | buf, |
| ssize_t | max_len, | ||
| const char * | src, | ||
| size_t | maxsrc, | ||
| int | append, | ||
| int | escapecommas | ||
| ) |
Definition at line 119 of file strings.c.
References ast_str::__AST_STR_LEN, and ast_str_make_space().
Referenced by ast_str_append_substr(), ast_str_append_va(), ast_str_set_escapecommas(), and ast_str_set_substr().
{
int dynamic = 0;
char *ptr = append ? &((*buf)->__AST_STR_STR[(*buf)->__AST_STR_USED]) : (*buf)->__AST_STR_STR;
if (maxlen < 1) {
if (maxlen == 0) {
dynamic = 1;
}
maxlen = (*buf)->__AST_STR_LEN;
}
while (*src && maxsrc && maxlen && (!escapecommas || (maxlen - 1))) {
if (escapecommas && (*src == '\\' || *src == ',')) {
*ptr++ = '\\';
maxlen--;
(*buf)->__AST_STR_USED++;
}
*ptr++ = *src++;
maxsrc--;
maxlen--;
(*buf)->__AST_STR_USED++;
if ((ptr >= (*buf)->__AST_STR_STR + (*buf)->__AST_STR_LEN - 3) ||
(dynamic && (!maxlen || (escapecommas && !(maxlen - 1))))) {
char *oldbase = (*buf)->__AST_STR_STR;
size_t old = (*buf)->__AST_STR_LEN;
if (ast_str_make_space(buf, (*buf)->__AST_STR_LEN * 2)) {
/* If the buffer can't be extended, end it. */
break;
}
/* What we extended the buffer by */
maxlen = old;
ptr += (*buf)->__AST_STR_STR - oldbase;
}
}
if (__builtin_expect(!maxlen, 0)) {
ptr--;
}
*ptr = '\0';
return (*buf)->__AST_STR_STR;
}
| int ast_build_string | ( | char ** | buffer, |
| size_t * | space, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
Build a string in a buffer, designed to be called repeatedly.
This is a wrapper for snprintf, that properly handles the buffer pointer and buffer space available.
| buffer | current position in buffer to place string into (will be updated on return) |
| space | remaining space in buffer (will be updated on return) |
| fmt | printf-style format string |
| 0 | on success |
| non-zero | on failure. |
Definition at line 1492 of file main/utils.c.
References ast_build_string_va().
Referenced by ast_fax_caps_to_str(), config_odbc(), generate_filenames_string(), handle_speechrecognize(), pp_each_extension_helper(), and pp_each_user_helper().
{
va_list ap;
int result;
va_start(ap, fmt);
result = ast_build_string_va(buffer, space, fmt, ap);
va_end(ap);
return result;
}
| int ast_build_string_va | ( | char ** | buffer, |
| size_t * | space, | ||
| const char * | fmt, | ||
| va_list | ap | ||
| ) |
Build a string in a buffer, designed to be called repeatedly.
This is a wrapper for snprintf, that properly handles the buffer pointer and buffer space available.
| buffer | current position in buffer to place string into (will be updated on return) |
| space | remaining space in buffer (will be updated on return) |
| fmt | printf-style format string |
| ap | varargs list of arguments for format |
Definition at line 1473 of file main/utils.c.
Referenced by ast_build_string().
{
int result;
if (!buffer || !*buffer || !space || !*space)
return -1;
result = vsnprintf(*buffer, *space, fmt, ap);
if (result < 0)
return -1;
else if (result > *space)
result = *space;
*buffer += result;
*space -= result;
return 0;
}
| int ast_check_digits | ( | const char * | arg | ) | [inline] |
Check if a string is only digits.
| 1 | The string contains only digits |
| 0 | The string contains non-digit characters |
Definition at line 934 of file strings.h.
Referenced by create_addr().
{
| void ast_copy_string | ( | char * | dst, |
| const char * | src, | ||
| size_t | size | ||
| ) | [inline] |
Size-limited null-terminating string copy.
| dst | The destination buffer. |
| src | The source string |
| size | The size of the destination buffer |
This is similar to strncpy, with two important differences:
Definition at line 223 of file strings.h.
Referenced by __analog_handle_event(), __analog_ss_thread(), __ast_context_destroy(), __ast_http_load(), __ast_http_post_load(), __ast_pbx_run(), __ast_play_and_record(), __iax2_show_peers(), __init_manager(), __schedule_action(), __set_address_from_contact(), _ast_odbc_request_obj2(), _get_mohbyname(), _macro_exec(), _sip_show_peers_one(), acf_channel_read(), acf_curl_helper(), acf_curlopt_helper(), acf_cut_exec(), acf_exception_read(), acf_faxopt_read(), acf_fetch(), acf_iaxvar_read(), acf_if(), acf_isexten_exec(), acf_jabberreceive_read(), acf_mailbox_exists(), acf_odbc_read(), acf_sprintf(), acf_transaction_read(), acf_version_exec(), acf_vm_info(), acl_new(), action_confbridgekick(), action_confbridgelist(), action_confbridgesetsinglevideosrc(), action_confbridgestartrecord(), action_confbridgestoprecord(), action_originate(), action_playback_and_continue(), actual_load_config(), add_agent(), add_cc_call_info_to_response(), add_exten_to_pattern_tree(), add_line(), add_realm_authentication(), add_route(), add_sdp(), add_sip_domain(), add_vm_recipients_from_string(), adsi_load(), adsi_message(), adsi_process(), aes_helper(), agentmonitoroutgoing_exec(), aji_create_buddy(), aji_create_client(), aji_find_version(), aji_handle_message(), aji_handle_presence(), alarmreceiver_exec(), alloc_profile(), analog_call(), analog_hangup(), analog_ss_thread(), announce_thread(), answer_call(), answer_exec_enable(), aoc_create_ie_data(), aoc_create_ie_data_charging_rate(), aoc_parse_ie_charging_rate(), app_exec(), append_mailbox(), apply_general_options(), apply_option(), apply_options_full(), ast_add_extension2_lockopt(), ast_aoc_s_add_rate_duration(), ast_aoc_s_add_rate_flat(), ast_aoc_s_add_rate_volume(), ast_aoc_set_association_number(), ast_aoc_set_currency_info(), ast_app_group_split_group(), ast_apply_ha(), ast_bridge_call(), ast_bridge_dtmf_stream(), ast_bridge_features_hook(), ast_bridge_features_register(), ast_call_forward(), ast_callerid_merge(), ast_callerid_parse(), ast_callerid_split(), ast_category_new(), ast_category_rename(), ast_cc_extension_monitor_add_dialstring(), ast_cc_get_param(), ast_cdr_appenduserfield(), ast_cdr_getvar(), ast_cdr_init(), ast_cdr_merge(), ast_cdr_register(), ast_cdr_setaccount(), ast_cdr_setapp(), ast_cdr_setdestchan(), ast_cdr_setpeeraccount(), ast_cdr_setuserfield(), ast_cdr_update(), ast_channel_context_set(), ast_channel_destructor(), ast_channel_exten_set(), ast_channel_get_cc_agent_type(), ast_channel_get_device_name(), ast_channel_macrocontext_set(), ast_channel_macroexten_set(), ast_cli_completion_matches(), ast_context_find(), ast_context_find_or_create(), ast_context_remove_extension_callerid2(), ast_devstate_prov_add(), ast_do_masquerade(), ast_eivr_getvariable(), ast_event_subscribe(), ast_expr(), ast_frame_subclass2str(), ast_frame_type2str(), ast_func_read(), ast_get_enum(), ast_get_hint(), ast_get_indication_zone(), ast_get_srv(), ast_get_txt(), ast_getformatname_multiple(), ast_getformatname_multiple_byid(), ast_http_prefix(), ast_linear_stream(), ast_makesocket(), ast_moh_files_next(), ast_monitor_change_fname(), ast_monitor_stop(), ast_pbx_outgoing_app(), ast_pbx_outgoing_exten(), ast_presence_state_prov_add(), ast_privacy_check(), ast_privacy_set(), ast_read_image(), ast_readconfig(), ast_remove_hint(), ast_say_date_th(), ast_say_date_with_format_da(), ast_say_date_with_format_de(), ast_say_date_with_format_en(), ast_say_date_with_format_es(), ast_say_date_with_format_fr(), ast_say_date_with_format_gr(), ast_say_date_with_format_it(), ast_say_date_with_format_nl(), ast_say_date_with_format_pl(), ast_say_date_with_format_th(), ast_say_date_with_format_vi(), ast_say_date_with_format_zh(), ast_say_datetime_from_now_pt(), ast_say_datetime_th(), ast_say_enumeration_full_da(), ast_say_enumeration_full_de(), ast_say_enumeration_full_en(), ast_say_enumeration_full_vi(), ast_say_number_full_cs(), ast_say_number_full_da(), ast_say_number_full_de(), ast_say_number_full_en(), ast_say_number_full_en_GB(), ast_say_number_full_es(), ast_say_number_full_fr(), ast_say_number_full_gr(), ast_say_number_full_hu(), ast_say_number_full_it(), ast_say_number_full_nl(), ast_say_number_full_no(), ast_say_number_full_pt(), ast_say_number_full_ru(), ast_say_number_full_se(), ast_say_number_full_th(), ast_say_number_full_vi(), ast_say_number_full_zh(), ast_set_cc_agent_dialstring(), ast_set_cc_callback_macro(), ast_set_cc_callback_sub(), ast_setstate(), AST_TEST_DEFINE(), ast_tryconnect(), ast_tzset(), ast_unregister_indication_country(), ast_var_assign(), ast_var_channels_table(), ast_var_indications(), ast_var_indications_table(), ast_xmldoc_printable(), auth_http_callback(), authenticate(), authenticate_verify(), begin_dial_channel(), blr_ebl(), bridge_channel_dtmf_stream(), build_alias(), build_conf(), build_context(), build_device(), build_gateway(), build_mapping(), build_peer(), build_reply_digest(), build_route(), build_user(), builtin_feature_get_exten(), cache_lookup(), cache_lookup_internal(), calendar_event_read(), calendar_join_attendees(), calendar_query_result_exec(), callerid_feed(), callerid_feed_jp(), callerid_read(), callerpres_read(), CB_ADD_LEN(), cb_events(), cc_build_payload(), cc_generic_agent_init(), cdata(), change_password_realtime(), chararray_handler_fn(), check_auth(), check_match(), check_password(), check_peer_ok(), check_sip_domain(), check_user_full(), check_via(), cleanup_stale_contexts(), cli_tps_report(), common_exec(), compile_script(), complete_confbridge_participant(), complete_dpreply(), complete_fn(), complete_indications(), conf_exec(), conf_run(), confbridge_exec(), config_device(), config_function_read(), config_line(), config_parse_variables(), config_pgsql(), config_text_file_load(), connectedline_read(), console_dial(), construct_pidf_body(), copy_message(), copy_via_headers(), create_addr(), create_addr_from_peer(), create_dynamic_parkinglot(), create_epa_entry(), create_followme_number(), create_parkinglot(), create_queue_member(), create_vmaccount(), crement_function_read(), csv_quote(), custom_silk_format(), cut_internal(), dahdi_call(), dahdi_func_read(), dahdi_handle_event(), dahdi_hangup(), dahdi_new(), dahdi_queryoption(), dahdi_r2_on_call_disconnect(), dahdi_show_channels(), db_get_common(), devstate_read(), dial_exec_full(), dialandactivatesub(), dialgroup_read(), dialgroup_write(), dialout(), dictate_exec(), disa_exec(), dispatch_thread_handler(), do_forward(), do_reload(), dump_addr(), dump_byte(), dump_datetime(), dump_int(), dump_ipaddr(), dump_prov_flags(), dump_prov_ies(), dump_samprate(), dump_short(), dump_versioned_codec(), dundi_answer_entity(), dundi_answer_query(), dundi_do_lookup(), dundi_do_precache(), dundi_do_query(), dundi_lookup_internal(), dundi_lookup_local(), dundi_precache_internal(), dundi_prop_precache(), dundi_query_eid_internal(), dundi_query_thread(), ebl_callback(), enum_query_read(), enum_result_read(), env_read(), epoch_to_exchange_time(), external_rtp_create(), extract_uri(), exts_compare(), extstate_read(), featuremap_write(), filename_parse(), find_account(), find_agent_callbacks(), find_cache(), find_conf(), find_conf_realtime(), find_context(), find_context_locked(), find_engine(), find_line_by_name(), find_or_create(), find_queue_by_name_rt(), find_realtime_gw(), find_subchannel_and_lock(), find_subchannel_by_name(), find_user_realtime(), findmeexec(), format_list_add_static(), forward_message(), func_channel_read(), func_check_sipdomain(), func_confbridge_info(), func_header_read(), function_agent(), function_enum(), function_iaxpeer(), function_realtime_read(), function_realtime_readdestroy(), function_sipchaninfo_read(), function_sippeer(), gen_header(), generate_uri(), generic_lock_unlock_helper(), generic_mute_unmute_helper(), get_also_info(), get_date(), get_destination(), get_domain(), get_esc_entry(), get_name_and_number(), get_pai(), get_rdnis(), get_rpid(), getdisplaybyname(), getflagbyname(), getkeybyname(), getstatebyname(), getsubbyname(), gettag(), global_read(), group_count_function_read(), group_function_read(), group_function_write(), group_list_function_read(), gtalk_add_candidate(), gtalk_alloc(), gtalk_call(), gtalk_create_candidates(), gtalk_create_member(), gtalk_load_config(), gtalk_newcall(), gtalk_ringing_ack(), gtalk_show_channels(), handle_cli_confbridge_kick(), handle_cli_confbridge_list(), handle_cli_confbridge_start_record(), handle_cli_confbridge_stop_record(), handle_cli_iax2_show_cache(), handle_cli_iax2_show_registry(), handle_cli_iax2_show_users(), handle_cli_indication_add(), handle_cli_indication_show(), handle_cli_keys_init(), handle_cli_misdn_send_display(), handle_cli_misdn_send_facility(), handle_cli_presencestate_list(), handle_cli_ulimit(), handle_command_response(), handle_common_options(), handle_dial_page(), handle_incoming(), handle_presencechange(), handle_pri_set_debug_file(), handle_request_invite(), handle_response(), handle_response_publish(), handle_select_codec(), handle_select_language(), handle_setcallerid(), handle_statechange(), hangupcause_keys_read(), hangupcause_read(), has_voicemail(), hash_read(), iax2_ack_registry(), iax2_append_register(), iax2_exec(), iax2_getpeername(), iax2_register(), iax2_transfer(), iax_frame_subclass2str(), iax_parse_ies(), iax_process_template(), iax_show_provisioning(), iax_template_copy(), iax_template_parse(), ices_exec(), ifmodule_read(), iftime(), import_ch(), inboxcount2(), init_acf_query(), init_logger_chain(), init_profile(), init_state(), initreqprep(), jb_conf_default(), jb_framedata_init(), jingle_action_session_terminate(), jingle_add_candidate(), jingle_alloc(), jingle_call(), jingle_create_candidates(), jingle_create_member(), jingle_load_config(), jingle_newcall(), jingle_outgoing_hook(), jingle_request(), jingle_show_channels(), jingle_transmit_invite(), join_conference_bridge(), join_queue(), key_dial_page(), key_favorite(), key_history(), key_main_page(), key_select_extension(), key_select_language(), leave_voicemail(), listfilter(), load_config(), load_format_config(), load_module(), load_moh_classes(), load_odbc_config(), load_password(), load_pktccops_config(), local_alloc(), local_ast_moh_start(), local_attended_transfer(), local_read(), lock_read(), log_events(), login_exec(), lookup_iface(), main(), make_email_file(), make_logchannel(), manager_iax2_show_peer_list(), manager_iax2_show_registry(), manager_modulecheck(), manager_set_defaults(), math(), message_template_build(), message_template_create(), message_template_parse_filebody(), mgcp_call(), mgcp_request(), mgcp_ss(), minivm_accmess_exec(), minivm_account_func_read(), minivm_delete_exec(), minivm_greet_exec(), minivm_mwi_exec(), minivm_notify_exec(), misdn_answer(), misdn_call(), misdn_cfg_get(), misdn_cfg_get_desc(), misdn_cfg_get_name(), misdn_check_l2l1(), misdn_copy_redirecting_from_ast(), misdn_digit_end(), misdn_facility_ie_handler(), misdn_get_connected_line(), misdn_hangup(), misdn_is_msn_valid(), misdn_request(), misdn_send_text(), misdn_set_opt_exec(), mkif(), mkintf(), moh_files_alloc(), moh_scan_files(), msg_data_func_read(), msg_func_read(), my_dial_digits(), my_distinctive_ring(), my_get_callerid(), my_new_pri_ast_channel(), my_new_ss7_ast_channel(), my_pri_init_config(), my_pri_make_cc_dialstring(), my_set_callerid(), my_set_dnid(), my_set_rdnis(), named_acl_alloc(), named_acl_find(), nbs_alloc(), netconsole(), notify_new_message(), odbc_log(), oh323_alloc(), oh323_call(), oh323_request(), open_mailbox(), osp_check_destination(), osp_convert_inout(), osp_convert_outin(), osp_create_provider(), osp_create_transaction(), osp_lookup(), osp_report_qos(), ospfinished_exec(), osplookup_exec(), page_exec(), park_call_exec(), park_call_full(), parkinglot_config_read(), parse_bookmark(), parse_config(), parse_moved_contact(), parse_naptr(), parse_ok_contact(), parse_options(), parse_register_contact(), parse_sip_options(), parse_tag(), parse_tone_zone(), party_id_read(), party_name_read(), party_number_read(), party_subaddress_read(), pbx_builtin_saynumber(), pbx_extension_helper(), pbx_load_config(), pbx_load_users(), pbx_retrieve_variable(), pbx_substitute_variables_helper_full(), peek_read(), peer_status(), pgsql_reconnect(), phone_call(), pktccops_show_cmtses(), pktccops_show_gates(), play_message_by_id(), play_record_review(), populate_defaults(), presence_read(), pri_dchannel(), pri_queue_pvt_cause_data(), pri_ss_thread(), private_enum_init(), process_applicationmap_line(), process_config(), process_dahdi(), process_precache(), profile_set_param(), proxy_from_config(), queue_set_param(), quote(), rcv_mac_addr(), read_agent_config(), read_config(), read_config_maps(), read_password_from_file(), realtime_common(), realtime_odbc(), realtime_peer(), realtime_peer_by_addr(), realtime_switch_common(), realtime_update_peer(), realtimefield_read(), receive_ademco_contact_id(), receive_message(), record_exec(), redirecting_read(), register_exten(), register_peer_exten(), register_verify(), registry_rerequest(), reload_config(), reload_followme(), reload_queue_rules(), reload_single_member(), remap_feature(), remove_from_queue(), reply_digest(), reqprep(), reset_user_pw(), respprep(), ring_entry(), rt_extend_conf(), rt_handle_member_record(), run_externnotify(), search_directory_sub(), sendmail(), sendpage(), set(), set_callforwards(), set_config(), set_destination(), set_fn(), set_insecure_flags(), set_message_vars_from_req(), set_one_cid(), setsubstate(), setup_incoming_call(), setup_privacy_args(), shared_read(), show_entry_history(), show_phone_number(), sig_pri_aoc_d_from_ast(), sig_pri_aoc_e_from_ast(), sig_pri_aoc_s_from_ast(), sig_pri_call(), sig_pri_handle_subcmds(), sig_pri_indicate(), sig_pri_init_config(), sig_pri_party_name_from_ast(), sig_pri_party_number_from_ast(), sig_pri_party_subaddress_from_ast(), sig_pri_send_mwi_indication(), sig_pri_sendtext(), sig_ss7_call(), sip_acf_channel_read(), sip_alloc(), sip_call(), sip_cc_agent_init(), sip_cli_notify(), sip_find_peer_full(), sip_get_cc_information(), sip_parse_register_line(), sip_poke_peer(), sip_prepare_socket(), sip_prune_realtime(), sip_queryoption(), sip_register(), sip_report_chal_sent(), sip_report_failed_challenge_response(), sip_request_call(), sip_show_inuse(), sip_sipredirect(), sip_subscribe_mwi(), skinny_call(), skinny_register(), skinny_request(), smdi_load(), smdi_msg_read(), smdi_read(), sms_exec(), sms_handleincoming(), sms_handleincoming_proto2(), sms_writefile(), socket_process_helper(), socket_read(), softhangup_exec(), spawn_dp_lookup(), spawn_mp3(), speech_grammar(), speech_read(), speech_score(), speech_text(), srv_query_read(), srv_result_read(), ss7_linkset(), ss7_queue_pvt_cause_data(), stat_read(), store_config(), store_odbc(), store_tone_zone_ring_cadence(), substring(), temp_peer(), term_color(), term_prompt(), timeout_read(), timezone_add(), transmit_callinfo(), transmit_cfwdstate(), transmit_connect(), transmit_connect_with_sdp(), transmit_dialednumber(), transmit_displaynotify(), transmit_displaypromptstatus(), transmit_modify_request(), transmit_modify_with_sdp(), transmit_notify_request(), transmit_notify_request_with_callerid(), transmit_refer(), transmit_speeddialstatres(), transmit_state_notify(), transmit_versionres(), try_calling(), try_load_key(), trylock_read(), txt_callback(), unistim_request(), unistim_sp(), unistim_ss(), unlock_read(), unregister_exten(), update_call_counter(), update_common_options(), uridecode(), users_data_provider_get(), vars2manager(), vm_authenticate(), vm_change_password(), vm_change_password_shell(), vm_execmain(), vm_mailbox_snapshot_create(), vm_msg_forward(), vm_msg_move(), vm_msg_play(), vm_msg_remove(), vmauthenticate(), wait_for_answer(), wait_for_winner(), write_history(), write_metadata(), xmpp_client_alloc(), xmpp_client_create_buddy(), xmpp_pak_message(), and xmpp_pak_presence().
{
| int attribute_pure ast_false | ( | const char * | val | ) |
Make sure something is false. Determine if a string containing a boolean value is "false". This function checks to see whether a string passed to it is an indication of an "false" value. It checks to see if the string is "no", "false", "n", "f", "off" or "0".
| 0 | if val is a NULL pointer. |
| -1 | if "true". |
| 0 | otherwise. |
Definition at line 1541 of file main/utils.c.
References ast_strlen_zero().
Referenced by acf_faxopt_write(), acf_transaction_write(), actual_load_config(), aji_create_client(), aji_load_config(), aoc_cli_debug_enable(), bool_handler_fn(), boolflag_handler_fn(), build_peer(), build_user(), dahdi_datetime_send_option(), dahdi_set_dnd(), find_realtime(), func_channel_write_real(), handle_common_options(), handle_queue_set_member_ringinuse(), init_acf_query(), load_config(), load_odbc_config(), manager_mute_mixmonitor(), manager_queue_member_ringinuse(), parse_empty_options(), process_dahdi(), reload_config(), reload_single_member(), rt_handle_member_record(), rtp_reload(), run_agi(), set_config(), set_insecure_flags(), sip_parse_nat_option(), sla_build_trunk(), and strings_to_mask().
{
if (ast_strlen_zero(s))
return 0;
/* Determine if this is a false value */
if (!strcasecmp(s, "no") ||
!strcasecmp(s, "false") ||
!strcasecmp(s, "n") ||
!strcasecmp(s, "f") ||
!strcasecmp(s, "0") ||
!strcasecmp(s, "off"))
return -1;
return 0;
}
| int ast_get_time_t | ( | const char * | src, |
| time_t * | dst, | ||
| time_t | _default, | ||
| int * | consumed | ||
| ) |
get values from config variables.
Definition at line 2098 of file main/utils.c.
References ast_strlen_zero().
Referenced by build_peer(), cache_lookup_internal(), dundi_show_cache(), dundi_show_hints(), handle_saydatetime(), load_password(), play_message_datetime(), process_clearcache(), realtime_peer(), and sayunixtime_exec().
{
long t;
int scanned;
if (dst == NULL)
return -1;
*dst = _default;
if (ast_strlen_zero(src))
return -1;
/* only integer at the moment, but one day we could accept more formats */
if (sscanf(src, "%30ld%n", &t, &scanned) == 1) {
*dst = t;
if (consumed)
*consumed = scanned;
return 0;
} else
return -1;
}
| int ast_get_timeval | ( | const char * | src, |
| struct timeval * | tv, | ||
| struct timeval | _default, | ||
| int * | consumed | ||
| ) |
get values from config variables.
Definition at line 2071 of file main/utils.c.
References ast_strlen_zero().
Referenced by acf_strftime().
{
long double dtv = 0.0;
int scanned;
if (dst == NULL)
return -1;
*dst = _default;
if (ast_strlen_zero(src))
return -1;
/* only integer at the moment, but one day we could accept more formats */
if (sscanf(src, "%30Lf%n", &dtv, &scanned) > 0) {
dst->tv_sec = dtv;
dst->tv_usec = (dtv - dst->tv_sec) * 1000000.0;
if (consumed)
*consumed = scanned;
return 0;
} else
return -1;
}
| void ast_join | ( | char * | s, |
| size_t | len, | ||
| const char *const | w[] | ||
| ) |
Definition at line 1690 of file main/utils.c.
References len().
Referenced by __ast_cli_generator(), ast_agi_register(), ast_agi_unregister(), ast_cli_command_full(), cli_console_sendtext(), console_sendtext(), find_best(), handle_cli_agi_show(), handle_cli_check_permissions(), handle_help(), help1(), help_workhorse(), set_full_cmd(), and write_htmldump().
| int ast_regex_string_to_regex_pattern | ( | const char * | regex_string, |
| struct ast_str ** | regex_pattern | ||
| ) |
Given a string regex_string in the form of "/regex/", convert it into the form of "regex".
This function will trim one leading / and one trailing / from a given input string ast_str regex_pattern must be preallocated before calling this function
| regex_string | the string containing /regex/ |
| regex_pattern | the destination ast_str which will contain "regex" after execution |
Definition at line 1504 of file main/utils.c.
References ast_str_set(), and ast_str_truncate().
Referenced by action_hangup().
{
int regex_len = strlen(regex_string);
int ret = 3;
/* Chop off the leading / if there is one */
if ((regex_len >= 1) && (regex_string[0] == '/')) {
ast_str_set(regex_pattern, 0, "%s", regex_string + 1);
ret -= 2;
}
/* Chop off the ending / if there is one */
if ((regex_len > 1) && (regex_string[regex_len - 1] == '/')) {
ast_str_truncate(*regex_pattern, -1);
ret -= 1;
}
return ret;
}
| char * ast_skip_blanks | ( | const char * | str | ) | [inline] |
Gets a pointer to the first non-whitespace character in a string.
| str | the input string |
Definition at line 97 of file strings.h.
References str.
Referenced by __ast_cli_register(), __astman_get_header(), __get_header(), acf_faxopt_write(), add_redirect(), apply_outgoing(), ast_append_acl(), ast_callerid_parse(), ast_get_namedgroups(), ast_parse_arg(), ast_parse_digest(), ast_skip_nonblanks(), build_peer(), callerid_write(), check_via(), connectedline_write(), determine_firstline_parts(), do_say(), find_call(), find_table_cb(), get_calleridname(), get_content_line(), get_rpid(), get_sdp_iterate(), get_sdp_line(), handle_incoming(), handle_request_invite(), handle_request_notify(), handle_response(), httpd_helper_thread(), keypad_pick_up(), keypad_setup(), man_do_variable_value(), mark_parsed_methods(), next_item(), parse_cdata(), parse_minse(), parse_session_expires(), parse_via(), pbx_load_config(), process_sdp(), process_text_line(), proxy_from_config(), redirecting_write(), reload_config(), reply_digest(), set_message_vars_from_req(), sip_digest_parser(), stackpeek_read(), transmit_fake_auth_response(), transmit_invite(), xml_translate(), and xmldoc_get_formatted().
{
| char * ast_skip_nonblanks | ( | const char * | str | ) | [inline] |
Gets a pointer to first whitespace character in a string.
| str | the input string |
Definition at line 136 of file strings.h.
References ast_skip_blanks(), and ast_trim_blanks().
Referenced by __ast_cli_register(), determine_firstline_parts(), handle_response(), and httpd_helper_thread().
{
| int ast_str_append | ( | struct ast_str ** | buf, |
| ssize_t | max_len, | ||
| const char * | fmt, | ||
| ... | |||
| ) | [inline] |
Append to a thread local dynamic string.
The arguments, return values, and usage of this function are the same as ast_str_set(), but the new data is appended to the current value.
Definition at line 915 of file strings.h.
Referenced by __ast_manager_event_multichan(), __ast_verbose_ap(), __queues_show(), _ast_xmldoc_build_seealso(), acf_curl_helper(), acf_odbc_read(), action_createconfig(), action_status(), action_userevent(), add_blank(), add_codec_to_sdp(), add_content(), add_dtls_to_sdp(), add_header(), add_ice_to_sdp(), add_ip_ie(), add_noncodec_to_sdp(), add_required_respheader(), add_rpid(), add_sdp(), add_tcodec_to_sdp(), add_vcodec_to_sdp(), aoc_amount_str(), aoc_d_event(), aoc_display_decoded_debug(), aoc_e_event(), aoc_request_event(), aoc_s_event(), aoc_time_str(), app_exec(), append_channel_vars(), append_ie(), append_var_and_value_to_filter(), ast_aoc_decoded2str(), ast_cdr_serialize_variables(), ast_eivr_getvariable(), ast_print_namedgroups(), ast_realtime_encode_chunk(), ast_rtp_lookup_mime_multiple2(), ast_sched_report(), ast_str_encode_mime(), ast_str_quote(), ast_str_substitute_variables_full(), ast_term_color_code(), ast_translate_path_to_str(), ast_xmldoc_printable(), auth_http_callback(), authority_to_str(), build_peer(), caldav_get_events_between(), caldav_write_event(), calendar_join_attendees(), CB_ADD(), CB_ADD_LEN(), cc_unique_append(), cdata(), cdr_handler(), celt_sdp_generate(), chanavail_exec(), check_message_integrity(), cli_alias_passthrough(), cli_prompt(), collect_names_cb(), commit_exec(), construct_pidf_body(), cut_internal(), data_result_print_cli(), data_result_print_cli_node(), data_search_generate(), destroy_curl(), destroy_pgsql(), detect_disconnect(), dump_queue_members(), encmethods_to_str(), epoch_to_exchange_time(), ewscal_write_event(), exchangecal_get_events_between(), exchangecal_write_event(), fetch_response_reader(), finalize_content(), function_db_keys(), function_realtime_read(), function_realtime_readdestroy(), generate_uri(), generic_http_callback(), get_content(), h263_format_attr_sdp_generate(), h264_format_attr_sdp_generate(), handle_characters(), handle_cli_indication_show(), handle_manager_show_events(), handle_missing_table(), handle_show_translation_path(), handle_show_translation_table(), handle_showchan(), hashkeys_read2(), httpstatus_callback(), initreqprep(), listfilter(), load_column_config(), load_config(), log_jack_status(), manager_sipnotify(), meetme_cmd_helper(), odbc_log(), pbx_builtin_serialize_variables(), peer_mailboxes_to_str(), pgsql_log(), pgsql_reconnect(), phoneprov_callback(), pp_each_extension_helper(), pp_each_user_helper(), print_uptimestr(), process_output(), process_text_line(), realtime_curl(), realtime_ldap_base_ap(), realtime_multi_curl(), realtime_multi_pgsql(), realtime_pgsql(), realtime_sqlite3_destroy(), realtime_sqlite3_helper(), realtime_sqlite3_store(), realtime_sqlite3_update(), realtime_sqlite3_update2(), realtime_update2_handler(), realtimefield_read(), require_curl(), rollback_exec(), run_station(), send_eivr_event(), set_rec_filename(), sig_pri_event_party_id(), sig_pri_mcid_event(), silk_sdp_generate(), sip_cli_notify(), sip_rtp_read(), sip_tcp_read(), sip_tls_read(), state_notify_build_xml(), store_curl(), store_pgsql(), strreplace(), substitute_escapes(), transmit_info_with_aoc(), transmit_notify_with_mwi(), update2_curl(), update2_ldap(), update2_pgsql(), update2_prepare(), update_curl(), update_ldap(), update_pgsql(), user_authority_to_str(), userevent_exec(), write_cdr(), xml_copy_escape(), xml_encode_str(), xml_translate(), xmldoc_get_syntax_cmd(), xmldoc_get_syntax_manager(), xmldoc_parse_argument(), xmldoc_parse_cmd_enumlist(), xmldoc_parse_enumlist(), xmldoc_parse_info(), xmldoc_parse_option(), xmldoc_parse_optionlist(), xmldoc_parse_para(), xmldoc_parse_parameter(), xmldoc_parse_specialtags(), xmldoc_parse_variable(), xmldoc_parse_variablelist(), xmldoc_string_cleanup(), and xmldoc_string_wrap().
{
| char * ast_str_append_escapecommas | ( | struct ast_str ** | buf, |
| ssize_t | maxlen, | ||
| const char * | src, | ||
| size_t | maxsrc | ||
| ) | [inline] |
Append a non-NULL terminated substring to the end of a dynamic string, with escaping of commas.
Definition at line 852 of file strings.h.
References ast_str_set_va().
Referenced by acf_odbc_read(), and function_db_keys().
{
| char * ast_str_append_substr | ( | struct ast_str ** | buf, |
| ssize_t | maxlen, | ||
| const char * | src, | ||
| size_t | maxsrc | ||
| ) | [inline] |
Append a non-NULL terminated substring to the end of a dynamic string.
Definition at line 838 of file strings.h.
References __ast_str_helper2().
Referenced by __ast_verbose_ap(), ast_str_substitute_variables_full(), file_read(), listfilter(), and WriteMemoryCallback().
{
| int ast_str_append_va | ( | struct ast_str ** | buf, |
| ssize_t | max_len, | ||
| const char * | fmt, | ||
| va_list | ap | ||
| ) | [inline] |
Append to a dynamic string using a va_list.
Same as ast_str_set_va(), but append to the current content.
Definition at line 824 of file strings.h.
References __ast_str_helper2().
Referenced by __ast_manager_event_multichan(), and ast_str_set().
{
| char * ast_str_buffer | ( | const struct ast_str * | buf | ) | [inline] |
Returns the string buffer within the ast_str buf.
| buf | A pointer to the ast_str structure. |
| A | pointer to the enclosed string. |
Definition at line 512 of file strings.h.
References ast_str::__AST_STR_STR, ast_str::__AST_STR_USED, len(), and typeof().
Referenced by __ast_manager_event_multichan(), __ast_verbose_ap(), __iax2_show_peers(), __queues_show(), __sip_pretend_ack(), __sip_reliable_xmit(), __sip_semi_ack(), __sip_xmit(), _ast_xmldoc_build_arguments(), _ast_xmldoc_build_seealso(), _macro_exec(), _sip_show_peer(), _sip_tcp_helper_thread(), _xmldoc_build_field(), acf_curl_helper(), acf_cut_exec(), acf_odbc_read(), acf_odbc_write(), action_createconfig(), action_hangup(), action_status(), action_userevent(), add_cc_call_info_to_response(), add_ip_ie(), add_required_respheader(), add_rpid(), add_sdp(), add_timeval_ie(), add_user_extension(), ALLOC_COMMENT(), alloc_event(), aoc_display_decoded_debug(), aocmessage_get_unit_entry(), append_channel_vars(), ast_agi_send(), ast_aoc_manager_event(), ast_cc_agent_set_interfaces_chanvar(), ast_cli(), ast_eivr_getvariable(), ast_func_read(), ast_func_read2(), ast_http_send(), ast_log_full(), ast_msg_get_body(), ast_odbc_ast_str_SQLGetData(), ast_parse_digest(), ast_print_namedgroups(), ast_realtime_encode_chunk(), ast_rtp_lookup_mime_multiple2(), ast_set_cc_interfaces_chanvar(), ast_sockaddr_stringify_fmt(), ast_str_encode_mime(), ast_str_get_encoded_str(), ast_str_quote(), ast_str_retrieve_variable(), ast_str_substitute_variables_full(), ast_str_substring(), ast_translate_path_to_str(), ast_var_channels_table(), ast_xmldoc_printable(), astman_append(), astman_send_error_va(), authority_to_str(), base64_helper(), blacklist_read2(), build_peer(), build_user_routes(), caldav_request(), calendar_join_attendees(), cc_extension_monitor_init(), cc_generic_agent_start_monitoring(), cc_unique_append(), cdata(), cdr_handler(), chanavail_exec(), change_hold_state(), check_message_integrity(), cli_alias_passthrough(), cli_match_char_tree(), cli_odbc_read(), cli_odbc_write(), cli_prompt(), commit_exec(), config_curl(), config_pgsql(), config_text_file_load(), construct_pidf_body(), create_channel_name(), custom_log(), cut_internal(), dahdi_cc_callback(), dahdi_new(), data_provider_print_cli(), data_result_manager_output(), data_result_print_cli(), data_result_print_cli_node(), data_search_generate(), destroy_curl(), destroy_pgsql(), detect_disconnect(), do_magic_pickup(), do_notify(), dump_queue_members(), dumpchan_exec(), eivr_comm(), endelm(), exchangecal_get_events_between(), exchangecal_request(), exchangecal_write_event(), exec_exec(), fetch_icalendar(), finalize_content(), find_realtime(), find_table(), function_fieldnum_helper(), function_fieldqty_helper(), function_realtime_read(), function_realtime_readdestroy(), function_sippeer(), generate_uri(), get_content(), handle_call_token(), handle_cli_iax2_show_peer(), handle_cli_indication_show(), handle_dbget(), handle_end_element(), handle_getvariablefull(), handle_manager_show_event(), handle_manager_show_events(), handle_missing_table(), handle_request_do(), handle_show_chanvar(), handle_show_translation_path(), handle_show_translation_table(), handle_showchan(), hangupcause_keys_read(), hashkeys_read(), hashkeys_read2(), http_post_callback(), iax_parse_ies(), initreqprep(), is_new_rec_file(), is_valid_uuid(), leave_voicemail(), listfilter(), load_column_config(), log_jack_status(), make_email_file(), manager_iax2_show_peer_list(), manager_log(), meetme_cmd_helper(), meetme_show_cmd(), msg_func_read(), msg_route(), odbc_log(), parse_hint_device(), parse_hint_presence(), parse_request(), pbx_find_extension(), pbx_retrieve_variable(), peers_data_provider_get(), pgsql_log(), pgsql_reconnect(), phoneprov_callback(), pp_each_extension_helper(), pp_each_user_helper(), print_uptimestr(), process_text_line(), read_raw_content_length(), realtime_curl(), realtime_ldap_base_ap(), realtime_multi_curl(), realtime_multi_pgsql(), realtime_pgsql(), realtime_sqlite3_destroy(), realtime_sqlite3_helper(), realtime_sqlite3_store(), realtime_sqlite3_update(), realtime_sqlite3_update2(), realtime_update2_handler(), realtimefield_read(), record_thread(), replace(), require_curl(), require_pgsql(), retrans_pkt(), rollback_exec(), run_station(), say_periodic_announcement(), security_event_cb(), send_eivr_event(), send_ews_request_and_parse(), send_request(), send_response(), sendmail(), sendpage(), sendtext_exec(), set2(), shift_pop(), show_channels_cb(), sig_pri_mcid_event(), sig_pri_start_pri(), sip_hangup(), sip_rtp_read(), sip_send_mwi_to_peer(), sip_show_sched(), sip_tcp_read(), sqlite3_escape_column_op(), sqlite3_escape_string_helper(), startelm(), store_curl(), store_pgsql(), string_tolower2(), string_toupper2(), strreplace(), substitute_escapes(), syslog_log(), system_exec_helper(), transmit_info_with_aoc(), transmit_invite(), transmit_notify_with_mwi(), transmit_state_notify(), tryexec_exec(), unshift_push(), update2_curl(), update2_ldap(), update2_odbc(), update2_pgsql(), update2_prepare(), update_caldav(), update_curl(), update_ewscal(), update_exchangecal(), update_ldap(), update_pgsql(), user_authority_to_str(), userevent_exec(), vars2manager(), write_cdr(), xmldoc_get_formatted(), xmldoc_get_syntax_cmd(), xmldoc_get_syntax_manager(), xmldoc_parse_cmd_enumlist(), xmldoc_parse_para(), xmldoc_parse_variable(), and xmldoc_string_wrap().
{
| static force_inline int attribute_pure ast_str_case_hash | ( | const char * | str | ) | [static] |
Compute a hash value on a case-insensitive string.
Uses the same hash algorithm as ast_str_hash, but converts all characters to lowercase prior to computing a hash. This allows for easy case-insensitive lookups in a hash table.
Definition at line 1004 of file strings.h.
Referenced by app_hash(), ast_channel_hash_cb(), ast_tone_zone_hash(), ast_xml_doc_item_hash(), cache_hash(), calendar_hash_fn(), conference_bridge_hash_cb(), config_opt_hash(), data_provider_hash(), dialog_hash_cb(), hint_hash(), hintdevice_hash_cb(), lid_hash(), moh_class_hash(), msg_data_hash_fn(), msg_tech_hash(), parkinglot_hash_cb(), peer_hash_cb(), profile_hash_fn(), protocol_hash_fn(), pvt_hash_cb(), queue_hash_cb(), routes_hash_fn(), skel_level_hash(), sla_station_hash(), sla_trunk_hash(), tps_hash_cb(), users_hash_fn(), and xmpp_config_hash().
| int ast_str_copy_string | ( | struct ast_str ** | dst, |
| struct ast_str * | src | ||
| ) | [inline] |
| struct ast_str * ast_str_create | ( | size_t | init_len | ) | [read] |
Create a malloc'ed dynamic length string.
| init_len | This is the initial length of the string buffer |
Definition at line 435 of file strings.h.
References ast_str::__AST_STR_LEN, ast_str::__AST_STR_STR, and ast_str::__AST_STR_USED.
Referenced by __ast_http_post_load(), __ast_verbose_ap(), __sip_reliable_xmit(), _ast_xmldoc_build_arguments(), _ast_xmldoc_build_seealso(), _macro_exec(), _sip_tcp_helper_thread(), acf_curl_helper(), acf_cut_exec(), action_hangup(), action_status(), add_required_respheader(), add_sdp(), add_user_extension(), aoc_display_decoded_debug(), ast_aoc_manager_event(), ast_cc_agent_set_interfaces_chanvar(), ast_channel_dialed_causes_channels(), ast_func_read(), ast_http_auth(), ast_http_error(), ast_msg_alloc(), ast_parse_digest(), ast_set_cc_interfaces_chanvar(), ast_str_substitute_variables_full(), ast_tcptls_client_create(), ast_tcptls_server_root(), ast_xml_doc_item_alloc(), ast_xmldoc_printable(), auth_http_callback(), build_user_routes(), caldav_get_events_between(), caldav_request(), caldav_write_event(), calendar_join_attendees(), cdr_handler(), cli_prompt(), config_text_file_load(), copy_request(), create_channel_name(), cut_internal(), data_provider_print_cli(), data_result_manager_output(), data_result_print_cli(), data_result_print_cli_node(), data_search_generate(), do_notify(), dump_queue_members(), ewscal_write_event(), exchangecal_get_events_between(), exchangecal_request(), exchangecal_write_event(), exec_exec(), fetch_icalendar(), find_realtime(), function_sippeer(), generic_http_callback(), get_ewscal_ids_for(), handle_dbget(), handle_getvariablefull(), handle_manager_show_events(), handle_missing_table(), handle_presencechange(), handle_show_translation_table(), handle_showchan(), handle_statechange(), handle_updates(), handle_uri(), httpstatus_callback(), iax_parse_ies(), init_appendbuf(), init_queue(), init_req(), init_resp(), is_new_rec_file(), leave_voicemail(), load_column_config(), load_config(), make_email_file(), meetme_cmd_helper(), meetme_show_cmd(), misdn_cfg_get_config_string(), odbc_log(), parse_ewscal_id(), pbx_retrieve_variable(), pgsql_log(), pgsql_reconnect(), phoneprov_callback(), pp_each_extension_helper(), pp_each_user_helper(), print_named_groups(), queue_set_param(), read_config(), read_raw_content_length(), realtime_ldap_base_ap(), realtime_sqlite3_destroy(), realtime_sqlite3_helper(), realtime_sqlite3_store(), realtime_sqlite3_update(), realtime_sqlite3_update2(), require_pgsql(), run_station(), send_eivr_event(), sendmail(), sendpage(), sig_pri_mcid_event(), sip_notify_alloc(), sip_rtp_read(), sip_tcptls_write(), sip_websocket_callback(), sipsock_read(), startelm(), static_callback(), tryexec_exec(), update2_ldap(), update_caldav(), update_ldap(), userevent_exec(), write_cdr(), xmldoc_get_formatted(), xmldoc_get_syntax_cmd(), xmldoc_get_syntax_manager(), xmldoc_parse_cmd_enumlist(), xmldoc_string_cleanup(), and xmldoc_string_wrap().
{
| static force_inline int attribute_pure ast_str_hash | ( | const char * | str | ) | [static] |
Compute a hash value on a string.
This famous hash algorithm was written by Dan Bernstein and is commonly used.
http://www.cse.yorku.ca/~oz/hash.html
Definition at line 964 of file strings.h.
Referenced by alias_hash_cb(), ast_event_append_ie_str(), ast_event_hash_devstate(), ast_event_hash_devstate_change(), ast_event_hash_mwi(), ast_event_hash_presence_state_change(), ast_event_sub_append_ie_str(), ast_get_namedgroups(), data_filter_hash(), data_result_hash(), data_search_hash(), db_hash_fn(), entry_hash_fn(), esc_hash_fn(), event_hash_fn(), feature_exten_hash(), generic_monitor_hash_fn(), group_hash_fn(), hook_hash(), jingle_add_ice_udp_candidates_to_transport(), jingle_endpoint_hash(), jingle_session_hash(), lang_hash_fn(), named_acl_hash_fn(), peer_hash_cb(), pvt_cause_hash_fn(), str_hash_fn(), user_hash_cb(), variable_count_hash_fn(), and xmpp_buddy_hash().
| static force_inline int ast_str_hash_add | ( | const char * | str, |
| int | hash | ||
| ) | [static] |
Compute a hash value on a string.
| [in] | str | The string to add to the hash |
| [in] | hash | The hash value to add to |
This version of the function is for when you need to compute a string hash of more than one string.
This famous hash algorithm was written by Dan Bernstein and is commonly used.
Definition at line 989 of file strings.h.
Referenced by ast_event_hash_mwi().
| int ast_str_make_space | ( | struct ast_str ** | buf, |
| size_t | new_len | ||
| ) | [inline] |
Make space in a new string (e.g. to read in data from a file)
Definition at line 603 of file strings.h.
References ast_str::__AST_STR_USED.
Referenced by __ast_str_helper(), __ast_str_helper2(), acf_odbc_read(), acf_odbc_write(), ast_func_read2(), ast_odbc_ast_str_SQLGetData(), ast_str_get_encoded_str(), base64_helper(), blacklist_read2(), cli_odbc_read(), cli_odbc_write(), handle_dbget(), listfilter(), set2(), string_tolower2(), and string_toupper2().
{
| void ast_str_reset | ( | struct ast_str * | buf | ) | [inline] |
Reset the content of a dynamic string. Useful before a series of ast_str_append.
Definition at line 451 of file strings.h.
References ast_str::__AST_STR_STR, and ast_str::__AST_STR_USED.
Referenced by __ast_verbose_ap(), _sip_show_peer(), _sip_tcp_helper_thread(), acf_odbc_read(), action_status(), action_userevent(), app_exec(), ast_cdr_serialize_variables(), ast_func_read2(), ast_realtime_encode_chunk(), ast_str_encode_mime(), ast_str_substitute_variables_full(), ast_str_substring(), authority_to_str(), build_peer(), CB_RESET(), cli_prompt(), commit_exec(), config_text_file_load(), data_provider_print_cli(), data_result_manager_output(), data_result_print_cli_node(), data_search_generate(), detect_disconnect(), endelm(), file_read(), function_db_keys(), get_content(), handle_request_do(), handle_show_translation_path(), handle_start_element(), listfilter(), pbx_builtin_serialize_variables(), read_config(), realtimefield_read(), rollback_exec(), set_rec_filename(), sip_tcp_read(), sqlite3_escape_column_op(), sqlite3_escape_string_helper(), startelm(), strreplace(), substitute_escapes(), and user_authority_to_str().
{
| int ast_str_set | ( | struct ast_str ** | buf, |
| ssize_t | max_len, | ||
| const char * | fmt, | ||
| ... | |||
| ) | [inline] |
Set a dynamic string using variable arguments.
| buf | This is the address of a pointer to a struct ast_str which should have been retrieved using ast_str_thread_get. It will need to be updated in the case that the buffer has to be reallocated to accomodate a longer string than what it currently has space for. |
| max_len | This is the maximum length to allow the string buffer to grow to. If this is set to 0, then there is no maximum length. If set to -1, we are bound to the current maximum length. |
| fmt | This is the format string (printf style) |
All the rest is the same as ast_str_set_va()
Definition at line 889 of file strings.h.
References ast_str_append_va().
Referenced by __ast_http_post_load(), __ast_manager_event_multichan(), __queues_show(), __sip_reliable_xmit(), acf_curl_helper(), acf_curlopt_helper(), action_createconfig(), add_cc_call_info_to_response(), add_hintdevice(), add_ip_ie(), add_rpid(), aocmessage_get_unit_entry(), ast_extension_state2(), ast_http_auth(), ast_http_error(), ast_msg_alloc(), ast_parse_digest(), ast_realtime_encode_chunk(), ast_regex_string_to_regex_pattern(), ast_sched_report(), ast_sockaddr_stringify_fmt(), ast_str_encode_mime(), ast_str_expr(), ast_str_get_encoded_str(), ast_str_get_hint(), ast_str_quote(), ast_str_retrieve_variable(), ast_translate_path_to_str(), bs_to_exchange_bs(), build_peer(), caldav_write_event(), cc_extension_monitor_init(), cc_generic_agent_start_monitoring(), cdata(), cdr_handler(), check_auth(), cli_match_char_tree(), cli_odbc_read(), cli_prompt(), config_curl(), config_pgsql(), create_channel_name(), data_provider_print_cli(), data_result_manager_output(), destroy_curl(), destroy_pgsql(), do_magic_pickup(), do_notify(), encmethods_to_str(), encode_timestamp(), ewscal_write_event(), exchangecal_write_event(), extension_presence_state_helper(), file_count_line(), file_format(), find_realtime(), find_table(), function_fieldnum_helper(), function_fieldqty_helper(), generate_exchange_uuid(), generate_uri(), get_ewscal_ids_for(), handle_call_token(), handle_cli_indication_show(), handle_manager_show_events(), handle_missing_table(), handle_presencechange(), handle_show_translation_path(), handle_show_translation_table(), handle_statechange(), handle_uri(), hashkeys_read(), hashkeys_read2(), iax_parse_ies(), init_queue(), init_req(), init_resp(), initreqprep(), is_new_rec_file(), leave_voicemail(), listfilter(), log_jack_status(), make_email_file(), meetme_cmd_helper(), meetme_show_cmd(), odbc_log(), parse_ewscal_id(), parse_hint_device(), parse_hint_presence(), passthru(), pgsql_log(), pgsql_reconnect(), phoneprov_callback(), process_text_line(), queue_set_param(), read_raw_content_length(), realtime_curl(), realtime_multi_curl(), realtime_multi_pgsql(), realtime_pgsql(), realtime_sqlite3_destroy(), realtime_sqlite3_helper(), realtime_sqlite3_store(), realtime_sqlite3_update(), realtime_sqlite3_update2(), realtime_update2_handler(), replace(), require_curl(), require_pgsql(), run_station(), security_event_cb(), sendmail(), sendpage(), set_rec_filename(), shift_pop(), sig_pri_start_pri(), sip_report_security_event(), sip_tcptls_write(), sip_websocket_callback(), sipsock_read(), stackpeek_read(), startelm(), static_callback(), store_curl(), store_pgsql(), transmit_fake_auth_response(), unshift_push(), update2_curl(), update2_pgsql(), update2_prepare(), update_curl(), update_pgsql(), and xmldoc_build_documentation_item().
{
| char * ast_str_set_escapecommas | ( | struct ast_str ** | buf, |
| ssize_t | maxlen, | ||
| const char * | src, | ||
| size_t | maxsrc | ||
| ) | [inline] |
Set a dynamic string to a non-NULL terminated substring, with escaping of commas.
Definition at line 845 of file strings.h.
References __ast_str_helper2().
Referenced by acf_curl_helper(), and realtimefield_read().
{
| char * ast_str_set_substr | ( | struct ast_str ** | buf, |
| ssize_t | maxlen, | ||
| const char * | src, | ||
| size_t | maxsrc | ||
| ) | [inline] |
Set a dynamic string to a non-NULL terminated substring.
Definition at line 831 of file strings.h.
References __ast_str_helper2().
Referenced by ast_str_substitute_variables_full(), and set_rec_filename().
{
| int ast_str_set_va | ( | struct ast_str ** | buf, |
| ssize_t | max_len, | ||
| const char * | fmt, | ||
| va_list | ap | ||
| ) | [inline] |
Set a dynamic string from a va_list.
| buf | This is the address of a pointer to a struct ast_str. If it is retrieved using ast_str_thread_get, the struct ast_threadstorage pointer will need to be updated in the case that the buffer has to be reallocated to accommodate a longer string than what it currently has space for. |
| max_len | This is the maximum length to allow the string buffer to grow to. If this is set to 0, then there is no maximum length. |
| fmt | This is the format string (printf style) |
| ap | This is the va_list |
Example usage (the first part is only for thread-local storage)
AST_THREADSTORAGE(my_str, my_str_init); #define MY_STR_INIT_SIZE 128 ... void my_func(const char *fmt, ...) { struct ast_str *buf; va_list ap; if (!(buf = ast_str_thread_get(&my_str, MY_STR_INIT_SIZE))) return; ... va_start(fmt, ap); ast_str_set_va(&buf, 0, fmt, ap); va_end(ap); printf("This is the string we just built: %s\n", buf->str); ... }
Definition at line 807 of file strings.h.
References __ast_str_helper().
Referenced by __ast_verbose_ap(), ast_agi_send(), ast_cli(), ast_log_full(), ast_msg_set_body(), ast_msg_set_context(), ast_msg_set_exten(), ast_msg_set_from(), ast_msg_set_to(), ast_str_append_escapecommas(), astman_append(), and astman_send_error_va().
{
| size_t ast_str_size | ( | const struct ast_str * | buf | ) | [inline] |
Returns the current maximum length (without reallocation) of the current buffer.
| buf | A pointer to the ast_str structure. |
| Current | maximum length of the buffer. |
Definition at line 497 of file strings.h.
References ast_str::__AST_STR_STR.
Referenced by ast_func_read(), ast_func_read2(), ast_odbc_ast_str_SQLGetData(), ast_str_get_encoded_str(), base64_helper(), blacklist_read2(), handle_dbget(), load_config(), pbx_find_extension(), pgsql_reconnect(), set2(), string_tolower2(), string_toupper2(), and WriteMemoryCallback().
{
| size_t ast_str_strlen | ( | const struct ast_str * | buf | ) | [inline] |
Returns the current length of the string stored within buf.
| buf | A pointer to the ast_str structure. |
Definition at line 486 of file strings.h.
References ast_str::__AST_STR_LEN.
Referenced by __sip_reliable_xmit(), __sip_xmit(), _ast_xmldoc_build_arguments(), _sip_tcp_helper_thread(), _xmldoc_build_field(), acf_curl_helper(), acf_odbc_read(), acf_odbc_write(), add_header(), add_required_respheader(), ALLOC_COMMENT(), ast_agi_send(), ast_cli(), ast_str_encode_mime(), ast_str_expr(), ast_str_substitute_variables_full(), ast_str_substring(), ast_var_channels_table(), authority_to_str(), base64_helper(), blacklist_read2(), build_cc_interfaces_chanvar(), build_peer(), caldav_get_events_between(), caldav_request(), cc_extension_monitor_init(), cdata(), chanavail_exec(), check_message_integrity(), collect_names_cb(), commit_exec(), config_text_file_load(), copy_request(), cut_internal(), dump_queue_members(), encmethods_to_str(), endelm(), exchangecal_request(), fetch_icalendar(), finalize_content(), function_fieldnum_helper(), function_fieldqty_helper(), handle_dbget(), handle_end_element(), handle_request_cancel(), handle_request_do(), handle_show_chanvar(), hangupcause_keys_read(), hashkeys_read(), hashkeys_read2(), is_valid_uuid(), listfilter(), load_column_config(), load_config(), lws2sws(), manager_log(), manager_sipnotify(), odbc_log(), parse_request(), pgsql_log(), print_uptimestr(), replace(), rollback_exec(), say_periodic_announcement(), send_ews_request_and_parse(), set_rec_filename(), shift_pop(), sip_cli_notify(), sip_hangup(), sip_send_mwi_to_peer(), sip_tcp_read(), sip_tls_read(), system_exec_helper(), transmit_invite(), unshift_push(), update_caldav(), update_exchangecal(), user_authority_to_str(), write_cdr(), WriteMemoryCallback(), xmldoc_get_formatted(), and xmldoc_parse_variable().
{
| struct ast_str * ast_str_thread_get | ( | struct ast_threadstorage * | ts, |
| size_t | init_len | ||
| ) | [read] |
Retrieve a thread locally stored dynamic string.
| ts | This is a pointer to the thread storage structure declared by using the AST_THREADSTORAGE macro. If declared with AST_THREADSTORAGE(my_buf, my_buf_init), then this argument would be (&my_buf). |
| init_len | This is the initial length of the thread's dynamic string. The current length may be bigger if previous operations in this thread have caused it to increase. |
Example usage:
AST_THREADSTORAGE(my_str, my_str_init); #define MY_STR_INIT_SIZE 128 ... void my_func(const char *fmt, ...) { struct ast_str *buf; if (!(buf = ast_str_thread_get(&my_str, MY_STR_INIT_SIZE))) return; ... }
Definition at line 684 of file strings.h.
References ast_str::__AST_STR_LEN, ast_str::__AST_STR_TS, and ast_str::__AST_STR_USED.
Referenced by __ast_manager_event_multichan(), __ast_verbose_ap(), acf_curl_helper(), acf_odbc_read(), acf_odbc_write(), action_userevent(), add_hintdevice(), append_channel_vars(), ast_agi_send(), ast_cli(), ast_extension_state2(), ast_log_full(), ast_sockaddr_stringify_fmt(), astman_append(), astman_send_error_va(), check_auth(), cli_odbc_read(), cli_odbc_write(), commit_exec(), config_curl(), config_pgsql(), custom_log(), destroy_curl(), destroy_pgsql(), dumpchan_exec(), extension_presence_state_helper(), find_table(), function_fieldnum_helper(), function_fieldqty_helper(), get_content(), handle_showchan(), listfilter(), pbx_find_extension(), realtime_curl(), realtime_multi_curl(), realtime_multi_pgsql(), realtime_pgsql(), realtime_update2_handler(), realtimefield_read(), replace(), require_curl(), rollback_exec(), security_event_cb(), shift_pop(), sip_report_security_event(), sqlite3_escape_column_op(), sqlite3_escape_string_helper(), store_curl(), store_pgsql(), strreplace(), substitute_escapes(), syslog_log(), system_exec_helper(), transmit_fake_auth_response(), unshift_push(), update2_curl(), update2_odbc(), update2_pgsql(), update2_prepare(), update_curl(), update_pgsql(), and vars2manager().
{
| void ast_str_trim_blanks | ( | struct ast_str * | buf | ) | [inline] |
Trims trailing whitespace characters from an ast_str string.
| buf | A pointer to the ast_str string. |
Definition at line 476 of file strings.h.
References ast_str::__AST_STR_USED.
Referenced by acf_curl_helper(), process_text_line(), and xmldoc_string_cleanup().
{
| char * ast_str_truncate | ( | struct ast_str * | buf, |
| ssize_t | len | ||
| ) | [inline] |
Truncates the enclosed string to the given length.
| buf | A pointer to the ast_str structure. |
| len | Maximum length of the string. If len is larger than the current maximum length, things will explode. If it is negative at most -len characters will be trimmed off the end. |
| A | pointer to the resulting string. |
Definition at line 536 of file strings.h.
Referenced by _ast_xmldoc_build_arguments(), ast_regex_string_to_regex_pattern(), build_cc_interfaces_chanvar(), check_message_integrity(), xmldoc_get_formatted(), and xmldoc_string_wrap().
{
| void ast_str_update | ( | struct ast_str * | buf | ) | [inline] |
Update the length of the buffer, after using ast_str merely as a buffer.
| buf | A pointer to the ast_str string. |
Definition at line 461 of file strings.h.
References ast_str::__AST_STR_STR, and ast_str::__AST_STR_USED.
Referenced by ast_odbc_ast_str_SQLGetData(), ast_str_get_encoded_str(), ast_str_substring(), base64_helper(), blacklist_read2(), handle_dbget(), sqlite3_escape_column_op(), sqlite3_escape_string_helper(), string_tolower2(), and string_toupper2().
{
| char * ast_strip | ( | char * | s | ) | [inline] |
Strip leading/trailing whitespace from a string.
| s | The string to be stripped (will be modified). |
This functions strips all leading and trailing whitespace characters from the input string, and returns a pointer to the resulting string. The string is modified in place.
Definition at line 155 of file strings.h.
Referenced by acf_if(), add_peer_mailboxes(), ast_el_add_history(), ast_get_namedgroups(), ast_playtones_start(), ast_register_file_version(), ast_strip_quoted(), build_calendar(), build_profile(), check_blacklist(), config_parse_variables(), config_text_file_load(), dahdi_display_text_option(), eivr_comm(), function_amiclient(), load_column_config(), load_config(), make_components(), parse_apps(), parse_cookies(), parse_events(), parse_sip_options(), pbx_builtin_background(), pbx_load_config(), process_text_line(), realtime_multi_odbc(), realtime_multi_pgsql(), realtime_odbc(), realtime_pgsql(), reload_config(), reload_single_member(), set(), sig_pri_msn_match(), sig_pri_start_pri(), store_tone_zone_ring_cadence(), and websocket_callback().
{
| char* ast_strip_quoted | ( | char * | s, |
| const char * | beg_quotes, | ||
| const char * | end_quotes | ||
| ) |
Strip leading/trailing whitespace and quotes from a string.
| s | The string to be stripped (will be modified). |
| beg_quotes | The list of possible beginning quote characters. |
| end_quotes | The list of matching ending quote characters. |
This functions strips all leading and trailing whitespace characters from the input string, and returns a pointer to the resulting string. The string is modified in place.
It can also remove beginning and ending quote (or quote-like) characters, in matching pairs. If the first character of the string matches any character in beg_quotes, and the last character of the string is the matching character in end_quotes, then they are removed from the string.
Examples:
ast_strip_quoted(buf, "\"", "\""); ast_strip_quoted(buf, "'", "'"); ast_strip_quoted(buf, "[{(", "]})");
Definition at line 1402 of file main/utils.c.
References ast_strip().
Referenced by ast_register_file_version(), get_rdnis(), iftime(), load_values_config(), parse_allowed_methods(), parse_cookies(), parse_dial_string(), and sip_parse_register_line().
{
char *e;
char *q;
s = ast_strip(s);
if ((q = strchr(beg_quotes, *s)) && *q != '\0') {
e = s + strlen(s) - 1;
if (*e == *(end_quotes + (q - beg_quotes))) {
s++;
*e = '\0';
}
}
return s;
}
| static force_inline int attribute_pure ast_strlen_zero | ( | const char * | s | ) | [static] |
Definition at line 63 of file strings.h.
Referenced by __analog_handle_event(), __analog_ss_thread(), __ast_bridge_technology_register(), __ast_callerid_generate(), __ast_channel_alloc_ap(), __ast_cli_generator(), __ast_cli_register(), __ast_datastore_alloc(), __ast_http_load(), __ast_pbx_run(), __ast_request_and_dial(), __astman_get_header(), __has_voicemail(), __iax2_show_peers(), __init_manager(), __oh323_new(), __queues_show(), __set_address_from_contact(), __sip_subscribe_mwi_do(), __ssl_setup(), _macro_exec(), _sip_show_peer(), _sip_show_peers(), _sip_show_peers_one(), _skinny_show_devices(), _skinny_show_lines(), acf_curl_helper(), acf_if(), acf_isexten_exec(), acf_jabberreceive_read(), acf_jabberstatus_read(), acf_mailbox_exists(), acf_meetme_info(), acf_odbc_read(), acf_odbc_write(), acf_rand_exec(), acf_retrieve_docs(), acf_strptime(), acf_transaction_read(), acf_transaction_write(), acf_version_exec(), acf_vm_info(), acf_vmcount_exec(), aco_option_register_deprecated(), aco_process_var(), aco_set_defaults(), action_add_agi_cmd(), action_agent_logoff(), action_agents(), action_aocmessage(), action_atxfer(), action_bridge(), action_challenge(), action_command(), action_confbridgekick(), action_confbridgelist(), action_confbridgelistrooms(), action_confbridgesetsinglevideosrc(), action_confbridgestartrecord(), action_confbridgestoprecord(), action_coresettings(), action_coreshowchannels(), action_corestatus(), action_dahdidialoffhook(), action_dahdidndoff(), action_dahdidndon(), action_dahdishowchannels(), action_events(), action_extensionstate(), action_getconfig(), action_getconfigjson(), action_getvar(), action_hangup(), action_listcategories(), action_lock_unlock_helper(), action_mailboxcount(), action_mailboxstatus(), action_meetmelist(), action_meetmelistrooms(), action_messagesend(), action_mute_unmute_helper(), action_originate(), action_ping(), action_presencestate(), action_prishowspans(), action_redirect(), action_sendtext(), action_setvar(), action_status(), action_timeout(), action_transfer(), action_transferhangup(), action_updateconfig(), action_waitevent(), actual_load_config(), add_agent(), add_calltoken_ignore(), add_cc_call_info_to_response(), add_diversion(), add_peer_mailboxes(), add_realm_authentication(), add_rpid(), add_sdp(), add_sip_domain(), add_text(), add_vm_recipients_from_string(), admin_exec(), adsi_exec(), adsi_input_format(), adsi_message(), advanced_options(), aes_helper(), agent_hangup(), agentmonitoroutgoing_exec(), agents_show(), agents_show_online(), agi_exec_full(), agi_handle_command(), aji_join_exec(), aji_leave_exec(), aji_log_hook(), aji_send_exec(), aji_sendgroup_exec(), alarmreceiver_exec(), alsa_new(), analog_call(), analog_hangup(), analog_ss_thread(), answer_exec_enable(), aoc_create_ie_data(), aoc_create_ie_data_charging_rate(), aoc_parse_ie_charging_rate(), aocmessage_get_unit_entry(), app_exec(), append_mailbox(), append_mailbox_mapping(), append_transaction(), apply_general_options(), apply_options_full(), apply_outgoing(), apply_peer(), apply_plan_to_existing_number(), aqm_exec(), ast_add_extension2_lockopt(), ast_agi_register(), ast_aoc_s_add_rate_duration(), ast_aoc_s_add_rate_flat(), ast_aoc_s_add_rate_volume(), ast_aoc_set_association_number(), ast_aoc_set_currency_info(), ast_app_getdata(), ast_app_getdata_full(), ast_app_group_get_count(), ast_app_group_match_get_count(), ast_app_group_set_channel(), ast_app_group_split_group(), ast_app_run_macro(), ast_app_run_sub(), ast_append_acl(), ast_apply_acl(), ast_bridge_call(), ast_bridge_features_enable(), ast_bridge_features_register(), ast_bridge_timelimit(), ast_bt_get_symbols(), ast_build_timing(), ast_cc_is_recall(), ast_cdr_congestion(), ast_cdr_copy_vars(), ast_cdr_data_add_structure(), ast_cdr_fork(), ast_cdr_getvar(), ast_cdr_getvar_internal(), ast_cdr_merge(), ast_cdr_setaccount(), ast_cdr_setpeeraccount(), ast_cel_check_retire_linkedid(), ast_cel_fabricate_channel_from_event(), ast_cel_linkedid_ref(), ast_channel_by_exten_cb(), ast_channel_by_name_cb(), ast_channel_by_uniqueid_cb(), ast_channel_connected_line_macro(), ast_channel_connected_line_sub(), ast_channel_get_by_name_prefix(), ast_channel_hash_cb(), ast_channel_linkedid_set(), ast_channel_redirecting_macro(), ast_channel_redirecting_sub(), ast_cli_complete(), ast_cli_perms_init(), ast_complete_channels(), ast_context_remove_extension_callerid2(), ast_data_add_password(), ast_data_add_str(), ast_db_deltree(), ast_db_gettree(), ast_dnsmgr_get_family(), ast_eivr_senddtmf(), ast_event_str_to_event_type(), ast_explicit_goto(), ast_false(), ast_frame_dump(), ast_get_encoded_char(), ast_get_enum(), ast_get_group(), ast_get_indication_zone(), ast_get_namedgroups(), ast_get_time_t(), ast_get_timeval(), ast_iax2_new(), ast_include_new(), ast_is_valid_string(), ast_jb_read_conf(), ast_linear_stream(), ast_load_realtime(), ast_makesocket(), ast_manager_register2(), ast_masq_park_call_exten(), ast_module_check(), ast_moh_files_next(), ast_monitor_change_fname(), ast_monitor_start(), ast_monitor_stop(), ast_msg_send(), ast_odbc_sanity_check(), ast_park_call_exten(), ast_parse_arg(), ast_parse_digest(), ast_pbx_hangup_handler_push(), ast_pbx_outgoing_app(), ast_pbx_outgoing_exten(), ast_pickup_call(), ast_playtones_start(), ast_privacy_set(), ast_readconfig(), ast_register_application2(), ast_register_indication(), ast_remotecontrol(), ast_rtp_dtls_set_configuration(), ast_rtp_engine_register2(), ast_rtp_glue_register2(), ast_rtp_instance_new(), ast_sendtext(), ast_set_cc_agent_dialstring(), ast_set_cc_callback_macro(), ast_set_cc_callback_sub(), ast_set_hangupsource(), ast_set_indication_country(), ast_set_owners_and_peers(), ast_speech_unregister(), ast_str_substitute_variables_full(), ast_stream_and_wait(), ast_taskprocessor_get(), AST_TEST_DEFINE(), ast_true(), ast_tzset(), ast_var_channels_table(), ast_variable_delete(), ast_variable_update(), ast_xmldoc_build_arguments(), ast_xmldoc_build_seealso(), ast_xmldoc_load_documentation(), astman_send_response_full(), async_wait(), asyncgoto_exec(), attempt_thread(), auth_exec(), auth_http_callback(), authenticate(), authenticate_reply(), authenticate_verify(), autoanswer_complete(), autopause2int(), background_detect_exec(), base64_helper(), begin_dial_channel(), bridge_exec(), build_channels(), build_contact(), build_device(), build_extension(), build_gateway(), build_mapping(), build_nonce(), build_peer(), build_profile(), build_reply_digest(), build_route(), build_user(), builtin_atxfer(), builtin_automixmonitor(), builtin_automonitor(), cache_get_callno_locked(), caldav_add_event(), caldav_load_calendar(), caldav_request(), caldav_write_event(), calendar_busy_exec(), calendar_event_read(), calendar_query_exec(), calendar_query_result_exec(), calendar_write_exec(), calendarstate(), callerid_feed(), callerid_genmsg(), cb_events(), cc_esc_publish_handler(), cc_handle_publish_error(), cc_unique_append(), cdr_read(), cdr_write(), celgenuserevent_exec(), chan_misdn_log(), chanavail_exec(), change_monitor_action(), change_redirecting_information(), channel_admin_exec(), channel_spy(), chanspy_exec(), check_access(), check_auth(), check_blacklist(), check_day(), check_dow(), check_goto_on_transfer(), check_match(), check_month(), check_password(), check_peer_ok(), check_sip_domain(), check_timerange(), check_user_full(), cleaned_basedn(), clear_stats(), cli_alias_passthrough(), cli_console_dial(), cli_console_sendtext(), cli_odbc_read(), cli_odbc_write(), close_client(), commit_exec(), common_exec(), compare(), compile_script(), complete_number(), conf_exec(), conf_run(), confbridge_exec(), config_curl(), config_function_read(), config_ldap(), config_line(), config_module(), config_parse_variables(), config_text_file_load(), console_dial(), console_new(), console_print(), console_sendtext(), controlplayback_exec(), copy_all_header(), copy_header(), copy_message(), copy_rules(), copy_via_headers(), count_exec(), create_addr(), create_addr_from_peer(), create_channel_name(), create_dynamic_parkinglot(), create_parkinglot(), create_queue_member(), create_vmaccount(), crement_function_read(), csv_log(), csv_quote(), custom_prepare(), custom_presence_callback(), dahdi_accept_r2_call_exec(), dahdi_handle_event(), dahdi_hangup(), dahdi_new(), dahdi_r2_get_channel_category(), dahdi_r2_set_context(), dahdi_read(), dahdi_send_callrerouting_facility_exec(), dahdi_send_keypad_facility_exec(), dahdiscan_exec(), data_filter_find(), data_result_create(), database_increment(), deltree_exec(), destroy_endpoint(), destroy_pgsql(), destroy_trans(), determine_sip_publish_type(), determine_starting_point(), device_state_cb(), devstate_change_collector_cb(), devstate_write(), dial_exec_full(), dial_handle_playtones(), dialgroup_read(), dialgroup_refreshdb(), dialgroup_write(), dialout(), dictate_exec(), directory_exec(), disa_exec(), do_forward(), do_immediate_setup(), do_message(), do_monitor(), do_notify(), do_pause_or_unpause(), dump_cause(), dump_hint(), dumpchan_exec(), dundi_exec(), dundi_flags2str(), dundi_helper(), dundi_hint2str(), dundi_lookup_local(), dundi_query_read(), dundi_query_thread(), dundi_result_read(), dundi_show_mappings(), dundi_show_peer(), dundifunc_read(), enable_jack_hook(), enum_callback(), enum_query_read(), enum_result_read(), env_write(), ewscal_load_calendar(), exchangecal_load_calendar(), exchangecal_write_event(), exec_exec(), execif_exec(), execute_state_callback(), expand_gosub_args(), export_ch(), extension_match_core(), extension_presence_state_helper(), extenspy_exec(), extract_uri(), extstate_read(), fast_originate(), feature_attended_transfer(), feature_blind_transfer(), feature_exec_app(), feature_interpret_helper(), feature_request_and_dial(), festival_exec(), fetch_icalendar(), fileexists_core(), filename_parse(), find_account(), find_call(), find_cli(), find_conf_realtime(), find_engine(), find_line_by_name(), find_or_create(), find_parkinglot(), find_queue_by_name_rt(), find_realtime_gw(), find_sdp(), find_sip_method(), find_table(), findmeexec(), findparkinglotname(), forkcdr_exec(), forward_message(), func_channel_read(), func_channels_read(), func_check_sipdomain(), func_confbridge_info(), func_header_read(), func_inheritance_write(), function_agent(), function_amiclient(), function_db_delete(), function_db_exists(), function_db_read(), function_db_write(), function_enum(), function_eval(), function_eval2(), function_fieldnum_helper(), function_realtime_read(), function_realtime_readdestroy(), function_realtime_store(), function_realtime_write(), function_txtcidname(), generic_fax_exec(), generic_recall(), get_also_info(), get_destination(), get_domain(), get_in_brackets_const(), get_in_brackets_full(), get_ip_and_port_from_sdp(), get_name_and_number(), get_name_from_variable(), get_pai(), get_parkingtime(), get_queue_member_status(), get_range(), get_rdnis(), get_realm(), get_refer_info(), get_rpid(), get_sip_pvt_byid_locked(), get_timerange(), get_transport_str2enum(), gosub_exec(), gosubif_exec(), goto_exten(), group_count_function_read(), group_function_read(), group_function_write(), group_list_function_read(), group_match_count_function_read(), group_show_channels(), gtalk_create_candidates(), gtalk_new(), gtalk_parser(), gui_init(), handle_cc_notify(), handle_cc_subscribe(), handle_chanlist(), handle_cli_check_permissions(), handle_cli_confbridge_start_record(), handle_cli_config_reload(), handle_cli_database_show(), handle_cli_database_showkey(), handle_cli_devstate_change(), handle_cli_dialplan_save(), handle_cli_file_convert(), handle_cli_iax2_show_cache(), handle_cli_iax2_show_peer(), handle_cli_iax2_show_users(), handle_cli_presencestate_change(), handle_cli_realtime_pgsql_status(), handle_command_response(), handle_controlstreamfile(), handle_debug(), handle_debug_dialplan(), handle_dial_page(), handle_exec(), handle_getvariable(), handle_incoming(), handle_manager_show_event(), handle_options(), handle_orig(), handle_playtones(), handle_presencechange(), handle_pri_set_debug_file(), handle_queue_add_member(), handle_queue_pause_member(), handle_queue_remove_member(), handle_queue_rule_show(), handle_request_bye(), handle_request_info(), handle_request_invite(), handle_request_invite_st(), handle_request_notify(), handle_request_options(), handle_request_publish(), handle_request_refer(), handle_request_subscribe(), handle_request_update(), handle_response(), handle_response_invite(), handle_response_notify(), handle_response_publish(), handle_response_refer(), handle_response_register(), handle_saydatetime(), handle_show_dialplan(), handle_show_translation_path(), handle_soft_key_event_message(), handle_speechrecognize(), handle_stimulus_message(), handle_subscribe(), handle_updates(), handle_verbose(), handle_voicemail_show_users(), has_voicemail(), hashtab_compare_extens(), hint_hash(), hint_read(), httpd_helper_thread(), iax2_call(), iax2_datetime(), iax2_devicestate(), iax2_prov_app(), iax2_request(), iax_check_version(), iax_firmware_append(), iax_provflags2str(), ical_load_calendar(), icalendar_add_event(), ices_exec(), iconv_read(), iftime(), import_helper(), inboxcount2(), init_acf_query(), init_jack_data(), initialize_cc_max_requests(), initreqprep(), insert_penaltychange(), inspect_module(), internal_aco_type_find(), internal_dnsmgr_lookup(), internal_process_ast_config(), is_argument(), is_new_rec_file(), is_prefix(), is_preload(), is_valid_tone_zone(), isAnsweringMachine(), isexten_function_read(), jack_exec(), jb_choose_impl(), jb_framedata_init(), jingle_action_hook(), jingle_alloc(), jingle_create_candidates(), jingle_interpret_content(), jingle_interpret_description(), jingle_interpret_google_transport(), jingle_interpret_ice_udp_transport(), jingle_new(), jingle_outgoing_hook(), jingle_request(), jingle_send_error_response(), join_conference_bridge(), key_dial_page(), key_history(), key_main_page(), kill_dead_queues(), launch_asyncagi(), launch_monitor_thread(), launch_netscript(), ldap_reconnect(), ldap_table_config_add_attribute(), leave_voicemail(), load_column_config(), load_config(), load_indications(), load_module(), load_moh_classes(), load_odbc_config(), load_values_config(), local_ast_moh_start(), local_attended_transfer(), log_events(), log_exec(), logger_print_normal(), login_exec(), loopback_parse(), lua_get_variable(), lua_get_variable_value(), main(), make_components(), make_dir(), make_email_file(), make_filename(), make_logchannel(), man_do_variable_value(), manage_parked_call(), manager_add_queue_member(), manager_data_get(), manager_dbdel(), manager_dbdeltree(), manager_dbget(), manager_dbput(), manager_iax2_show_peer_list(), manager_iax2_show_peers(), manager_iax2_show_registry(), manager_jabber_send(), manager_list_voicemail_users(), manager_mixmonitor(), manager_modulecheck(), manager_moduleload(), manager_mute_mixmonitor(), manager_mutestream(), manager_optimize_away(), manager_park(), manager_parking_status(), manager_parkinglot_list(), manager_pause_queue_member(), manager_play_dtmf(), manager_queue_log_custom(), manager_queue_member_penalty(), manager_queue_member_ringinuse(), manager_queue_rule_show(), manager_queues_status(), manager_queues_summary(), manager_remove_queue_member(), manager_show_dialplan(), manager_show_dialplan_helper(), manager_show_registry(), manager_sip_peer_status(), manager_sip_qualify_peer(), manager_sip_show_peer(), manager_sip_show_peers(), manager_sipnotify(), manager_skinny_show_device(), manager_skinny_show_devices(), manager_skinny_show_line(), manager_skinny_show_lines(), manager_stop_mixmonitor(), mark_dead_and_unfound(), mark_parsed_methods(), match_req_to_dialog(), matchcid(), math(), md5(), meetmemute(), message_range_and_existence_check(), message_template_find(), message_template_parse_filebody(), mgcp_call(), mgcp_hangup(), mgcp_new(), mgcp_prune_realtime_gateway(), mgcp_request(), mgcp_ss(), mgcpsock_read(), milliwatt_exec(), minivm_accmess_exec(), minivm_account_func_read(), minivm_counter_func_read(), minivm_counter_func_write(), minivm_delete_exec(), minivm_greet_exec(), minivm_mwi_exec(), minivm_notify_exec(), minivm_record_exec(), misdn_answer(), misdn_call(), misdn_cfg_update_ptp(), misdn_check_l2l1(), misdn_facility_exec(), misdn_new(), misdn_overlap_dial_task(), misdn_request(), misdn_set_opt_exec(), mixmonitor_exec(), mixmonitor_save_prep(), mixmonitor_thread(), mkintf(), monitor_dial(), morsecode_exec(), mp3_exec(), msg_send_cb(), msg_send_exec(), msg_set_var_full(), multicast_rtp_request(), named_acl_find_realtime(), nbs_alloc(), new_outgoing(), new_realtime_sqlite3_db(), next_node_name(), notify_message(), notify_new_message(), odbc_log(), oh323_call(), oh323_request(), oldest_linkedid(), onedigit_goto(), orig_app(), orig_exten(), originate_exec(), osp_auth(), osp_convert_inout(), osp_convert_outin(), osp_get_varfloat(), osp_get_varint(), osp_lookup(), osp_report_qos(), ospauth_exec(), ospfinished_exec(), osplookup_exec(), ospnext_exec(), oss_call(), oss_new(), page_exec(), park_call_exec(), park_call_full(), park_space_reserve(), parkandannounce_exec(), parked_call_exec(), parkinglot_config_read(), parse(), parse_allowed_methods(), parse_apps(), parse_bookmark(), parse_config(), parse_cookies(), parse_data(), parse_dial_string(), parse_events(), parse_minse(), parse_moved_contact(), parse_oli(), parse_register_contact(), parse_request(), parse_session_expires(), parse_sip_options(), parse_tag(), parse_uri_full(), parse_via(), pbx_builtin_answer(), pbx_builtin_background(), pbx_builtin_execiftime(), pbx_builtin_gotoif(), pbx_builtin_gotoiftime(), pbx_builtin_hangup(), pbx_builtin_importvar(), pbx_builtin_incomplete(), pbx_builtin_resetcdr(), pbx_builtin_saynumber(), pbx_builtin_setvar(), pbx_builtin_setvar_multiple(), pbx_builtin_waitexten(), pbx_checkcondition(), pbx_exec(), pbx_extension_helper(), pbx_find_extension(), pbx_load_config(), pbx_load_users(), pbx_parseable_goto(), pbx_set_overrideswitch(), pbx_substitute_variables_helper_full(), peek_read(), peer_ipcmp_cb_full(), peer_mailboxes_to_str(), pgsql_reconnect(), phone_call(), phone_new(), phoneprov_callback(), pickup_exec(), pickupchan_exec(), pidf_validate_presence(), play_file(), play_mailbox_owner(), play_message(), play_message_by_id_helper(), play_message_callerid(), play_message_category(), play_message_datetime(), play_moh_exec(), play_record_review(), play_sound_helper(), playback_exec(), poll_subscribed_mailboxes(), port_str2int(), post_cdr(), pp_each_extension_helper(), pp_each_user_helper(), pqm_exec(), prep_email_sub_vars(), presence_read(), presence_state_cached(), presence_state_cb(), presence_write(), pri_dchannel(), pri_ss_thread(), print_ext(), print_frame(), print_message(), privacy_exec(), proc_422_rsp(), process_applicationmap_line(), process_dahdi(), process_echocancel(), process_message(), process_message_callback(), process_sdp(), process_sdp_a_ice(), process_sdp_o(), process_text_line(), process_token(), proxy_from_config(), ql_exec(), queue_exec(), queue_function_exists(), queue_function_mem_read(), queue_function_mem_write(), queue_function_memberpenalty_read(), queue_function_memberpenalty_write(), queue_function_qac_dep(), queue_function_queuememberlist(), queue_function_queuewaitingcount(), queue_function_var(), queue_mwi_event(), queue_reload_request(), queues_data_provider_get(), quote(), rcv_mac_addr(), rcvfax_exec(), read_agent_config(), read_config(), read_exec(), readexten_exec(), readfile_exec(), real_ctx(), really_quit(), realtime_common(), realtime_curl(), realtime_directory(), realtime_exec(), realtime_ldap_entry_to_var(), realtime_ldap_result_to_vars(), realtime_ldap_status(), realtime_multi_curl(), realtime_multi_odbc(), realtime_multi_pgsql(), realtime_odbc(), realtime_peer_by_addr(), realtime_pgsql(), realtime_sqlite3_destroy(), realtime_sqlite3_helper(), realtime_sqlite3_load(), realtime_sqlite3_require(), realtime_sqlite3_store(), realtime_sqlite3_update(), realtime_sqlite3_update2(), realtime_update_peer(), realtimefield_read(), receive_ademco_contact_id(), receive_message(), receivefax_exec(), record_exec(), recordthread(), register_exten(), register_peer_exten(), register_verify(), registry_rerequest(), reload_config(), reload_followme(), reload_queue_members(), reload_queues(), reload_single_member(), remove_from_queue(), remove_members_and_mark_unfound(), replace(), reply_digest(), reqprep(), requirecalltoken_mark_auto(), respprep(), retrydial_exec(), ring_entry(), rollback_exec(), rotate_file(), rqm_exec(), rt_handle_member_record(), rtcp_do_debug_ip(), rtp_do_debug_ip(), run_externnotify(), saycountedadj_exec(), saycountednoun_exec(), sayunixtime_exec(), sdl_setup(), sdp_crypto_process(), search_directory(), search_directory_sub(), select_item_pause(), senddtmf_exec(), sendfax_exec(), sendimage_exec(), sendmail(), sendpage(), sendurl_exec(), set(), set_bridge_features_on_config(), set_callforwards(), set_config(), set_fn(), set_insecure_flags(), set_local_info(), set_member_paused(), set_member_value(), set_moh_exec(), set_rec_filename(), setsubstate(), setup_dahdi_int(), setup_incoming_call(), setup_privacy_args(), setup_profile_caller(), setup_profile_paged(), setup_stunaddr(), sha1(), shared_read(), shared_write(), shell_helper(), shift_pop(), show_main_page(), sig_pri_aoc_d_from_ast(), sig_pri_aoc_e_from_ast(), sig_pri_aoc_s_from_ast(), sig_pri_call(), sig_pri_extract_called_num_subaddr(), sig_pri_handle_subcmds(), sig_pri_hangup(), sig_pri_msn_match(), sig_pri_mwi_event_cb(), sig_pri_party_name_from_ast(), sig_pri_party_number_from_ast(), sig_pri_party_subaddress_from_ast(), sig_pri_set_caller_id(), sig_pri_start_pri(), sig_ss7_set_caller_id(), sip_acf_channel_read(), sip_addheader(), sip_alloc(), sip_call(), sip_cc_agent_respond(), sip_cc_monitor_suspend(), sip_cc_monitor_unsuspend(), sip_get_cc_information(), sip_msg_send(), sip_new(), sip_parse_host(), sip_parse_register_line(), sip_pidf_validate(), sip_poke_peer(), sip_prepare_socket(), sip_removeheader(), sip_report_chal_sent(), sip_report_failed_challenge_response(), sip_report_security_event(), sip_request_call(), sip_send_mwi_to_peer(), sip_show_channel(), sip_show_registry(), sip_show_settings(), sip_show_user(), sip_sipredirect(), sip_subscribe_mwi(), sip_uri_cmp(), sip_uri_headers_cmp(), sip_uri_params_cmp(), sipinfo_send(), skel_exec(), skinny_new(), skinny_register(), skinny_request(), sla_build_station(), sla_build_trunk(), sla_check_device(), sla_queue_event_conf(), sla_station_destructor(), sla_station_exec(), sla_trunk_destructor(), sla_trunk_exec(), smdi_msg_find(), smdi_msg_read(), smdi_msg_retrieve_read(), sms_exec(), sndfax_exec(), socket_process_helper(), softhangup_exec(), spawn_mp3(), speech_background(), split_ext(), srv_query_read(), srv_result_read(), ss7_apply_plan_to_number(), ss7_linkset(), ss7_start_call(), stackpeek_read(), start_monitor_action(), start_monitor_exec(), static_callback(), stop_mixmonitor_full(), stop_monitor_action(), store_config(), strings_to_mask(), strreplace(), substituted(), sysinfo_helper(), system_exec_helper(), testclient_exec(), testserver_exec(), transfer_exec(), transmit_cfwdstate(), transmit_fake_auth_response(), transmit_info_with_aoc(), transmit_invite(), transmit_modify_request(), transmit_modify_with_sdp(), transmit_notify_request(), transmit_notify_request_with_callerid(), transmit_register(), transmit_request_with_auth(), try_calling(), try_firmware(), tryexec_exec(), unalloc_sub(), unistim_call(), unistim_new(), unistim_request(), unistim_send_mwi_to_peer(), unregister_exten(), unshift_push(), update_bridge_vars(), update_connectedline(), update_odbc(), update_realtime_member_field(), update_realtime_members(), update_registry(), upqm_exec(), uridecode(), uriencode(), userevent_exec(), users_data_provider_get(), ustmtext(), valid_exit(), verbose_exec(), vm_authenticate(), vm_box_exists(), vm_exec(), vm_execmain(), vm_mailbox_snapshot_create(), vm_msg_forward(), vm_msg_move(), vm_msg_play(), vm_msg_remove(), vm_newuser(), vm_options(), vm_playmsgexec(), vmauthenticate(), vmsayname_exec(), vmu_tm(), volume_write(), wait_for_answer(), wait_for_hangup(), wait_for_winner(), waituntil_exec(), websocket_callback(), word_match(), write_metadata(), xfer_park_call_helper(), xml_translate(), xmldoc_build_field(), xmldoc_get_node(), xmldoc_get_syntax_fun(), xmldoc_parse_specialtags(), xmpp_client_config_post_apply(), xmpp_client_send_message(), xmpp_client_set_presence(), xmpp_config_prelink(), xmpp_join_exec(), xmpp_leave_exec(), xmpp_log_hook(), xmpp_pak_message(), xmpp_pak_presence(), xmpp_pubsub_iq_create(), xmpp_send_cb(), xmpp_send_exec(), xmpp_sendgroup_exec(), xmpp_status_exec(), and zapateller_exec().
{
return (!s || (*s == '\0'));
}
| char * ast_tech_to_upper | ( | char * | dev_str | ) | [inline] |
Convert the tech portion of a device string to upper case.
| dev_str | Returns the char* passed in for convenience |
Definition at line 954 of file strings.h.
Referenced by ast_event_append_ie_str(), ast_event_sub_append_ie_str(), create_new_generic_list(), find_generic_monitor_instance_list(), match_ie_val(), match_sub_ie_val_to_event(), pvt_cause_cmp_fn(), and pvt_cause_hash_fn().
{
| char * ast_trim_blanks | ( | char * | str | ) | [inline] |
Trims trailing whitespace characters from a string.
| str | the input string |
Definition at line 122 of file strings.h.
References str.
Referenced by apply_outgoing(), ast_callerid_parse(), ast_get_namedgroups(), ast_skip_nonblanks(), callerid_write(), connectedline_write(), determine_firstline_parts(), do_say(), httpd_helper_thread(), keypad_setup(), load_config(), party_id_write(), party_name_write(), party_number_write(), party_subaddress_write(), redirecting_write(), set_message_vars_from_req(), show_entry_history(), and xml_translate().
{
| int attribute_pure ast_true | ( | const char * | val | ) |
Make sure something is true. Determine if a string containing a boolean value is "true". This function checks to see whether a string passed to it is an indication of an "true" value. It checks to see if the string is "yes", "true", "y", "t", "on" or "1".
| 0 | if val is a NULL pointer. |
| -1 | if "true". |
| 0 | otherwise. |
Definition at line 1524 of file main/utils.c.
References ast_strlen_zero().
Referenced by __ast_http_load(), __init_manager(), _parse(), acf_curlopt_write(), acf_faxopt_write(), acf_transaction_write(), action_agent_logoff(), action_bridge(), action_originate(), action_updateconfig(), actual_load_config(), aji_create_client(), aji_load_config(), aoc_cli_debug_enable(), apply_general_options(), apply_option(), apply_outgoing(), ast_bridge_timelimit(), ast_jb_read_conf(), ast_plc_reload(), ast_readconfig(), ast_rtp_dtls_cfg_parse(), ast_tls_read_conf(), autopause2int(), bool_handler_fn(), boolflag_handler_fn(), build_device(), build_gateway(), build_peer(), build_user(), client_bitfield_handler(), config_parse_variables(), custom_bitfield_handler(), dahdi_accept_r2_call_exec(), dahdi_r2_answer(), dahdi_set_dnd(), data_search_cmp_bool(), do_reload(), festival_exec(), func_channel_write_real(), func_inheritance_write(), func_mute_write(), get_encrypt_methods(), global_bitfield_handler(), gtalk_load_config(), handle_common_options(), handle_logger_set_level(), handle_mfcr2_call_files(), handle_queue_set_member_ringinuse(), handle_t38_options(), init_logger_chain(), jingle_load_config(), load_config(), load_config_meetme(), load_format_config(), load_module(), load_modules(), load_moh_classes(), load_odbc_config(), local_ast_moh_start(), login_exec(), manager_add_queue_member(), manager_mutestream(), manager_pause_queue_member(), manager_queue_member_ringinuse(), message_template_build(), misdn_answer(), new_realtime_sqlite3_db(), odbc_load_module(), osp_load(), osplookup_exec(), parkinglot_config_read(), parse_config(), parse_empty_options(), pbx_load_config(), pbx_load_users(), process_config(), process_dahdi(), process_echocancel(), queue_set_global_params(), queue_set_param(), read_agent_config(), realtime_directory(), reload_config(), reload_single_member(), rt_handle_member_record(), rtp_reload(), run_agi(), run_startup_commands(), search_directory(), search_directory_sub(), set_active(), set_config(), sla_load_config(), smdi_load(), speex_write(), stackpeek_read(), start_monitor_action(), strings_to_mask(), tds_load_module(), update_common_options(), xmldoc_get_syntax_cmd(), xmldoc_get_syntax_fun(), and xmldoc_get_syntax_manager().
{
if (ast_strlen_zero(s))
return 0;
/* Determine if this is a true value */
if (!strcasecmp(s, "yes") ||
!strcasecmp(s, "true") ||
!strcasecmp(s, "y") ||
!strcasecmp(s, "t") ||
!strcasecmp(s, "1") ||
!strcasecmp(s, "on"))
return -1;
return 0;
}
| char* ast_unescape_c | ( | char * | s | ) |
Convert some C escape sequences.
(\b\f\n\r\t)
into the equivalent characters. The string to be converted (will be modified).
Definition at line 1438 of file main/utils.c.
Referenced by ast_parse_digest().
{
char c, *ret, *dst;
if (src == NULL)
return NULL;
for (ret = dst = src; (c = *src++); *dst++ = c ) {
if (c != '\\')
continue; /* copy char at the end of the loop */
switch ((c = *src++)) {
case '\0': /* special, trailing '\' */
c = '\\';
break;
case 'b': /* backspace */
c = '\b';
break;
case 'f': /* form feed */
c = '\f';
break;
case 'n':
c = '\n';
break;
case 'r':
c = '\r';
break;
case 't':
c = '\t';
break;
}
/* default, use the char literally */
}
*dst = '\0';
return ret;
}
| char* ast_unescape_semicolon | ( | char * | s | ) |
Strip backslash for "escaped" semicolons, the string to be stripped (will be modified).
Definition at line 1419 of file main/utils.c.
Referenced by sip_cli_notify().
{
char *e;
char *work = s;
while ((e = strchr(work, ';'))) {
if ((e > work) && (*(e-1) == '\\')) {
memmove(e - 1, e, strlen(e) + 1);
work = e;
} else {
work = e + 1;
}
}
return s;
}