2 * (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
3 * All rights reserved. The file named COPYRIGHT specifies the terms
4 * and conditions for redistribution.
11 * $Id: xlog.h,v 1.2 2003/03/09 19:30:08 steveg Exp $
17 #define XLOG_NOFLAGS 0x0
18 #define XLOG_SET_LEVEL 0x1
19 #define XLOG_NO_SIZECHECK 0x2
20 #define XLOG_NO_ERRNO 0x4
21 /* #define XLOG_PRINT_TIMESTAMP 0x8 */
22 #define XLOG_PRINT_ID 0x10
23 #define XLOG_PRINT_PID 0x20
28 #define XLOG_ENOERROR 0
39 typedef enum { XLOG_SYSLOG, XLOG_FILELOG } xlog_e ;
43 XLOG_LINK, /* generic: link this log to another log */
44 XLOG_CALLBACK, /* generic: call this function in case of error */
45 XLOG_GETFLAG, /* generic: get value of specified flag */
46 XLOG_SETFLAG, /* generic: set value of specified flag */
47 XLOG_LEVEL, /* syslog: set the default syslog level */
48 XLOG_FACILITY, /* syslog: set the default syslog facility */
49 XLOG_PREEXEC, /* syslog: prepare the log for an exec(2) */
50 XLOG_POSTEXEC, /* syslog: exec(2) failed */
51 XLOG_SIZECHECK, /* filelog: check file size */
52 XLOG_GETFD, /* filelog: get file descriptor of log file */
53 XLOG_LIMITS /* filelog: set (new) soft/hard limits */
56 typedef void *xlog_h ;
58 xlog_h xlog_create ( xlog_e type, const char *id, int flags, ... ) ;
59 void xlog_destroy ( xlog_h ) ;
60 void xlog_write ( xlog_h, const char *buf, int len, int flags, ... ) ;
61 int xlog_control ( xlog_h, xlog_cmd_e, ... ) ;
62 int xlog_parms ( xlog_e type, ... ) ;