summaryrefslogtreecommitdiff
path: root/main/db.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2011-11-19 15:11:45 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2011-11-19 15:11:45 +0000
commit6e7359f59404d19b7d8eb787f47f6dcc72cdc45d (patch)
treefc9016463d101a4cd4de63ba6d65c194bca20b00 /main/db.c
parent6b8b13ec2dc170236f4e4a74e60a178ea982ba1e (diff)
Update the documentation to better clarify how the existing commands work.
Review: https://reviewboard.asterisk.org/r/1593/ ........ Merged revisions 345682 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 345683 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@345684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/db.c')
-rw-r--r--main/db.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/main/db.c b/main/db.c
index 803bc2bb3..7b37a2377 100644
--- a/main/db.c
+++ b/main/db.c
@@ -364,16 +364,16 @@ int ast_db_del(const char *family, const char *key)
return res;
}
-int ast_db_deltree(const char *family, const char *subfamily)
+int ast_db_deltree(const char *family, const char *keytree)
{
sqlite3_stmt *stmt = deltree_stmt;
char prefix[MAX_DB_FIELD];
int res = 0;
if (!ast_strlen_zero(family)) {
- if (!ast_strlen_zero(subfamily)) {
+ if (!ast_strlen_zero(keytree)) {
/* Family and key tree */
- snprintf(prefix, sizeof(prefix), "/%s/%s", family, subfamily);
+ snprintf(prefix, sizeof(prefix), "/%s/%s", family, keytree);
} else {
/* Family only */
snprintf(prefix, sizeof(prefix), "/%s", family);
@@ -399,16 +399,16 @@ int ast_db_deltree(const char *family, const char *subfamily)
return res;
}
-struct ast_db_entry *ast_db_gettree(const char *family, const char *subfamily)
+struct ast_db_entry *ast_db_gettree(const char *family, const char *keytree)
{
char prefix[MAX_DB_FIELD];
sqlite3_stmt *stmt = gettree_stmt;
struct ast_db_entry *cur, *last = NULL, *ret = NULL;
if (!ast_strlen_zero(family)) {
- if (!ast_strlen_zero(subfamily)) {
+ if (!ast_strlen_zero(keytree)) {
/* Family and key tree */
- snprintf(prefix, sizeof(prefix), "/%s/%s", family, subfamily);
+ snprintf(prefix, sizeof(prefix), "/%s/%s", family, keytree);
} else {
/* Family only */
snprintf(prefix, sizeof(prefix), "/%s", family);
@@ -554,9 +554,11 @@ static char *handle_cli_database_deltree(struct ast_cli_entry *e, int cmd, struc
case CLI_INIT:
e->command = "database deltree";
e->usage =
- "Usage: database deltree <family> [subfamily]\n"
- " Deletes a family or specific subfamily within a family\n"
- " in the Asterisk database.\n";
+ "Usage: database deltree <family> [keytree]\n"
+ " OR: database deltree <family>[/keytree]\n"
+ " Deletes a family or specific keytree within a family\n"
+ " in the Asterisk database. The two arguments may be\n"
+ " separated by either a space or a slash.\n";
return NULL;
case CLI_GENERATE:
return NULL;
@@ -587,9 +589,11 @@ static char *handle_cli_database_show(struct ast_cli_entry *e, int cmd, struct a
case CLI_INIT:
e->command = "database show";
e->usage =
- "Usage: database show [family [subfamily]]\n"
+ "Usage: database show [family [keytree]]\n"
+ " OR: database show [family[/keytree]]\n"
" Shows Asterisk database contents, optionally restricted\n"
- " to a given family, or family and subfamily.\n";
+ " to a given family, or family and keytree. The two arguments\n"
+ " may be separated either by a space or by a slash.\n";
return NULL;
case CLI_GENERATE:
return NULL;
@@ -647,7 +651,7 @@ static char *handle_cli_database_showkey(struct ast_cli_entry *e, int cmd, struc
case CLI_INIT:
e->command = "database showkey";
e->usage =
- "Usage: database showkey <subfamily>\n"
+ "Usage: database showkey <keytree>\n"
" Shows Asterisk database contents, restricted to a given key.\n";
return NULL;
case CLI_GENERATE:
@@ -729,7 +733,7 @@ static struct ast_cli_entry cli_database[] = {
AST_CLI_DEFINE(handle_cli_database_get, "Gets database value"),
AST_CLI_DEFINE(handle_cli_database_put, "Adds/updates database value"),
AST_CLI_DEFINE(handle_cli_database_del, "Removes database key/value"),
- AST_CLI_DEFINE(handle_cli_database_deltree, "Removes database subfamily/values"),
+ AST_CLI_DEFINE(handle_cli_database_deltree, "Removes database keytree/values"),
AST_CLI_DEFINE(handle_cli_database_query, "Run a user-specified query on the astdb"),
};