| 59 | ")"; |
| 60 | |
| 61 | static acl::db_handle* open_option_tbl() |
| 62 | { |
| 63 | const char* path = global::get_instance().get_path(); |
| 64 | acl::string dbpath; |
| 65 | dbpath.format("%s/net_store.db", path); |
| 66 | |
| 67 | acl::db_handle* db = new acl::db_sqlite(dbpath.c_str()); |
| 68 | if (db->open() == false) |
| 69 | { |
| 70 | logger_error("open db: %s failed", dbpath.c_str()); |
| 71 | delete db; |
| 72 | return NULL; |
| 73 | } |
| 74 | else if (create_option_tbl(*db, "option_tbl", CREATE_OPT_TBL) == false) |
| 75 | { |
| 76 | delete db; |
| 77 | return NULL; |
| 78 | } |
| 79 | else |
| 80 | return db; |
| 81 | } |
| 82 | |
| 83 | bool net_store::get_key(const char* name, acl::string& out) |
| 84 | { |