#include "asterisk/linkedlists.h"
Go to the source code of this file.
Data Structures | |
struct | ast_var_t |
struct | varshead |
Functions | |
ast_var_t * | ast_var_assign (const char *name, const char *value) |
void | ast_var_delete (struct ast_var_t *var) |
const char * | ast_var_full_name (const struct ast_var_t *var) |
const char * | ast_var_name (const struct ast_var_t *var) |
const char * | ast_var_value (const struct ast_var_t *var) |
Definition in file chanvars.h.
struct ast_var_t* ast_var_assign | ( | const char * | name, | |
const char * | value | |||
) |
Definition at line 39 of file chanvars.c.
References ast_calloc, ast_copy_string(), and var.
Referenced by ast_cdr_copy_vars(), ast_cdr_setvar(), ast_channel_inherit_variables(), clone_variables(), dundi_lookup_local(), loopback_subst(), pbx_builtin_pushvar_helper(), and pbx_builtin_setvar_helper().
00040 { 00041 struct ast_var_t *var; 00042 int name_len = strlen(name) + 1; 00043 int value_len = strlen(value) + 1; 00044 00045 if (!(var = ast_calloc(sizeof(*var) + name_len + value_len, sizeof(char)))) { 00046 return NULL; 00047 } 00048 00049 ast_copy_string(var->name, name, name_len); 00050 var->value = var->name + name_len; 00051 ast_copy_string(var->value, value, value_len); 00052 00053 return var; 00054 }
void ast_var_delete | ( | struct ast_var_t * | var | ) |
Definition at line 56 of file chanvars.c.
Referenced by ast_cdr_free_vars(), ast_cdr_setvar(), ast_channel_free(), dundi_lookup_local(), loopback_subst(), pbx_builtin_clear_globals(), and pbx_builtin_setvar_helper().
const char* ast_var_full_name | ( | const struct ast_var_t * | var | ) |
Definition at line 77 of file chanvars.c.
References var.
Referenced by ast_channel_inherit_variables().
const char* ast_var_name | ( | const struct ast_var_t * | var | ) |
Definition at line 62 of file chanvars.c.
Referenced by ast_cdr_copy_vars(), ast_cdr_getvar_internal(), ast_cdr_serialize_variables(), ast_cdr_setvar(), ast_channel_inherit_variables(), cdr_merge_vars(), handle_show_globals(), mgcp_call(), ospauth_exec(), ospfinished_exec(), osplookup_exec(), ospnext_exec(), pbx_builtin_getvar_helper(), pbx_builtin_serialize_variables(), pbx_builtin_setvar_helper(), pbx_retrieve_variable(), sip_call(), and transmit_invite().
00063 { 00064 const char *name; 00065 00066 if (var == NULL || (name = var->name) == NULL) 00067 return NULL; 00068 /* Return the name without the initial underscores */ 00069 if (name[0] == '_') { 00070 name++; 00071 if (name[0] == '_') 00072 name++; 00073 } 00074 return name; 00075 }
const char* ast_var_value | ( | const struct ast_var_t * | var | ) |
Definition at line 82 of file chanvars.c.
References var.
Referenced by ast_cdr_copy_vars(), ast_cdr_getvar_internal(), ast_cdr_serialize_variables(), ast_channel_inherit_variables(), cdr_merge_vars(), handle_show_globals(), mgcp_call(), ospauth_exec(), ospfinished_exec(), osplookup_exec(), ospnext_exec(), pbx_builtin_getvar_helper(), pbx_builtin_serialize_variables(), pbx_retrieve_variable(), sip_call(), and transmit_invite().