summaryrefslogtreecommitdiff
path: root/lib/libalpm/handle.c
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2007-01-24 03:02:53 +0000
committerAaron Griffin <aaron@archlinux.org>2007-01-24 03:02:53 +0000
commit1b61cc8c69025ddd394401a506b21f16df5d4e6d (patch)
treec99b4717e8eeb23295603d60eb97e27cc821a730 /lib/libalpm/handle.c
parent838767205319e5d436194cc4a5aaa08ccf4f6077 (diff)
downloadpacman-1b61cc8c69025ddd394401a506b21f16df5d4e6d.tar.xz
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 <dpmcgee@gmail.com>
Diffstat (limited to 'lib/libalpm/handle.c')
-rw-r--r--lib/libalpm/handle.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
index 42490f6e..1c31e41d 100644
--- a/lib/libalpm/handle.c
+++ b/lib/libalpm/handle.c
@@ -117,12 +117,12 @@ int _alpm_handle_free(pmhandle_t *handle)
alpm_cb_log alpm_option_get_logcb() { return handle->logcb; }
alpm_cb_download alpm_option_get_dlcb() { return handle->dlcb; }
-unsigned char alpm_option_get_logmask() { return handle->logmask; }
+unsigned short alpm_option_get_logmask() { return handle->logmask; }
const char *alpm_option_get_root() { return handle->root; }
const char *alpm_option_get_dbpath() { return handle->dbpath; }
const char *alpm_option_get_cachedir() { return handle->cachedir; }
const char *alpm_option_get_logfile() { return handle->logfile; }
-unsigned char alpm_option_get_usesyslog() { return handle->usesyslog; }
+unsigned short alpm_option_get_usesyslog() { return handle->usesyslog; }
alpm_list_t *alpm_option_get_noupgrades() { return handle->noupgrade; }
alpm_list_t *alpm_option_get_noextracts() { return handle->noextract; }
alpm_list_t *alpm_option_get_ignorepkgs() { return handle->ignorepkg; }
@@ -135,13 +135,16 @@ alpm_list_t *alpm_option_get_needles() { return handle->needles; }
unsigned short alpm_option_get_usecolor() { return handle->use_color; }
pmdb_t *alpm_option_get_localdb() { return handle->db_local; }
-alpm_list_t *alpm_option_get_syncdbs() { return handle->dbs_sync; }
+alpm_list_t *alpm_option_get_syncdbs()
+{
+ return handle->dbs_sync;
+}
void alpm_option_set_logcb(alpm_cb_log cb) { handle->logcb = cb; }
void alpm_option_set_dlcb(alpm_cb_download cb) { handle->dlcb = cb; }
-void alpm_option_set_logmask(unsigned char mask) { handle->logmask = mask; }
+void alpm_option_set_logmask(unsigned short mask) { handle->logmask = mask; }
void alpm_option_set_root(const char *root)
{
@@ -176,12 +179,16 @@ void alpm_option_set_logfile(const char *logfile)
}
}
-void alpm_option_set_usesyslog(unsigned char usesyslog) { handle->usesyslog = usesyslog; }
+void alpm_option_set_usesyslog(unsigned short usesyslog)
+{
+ handle->usesyslog = usesyslog;
+}
void alpm_option_add_noupgrade(char *pkg)
{
handle->noupgrade = alpm_list_add(handle->noupgrade, strdup(pkg));
}
+
void alpm_option_set_noupgrades(alpm_list_t *noupgrade)
{
if(handle->noupgrade) FREELIST(handle->noupgrade);
@@ -218,7 +225,10 @@ void alpm_option_set_holdpkgs(alpm_list_t *holdpkgs)
if(holdpkgs) handle->holdpkg = holdpkgs;
}
-void alpm_option_set_upgradedelay(time_t delay) { handle->upgradedelay = delay; }
+void alpm_option_set_upgradedelay(time_t delay)
+{
+ handle->upgradedelay = delay;
+}
void alpm_option_set_xfercommand(const char *cmd)
{
@@ -226,7 +236,10 @@ void alpm_option_set_xfercommand(const char *cmd)
if(cmd) handle->xfercommand = strdup(cmd);
}
-void alpm_option_set_nopassiveftp(unsigned short nopasv) { handle->nopassiveftp = nopasv; }
+void alpm_option_set_nopassiveftp(unsigned short nopasv)
+{
+ handle->nopassiveftp = nopasv;
+}
void alpm_option_set_chomp(unsigned short chomp) { handle->chomp = chomp; }
@@ -239,6 +252,9 @@ void alpm_option_set_needles(alpm_list_t *needles)
if(handle->needles) FREELIST(handle->needles);
if(needles) handle->needles = needles;
}
-void alpm_option_set_usecolor(unsigned short usecolor) { handle->use_color = usecolor; }
+void alpm_option_set_usecolor(unsigned short usecolor)
+{
+ handle->use_color = usecolor;
+}
/* vim: set ts=2 sw=2 et: */