#pragma prototyped
#ifndef _SYSLOG_H
#define _SYSLOG_H
#include <stdarg.h>
#define LOG_PRIBITS 3
#define LOG_FACBITS 7
#define LOG_PRIMASK ((1<<LOG_PRIBITS)-1)
#define LOG_FACMASK (((1<<LOG_FACBITS)-1)<<LOG_PRIBITS)
#define LOG_PRI(p) ((p)&((1<<LOG_PRIBITS)-1))
#define LOG_FAC(p) (((p)>>LOG_PRIBITS)&((1<<LOG_FACBITS)-1))
#define LOG_MAKEPRI(f,p) (((f)<<LOG_PRIBITS)|(p))
#define LOG_EMERG 0
#define LOG_ALERT 1
#define LOG_CRIT 2
#define LOG_ERR 3
#define LOG_WARNING 4
#define LOG_NOTICE 5
#define LOG_INFO 6
#define LOG_DEBUG 7
#define LOG_MASK(s) (1<<(s))
#define LOG_UPTO(s) ((1<<((s)+1))-1)
#define LOG_KERN (0<<LOG_PRIBITS)
#define LOG_USER (1<<LOG_PRIBITS)
#define LOG_MAIL (2<<LOG_PRIBITS)
#define LOG_DAEMON (3<<LOG_PRIBITS)
#define LOG_AUTH (4<<LOG_PRIBITS)
#define LOG_SYSLOG (5<<LOG_PRIBITS)
#define LOG_LPR (6<<LOG_PRIBITS)
#define LOG_NEWS (7<<LOG_PRIBITS)
#define LOG_UUCP (8<<LOG_PRIBITS)
#define LOG_CRON (9<<LOG_PRIBITS)
#define LOG_AUDIT (13<<LOG_PRIBITS)
#define LOG_LFMT (14<<LOG_PRIBITS)
#define LOG_LOCAL0 (16<<LOG_PRIBITS)
#define LOG_LOCAL1 (17<<LOG_PRIBITS)
#define LOG_LOCAL2 (18<<LOG_PRIBITS)
#define LOG_LOCAL3 (19<<LOG_PRIBITS)
#define LOG_LOCAL4 (20<<LOG_PRIBITS)
#define LOG_LOCAL5 (21<<LOG_PRIBITS)
#define LOG_LOCAL6 (22<<LOG_PRIBITS)
#define LOG_LOCAL7 (23<<LOG_PRIBITS)
#define LOG_NFACILITIES 24
#define LOG_PID 0x01
#define LOG_CONS 0x02
#define LOG_NDELAY 0x08
#define LOG_ODELAY 0x04
#define LOG_NOWAIT 0x10
#define LOG_PERROR 0x20
#define LOG_LEVEL 0x40
#ifdef LOG_TABLES
#include <ast_namval.h>
#define log_facility _log_facility
#define log_severity _log_severity
#define LOG_FACILITY(p) LOG_FAC(p)
#define LOG_SEVERITY(p) LOG_PRI(p)
#if _BLD_ast && defined(__EXPORT__)
#define extern __EXPORT__
#endif
#if !_BLD_ast && defined(__IMPORT__)
#define extern extern __IMPORT__
#endif
extern const Namval_t log_facility[];
extern const Namval_t log_severity[];
#undef extern
#endif
#if _BLD_ast && defined(__EXPORT__)
#define extern __EXPORT__
#endif
extern void closelog(void);
extern void openlog(const char*, int, int);
extern int setlogmask(int);
extern void syslog(int, const char*, ...);
extern void vsyslog(int, const char*, va_list);
#undef extern
#endif