major update to arg/option parsing APIs and documentation

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2005-11-03 21:19:11 +00:00
parent fc9612edad
commit 426360e389
19 changed files with 279 additions and 166 deletions

View File

@@ -61,12 +61,14 @@ STANDARD_LOCAL_USER;
LOCAL_USER_DECL;
#define PAGE_DUPLEX (1 << 0)
#define PAGE_QUIET (1 << 1)
enum {
PAGE_DUPLEX = (1 << 0),
PAGE_QUIET = (1 << 1),
} page_opt_flags;
AST_DECLARE_OPTIONS(page_opts,{
['d'] = { PAGE_DUPLEX },
['q'] = { PAGE_QUIET },
AST_APP_OPTIONS(page_opts, {
AST_APP_OPTION('d', PAGE_DUPLEX),
AST_APP_OPTION('q', PAGE_QUIET),
});
struct calloutdata {
@@ -142,7 +144,7 @@ static int page_exec(struct ast_channel *chan, void *data)
tmp = strsep(&options, "|");
if (options)
ast_parseoptions(page_opts, &flags, NULL, options);
ast_app_parse_options(page_opts, &flags, NULL, options);
snprintf(meetmeopts, sizeof(meetmeopts), "%ud|%sqxdw", confid, ast_test_flag(&flags, PAGE_DUPLEX) ? "" : "m");
while ((tech = strsep(&tmp, "&"))) {