/*
* db.h
*
- * Copyright (c) 2006-2011 Pacman Development Team <pacman-dev@archlinux.org>
+ * Copyright (c) 2006-2013 Pacman Development Team <pacman-dev@archlinux.org>
* Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
* Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
#ifndef _ALPM_DB_H
#define _ALPM_DB_H
-#include <time.h>
-
/* libarchive */
#include <archive.h>
#include <archive_entry.h>
INFRQ_SCRIPTLET = (1 << 3),
INFRQ_DSIZE = (1 << 4),
/* ALL should be info stored in the package or database */
- INFRQ_ALL = 0x1F
+ INFRQ_ALL = 0x1F,
+ INFRQ_ERROR = (1 << 31)
} alpm_dbinfrq_t;
/** Database status. Bitflags. */
enum _alpm_dbstatus_t {
DB_STATUS_VALID = (1 << 0),
- DB_STATUS_PKGCACHE = (1 << 1),
- DB_STATUS_GRPCACHE = (1 << 2)
+ DB_STATUS_INVALID = (1 << 1),
+ DB_STATUS_EXISTS = (1 << 2),
+ DB_STATUS_MISSING = (1 << 3),
+
+ DB_STATUS_LOCAL = (1 << 10),
+ DB_STATUS_PKGCACHE = (1 << 11),
+ DB_STATUS_GRPCACHE = (1 << 12)
};
struct db_operations {
char *treename;
/* do not access directly, use _alpm_db_path(db) for lazy access */
char *_path;
- /* also indicates whether we are RO or RW */
- int is_local;
- /* flags determining validity, loaded caches, etc. */
- enum _alpm_dbstatus_t status;
alpm_pkghash_t *pkgcache;
alpm_list_t *grpcache;
alpm_list_t *servers;
- alpm_siglevel_t siglevel;
-
struct db_operations *ops;
+ /* flags determining validity, local, loaded caches, etc. */
+ enum _alpm_dbstatus_t status;
+ alpm_siglevel_t siglevel;
+ alpm_db_usage_t usage;
};
alpm_db_t *_alpm_db_new(const char *treename, int is_local);
void _alpm_db_free(alpm_db_t *db);
const char *_alpm_db_path(alpm_db_t *db);
-char *_alpm_db_sig_path(alpm_db_t *db);
int _alpm_db_cmp(const void *d1, const void *d2);
alpm_list_t *_alpm_db_search(alpm_db_t *db, const alpm_list_t *needles);
alpm_db_t *_alpm_db_register_local(alpm_handle_t *handle);
int _alpm_local_db_prepare(alpm_db_t *db, alpm_pkg_t *info);
int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, alpm_dbinfrq_t inforeq);
int _alpm_local_db_remove(alpm_db_t *db, alpm_pkg_t *info);
+char *_alpm_local_db_pkgpath(alpm_db_t *db, alpm_pkg_t *info, const char *filename);
/* cache bullshit */
/* packages */