Made chan_agent code parsing more robust and

implemented new macro code. from 6228.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8064 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Matt O'Gorman
2006-01-13 18:30:49 +00:00
parent 1874f21ff8
commit 3928ebd74f
2 changed files with 50 additions and 22 deletions

View File

@@ -228,6 +228,19 @@ int ast_app_group_match_get_count(const char *groupmatch, const char *category);
#define AST_STANDARD_APP_ARGS(args, parse) \
args.argc = ast_app_separate_args(parse, '|', args.argv, (sizeof(args) - sizeof(args.argc)) / sizeof(args.argv[0]))
/*!
\brief Performs the 'nonstandard' argument separation process for an application.
\param args An argument structure defined using AST_DECLARE_APP_ARGS
\param parse A modifiable buffer containing the input to be parsed
\param sep A nonstandard separator character
This function will separate the input string using the nonstandard argument
separator character and fill in the provided structure, including
the argc argument counter field.
*/
#define AST_NONSTANDARD_APP_ARGS(args, parse, sep) \
args.argc = ast_app_separate_args(parse, sep, args.argv, (sizeof(args) - sizeof(args.argc)) / sizeof(args.argv[0]))
/*!
\brief Separate a string into arguments in an array
\param buf The string to be parsed (this must be a writable copy, as it will be modified)