Set the correct type on the log callback function

Somehow missed this earlier when changing everything to types.
unsigned short -> pmloglevel_t wherever necessary.

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2007-04-26 18:59:02 -04:00
parent 7bbcaaaae9
commit 6a1dfdf292
4 changed files with 5 additions and 4 deletions

View file

@ -70,7 +70,7 @@ typedef enum _pmloglevel_t {
PM_LOG_FUNCTION = 0x10 PM_LOG_FUNCTION = 0x10
} pmloglevel_t; } pmloglevel_t;
typedef void (*alpm_cb_log)(unsigned short, char *); typedef void (*alpm_cb_log)(pmloglevel_t, char *);
int alpm_logaction(char *fmt, ...); int alpm_logaction(char *fmt, ...);
/* /*

View file

@ -567,7 +567,7 @@ void cb_dl_progress(const char *filename, int xfered, int total)
} }
/* Callback to handle notifications from the library */ /* Callback to handle notifications from the library */
void cb_log(unsigned short level, char *msg) void cb_log(pmloglevel_t level, char *msg)
{ {
char str[LOG_STR_LEN] = ""; char str[LOG_STR_LEN] = "";

View file

@ -38,7 +38,7 @@ void cb_trans_progress(pmtransprog_t event, const char *pkgname, int percent,
void cb_dl_progress(const char *filename, int xfered, int total); void cb_dl_progress(const char *filename, int xfered, int total);
/* callback to handle messages/notifications from pacman library */ /* callback to handle messages/notifications from pacman library */
void cb_log(unsigned short level, char *msg); void cb_log(pmloglevel_t level, char *msg);
#endif /* _PM_CALLBACK_H */ #endif /* _PM_CALLBACK_H */

View file

@ -28,12 +28,13 @@
#include <alpm.h> #include <alpm.h>
void output_cb(unsigned short level, char *msg) void output_cb(pmloglevel_t level, char *msg)
{ {
if(strlen(msg)) { if(strlen(msg)) {
switch(level) { switch(level) {
case PM_LOG_ERROR: printf("error: "); break; case PM_LOG_ERROR: printf("error: "); break;
case PM_LOG_WARNING: printf("warning: "); break; case PM_LOG_WARNING: printf("warning: "); break;
default: break;
} }
puts(msg); puts(msg);
} }