diff options
author | Steve Murphy <murf@digium.com> | 2006-11-07 21:47:49 +0000 |
---|---|---|
committer | Steve Murphy <murf@digium.com> | 2006-11-07 21:47:49 +0000 |
commit | 908f176cf38eb1f81a3372a2ebf24ed17c75e8a6 (patch) | |
tree | c85e2036ae8d28edebee2af6cc055a51e39ba1da /include/asterisk | |
parent | 7659f6d5240b03068adf9746b3dd2938d1ebb0fd (diff) |
A fair number of changes for the sake of bug 7506
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47290 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk')
-rw-r--r-- | include/asterisk/channel.h | 8 | ||||
-rw-r--r-- | include/asterisk/stringfields.h | 39 |
2 files changed, 46 insertions, 1 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 26412b3fe..10491a041 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -579,7 +579,7 @@ int ast_setstate(struct ast_channel *chan, enum ast_channel_state); by default set to the "default" context and extension "s" */ -struct ast_channel *ast_channel_alloc(int needalertpipe); +struct ast_channel *ast_channel_alloc(int needalertpipe, int state, const char *cid_num, const char *cid_name, const char *name_fmt, ...); /*! \brief Queue an outgoing frame */ int ast_queue_frame(struct ast_channel *chan, struct ast_frame *f); @@ -1106,6 +1106,12 @@ void ast_deactivate_generator(struct ast_channel *chan); void ast_set_callerid(struct ast_channel *chan, const char *cidnum, const char *cidname, const char *ani); + +/*! return a mallocd string with the result of sprintf of the fmt and following args */ +char *ast_safe_string_alloc(const char *fmt, ...); + + + /*! Start a tone going */ int ast_tonepair_start(struct ast_channel *chan, int freq1, int freq2, int duration, int vol); /*! Stop a tone from playing */ diff --git a/include/asterisk/stringfields.h b/include/asterisk/stringfields.h index bf4c0a055..d35ef7d8e 100644 --- a/include/asterisk/stringfields.h +++ b/include/asterisk/stringfields.h @@ -168,6 +168,22 @@ void __ast_string_field_index_build(struct ast_string_field_mgr *mgr, int index, const char *format, ...); /*! + \internal + \brief Set a field to a complex (built) value + \param mgr Pointer to the pool manager structure + \param fields Pointer to the first entry of the field array + \param num_fields Number of fields in the array + \param index Index position of the field within the structure + \param format printf-style format string + \param args va_list of the args for the format_string + \param args_again a copy of the first va_list for the sake of bsd not having a copy routine + \return nothing +*/ +void __ast_string_field_index_build_va(struct ast_string_field_mgr *mgr, + ast_string_field *fields, int num_fields, + int index, const char *format, va_list a1, va_list a2); + +/*! \brief Declare a string field \param name The field name */ @@ -276,6 +292,18 @@ void __ast_string_field_index_build(struct ast_string_field_mgr *mgr, __ast_string_field_index_build(&(x)->__field_mgr, &(x)->__begin_field[0], ast_string_field_count(x), index, fmt, args) /*! + \brief Set a field to a complex (built) value with prebuilt va_lists. + \param x Pointer to a structure containing fields + \param index Index position of the field within the structure + \param fmt printf-style format string + \param args1 Arguments for format string in va_list format + \param args2 a second copy of the va_list for the sake of bsd, with no va_list copy operation + \return nothing +*/ +#define ast_string_field_index_build_va(x, index, fmt, args1, args2) \ + __ast_string_field_index_build_va(&(x)->__field_mgr, &(x)->__begin_field[0], ast_string_field_count(x), index, fmt, args1, args2) + +/*! \brief Set a field to a complex (built) value \param x Pointer to a structure containing fields \param field Name of the field to set @@ -287,6 +315,17 @@ void __ast_string_field_index_build(struct ast_string_field_mgr *mgr, ast_string_field_index_build(x, ast_string_field_index(x, field), fmt, args) /*! + \brief Set a field to a complex (built) value + \param x Pointer to a structure containing fields + \param field Name of the field to set + \param fmt printf-style format string + \param argslist a va_list of the args + \return nothing +*/ +#define ast_string_field_build_va(x, field, fmt, args1, args2) \ + ast_string_field_index_build_va(x, ast_string_field_index(x, field), fmt, args1, args2) + +/*! \brief Free a field's value. \param x Pointer to a structure containing fields \param index Index position of the field within the structure |