mirror of
https://github.com/moparisthebest/pacman
synced 2024-11-15 13:55:09 -05:00
Removed the "__" prefix from __pm_logcb and __pm_logmask
Not needed for library internal data
This commit is contained in:
parent
49415cb675
commit
b0f613c211
@ -37,8 +37,8 @@
|
|||||||
#include "handle.h"
|
#include "handle.h"
|
||||||
|
|
||||||
/* log */
|
/* log */
|
||||||
extern alpm_cb_log __pm_logcb;
|
extern alpm_cb_log pm_logcb;
|
||||||
extern unsigned char __pm_logmask;
|
extern unsigned char pm_logmask;
|
||||||
|
|
||||||
pmhandle_t *handle_new()
|
pmhandle_t *handle_new()
|
||||||
{
|
{
|
||||||
@ -189,10 +189,10 @@ int handle_set_option(pmhandle_t *handle, unsigned char val, unsigned long data)
|
|||||||
_alpm_log(PM_LOG_FLOW2, "PM_OPT_USESYSLOG set to '%d'", handle->usesyslog);
|
_alpm_log(PM_LOG_FLOW2, "PM_OPT_USESYSLOG set to '%d'", handle->usesyslog);
|
||||||
break;
|
break;
|
||||||
case PM_OPT_LOGCB:
|
case PM_OPT_LOGCB:
|
||||||
__pm_logcb = (alpm_cb_log)data;
|
pm_logcb = (alpm_cb_log)data;
|
||||||
break;
|
break;
|
||||||
case PM_OPT_LOGMASK:
|
case PM_OPT_LOGMASK:
|
||||||
__pm_logmask = (unsigned char)data;
|
pm_logmask = (unsigned char)data;
|
||||||
_alpm_log(PM_LOG_FLOW2, "PM_OPT_LOGMASK set to '%02x'", (unsigned char)data);
|
_alpm_log(PM_LOG_FLOW2, "PM_OPT_LOGMASK set to '%02x'", (unsigned char)data);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -216,8 +216,8 @@ int handle_get_option(pmhandle_t *handle, unsigned char val, long *data)
|
|||||||
case PM_OPT_NOUPGRADE: *data = (long)handle->noupgrade; break;
|
case PM_OPT_NOUPGRADE: *data = (long)handle->noupgrade; break;
|
||||||
case PM_OPT_IGNOREPKG: *data = (long)handle->ignorepkg; break;
|
case PM_OPT_IGNOREPKG: *data = (long)handle->ignorepkg; break;
|
||||||
case PM_OPT_USESYSLOG: *data = handle->usesyslog; break;
|
case PM_OPT_USESYSLOG: *data = handle->usesyslog; break;
|
||||||
case PM_OPT_LOGCB: *data = (long)__pm_logcb; break;
|
case PM_OPT_LOGCB: *data = (long)pm_logcb; break;
|
||||||
case PM_OPT_LOGMASK: *data = __pm_logmask; break;
|
case PM_OPT_LOGMASK: *data = pm_logmask; break;
|
||||||
default:
|
default:
|
||||||
PM_RET_ERR(PM_ERR_WRONG_ARGS, -1);
|
PM_RET_ERR(PM_ERR_WRONG_ARGS, -1);
|
||||||
break;
|
break;
|
||||||
|
@ -28,24 +28,24 @@
|
|||||||
|
|
||||||
/* Internal library log mechanism */
|
/* Internal library log mechanism */
|
||||||
|
|
||||||
alpm_cb_log __pm_logcb = NULL;
|
alpm_cb_log pm_logcb = NULL;
|
||||||
unsigned char __pm_logmask = 0;
|
unsigned char pm_logmask = 0;
|
||||||
|
|
||||||
void _alpm_log(unsigned char flag, char *fmt, ...)
|
void _alpm_log(unsigned char flag, char *fmt, ...)
|
||||||
{
|
{
|
||||||
char str[LOG_STR_LEN];
|
char str[LOG_STR_LEN];
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
if(__pm_logcb == NULL) {
|
if(pm_logcb == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(flag & __pm_logmask) {
|
if(flag & pm_logmask) {
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
vsnprintf(str, LOG_STR_LEN, fmt, args);
|
vsnprintf(str, LOG_STR_LEN, fmt, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
__pm_logcb(flag, str);
|
pm_logcb(flag, str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user