Applications to decline words according to current language. More...
#include "asterisk.h"#include "asterisk/logger.h"#include "asterisk/module.h"#include "asterisk/app.h"#include "asterisk/say.h"
Go to the source code of this file.
Functions | |
| static void | __reg_module (void) |
| static void | __unreg_module (void) |
| static int | load_module (void) |
| static int | saycountedadj_exec (struct ast_channel *chan, const char *data) |
| static int | saycountednoun_exec (struct ast_channel *chan, const char *data) |
| static int | unload_module (void) |
Variables | |
| static struct ast_module_info | __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Decline words according to channel language" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, } |
| static struct ast_module_info * | ast_module_info = &__mod_info |
Applications to decline words according to current language.
Definition in file app_saycounted.c.
| static void __reg_module | ( | void | ) | [static] |
Definition at line 208 of file app_saycounted.c.
| static void __unreg_module | ( | void | ) | [static] |
Definition at line 208 of file app_saycounted.c.
| static int load_module | ( | void | ) | [static] |
Definition at line 192 of file app_saycounted.c.
References ast_register_application_xml, saycountedadj_exec(), and saycountednoun_exec().
{
int res;
res = ast_register_application_xml("SayCountedNoun", saycountednoun_exec);
res |= ast_register_application_xml("SayCountedAdj", saycountedadj_exec);
return res;
}
| static int saycountedadj_exec | ( | struct ast_channel * | chan, |
| const char * | data | ||
| ) | [static] |
Definition at line 154 of file app_saycounted.c.
References args, AST_APP_ARG, AST_DECLARE_APP_ARGS, ast_log(), ast_say_counted_adjective(), AST_STANDARD_APP_ARGS, ast_strlen_zero(), LOG_WARNING, and parse().
Referenced by load_module().
{
char *parse;
int number;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(number);
AST_APP_ARG(adjective);
AST_APP_ARG(gender);
);
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "SayCountedAdj requires two or three arguments (<number>,<adjective>[,<gender>])\n");
return -1;
}
parse = ast_strdupa(data);
AST_STANDARD_APP_ARGS(args, parse);
if (args.argc < 2) {
ast_log(LOG_WARNING, "SayCountedAdj requires at least two arguments\n");
return -1;
}
if (sscanf(args.number, "%d", &number) != 1) {
ast_log(LOG_WARNING, "First argument must be a number between 0 and 2,147,483,647.\n");
return -1;
}
if (!ast_strlen_zero(args.gender)) {
if (strchr("cCfFmMnN", args.gender[0])) {
ast_log(LOG_WARNING, "SayCountedAdj gender option must be one of 'f', 'm', 'c', or 'n'.\n");
return -1;
}
}
return ast_say_counted_adjective(chan, number, args.adjective, args.gender);
}
| static int saycountednoun_exec | ( | struct ast_channel * | chan, |
| const char * | data | ||
| ) | [static] |
Definition at line 124 of file app_saycounted.c.
References args, AST_APP_ARG, AST_DECLARE_APP_ARGS, ast_log(), ast_say_counted_noun(), AST_STANDARD_APP_ARGS, ast_strlen_zero(), LOG_WARNING, and parse().
Referenced by load_module().
{
char *parse;
int number;
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(number);
AST_APP_ARG(noun);
);
if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "SayCountedNoun requires two arguments (<number>,<noun>)\n");
return -1;
}
parse = ast_strdupa(data);
AST_STANDARD_APP_ARGS(args, parse);
if (args.argc != 2) {
ast_log(LOG_WARNING, "SayCountedNoun requires two arguments\n");
return -1;
}
if (sscanf(args.number, "%d", &number) != 1) {
ast_log(LOG_WARNING, "First argument must be a number between 0 and 2,147,483,647.\n");
return -1;
}
return ast_say_counted_noun(chan, number, args.noun);
}
| static int unload_module | ( | void | ) | [static] |
Definition at line 200 of file app_saycounted.c.
References ast_unregister_application().
{
int res;
res = ast_unregister_application("SayCountedNoun");
res |= ast_unregister_application("SayCountedAdj");
return res;
}
struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Decline words according to channel language" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_DEFAULT, } [static] |
Definition at line 208 of file app_saycounted.c.
struct ast_module_info* ast_module_info = &__mod_info [static] |
Definition at line 208 of file app_saycounted.c.