summaryrefslogtreecommitdiff
path: root/res/res_speech.c
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2009-05-21 21:13:09 +0000
committerKevin P. Fleming <kpfleming@digium.com>2009-05-21 21:13:09 +0000
commite6b2e9a7501b5d2e351a5e626fa13dfc3c113f1e (patch)
treeb40d978190102dbe6f14458ab8a70f358db533e4 /res/res_speech.c
parent88bda581ec7c524050bca769c6705ee5c66357ad (diff)
Const-ify the world (or at least a good part of it)
This patch adds 'const' tags to a number of Asterisk APIs where they are appropriate (where the API already demanded that the function argument not be modified, but the compiler was not informed of that fact). The list includes: - CLI command handlers - CLI command handler arguments - AGI command handlers - AGI command handler arguments - Dialplan application handler arguments - Speech engine API function arguments In addition, various file-scope and function-scope constant arrays got 'const' and/or 'static' qualifiers where they were missing. Review: https://reviewboard.asterisk.org/r/251/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_speech.c')
-rw-r--r--res/res_speech.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/res/res_speech.c b/res/res_speech.c
index 902955da1..5b8e1a474 100644
--- a/res/res_speech.c
+++ b/res/res_speech.c
@@ -40,7 +40,7 @@ static AST_RWLIST_HEAD_STATIC(engines, ast_speech_engine);
static struct ast_speech_engine *default_engine = NULL;
/*! \brief Find a speech recognition engine of specified name, if NULL then use the default one */
-static struct ast_speech_engine *find_engine(char *engine_name)
+static struct ast_speech_engine *find_engine(const char *engine_name)
{
struct ast_speech_engine *engine = NULL;
@@ -60,25 +60,25 @@ static struct ast_speech_engine *find_engine(char *engine_name)
}
/*! \brief Activate a loaded (either local or global) grammar */
-int ast_speech_grammar_activate(struct ast_speech *speech, char *grammar_name)
+int ast_speech_grammar_activate(struct ast_speech *speech, const char *grammar_name)
{
return (speech->engine->activate ? speech->engine->activate(speech, grammar_name) : -1);
}
/*! \brief Deactivate a loaded grammar on a speech structure */
-int ast_speech_grammar_deactivate(struct ast_speech *speech, char *grammar_name)
+int ast_speech_grammar_deactivate(struct ast_speech *speech, const char *grammar_name)
{
return (speech->engine->deactivate ? speech->engine->deactivate(speech, grammar_name) : -1);
}
/*! \brief Load a local grammar on a speech structure */
-int ast_speech_grammar_load(struct ast_speech *speech, char *grammar_name, char *grammar)
+int ast_speech_grammar_load(struct ast_speech *speech, const char *grammar_name, const char *grammar)
{
return (speech->engine->load ? speech->engine->load(speech, grammar_name, grammar) : -1);
}
/*! \brief Unload a local grammar from a speech structure */
-int ast_speech_grammar_unload(struct ast_speech *speech, char *grammar_name)
+int ast_speech_grammar_unload(struct ast_speech *speech, const char *grammar_name)
{
return (speech->engine->unload ? speech->engine->unload(speech, grammar_name) : -1);
}
@@ -163,13 +163,13 @@ int ast_speech_dtmf(struct ast_speech *speech, const char *dtmf)
}
/*! \brief Change an engine specific attribute */
-int ast_speech_change(struct ast_speech *speech, char *name, const char *value)
+int ast_speech_change(struct ast_speech *speech, const char *name, const char *value)
{
return (speech->engine->change ? speech->engine->change(speech, name, value) : -1);
}
/*! \brief Create a new speech structure using the engine specified */
-struct ast_speech *ast_speech_new(char *engine_name, int formats)
+struct ast_speech *ast_speech_new(const char *engine_name, int formats)
{
struct ast_speech_engine *engine = NULL;
struct ast_speech *new_speech = NULL;
@@ -299,7 +299,7 @@ int ast_speech_register(struct ast_speech_engine *engine)
}
/*! \brief Unregister a speech recognition engine */
-int ast_speech_unregister(char *engine_name)
+int ast_speech_unregister(const char *engine_name)
{
struct ast_speech_engine *engine = NULL;
int res = -1;