clang-format the files

This commit is contained in:
dota17
2020-03-28 10:25:00 +08:00
parent c117d8a8a8
commit 8b162c4b89
54 changed files with 2860 additions and 2713 deletions

63
debug.c
View File

@@ -11,17 +11,17 @@
#include "config.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#if HAVE_SYSLOG_H
# include <syslog.h>
#include <syslog.h>
#endif /* HAVE_SYSLOG_H */
#if HAVE_UNISTD_H
# include <unistd.h>
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
#if HAVE_SYS_PARAM_H
@@ -33,51 +33,64 @@
static int _syslog = 0;
static int _debug = 0;
void mc_set_debug(int debug) { _debug = debug; }
int mc_get_debug(void) { return _debug; }
void mc_set_debug(int debug)
{
_debug = debug;
}
int mc_get_debug(void)
{
return _debug;
}
extern void mc_set_syslog(int syslog)
{
_syslog = syslog;
_syslog = syslog;
}
void mc_debug(const char *msg, ...)
{
va_list ap;
if(_debug) {
va_start(ap, msg);
va_list ap;
if (_debug)
{
va_start(ap, msg);
#if HAVE_VSYSLOG
if(_syslog) {
vsyslog(LOG_DEBUG, msg, ap);
} else
if (_syslog)
{
vsyslog(LOG_DEBUG, msg, ap);
}
else
#endif
vprintf(msg, ap);
va_end(ap);
}
vprintf(msg, ap);
va_end(ap);
}
}
void mc_error(const char *msg, ...)
{
va_list ap;
va_start(ap, msg);
va_list ap;
va_start(ap, msg);
#if HAVE_VSYSLOG
if(_syslog) {
if (_syslog)
{
vsyslog(LOG_ERR, msg, ap);
} else
}
else
#endif
vfprintf(stderr, msg, ap);
va_end(ap);
va_end(ap);
}
void mc_info(const char *msg, ...)
{
va_list ap;
va_start(ap, msg);
va_list ap;
va_start(ap, msg);
#if HAVE_VSYSLOG
if(_syslog) {
if (_syslog)
{
vsyslog(LOG_INFO, msg, ap);
} else
}
else
#endif
vfprintf(stderr, msg, ap);
va_end(ap);
va_end(ap);
}