Changed address report format

This commit is contained in:
john 2019-12-06 08:44:51 -05:00
parent f99812a97b
commit 71b6b1f97b
14 changed files with 686 additions and 68 deletions

View File

@ -92,7 +92,7 @@ struct Global G= {
.version= {
.major= 0,
.minor= 13,
.patch= 9
.patch= 10
},
.bitTuples.flags= GlobalFlagBitTuples

14
ez_es.c
View File

@ -5,9 +5,11 @@
/***************************************************/
int _ez_ES_registerFd (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
int fd,
short events,
int (*callback_f)(void *ctxt, int fd, short events),
@ -29,9 +31,11 @@ int _ez_ES_registerFd (
/***************************************************/
int _ez_ES_registerSignal (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
int signum,
int (*callback_f)(void *ctxt, int signo),
void *ctxt
@ -52,9 +56,11 @@ int _ez_ES_registerSignal (
/***************************************************/
int _ez_ES_registerVSignal (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
int signum,
int (*callback_f)(void *ctxt, int signo),
void *ctxt
@ -74,9 +80,11 @@ int _ez_ES_registerVSignal (
/***************************************************/
int _ez_ES_VSignal (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
pthread_t tid,
int signum
)
@ -95,9 +103,11 @@ int _ez_ES_VSignal (
/***************************************************/
int _ez_ES_registerTimer (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
int64_t pause_ms,
int64_t interval_ms,
int (*callback_f)(void *ctxt),
@ -118,9 +128,11 @@ int _ez_ES_registerTimer (
/***************************************************/
int _ez_ES_unregister (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
int key
)
{
@ -138,9 +150,11 @@ int _ez_ES_unregister (
/***************************************************/
int _ez_ES_run (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName
#endif
)
{
int rtn= ES_run();

63
ez_es.h
View File

@ -12,12 +12,19 @@
extern "C" {
#endif
#define ez_ES_registerFd(fd, events, callback_f, ctxt) \
#ifdef DEBUG
# define ez_ES_registerFd(fd, events, callback_f, ctxt) \
_ez_ES_registerFd(__FILE__, __LINE__, __FUNCTION__, fd, events, callback_f, ctxt)
#else
# define ez_ES_registerFd(fd, events, callback_f, ctxt) \
_ez_ES_registerFd(fd, events, callback_f, ctxt)
#endif
int _ez_ES_registerFd (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
int fd,
short events,
int (*callback_f)(void *ctxt, int fd, short events),
@ -26,44 +33,72 @@ int _ez_ES_registerFd (
#define ez_ES_registerSignal(signum, callback_f, ctxt) \
#ifdef DEBUG
# define ez_ES_registerSignal(signum, callback_f, ctxt) \
_ez_ES_registerSignal(__FILE__, __LINE__, __FUNCTION__, signum, callback_f, ctxt)
#else
# define ez_ES_registerSignal(signum, callback_f, ctxt) \
_ez_ES_registerSignal(signum, callback_f, ctxt)
#endif
int _ez_ES_registerSignal (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
int signum,
int (*callback_f)(void *ctxt, int signo),
void *ctxt
);
#define ez_ES_registerVSignal(signum, callback_f, ctxt) \
#ifdef DEBUG
# define ez_ES_registerVSignal(signum, callback_f, ctxt) \
_ez_ES_registerVSignal(__FILE__, __LINE__, __FUNCTION__, signum, callback_f, ctxt)
#else
# define ez_ES_registerVSignal(signum, callback_f, ctxt) \
_ez_ES_registerVSignal(signum, callback_f, ctxt)
#endif
int _ez_ES_registerVSignal (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
int signum,
int (*callback_f)(void *ctxt, int signo),
void *ctxt
);
#define ez_ES_VSignal(tid, signum) \
#ifdef DEBUG
# define ez_ES_VSignal(tid, signum) \
_ez_ES_VSignal(__FILE__, __LINE__, __FUNCTION__, tid, signum)
#else
# define ez_ES_VSignal(tid, signum) \
_ez_ES_VSignal(tid, signum)
#endif
int _ez_ES_VSignal (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
pthread_t tid,
int signum
);
#define ez_ES_registerTimer(pause_ms, interval_ms, callback_f, ctxt) \
#ifdef DEBUG
# define ez_ES_registerTimer(pause_ms, interval_ms, callback_f, ctxt) \
_ez_ES_registerTimer(__FILE__, __LINE__, __FUNCTION__, pause_ms, interval_ms, callback_f, ctxt)
#else
# define ez_ES_registerTimer(pause_ms, interval_ms, callback_f, ctxt) \
_ez_ES_registerTimer(pause_ms, interval_ms, callback_f, ctxt)
#endif
int _ez_ES_registerTimer (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
int64_t pause_ms,
int64_t interval_ms,
int (*callback_f)(void *ctxt),
@ -71,21 +106,35 @@ int _ez_ES_registerTimer (
);
#define ez_ES_unregister(key) \
#ifdef DEBUG
# define ez_ES_unregister(key) \
{_ez_ES_unregister(__FILE__, __LINE__, __FUNCTION__, key); (key)= 0;}
#else
# define ez_ES_unregister(key) \
{_ez_ES_unregister(key); (key)= 0;}
#endif
int _ez_ES_unregister (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
int key
);
#define ez_ES_run() \
#ifdef DEBUG
# define ez_ES_run() \
_ez_ES_run(__FILE__, __LINE__, __FUNCTION__)
#else
# define ez_ES_run() \
_ez_ES_run()
#endif
int _ez_ES_run (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName
#endif
);
#ifdef __cplusplus

View File

@ -24,9 +24,11 @@
/***************************************************/
int _ez_getaddrinfo_a(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
int mode,
struct gaicb *list[],
int nitems,
@ -53,9 +55,11 @@ int _ez_getaddrinfo_a(
/***************************************************/
int _ez_gai_suspend(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const struct gaicb * const list[],
int nitems,
const struct timespec *timeout

View File

@ -27,24 +27,38 @@
extern "C" {
#endif
#define ez_getaddrinfo_a(mode, list, nItems, sevp) \
#ifdef DEBUG
# define ez_getaddrinfo_a(mode, list, nItems, sevp) \
_ez_getaddrinfo_a(__FILE__, __LINE__, __FUNCTION__, mode, list, nItems, sevp)
#else
# define ez_getaddrinfo_a(mode, list, nItems, sevp) \
_ez_getaddrinfo_a(mode, list, nItems, sevp)
#endif
int _ez_getaddrinfo_a(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
int mode,
struct gaicb *list[],
int nitems,
struct sigevent *sevp
);
#define ez_gai_suspend(list, nItems, timeout) \
#ifdef DEBUG
# define ez_gai_suspend(list, nItems, timeout) \
_ez_gai_suspend(__FILE__, __LINE__, __FUNCTION__, list, nItems, timeout)
#else
# define ez_gai_suspend(list, nItems, timeout) \
_ez_gai_suspend(list, nItems, timeout)
#endif
int _ez_gai_suspend(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const struct gaicb * const list[],
int nitems,
const struct timespec *timeout

View File

@ -26,9 +26,11 @@
/***************************************************/
int _ez_fputs (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *s,
FILE *stream
)
@ -47,9 +49,11 @@ int _ez_fputs (
/***************************************************/
int _ez_fputc (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
int c,
FILE *stream
)
@ -68,9 +72,11 @@ int _ez_fputc (
/***************************************************/
int _ez_fprintf (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
FILE *stream,
const char *fmt,
...
@ -97,9 +103,11 @@ int _ez_fprintf (
/***************************************************/
FILE* _ez_popen (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *command,
const char *type
)
@ -119,9 +127,11 @@ FILE* _ez_popen (
/***************************************************/
FILE* _ez_fopen (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *pathname,
const char *mode
)
@ -140,9 +150,11 @@ FILE* _ez_fopen (
/***************************************************/
int _ez_fclose (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
FILE *stream
)
{
@ -160,9 +172,11 @@ int _ez_fclose (
/***************************************************/
int _ez_fflush (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
FILE *stream
)
{
@ -180,9 +194,11 @@ int _ez_fflush (
/***************************************************/
size_t _ez_fread (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
void *ptr,
size_t size,
size_t nmemb,
@ -203,9 +219,11 @@ size_t _ez_fread (
/***************************************************/
size_t _ez_fwrite (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const void *ptr,
size_t size,
size_t nmemb,
@ -226,9 +244,11 @@ size_t _ez_fwrite (
/***************************************************/
int _ez_pclose (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
FILE *stream
)
{
@ -246,9 +266,11 @@ int _ez_pclose (
/***************************************************/
char* _ez_fgets (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
char *s,
int size,
FILE *stream
@ -268,9 +290,11 @@ char* _ez_fgets (
/***************************************************/
int _ez_remove (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *pathname
)
{
@ -288,9 +312,11 @@ int _ez_remove (
/***************************************************/
int _ez_rename (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *oldpath,
const char *newpath
)
@ -309,9 +335,11 @@ int _ez_rename (
/***************************************************/
DIR* _ez_opendir (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *name
)
{
@ -329,9 +357,11 @@ DIR* _ez_opendir (
/***************************************************/
int _ez_closedir (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
DIR *dirp
)
{
@ -349,9 +379,11 @@ int _ez_closedir (
/***************************************************/
struct dirent* _ez_readdir (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
DIR *dirp
)
{
@ -374,9 +406,11 @@ struct dirent* _ez_readdir (
/***************************************************/
int _ez_close (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
int fd
)
{
@ -394,9 +428,11 @@ int _ez_close (
/***************************************************/
ssize_t _ez_write (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
int fd,
const void *buf,
size_t count
@ -416,9 +452,11 @@ ssize_t _ez_write (
/***************************************************/
int _ez_stat (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *pathname,
struct stat *statbuf
)
@ -437,9 +475,11 @@ int _ez_stat (
/***************************************************/
int _ez_mkdir (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *pathname,
mode_t mode
)
@ -458,9 +498,11 @@ int _ez_mkdir (
/***************************************************/
int _ez_rmdir (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *pathname
)
{
@ -478,9 +520,11 @@ int _ez_rmdir (
/***************************************************/
int _ez_unlink (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *pathname
)
{
@ -498,9 +542,11 @@ int _ez_unlink (
/***************************************************/
int _ez_getaddrinfo(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *node,
const char *service,
const struct addrinfo *hints,
@ -538,9 +584,11 @@ int _ez_getaddrinfo(
/***************************************************/
int _ez_getnameinfo(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const struct sockaddr *addr,
socklen_t addrlen,
char *host,
@ -580,9 +628,11 @@ int _ez_getnameinfo(
/***************************************************/
int _ez_flock (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
int fd,
int operation
)
@ -609,9 +659,11 @@ int _ez_flock (
/***************************************************/
int _ez_open(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *pathname,
int flags,
mode_t mode
@ -639,9 +691,11 @@ int _ez_open(
/***************************************************/
int _ez_access(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *pathname,
int mode
)
@ -667,9 +721,11 @@ int _ez_access(
/***************************************************/
char *_ez_strptime(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *s,
const char *format,
struct tm *tm
@ -689,9 +745,11 @@ char *_ez_strptime(
/***************************************************/
int _ez_seteuid(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
uid_t euid
)
{
@ -708,9 +766,11 @@ int _ez_seteuid(
/***************************************************/
int _ez_setegid(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
gid_t egid
)
{
@ -727,9 +787,11 @@ int _ez_setegid(
/***************************************************/
struct group* _ez_getgrnam(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *name
)
{
@ -760,9 +822,11 @@ struct group* _ez_getgrnam(
/***************************************************/
int _ez_chown(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *pathname,
uid_t owner,
gid_t group
@ -781,9 +845,11 @@ int _ez_chown(
/***************************************************/
int _ez_fchown(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
int fd,
uid_t owner,
gid_t group
@ -802,9 +868,11 @@ int _ez_fchown(
/***************************************************/
int _ez_fchmod(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
int fd,
mode_t mode
)
@ -822,9 +890,11 @@ int _ez_fchmod(
/***************************************************/
int _ez_setuid(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
uid_t uid
)
{
@ -841,9 +911,11 @@ int _ez_setuid(
/***************************************************/
int _ez_setgid(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
gid_t gid
)
{

333
ez_libc.h
View File

@ -43,126 +43,210 @@ glibc calls with boilerplate error handling.
extern "C" {
#endif
#define ez_strptime(s, format, tm) \
#ifdef DEBUG
# define ez_strptime(s, format, tm) \
_ez_strptime(__FILE__, __LINE__, __FUNCTION__, s, format, tm)
#else
# define ez_strptime(s, format, tm) \
_ez_strptime(s, format, tm)
#endif
char *_ez_strptime(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *s,
const char *format,
struct tm *tm
);
#define ez_access(pathname, mode) \
#ifdef DEBUG
# define ez_access(pathname, mode) \
_ez_access(__FILE__, __LINE__, __FUNCTION__, pathname, mode)
#else
# define ez_access(pathname, mode) \
_ez_access(pathname, mode)
#endif
int _ez_access(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *pathname,
int mode
);
#define ez_open(pathname, flags, mode) \
#ifdef DEBUG
# define ez_open(pathname, flags, mode) \
_ez_open(__FILE__, __LINE__, __FUNCTION__, pathname, flags, mode)
#else
# define ez_open(pathname, flags, mode) \
_ez_open(pathname, flags, mode)
#endif
int _ez_open(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *pathname,
int flags,
mode_t mode
);
#define ez_fputs(s, stream) \
#ifdef DEBUG
# define ez_fputs(s, stream) \
_ez_fputs(__FILE__, __LINE__, __FUNCTION__, s, stream)
#else
# define ez_fputs(s, stream) \
_ez_fputs(s, stream)
#endif
int _ez_fputs (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *s,
FILE *stream
);
#define ez_fputc(c, stream) \
#ifdef DEBUG
# define ez_fputc(c, stream) \
_ez_fputc(__FILE__, __LINE__, __FUNCTION__, c, stream)
#else
# define ez_fputc(c, stream) \
_ez_fputc(c, stream)
#endif
int _ez_fputc (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
int c,
FILE *stream
);
#define ez_fprintf(stream, fmt, ...) \
#ifdef DEBUG
# define ez_fprintf(stream, fmt, ...) \
_ez_fprintf(__FILE__, __LINE__, __FUNCTION__, stream, fmt, ##__VA_ARGS__)
#else
# define ez_fprintf(stream, fmt, ...) \
_ez_fprintf(stream, fmt, ##__VA_ARGS__)
#endif
int _ez_fprintf (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
FILE *stream,
const char *fmt,
...
);
#define ez_popen(command, type) \
#ifdef DEBUG
# define ez_popen(command, type) \
_ez_popen(__FILE__, __LINE__, __FUNCTION__, command, type)
#else
# define ez_popen(command, type) \
_ez_popen(command, type)
#endif
FILE* _ez_popen (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *command,
const char *type
);
#define ez_fopen(pathname, mode) \
#ifdef DEBUG
# define ez_fopen(pathname, mode) \
_ez_fopen(__FILE__, __LINE__, __FUNCTION__, pathname, mode)
#else
# define ez_fopen(pathname, mode) \
_ez_fopen(pathname, mode)
#endif
FILE* _ez_fopen (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *pathname,
const char *mode
);
#define ez_fclose(stream) \
#ifdef DEBUG
# define ez_fclose(stream) \
_ez_fclose(__FILE__, __LINE__, __FUNCTION__, stream)
#else
# define ez_fclose(stream) \
_ez_fclose(stream)
#endif
int _ez_fclose (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
FILE *stream
);
#define ez_fflush(stream) \
#ifdef DEBUG
# define ez_fflush(stream) \
_ez_fflush(__FILE__, __LINE__, __FUNCTION__, stream)
#else
# define ez_fflush(stream) \
_ez_fflush(stream)
#endif
int _ez_fflush (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
FILE *stream
);
#define ez_fread(ptr, size, nmemb, stream) \
#ifdef DEBUG
# define ez_fread(ptr, size, nmemb, stream) \
_ez_fread(__FILE__, __LINE__, __FUNCTION__, ptr, size, nmemb, stream)
#else
# define ez_fread(ptr, size, nmemb, stream) \
_ez_fread(ptr, size, nmemb, stream)
#endif
size_t _ez_fread(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
void *ptr,
size_t size,
size_t nmemb,
FILE *stream
);
#define ez_fwrite(ptr, size, nmemb, stream) \
#ifdef DEBUG
# define ez_fwrite(ptr, size, nmemb, stream) \
_ez_fwrite(__FILE__, __LINE__, __FUNCTION__, ptr, size, nmemb, stream)
#else
# define ez_fwrite(ptr, size, nmemb, stream) \
_ez_fwrite(ptr, size, nmemb, stream)
#endif
size_t _ez_fwrite(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const void *ptr,
size_t size,
size_t nmemb,
@ -170,78 +254,134 @@ size_t _ez_fwrite(
);
#define ez_pclose(stream) \
#ifdef DEBUG
# define ez_pclose(stream) \
_ez_pclose(__FILE__, __LINE__, __FUNCTION__, stream)
#else
# define ez_pclose(stream) \
_ez_pclose(stream)
#endif
int _ez_pclose (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
FILE *stream
);
#define ez_fgets(s, size, stream) \
#ifdef DEBUG
# define ez_fgets(s, size, stream) \
_ez_fgets(__FILE__, __LINE__, __FUNCTION__, s, size, stream)
#else
# define ez_fgets(s, size, stream) \
_ez_fgets(s, size, stream)
#endif
char* _ez_fgets (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
char *s,
int size,
FILE *stream
);
#define ez_remove(pathname) \
#ifdef DEBUG
# define ez_remove(pathname) \
_ez_remove(__FILE__, __LINE__, __FUNCTION__, pathname)
#else
# define ez_remove(pathname) \
_ez_remove(pathname)
#endif
int _ez_remove (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *pathname
);
#define ez_rename(oldpath, newpath) \
#ifdef DEBUG
# define ez_rename(oldpath, newpath) \
_ez_rename(__FILE__, __LINE__, __FUNCTION__, oldpath, newpath)
#else
# define ez_rename(oldpath, newpath) \
_ez_rename(oldpath, newpath)
#endif
int _ez_rename (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *oldpath,
const char *newpath
);
#define ez_opendir(name) \
#ifdef DEBUG
# define ez_opendir(name) \
_ez_opendir(__FILE__, __LINE__, __FUNCTION__, name)
#else
# define ez_opendir(name) \
_ez_opendir(name)
#endif
DIR* _ez_opendir (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *name
);
#define ez_closedir(dirp) \
#ifdef DEBUG
# define ez_closedir(dirp) \
_ez_closedir(__FILE__, __LINE__, __FUNCTION__, dirp)
#else
# define ez_closedir(dirp) \
_ez_closedir(dirp)
#endif
int _ez_closedir (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
DIR *dirp
);
#define ez_readdir(dirp) \
#ifdef DEBUG
# define ez_readdir(dirp) \
_ez_readdir(__FILE__, __LINE__, __FUNCTION__, dirp)
#else
# define ez_readdir(dirp) \
_ez_readdir(dirp)
#endif
struct dirent* _ez_readdir (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
DIR *dirp
);
#define ez_close(fd) \
#ifdef DEBUG
# define ez_close(fd) \
_ez_close(__FILE__, __LINE__, __FUNCTION__, fd)
#else
# define ez_close(fd) \
_ez_close(fd)
#endif
int _ez_close (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
int fd
);
@ -259,82 +399,138 @@ ssize_t _ez_read (
);
#endif
#define ez_write(fd, buf, count) \
#ifdef DEBUG
# define ez_write(fd, buf, count) \
_ez_write(__FILE__, __LINE__, __FUNCTION__, fd, buf, count)
#else
# define ez_write(fd, buf, count) \
_ez_write(fd, buf, count)
#endif
ssize_t _ez_write (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
int fd,
const void *buf,
size_t count
);
#define ez_stat(pathname, statbuf) \
#ifdef DEBUG
# define ez_stat(pathname, statbuf) \
_ez_stat(__FILE__, __LINE__, __FUNCTION__, pathname, statbuf)
#else
# define ez_stat(pathname, statbuf) \
_ez_stat(pathname, statbuf)
#endif
int _ez_stat (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *pathname,
struct stat *statbuf
);
#define ez_mkdir(pathname, mode) \
#ifdef DEBUG
# define ez_mkdir(pathname, mode) \
_ez_mkdir(__FILE__, __LINE__, __FUNCTION__, pathname, mode)
#else
# define ez_mkdir(pathname, mode) \
_ez_mkdir(pathname, mode)
#endif
int _ez_mkdir (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *pathname,
mode_t mode
);
#define ez_rmdir(pathname) \
#ifdef DEBUG
# define ez_rmdir(pathname) \
_ez_rmdir(__FILE__, __LINE__, __FUNCTION__, pathname)
#else
# define ez_rmdir(pathname) \
_ez_rmdir(pathname)
#endif
int _ez_rmdir (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *pathname
);
#define ez_unlink(pathname) \
#ifdef DEBUG
# define ez_unlink(pathname) \
_ez_unlink(__FILE__, __LINE__, __FUNCTION__, pathname)
#else
# define ez_unlink(pathname) \
_ez_unlink(pathname)
#endif
int _ez_unlink (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *pathname
);
#define ez_unlink(pathname) \
#ifdef DEBUG
# define ez_unlink(pathname) \
_ez_unlink(__FILE__, __LINE__, __FUNCTION__, pathname)
#else
# define ez_unlink(pathname) \
_ez_unlink(pathname)
#endif
int _ez_unlink (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *pathname
);
#define ez_getaddrinfo(node, service, hints, res) \
#ifdef DEBUG
# define ez_getaddrinfo(node, service, hints, res) \
_ez_getaddrinfo(__FILE__, __LINE__, __FUNCTION__, node, service, hints, res)
#else
# define ez_getaddrinfo(node, service, hints, res) \
_ez_getaddrinfo(node, service, hints, res)
#endif
int _ez_getaddrinfo(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *node,
const char *service,
const struct addrinfo *hints,
struct addrinfo **res
);
#define ez_getnameinfo(addr, addrlen, host, hostlen, serv, servlen, flags) \
#ifdef DEBUG
# define ez_getnameinfo(addr, addrlen, host, hostlen, serv, servlen, flags) \
_ez_getnameinfo(__FILE__, __LINE__, __FUNCTION__, addr, addrlen, host, hostlen, serv, servlen, flags)
#else
# define ez_getnameinfo(addr, addrlen, host, hostlen, serv, servlen, flags) \
_ez_getnameinfo(addr, addrlen, host, hostlen, serv, servlen, flags)
#endif
int _ez_getnameinfo(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const struct sockaddr *addr,
socklen_t addrlen,
char *host,
@ -344,90 +540,153 @@ int _ez_getnameinfo(
int flags
);
#define ez_flock(fd, operation) \
#ifdef DEBUG
# define ez_flock(fd, operation) \
_ez_flock(__FILE__, __LINE__, __FUNCTION__, fd, operation)
#else
# define ez_flock(fd, operation) \
_ez_flock(fd, operation)
#endif
int _ez_flock (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
int fd,
int operation
);
#define ez_setuid(uid) \
#ifdef DEBUG
# define ez_setuid(uid) \
_ez_setuid(__FILE__, __LINE__, __FUNCTION__, uid)
#else
# define ez_setuid(uid) \
_ez_setuid(uid)
#endif
int _ez_setuid(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
uid_t uid
);
#define ez_setgid(gid) \
#ifdef DEBUG
# define ez_setgid(gid) \
_ez_setgid(__FILE__, __LINE__, __FUNCTION__, gid)
#else
# define ez_setgid(gid) \
_ez_setgid(gid)
#endif
int _ez_setgid(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
gid_t gid
);
#define ez_seteuid(euid) \
#ifdef DEBUG
# define ez_seteuid(euid) \
_ez_seteuid(__FILE__, __LINE__, __FUNCTION__, euid)
#else
# define ez_seteuid(euid) \
_ez_seteuid(euid)
#endif
int _ez_seteuid(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
uid_t euid
);
#define ez_setegid(egid) \
#ifdef DEBUG
# define ez_setegid(egid) \
_ez_setegid(__FILE__, __LINE__, __FUNCTION__, egid)
#else
# define ez_setegid(egid) \
_ez_setegid(egid)
#endif
int _ez_setegid(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
gid_t egid
);
#define ez_getgrnam(name) \
#ifdef DEBUG
# define ez_getgrnam(name) \
_ez_getgrnam(__FILE__, __LINE__, __FUNCTION__, name)
#else
# define ez_getgrnam(name) \
_ez_getgrnam(name)
#endif
struct group* _ez_getgrnam(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *name
);
#define ez_chown(pathname, owner, group) \
#ifdef DEBUG
# define ez_chown(pathname, owner, group) \
_ez_chown(__FILE__, __LINE__, __FUNCTION__, pathname, owner, group)
#else
# define ez_chown(pathname, owner, group) \
_ez_chown(pathname, owner, group)
#endif
int _ez_chown(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *pathname,
uid_t owner,
gid_t group
);
#define ez_fchown(fd, owner, group) \
#ifdef DEBUG
# define ez_fchown(fd, owner, group) \
_ez_fchown(__FILE__, __LINE__, __FUNCTION__, fd, owner, group)
#else
# define ez_fchown(fd, owner, group) \
_ez_fchown(fd, owner, group)
#endif
int _ez_fchown(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
int fd,
uid_t owner,
gid_t group
);
#define ez_fchmod(fd, mode) \
#ifdef DEBUG
# define ez_fchmod(fd, mode) \
_ez_fchmod(__FILE__, __LINE__, __FUNCTION__, fd, mode)
#else
# define ez_fchmod(fd, mode) \
_ez_fchmod(fd, mode)
#endif
int _ez_fchmod(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
int fd,
mode_t mode
);

View File

@ -24,9 +24,11 @@
/***************************************************/
int _ez_db_create(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
DB **dbp,
DB_ENV *dbenv,
u_int32_t flags
@ -48,9 +50,11 @@ int _ez_db_create(
/***************************************************/
int _ez_db_open(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
DB *db,
DB_TXN *txnid,
const char *file,
@ -76,9 +80,11 @@ int _ez_db_open(
/***************************************************/
int _ez_db_put(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
DB *db,
DB_TXN *txnid,
DBT *key,
@ -102,9 +108,11 @@ int _ez_db_put(
/***************************************************/
int _ez_db_get(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
DB *db,
DB_TXN *txnid,
DBT *key,
@ -132,9 +140,11 @@ int _ez_db_get(
/***************************************************/
int _ez_db_del(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
DB *db,
DB_TXN *txnid,
DBT *key,
@ -157,9 +167,11 @@ int _ez_db_del(
/***************************************************/
int _ez_db_close(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
DB *db,
u_int32_t flags
)
@ -180,9 +192,11 @@ int _ez_db_close(
/***************************************************/
int _ez_db_fd(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
DB *db,
int *fdp
)

View File

@ -27,23 +27,37 @@
extern "C" {
#endif
#define ez_db_create(dbp, dbenv, flags) \
#ifdef DEBUG
# define ez_db_create(dbp, dbenv, flags) \
_ez_db_create(__FILE__, __LINE__, __FUNCTION__, dbp, dbenv, flags)
#else
# define ez_db_create(dbp, dbenv, flags) \
_ez_db_create(dbp, dbenv, flags)
#endif
int _ez_db_create(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
DB **dbp,
DB_ENV *dbenv,
u_int32_t flags
);
#define ez_db_open(db, txnid, file, database, type, flags, mode ) \
#ifdef DEBUG
# define ez_db_open(db, txnid, file, database, type, flags, mode ) \
_ez_db_open(__FILE__, __LINE__, __FUNCTION__, db, txnid, file, database, type, flags, mode)
#else
# define ez_db_open(db, txnid, file, database, type, flags, mode ) \
_ez_db_open(db, txnid, file, database, type, flags, mode)
#endif
int _ez_db_open(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
DB *db,
DB_TXN *txnid,
const char *file,
@ -53,12 +67,19 @@ int _ez_db_open(
int mode
);
#define ez_db_put(db, txnid, key, data, flags) \
#ifdef DEBUG
# define ez_db_put(db, txnid, key, data, flags) \
_ez_db_put(__FILE__, __LINE__, __FUNCTION__, db, txnid, key, data, flags)
#else
# define ez_db_put(db, txnid, key, data, flags) \
_ez_db_put(db, txnid, key, data, flags)
#endif
int _ez_db_put(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
DB *db,
DB_TXN *txnid,
DBT *key,
@ -66,12 +87,19 @@ int _ez_db_put(
u_int32_t flags
);
#define ez_db_get(db, txnid, key, data, flags) \
#ifdef DEBUG
# define ez_db_get(db, txnid, key, data, flags) \
_ez_db_get(__FILE__, __LINE__, __FUNCTION__, db, txnid, key, data, flags)
#else
# define ez_db_get(db, txnid, key, data, flags) \
_ez_db_get(db, txnid, key, data, flags)
#endif
int _ez_db_get(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
DB *db,
DB_TXN *txnid,
DBT *key,
@ -79,34 +107,55 @@ int _ez_db_get(
u_int32_t flags
);
#define ez_db_del(db, txnid, key, flags) \
#ifdef DEBUG
# define ez_db_del(db, txnid, key, flags) \
_ez_db_del(__FILE__, __LINE__, __FUNCTION__, db, txnid, key, flags)
#else
# define ez_db_del(db, txnid, key, flags) \
_ez_db_del(db, txnid, key, flags)
#endif
int _ez_db_del(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
DB *db,
DB_TXN *txnid,
DBT *key,
u_int32_t flags
);
#define ez_db_close(db, flags) \
#ifdef DEBUG
# define ez_db_close(db, flags) \
_ez_db_close(__FILE__, __LINE__, __FUNCTION__, db, flags)
#else
# define ez_db_close(db, flags) \
_ez_db_close(db, flags)
#endif
int _ez_db_close(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
DB *db,
u_int32_t flags
);
#define ez_db_fd(db, fdp) \
#ifdef DEBUG
# define ez_db_fd(db, fdp) \
_ez_db_fd(__FILE__, __LINE__, __FUNCTION__, db, fdp)
#else
# define ez_db_fd(db, fdp) \
_ez_db_fd(db, fdp)
#endif
int _ez_db_fd(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
DB *db,
int *fdp
);

View File

@ -26,9 +26,11 @@
/***************************************************/
int _ez_pthread_mutex_lock(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
pthread_mutex_t *mutex
)
{
@ -46,9 +48,11 @@ int _ez_pthread_mutex_lock(
/***************************************************/
int _ez_pthread_mutex_unlock(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
pthread_mutex_t *mutex
)
{
@ -66,9 +70,11 @@ int _ez_pthread_mutex_unlock(
/***************************************************/
int _ez_pthread_create(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
pthread_t *thread,
const pthread_attr_t *attr,
void *(*start_routine) (void *),
@ -89,9 +95,11 @@ int _ez_pthread_create(
/***************************************************/
int _ez_pthread_cond_signal(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
pthread_cond_t *cond
)
{
@ -109,9 +117,11 @@ int _ez_pthread_cond_signal(
/***************************************************/
int _ez_pthread_cond_wait(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
pthread_cond_t *cond,
pthread_mutex_t *mutex
)
@ -130,9 +140,11 @@ int _ez_pthread_cond_wait(
/***************************************************/
int _ez_pthread_join(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
pthread_t thread,
void **retval
)

View File

@ -27,61 +27,103 @@
extern "C" {
#endif
#define ez_pthread_mutex_lock(mutex) \
#ifdef DEBUG
# define ez_pthread_mutex_lock(mutex) \
_ez_pthread_mutex_lock(__FILE__, __LINE__, __FUNCTION__, mutex)
#else
# define ez_pthread_mutex_lock(mutex) \
_ez_pthread_mutex_lock(mutex)
#endif
int _ez_pthread_mutex_lock(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
pthread_mutex_t *mutex
);
#define ez_pthread_mutex_unlock(mutex) \
#ifdef DEBUG
# define ez_pthread_mutex_unlock(mutex) \
_ez_pthread_mutex_unlock(__FILE__, __LINE__, __FUNCTION__, mutex)
#else
# define ez_pthread_mutex_unlock(mutex) \
_ez_pthread_mutex_unlock(mutex)
#endif
int _ez_pthread_mutex_unlock(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
pthread_mutex_t *mutex
);
#define ez_pthread_create(thread, addr, start_routine, arg) \
#ifdef DEBUG
# define ez_pthread_create(thread, addr, start_routine, arg) \
_ez_pthread_create(__FILE__, __LINE__, __FUNCTION__, thread, addr, start_routine, arg)
#else
# define ez_pthread_create(thread, addr, start_routine, arg) \
_ez_pthread_create(thread, addr, start_routine, arg)
#endif
int _ez_pthread_create(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
pthread_t *thread,
const pthread_attr_t *attr,
void *(*start_routine) (void *),
void *arg
);
#define ez_pthread_cond_signal(cond) \
#ifdef DEBUG
# define ez_pthread_cond_signal(cond) \
_ez_pthread_cond_signal(__FILE__, __LINE__, __FUNCTION__, cond)
#else
# define ez_pthread_cond_signal(cond) \
_ez_pthread_cond_signal(cond)
#endif
int _ez_pthread_cond_signal(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
pthread_cond_t *cond
);
#define ez_pthread_cond_wait(cond, mutex) \
#ifdef DEBUG
# define ez_pthread_cond_wait(cond, mutex) \
_ez_pthread_cond_wait(__FILE__, __LINE__, __FUNCTION__, cond, mutex)
#else
# define ez_pthread_cond_wait(cond, mutex) \
_ez_pthread_cond_wait(cond, mutex)
#endif
int _ez_pthread_cond_wait(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
pthread_cond_t *cond,
pthread_mutex_t *mutex
);
#define ez_pthread_join(thread, retval) \
#ifdef DEBUG
# define ez_pthread_join(thread, retval) \
_ez_pthread_join(__FILE__, __LINE__, __FUNCTION__, thread, retval)
#else
# define ez_pthread_join(thread, retval) \
_ez_pthread_join(thread, retval)
#endif
int _ez_pthread_join(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
pthread_t thread,
void **retval
);

View File

@ -24,9 +24,11 @@
/***************************************************/
gzFile _ez_gzopen(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *path,
const char *mode
)
@ -44,9 +46,11 @@ gzFile _ez_gzopen(
/***************************************************/
int _ez_gzclose(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
gzFile file
)
{
@ -88,9 +92,11 @@ int _ez_gzclose(
/***************************************************/
int _ez_gzwrite(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
gzFile file,
voidpc buf,
unsigned len
@ -119,9 +125,11 @@ int _ez_gzwrite(
/***************************************************/
int _ez_gzread(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
gzFile file,
voidp buf,
unsigned len
@ -150,9 +158,11 @@ int _ez_gzread(
/***************************************************/
int _ez_gzflush(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
gzFile file,
int flush
)
@ -179,9 +189,11 @@ int _ez_gzflush(
/***************************************************/
z_off_t _ez_gzseek(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
gzFile file,
z_off_t offset,
int whence
@ -210,9 +222,11 @@ z_off_t _ez_gzseek(
/***************************************************/
char* _ez_gzgets (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
gzFile file,
char *buf,
int len
@ -246,9 +260,11 @@ char* _ez_gzgets (
/***************************************************/
z_off_t _ez_gztell(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
gzFile file
)
{

View File

@ -27,83 +27,139 @@
extern "C" {
#endif
#define ez_gzopen(path, mode) \
#ifdef DEBUG
# define ez_gzopen(path, mode) \
_ez_gzopen(__FILE__, __LINE__, __FUNCTION__, path, mode)
#else
# define ez_gzopen(path, mode) \
_ez_gzopen(path, mode)
#endif
gzFile _ez_gzopen(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
const char *path,
const char *mode
);
#define ez_gzclose(file) \
#ifdef DEBUG
# define ez_gzclose(file) \
_ez_gzclose(__FILE__, __LINE__, __FUNCTION__, file)
#else
# define ez_gzclose(file) \
_ez_gzclose(file)
#endif
int _ez_gzclose(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
gzFile file
);
#define ez_gzwrite(file, buf, len) \
#ifdef DEBUG
# define ez_gzwrite(file, buf, len) \
_ez_gzwrite(__FILE__, __LINE__, __FUNCTION__, file, buf, len)
#else
# define ez_gzwrite(file, buf, len) \
_ez_gzwrite(file, buf, len)
#endif
int _ez_gzwrite(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
gzFile file,
voidpc buf,
unsigned len
);
#define ez_gzread(file, buf, len) \
#ifdef DEBUG
# define ez_gzread(file, buf, len) \
_ez_gzread(__FILE__, __LINE__, __FUNCTION__, file, buf, len)
#else
# define ez_gzread(file, buf, len) \
_ez_gzread(file, buf, len)
#endif
int _ez_gzread(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
gzFile file,
voidp buf,
unsigned len
);
#define ez_gzflush(file, flush) \
#ifdef DEBUG
# define ez_gzflush(file, flush) \
_ez_gzflush(__FILE__, __LINE__, __FUNCTION__, file, flush)
#else
# define ez_gzflush(file, flush) \
_ez_gzflush(file, flush)
#endif
int _ez_gzflush(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
gzFile file,
int flush
);
#define ez_gzseek(file, offset, whence) \
#ifdef DEBUG
# define ez_gzseek(file, offset, whence) \
_ez_gzseek(__FILE__, __LINE__, __FUNCTION__, file, offset, whence)
#else
# define ez_gzseek(file, offset, whence) \
_ez_gzseek(file, offset, whence)
#endif
z_off_t _ez_gzseek(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
gzFile file,
z_off_t offset,
int whence
);
#define ez_gztell(file) \
#ifdef DEBUG
# define ez_gztell(file) \
_ez_gztell(__FILE__, __LINE__, __FUNCTION__, file)
#else
# define ez_gztell(file) \
_ez_gztell(file)
#endif
z_off_t _ez_gztell(
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
gzFile file
);
#define ez_gzgets(file, buf, len) \
#ifdef DEBUG
# define ez_gzgets(file, buf, len) \
_ez_gzgets(__FILE__, __LINE__, __FUNCTION__, file, buf, len)
#else
# define ez_gzgets(file, buf, len) \
_ez_gzgets(file, buf, len)
#endif
char* _ez_gzgets (
#ifdef DEBUG
const char *fileName,
int lineNo,
const char *funcName,
#endif
gzFile file,
char *buf,
int len

View File

@ -233,6 +233,7 @@ OFFENTRY_list(OFFENTRY *self, FILE *fh, int flags, unsigned nAllowed)
};
#ifdef OLD
const static char *dns_fmt= "%u %-13s %-15s\t%5u/%-4d offenses %s [%s] %s %s\n",
*fmt= "%u %-13s %-15s\t%5u/%-4d offenses %s [%s]\n";
@ -247,6 +248,22 @@ OFFENTRY_list(OFFENTRY *self, FILE *fh, int flags, unsigned nAllowed)
, self->dns.name ? self->dns.name : ""
, bits2str(self->dns.flags, dns_flagsArr)
);
#else
const static char *dns_fmt= "%u %-13s %5u/%-4d offenses %s [%-3s] %s \t%s %s\n",
*fmt= "%u %-13s %5u/%-4d offenses %s [%-3s] %s\n";
ez_fprintf(fh, self->dns.flags ? dns_fmt : fmt
, self->severity
, self->latest ? local_strftime(&self->latest, "%b %d %H:%M") : ""
, self->count
, nAllowed
, self->cntry[0] ? self->cntry : "--"
, bits2str(flags, BlockBitTuples)
, self->addr
, self->dns.name ? self->dns.name : ""
, bits2str(self->dns.flags, dns_flagsArr)
);
#endif
return 0;
}