Merged revisions 89536 via svnmerge from
[asterisk/asterisk.git] / main / db.c
index ba322d2..36ba9ae 100644 (file)
--- a/main/db.c
+++ b/main/db.c
 
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include "asterisk/_private.h"
+#include "asterisk/paths.h"    /* use ast_config_AST_DB */
 #include <sys/time.h>
 #include <signal.h>
-#include <errno.h>
-#include <unistd.h>
 #include <dirent.h>
 
 #include "asterisk/channel.h"
 #include "asterisk/file.h"
 #include "asterisk/app.h"
 #include "asterisk/dsp.h"
-#include "asterisk/logger.h"
-#include "asterisk/options.h"
 #include "asterisk/astdb.h"
 #include "asterisk/cli.h"
 #include "asterisk/utils.h"
@@ -53,10 +48,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/manager.h"
 #include "db1-ast/include/db.h"
 
-#ifdef __CYGWIN__
-#define dbopen __dbopen
-#endif
-
 static DB *astdb;
 AST_MUTEX_DEFINE_STATIC(dblock);
 
@@ -429,7 +420,7 @@ static char *handle_cli_database_showkey(struct ast_cli_entry *e, int cmd, struc
 
        switch (cmd) {
        case CLI_INIT:
-               e->command = "database show";
+               e->command = "database showkey";
                e->usage =
                        "Usage: database showkey <keytree>\n"
                        "       Shows Asterisk database contents, restricted to a given key.\n";
@@ -549,12 +540,12 @@ void ast_db_freetree(struct ast_db_entry *dbe)
 }
 
 struct ast_cli_entry cli_database[] = {
-       AST_CLI(handle_cli_database_show,    "Shows database contents"),
-       AST_CLI(handle_cli_database_showkey, "Shows database contents"),
-       AST_CLI(handle_cli_database_get,     "Gets database value"),
-       AST_CLI(handle_cli_database_put,     "Adds/updates database value"),
-       AST_CLI(handle_cli_database_del,     "Removes database key/value"),
-       AST_CLI(handle_cli_database_deltree, "Removes database keytree/values")
+       AST_CLI_DEFINE(handle_cli_database_show,    "Shows database contents"),
+       AST_CLI_DEFINE(handle_cli_database_showkey, "Shows database contents"),
+       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 keytree/values")
 };
 
 static int manager_dbput(struct mansession *s, const struct message *m)