new: implement and fix few more database functions
This commit is contained in:
@ -5,6 +5,8 @@
|
||||
typedef enum lm_query_index {
|
||||
QUERY_CREATE_TABLE = 0,
|
||||
QUERY_INSERT_PACKAGE = 1,
|
||||
QUERY_SELECT_PACKAGE = 2,
|
||||
QUERY_DELETE_PACKAGE = 3,
|
||||
} lm_query_index_t;
|
||||
|
||||
extern char *queries[];
|
||||
@ -21,16 +23,16 @@ typedef bool (*lm_database_keeps_eachfunc_t)(lm_pkg_t *pkg, char *path, void *da
|
||||
lm_database_t *lm_database_new(char *path);
|
||||
void lm_database_free(lm_database_t *db);
|
||||
|
||||
bool lm_database_find(lm_database_t *db, lm_pkg_t *pkg, char *name);
|
||||
bool lm_database_add(lm_database_t *db, lm_pkg_t *pkg);
|
||||
bool lm_database_del(lm_database_t *db, lm_pkg_t *pkg);
|
||||
bool lm_database_find(lm_database_t *db, lm_pkg_t *pkg);
|
||||
|
||||
bool lm_database_files_del(lm_database_t *db, lm_pkg_t *pkg);
|
||||
bool lm_database_files_foreach(lm_database_t *db, lm_pkg_t *pkg, lm_database_files_eachfunc_t func);
|
||||
bool lm_database_files_add(lm_database_t *db, lm_pkg_t *pkg, char *path, char *hash);
|
||||
bool lm_database_files_get(lm_database_t *db, lm_pkg_t *pkg, char *path, char *hash);
|
||||
bool lm_database_files_foreach(lm_database_t *db, lm_pkg_t *pkg, lm_database_files_eachfunc_t func);
|
||||
bool lm_database_files_del(lm_database_t *db, lm_pkg_t *pkg);
|
||||
|
||||
bool lm_database_keeps_del(lm_database_t *db, lm_pkg_t *pkg);
|
||||
bool lm_database_keeps_add(lm_database_t *db, lm_pkg_t *pkg, char *path);
|
||||
bool lm_database_keeps_contains(lm_database_t *db, lm_pkg_t *pkg, char *path);
|
||||
bool lm_database_keeps_foreach(lm_database_t *db, lm_pkg_t *pkg, lm_database_keeps_eachfunc_t func);
|
||||
bool lm_database_keeps_contains(lm_database_t *db, lm_pkg_t *pkg, char *path);
|
||||
bool lm_database_keeps_add(lm_database_t *db, lm_pkg_t *pkg, char *path);
|
||||
bool lm_database_keeps_del(lm_database_t *db, lm_pkg_t *pkg);
|
||||
|
@ -10,6 +10,7 @@
|
||||
lm_pkg_t *lm_package_new();
|
||||
void lm_package_free(lm_pkg_t *pkg);
|
||||
bool lm_package_verify(lm_pkg_t *pkg);
|
||||
void lm_package_init(lm_pkg_t *pkg);
|
||||
|
||||
bool lm_package_data_load(lm_pkg_t *pkg, char *file);
|
||||
void lm_package_data_free(lm_pkg_t *pkg);
|
||||
@ -18,6 +19,8 @@ bool lm_package_depend_add(lm_pkg_t *pkg, char *depend);
|
||||
size_t lm_package_depend_count(lm_pkg_t *pkg);
|
||||
size_t lm_package_depend_strlen(lm_pkg_t *pkg);
|
||||
bool lm_package_depend_tostr(lm_pkg_t *pkg, char *buffer);
|
||||
bool lm_package_depend_fromstr(lm_pkg_t *pkg, char *buffer);
|
||||
void lm_package_depend_free(lm_pkg_t *pkg);
|
||||
|
||||
size_t lm_package_keep_count(lm_pkg_t *pkg);
|
||||
bool lm_package_keep_add(lm_pkg_t *pkg, char *path);
|
||||
|
Reference in New Issue
Block a user