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/package.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'lib/libalpm/package.h') diff --git a/lib/libalpm/package.h b/lib/libalpm/package.h index 616131d5..50052326 100644 --- a/lib/libalpm/package.h +++ b/lib/libalpm/package.h @@ -30,11 +30,12 @@ #endif #include "alpm.h" +#include "db.h" -enum { +typedef enum _pmpkgfrom_t { PKG_FROM_CACHE = 1, PKG_FROM_FILE -}; +} pmpkgfrom_t; /* Packages */ #define PKG_FILENAME_LEN 512 @@ -65,10 +66,10 @@ struct __pmpkg_t { char arch[PKG_ARCH_LEN]; unsigned long size; unsigned long isize; - unsigned char scriptlet; - unsigned char force; + unsigned short scriptlet; + unsigned short force; time_t date; - unsigned char reason; + pmpkgreason_t reason; alpm_list_t *desc_localized; alpm_list_t *license; alpm_list_t *replaces; @@ -81,9 +82,9 @@ struct __pmpkg_t { alpm_list_t *conflicts; alpm_list_t *provides; /* internal */ - unsigned char origin; + unsigned short origin; void *data; - unsigned char infolevel; + pmdbinfrq_t infolevel; }; #define FREEPKG(p) do { if(p){_alpm_pkg_free(p); p = NULL;}} while(0) -- cgit v1.2.3-54-g00ecf