Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00037 #include "../../dprint.h"
00038 #include "../../lib/srdb1/db.h"
00039 #include "km_db_berkeley.h"
00040 #include "km_bdb_mi.h"
00041
00042
00043
00044
00045
00046
00047 struct mi_root* mi_bdb_reload(struct mi_root *cmd, void *param)
00048 {
00049 struct mi_node *node;
00050 str *db_path;
00051
00052 node = cmd->node.kids;
00053 if (node && node->next)
00054 return init_mi_tree( 400, MI_MISSING_PARM_S, MI_MISSING_PARM_LEN);
00055
00056 db_path = &node->value;
00057
00058 if (!db_path || db_path->len == 0)
00059 return init_mi_tree( 400, "bdb_reload missing db arg", 21);
00060
00061 if (bdb_reload(db_path->s) == 0)
00062 {
00063 return init_mi_tree( 200, MI_OK_S, MI_OK_LEN);
00064 }
00065 else
00066 {
00067 return init_mi_tree( 500, "db_berkeley Reload Failed", 26);
00068 }
00069 }
00070