diff options
author | samr7 <samr7@126591fb-c623-4b62-a76d-97a8e4f34109> | 2008-10-17 21:28:01 +0000 |
---|---|---|
committer | samr7 <samr7@126591fb-c623-4b62-a76d-97a8e4f34109> | 2008-10-17 21:28:01 +0000 |
commit | b9526d2a82d25d2800e5d76ee45e561ec5870458 (patch) | |
tree | d3eab6e4bc413696e5ebd967bf6db529f5e5c7d8 /hfpd/util.h | |
download | nohands-b9526d2a82d25d2800e5d76ee45e561ec5870458.tar.gz |
Initial hfpforlinux submission to sourceforge.
git-svn-id: http://nohands.svn.sourceforge.net/svnroot/nohands/trunk@1 126591fb-c623-4b62-a76d-97a8e4f34109
Diffstat (limited to 'hfpd/util.h')
-rw-r--r-- | hfpd/util.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/hfpd/util.h b/hfpd/util.h new file mode 100644 index 0000000..e49c234 --- /dev/null +++ b/hfpd/util.h @@ -0,0 +1,48 @@ +/* -*- C++ -*- */ +/* + * Software Bluetooth Hands-Free Implementation + * + * Copyright (C) 2008 Sam Revitch <samr7@cs.washington.edu> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#if !defined(__HFPD_UTIL_H__) +#define __HFPD_UTIL_H__ + +#include <libhfp/events.h> +#include <libhfp/events-indep.h> + +extern bool Daemonize(void); + +class SyslogDispatcher : public libhfp::IndepEventDispatcher { +public: + DispatchInterface::logtype_t m_level; + bool m_stderr; + bool m_syslog; + DispatchInterface::logtype_t m_syslog_elevate; + + SyslogDispatcher(void); + virtual ~SyslogDispatcher(void); + + void SetLevel(DispatchInterface::logtype_t lt) { m_level = lt; } + void SetStderr(bool enable) { m_stderr = enable; } + void SetSyslog(bool enable, DispatchInterface::logtype_t elevate = + DispatchInterface::EVLOG_DEBUG); + virtual void LogVa(DispatchInterface::logtype_t lt, + const char *fmt, va_list ap); +}; + +#endif /* !defined(__HFPD_UTIL_H__) */ |