00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _ALPM_DB_H
00022 #define _ALPM_DB_H
00023
00024 #include "alpm.h"
00025 #include <limits.h>
00026 #include <time.h>
00027
00028
00029 typedef enum _pmdbinfrq_t {
00030 INFRQ_BASE = 0x01,
00031 INFRQ_DESC = 0x02,
00032 INFRQ_DEPENDS = 0x04,
00033 INFRQ_FILES = 0x08,
00034 INFRQ_SCRIPTLET = 0x10,
00035 INFRQ_DELTAS = 0x20,
00036
00037 INFRQ_ALL = 0x3F
00038 } pmdbinfrq_t;
00039
00040
00041 struct __pmdb_t {
00042 char *path;
00043 char treename[PATH_MAX];
00044 void *handle;
00045 alpm_list_t *pkgcache;
00046 alpm_list_t *grpcache;
00047 alpm_list_t *servers;
00048 };
00049
00050
00051 pmdb_t *_alpm_db_new(const char *dbpath, const char *treename);
00052 void _alpm_db_free(pmdb_t *db);
00053 int _alpm_db_cmp(const void *db1, const void *db2);
00054 alpm_list_t *_alpm_db_search(pmdb_t *db, const alpm_list_t *needles);
00055 pmdb_t *_alpm_db_register_local(void);
00056 pmdb_t *_alpm_db_register_sync(const char *treename);
00057
00058
00059 int _alpm_prov_cmp(const void *provision, const void *needle);
00060 alpm_list_t *_alpm_db_whatprovides(pmdb_t *db, const char *package);
00061
00062
00063 int _alpm_db_install(pmdb_t *db, const char *dbfile);
00064 int _alpm_db_open(pmdb_t *db);
00065 void _alpm_db_close(pmdb_t *db);
00066 void _alpm_db_rewind(pmdb_t *db);
00067 pmpkg_t *_alpm_db_scan(pmdb_t *db, const char *target);
00068 int _alpm_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq);
00069 int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq);
00070 int _alpm_db_remove(pmdb_t *db, pmpkg_t *info);
00071 time_t _alpm_db_getlastupdate(const pmdb_t *db);
00072 int _alpm_db_setlastupdate(const pmdb_t *db, time_t time);
00073
00074 #endif
00075
00076