]>
git.saurik.com Git - apple/syslog.git/blob - syslogd.tproj/daemon.h
2 * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * "Portions Copyright (c) 2004 Apple Computer, Inc. All Rights
7 * Reserved. This file contains Original Code and/or Modifications of
8 * Original Code as defined in and that are subject to the Apple Public
9 * Source License Version 1.0 (the 'License'). You may not use this file
10 * except in compliance with the License. Please obtain a copy of the
11 * License at http://www.apple.com/publicsource and read it before using
14 * The Original Code and all software distributed under the License are
15 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19 * License for the specific language governing rights and limitations
22 * @APPLE_LICENSE_HEADER_END@
29 #include <sys/types.h>
30 #include <sys/queue.h>
33 #include <asl_private.h>
36 #define _PATH_PIDFILE "/var/run/syslog.pid"
37 #define _PATH_ASL_IN "/var/run/asl_input"
38 #define _PATH_ASL_PRUNE "/var/run/asl_prune"
39 #define _PATH_ASL_OUT "/var/log/asl.log"
40 #define _PATH_SYSLOG_CONF "/etc/syslog.conf"
41 #define _PATH_SYSLOG_IN "/var/run/syslog"
42 #define _PATH_KLOG "/dev/klog"
43 #define _PATH_MODULE_LIB "/usr/lib/asl"
52 TAILQ_ENTRY(module_list
) entries
;
55 int aslevent_init(void);
56 int aslevent_fdsets(fd_set
*, fd_set
*, fd_set
*);
57 void aslevent_handleevent(fd_set
, fd_set
, fd_set
, char *);
60 char *get_line_from_file(FILE *f
);
62 int asldebug(const char *, ...);
63 int asl_log_string(const char *str
);
65 char *asl_msg_to_string(asl_msg_t
*msg
, uint32_t *len
);
66 asl_msg_t
*asl_msg_from_string(const char *buf
);
67 int asl_msg_cmp(asl_msg_t
*a
, asl_msg_t
*b
);
68 time_t asl_parse_time(const char *str
);
70 typedef asl_msg_t
*(*aslreadfn
)(int);
71 typedef char *(*aslwritefn
)(const char *, int);
72 typedef char *(*aslexceptfn
)(int);
73 typedef int (*aslsendmsgfn
)(asl_msg_t
*msg
, const char *outid
);
75 int aslevent_addfd(int fd
, aslreadfn
, aslwritefn
, aslexceptfn
);
76 int aslevent_removefd(int fd
);
77 int aslevent_addmatch(asl_msg_t
*query
, char *outid
);
79 int aslevent_addoutput(aslsendmsgfn
, const char *outid
);
81 int asl_syslog_faciliy_name_to_num(const char *fac
);
82 const char *asl_syslog_faciliy_num_to_name(int num
);
83 asl_msg_t
*asl_syslog_input_convert(const char *in
, int len
, char *rhost
, int flag
);
84 int asl_prune(asl_msg_t
*pq
);
87 uint32_t notify_get_state(int token
, int *state
);
88 uint32_t notify_set_state(int token
, int state
);
89 uint32_t notify_register_plain(const char *name
, int *out_token
);
91 #endif /* __DAEMON_H__ */