Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=ebbaac8416bfa9da7e2be566863dd9a5041114df

commit ebbaac8416bfa9da7e2be566863dd9a5041114df
Author: Michel Hermier <herm...@frugalware.org>
Date:   Fri Jul 29 00:06:05 2011 +0200

pacman.h: declare _pmtranstype_t and use it in trans.*

diff --git a/lib/libpacman/pacman.h b/lib/libpacman/pacman.h
index 6fe681b..9624383 100644
--- a/lib/libpacman/pacman.h
+++ b/lib/libpacman/pacman.h
@@ -257,12 +257,12 @@ int pacman_sync_cleancache(int full);
*/

/* Types */
-enum {
+typedef enum _pmtranstype_t {
PM_TRANS_TYPE_ADD = 1,
PM_TRANS_TYPE_REMOVE,
PM_TRANS_TYPE_UPGRADE,
PM_TRANS_TYPE_SYNC
-};
+} pmtranstype_t;

/* Flags */
#define PM_TRANS_FLAG_NODEPS  0x01
diff --git a/lib/libpacman/trans.c b/lib/libpacman/trans.c
index 171ac7a..e68173e 100644
--- a/lib/libpacman/trans.c
+++ b/lib/libpacman/trans.c
@@ -101,7 +101,7 @@ void _pacman_trans_free(pmtrans_t *trans)
free(trans);
}

-int _pacman_trans_init(pmtrans_t *trans, unsigned char type, unsigned int 
flags, pacman_trans_cb_event event, pacman_trans_cb_conv conv, 
pacman_trans_cb_progress progress)
+int _pacman_trans_init(pmtrans_t *trans, pmtranstype_t type, unsigned int 
flags, pacman_trans_cb_event event, pacman_trans_cb_conv conv, 
pacman_trans_cb_progress progress)
{
/* Sanity checks */
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
diff --git a/lib/libpacman/trans.h b/lib/libpacman/trans.h
index c2db764..fef6ee2 100644
--- a/lib/libpacman/trans.h
+++ b/lib/libpacman/trans.h
@@ -37,7 +37,7 @@ enum {
#include "pacman.h"

typedef struct __pmtrans_t {
-       unsigned char type;
+       pmtranstype_t type;
unsigned int flags;
unsigned char state;
pmlist_t *targets;     /* pmlist_t of (char *) */
@@ -76,7 +76,7 @@ do { \

pmtrans_t *_pacman_trans_new(void);
void _pacman_trans_free(pmtrans_t *trans);
-int _pacman_trans_init(pmtrans_t *trans, unsigned char type, unsigned int 
flags, pacman_trans_cb_event event, pacman_trans_cb_conv conv, 
pacman_trans_cb_progress progress);
+int _pacman_trans_init(pmtrans_t *trans, pmtranstype_t type, unsigned int 
flags, pacman_trans_cb_event event, pacman_trans_cb_conv conv, 
pacman_trans_cb_progress progress);
int _pacman_trans_sysupgrade(pmtrans_t *trans);
int _pacman_trans_addtarget(pmtrans_t *trans, const char *target);
int _pacman_trans_prepare(pmtrans_t *trans, pmlist_t **data);
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to