?? msgf.c
字號:
/* msgf.c : * * Format and log a server message : */#include <stdio.h>#include <unistd.h>#include <stdlib.h>#include <errno.h>#include <stdarg.h>#include <syslog.h>#include <sys/types.h>#include "quotes.h"#define MAX_MSGBUF 256/* * Report formatted message : */voidmsgf(char type,const char *format,...) { int er = errno; /* Save errno */ int mtype; va_list ap; char msgbuf[MAX_MSGBUF]; switch ( type ) { case 'w' : mtype = LOG_WARNING; break; case 'e' : mtype = LOG_ERR; break; case 'i' : default : mtype = LOG_INFO; } va_start(ap,format); vsnprintf(msgbuf,sizeof msgbuf-1, format,ap); va_end(ap); syslog(mtype,"%s",msgbuf); errno = er; /* Restore errno */}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -