1/*
2 * Copyright 2003-2015, Axel D��rfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef _SYSLOG_DAEMON_H_
6#define _SYSLOG_DAEMON_H_
7
8
9#include <Locker.h>
10#include <List.h>
11#include <Server.h>
12#include <OS.h>
13
14#include <syslog_daemon.h>
15
16
17typedef void (*handler_func)(syslog_message&);
18
19
20class SyslogDaemon : public BServer {
21public:
22								SyslogDaemon();
23
24	virtual	void				ReadyToRun();
25	virtual	void				AboutRequested();
26	virtual	bool				QuitRequested();
27	virtual	void				MessageReceived(BMessage* message);
28
29			void				AddHandler(handler_func function);
30
31private:
32			void				_Daemon();
33	static	int32				_DaemonThread(void* data);
34
35private:
36			thread_id			fDaemon;
37			port_id				fPort;
38
39			BLocker				fHandlerLock;
40			BList				fHandlers;
41};
42
43
44#endif	/* _SYSLOG_DAEMON_H_ */
45