diff options
author | Timo Teras <timo.teras@iki.fi> | 2009-08-06 14:25:03 +0300 |
---|---|---|
committer | Timo Teras <timo.teras@iki.fi> | 2009-08-06 14:25:03 +0300 |
commit | ecdacd15032578148489f868fd928fb502032c60 (patch) | |
tree | e8ad3d487b60017f3f4975d09bbeac4a77b8d0b7 /src/apk_database.h | |
parent | fac43e2d60b550425481052e521d141730a303de (diff) | |
download | apk-tools-ecdacd15032578148489f868fd928fb502032c60.tar.gz apk-tools-ecdacd15032578148489f868fd928fb502032c60.tar.bz2 apk-tools-ecdacd15032578148489f868fd928fb502032c60.tar.xz apk-tools-ecdacd15032578148489f868fd928fb502032c60.zip |
all: implement database open options
so user can override trusted keys directory and repositories file.
Diffstat (limited to 'src/apk_database.h')
-rw-r--r-- | src/apk_database.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/apk_database.h b/src/apk_database.h index 1ded91e..09f9ef7 100644 --- a/src/apk_database.h +++ b/src/apk_database.h @@ -79,6 +79,19 @@ struct apk_repository { struct apk_checksum csum; }; +struct apk_repository_list { + struct list_head list; + const char *url; +}; + +struct apk_db_options { + unsigned long open_flags; + char *root; + char *keys_dir; + char *repositories_file; + struct list_head repository_list; +}; + struct apk_database { char *root; int root_fd, lock_fd, cache_fd, cachetmp_fd, keys_fd; @@ -120,9 +133,9 @@ struct apk_db_file *apk_db_file_query(struct apk_database *db, apk_blob_t dir, apk_blob_t name); -#define APK_OPENF_READ 0x0000 -#define APK_OPENF_WRITE 0x0001 -#define APK_OPENF_CREATE 0x0002 +#define APK_OPENF_READ 0x0001 +#define APK_OPENF_WRITE 0x0002 +#define APK_OPENF_CREATE 0x0004 #define APK_OPENF_NO_INSTALLED 0x0010 #define APK_OPENF_NO_SCRIPTS 0x0020 #define APK_OPENF_NO_WORLD 0x0040 @@ -132,7 +145,7 @@ struct apk_db_file *apk_db_file_query(struct apk_database *db, APK_OPENF_NO_SCRIPTS | \ APK_OPENF_NO_WORLD) -int apk_db_open(struct apk_database *db, const char *root, unsigned int flags); +int apk_db_open(struct apk_database *db, struct apk_db_options *dbopts); int apk_db_write_config(struct apk_database *db); void apk_db_close(struct apk_database *db); int apk_db_permanent(struct apk_database *db); |