From 1b61cc8c69025ddd394401a506b21f16df5d4e6d Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Wed, 24 Jan 2007 03:02:53 +0000 Subject: This mainly deals with code clarity- removing currently unneeded optimizations in order to make the code much more readable and type-checkable. Every enum in the library now has it's own type that should be used instead of the generic 'unsigned char'. In addition, several #define statements dealing with constants were converted to enums. Signed-off-by: Dan McGee --- lib/libalpm/db.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'lib/libalpm/db.h') diff --git a/lib/libalpm/db.h b/lib/libalpm/db.h index 6d9ddd2c..024fb78d 100644 --- a/lib/libalpm/db.h +++ b/lib/libalpm/db.h @@ -27,12 +27,14 @@ #include /* Database entries */ -#define INFRQ_NONE 0x00 -#define INFRQ_DESC 0x01 -#define INFRQ_DEPENDS 0x02 -#define INFRQ_FILES 0x04 -#define INFRQ_SCRIPTLET 0x08 -#define INFRQ_ALL 0xFF +typedef enum _pmdbinfrq_t { + INFRQ_NONE = 0x00, + INFRQ_DESC = 0x01, + INFRQ_DEPENDS = 0x02, + INFRQ_FILES = 0x04, + INFRQ_SCRIPTLET = 0x08, + INFRQ_ALL = 0xFF +} pmdbinfrq_t; /* Database */ struct __pmdb_t { @@ -55,9 +57,9 @@ int _alpm_db_install(pmdb_t *db, const char *dbfile); int _alpm_db_open(pmdb_t *db); 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, unsigned int inforeq, pmpkg_t *info); -int _alpm_db_write(pmdb_t *db, pmpkg_t *info, unsigned int inforeq); +pmpkg_t *_alpm_db_scan(pmdb_t *db, char *target, pmdbinfrq_t inforeq); +int _alpm_db_read(pmdb_t *db, pmdbinfrq_t inforeq, pmpkg_t *info); +int _alpm_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq); int _alpm_db_remove(pmdb_t *db, pmpkg_t *info); int _alpm_db_getlastupdate(pmdb_t *db, char *ts); int _alpm_db_setlastupdate(pmdb_t *db, char *ts); -- cgit v1.2.3-24-g4f1b