1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/yuanhack-yhevents

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
В этом репозитории не указан файл с открытой лицензией (LICENSE). При использовании обратитесь к конкретному описанию проекта и его зависимостям в коде.
Клонировать/Скачать
yherror.h 2 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
Yuan Hong Отправлено 03.12.2015 09:38 407bae3
#ifndef __YH_ERROR_H__
#define __YH_ERROR_H__
#include <stdarg.h> /* ANSI C header file */
#include <syslog.h> /* for syslog() */
#include <stdarg.h> /* ANSI C header file */
#include <syslog.h> /* for syslog() */
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define YH_ERROR_MAXLINE 1024
extern int daemon_proc; /* set nonzero by daemon_init() */
#ifdef __cplusplus
extern "C"
{
#endif
#pragma pack(push)
#pragma pack(1)
#pragma pack(pop)
/* Nonfatal error related to a system call.
* Print a message and return. */
/* $$.ix [err_ret]~function,~source~code$$ */
void
err_ret(const char *fmt, ...);
/* Fatal error related to a system call.
* Print a message and terminate. */
/* $$.ix [err_sys]~function,~source~code$$ */
void
err_sys(const char *fmt, ...);
/* Fatal error related to a system call.
* Print a message, dump core, and terminate. */
/* $$.ix [err_dump]~function,~source~code$$ */
void
err_dump(const char *fmt, ...);
/* Nonfatal error unrelated to a system call.
* Print a message and return. */
/* $$.ix [err_msg]~function,~source~code$$ */
void
err_msg(const char *fmt, ...);
#define log_msg(fmt, ...) err_msg(fmt, ##__VA_ARGS__)
/* Fatal error unrelated to a system call.
* Print a message and terminate. */
/* $$.ix [err_quit]~function,~source~code$$ */
void
err_quit(const char *fmt, ...);
#define ERR_LOG(errfunc, format, ...) \
do { \
errfunc("\e[7m%s:%d `%s'\e[m "format,__FILE__,__LINE__,__func__,##__VA_ARGS__);\
} while (0)
#define ERR_MSG(s,...) ERR_LOG(err_msg,s,##__VA_ARGS__)
#define ERR_RET(s,...) ERR_LOG(err_ret,s,##__VA_ARGS__)
#define ERR_SYS(s,...) ERR_LOG(err_sys,s,##__VA_ARGS__)
#define ERR_DUMP(s,...) ERR_LOG(err_dump,s,##__VA_ARGS__)
#define ERR_QUIT(s,...) ERR_LOG(err_quit,s,##__VA_ARGS__)
#define LOG_MSG(s,...) ERR_LOG(log_msg,s,##__VA_ARGS__)
#define LOG_MARK() ERR_LOG(log_msg,"")
#ifdef __cplusplus
}
#endif
#endif /* __YH_ERROR_H__ */

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/yuanhack-yhevents.git
git@api.gitlife.ru:oschina-mirror/yuanhack-yhevents.git
oschina-mirror
yuanhack-yhevents
yuanhack-yhevents
master