summaryrefslogtreecommitdiff
path: root/lib/libalpm/db.h
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2006-03-02 19:06:52 +0000
committerAurelien Foret <aurelien@archlinux.org>2006-03-02 19:06:52 +0000
commite2faeb46e108395f6efab06472ef9bb72e64431a (patch)
tree1567d106ecd2250611f55cbc04d809fdcf1ca87c /lib/libalpm/db.h
parent5261c7fafb142135d01458b083013580a9d035cc (diff)
downloadpacman-e2faeb46e108395f6efab06472ef9bb72e64431a.tar.xz
reworked the db object to prepare future integration with different backends
Diffstat (limited to 'lib/libalpm/db.h')
-rw-r--r--lib/libalpm/db.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/libalpm/db.h b/lib/libalpm/db.h
index dbade3b0..6d885efd 100644
--- a/lib/libalpm/db.h
+++ b/lib/libalpm/db.h
@@ -21,9 +21,6 @@
#ifndef _ALPM_DB_H
#define _ALPM_DB_H
-#include <dirent.h>
-
-#include "list.h"
#include "package.h"
/* Database entries */
@@ -42,16 +39,20 @@
typedef struct __pmdb_t {
char *path;
char treename[DB_TREENAME_LEN];
- DIR *dir;
+ void *handle;
PMList *pkgcache;
PMList *grpcache;
} pmdb_t;
-pmdb_t *_alpm_db_open(char *path, char *treename, int mode);
-void _alpm_db_close(void *data);
+
+pmdb_t *_alpm_db_new(char *root, char *dbpath, char *treename);
+void _alpm_db_free(void *data);
+/* Prototypes for backends functions */
+int _alpm_db_open(pmdb_t *db, int mode);
+void _alpm_db_close(pmdb_t *db);
void _alpm_db_rewind(pmdb_t *db);
pmpkg_t *_alpm_db_scan(pmdb_t *db, char *target, unsigned int inforeq);
-int _alpm_db_read(pmdb_t *db, char *name, unsigned int inforeq, pmpkg_t *info);
+int _alpm_db_read(pmdb_t *db, unsigned int inforeq, pmpkg_t *info);
int _alpm_db_write(pmdb_t *db, pmpkg_t *info, unsigned int inforeq);
int _alpm_db_remove(pmdb_t *db, pmpkg_t *info);