diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-10-09 07:08:36 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-10-09 07:08:36 -0600 |
commit | f41649ece21fc3e9696eaa3a68c2a6d34f00940c (patch) | |
tree | 93531d745ca7e106e693c50043347f77b48d1325 /nuttx/fs | |
parent | 71338dddde5f9be7bf3fd05be22c04e87e417de7 (diff) | |
download | px4-nuttx-f41649ece21fc3e9696eaa3a68c2a6d34f00940c.tar.gz px4-nuttx-f41649ece21fc3e9696eaa3a68c2a6d34f00940c.tar.bz2 px4-nuttx-f41649ece21fc3e9696eaa3a68c2a6d34f00940c.zip |
Move syslog back to libc/syslog from fs/syslog
Diffstat (limited to 'nuttx/fs')
-rw-r--r-- | nuttx/fs/Makefile | 1 | ||||
-rw-r--r-- | nuttx/fs/driver/Make.defs | 8 | ||||
-rw-r--r-- | nuttx/fs/driver/fs_devsyslog.c (renamed from nuttx/fs/syslog/fs_devsyslog.c) | 2 | ||||
-rw-r--r-- | nuttx/fs/syslog/Make.defs | 55 | ||||
-rw-r--r-- | nuttx/fs/syslog/fs_lowsyslog.c | 147 | ||||
-rw-r--r-- | nuttx/fs/syslog/fs_setlogmask.c | 89 | ||||
-rw-r--r-- | nuttx/fs/syslog/fs_syslog.c | 169 | ||||
-rw-r--r-- | nuttx/fs/syslog/fs_syslogstream.c | 123 | ||||
-rw-r--r-- | nuttx/fs/syslog/syslog.h | 80 |
9 files changed, 9 insertions, 665 deletions
diff --git a/nuttx/fs/Makefile b/nuttx/fs/Makefile index 33e6b315c..0c7250604 100644 --- a/nuttx/fs/Makefile +++ b/nuttx/fs/Makefile @@ -48,7 +48,6 @@ include vfs/Make.defs include driver/Make.defs include dirent/Make.defs include aio/Make.defs -include syslog/Make.defs include mmap/Make.defs # OS resources diff --git a/nuttx/fs/driver/Make.defs b/nuttx/fs/driver/Make.defs index 1a7ea9e55..587076dae 100644 --- a/nuttx/fs/driver/Make.defs +++ b/nuttx/fs/driver/Make.defs @@ -41,6 +41,14 @@ CSRCS += fs_registerdriver.c fs_unregisterdriver.c CSRCS += fs_registerblockdriver.c fs_unregisterblockdriver.c CSRCS += fs_findblockdriver.c fs_openblockdriver.c fs_closeblockdriver.c +# System logging to a character device (or file) + +ifeq ($(CONFIG_SYSLOG),y) +ifeq ($(CONFIG_SYSLOG_CHAR),y) +CSRCS += fs_devsyslog.c +endif +endif + # Include driver build support DEPPATH += --dep-path driver diff --git a/nuttx/fs/syslog/fs_devsyslog.c b/nuttx/fs/driver/fs_devsyslog.c index 930c89be4..526a9e0b2 100644 --- a/nuttx/fs/syslog/fs_devsyslog.c +++ b/nuttx/fs/driver/fs_devsyslog.c @@ -1,5 +1,5 @@ /**************************************************************************** - * fs/syslog/fs_devsyslog.c + * fs/driver/fs_devsyslog.c * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> diff --git a/nuttx/fs/syslog/Make.defs b/nuttx/fs/syslog/Make.defs deleted file mode 100644 index d67f63e1f..000000000 --- a/nuttx/fs/syslog/Make.defs +++ /dev/null @@ -1,55 +0,0 @@ -############################################################################ -# libc/syslog/Make.defs -# -# Copyright (C) 2014 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt <gnutt@nuttx.org> -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# 3. Neither the name NuttX nor the names of its contributors may be -# used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# -############################################################################ - -# Add the internal C files to the build - -CSRCS += fs_syslog.c fs_lowsyslog.c fs_setlogmask.c - -ifeq ($(CONFIG_SYSLOG),y) -CSRCS += fs_syslogstream.c -endif - -# System logging to a character device (or file) - -ifeq ($(CONFIG_SYSLOG),y) -ifeq ($(CONFIG_SYSLOG_CHAR),y) -CSRCS += fs_devsyslog.c -endif -endif - -# Add the syslog directory to the build - -DEPPATH += --dep-path syslog -VPATH += :syslog diff --git a/nuttx/fs/syslog/fs_lowsyslog.c b/nuttx/fs/syslog/fs_lowsyslog.c deleted file mode 100644 index 3caa81d8a..000000000 --- a/nuttx/fs/syslog/fs_lowsyslog.c +++ /dev/null @@ -1,147 +0,0 @@ -/**************************************************************************** - * fs/syslog/fs_lowsyslog.c - * - * Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <gnutt@nuttx.org> - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include <nuttx/config.h> - -#include <stdio.h> -#include <syslog.h> - -#include <nuttx/streams.h> - -#include "syslog/syslog.h" - -#if defined(CONFIG_ARCH_LOWPUTC) || defined(CONFIG_SYSLOG) - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Type Declarations - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Global Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Global Constant Data - ****************************************************************************/ - -/**************************************************************************** - * Global Variables - ****************************************************************************/ - -/**************************************************************************** - * Private Constant Data - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: lowvsyslog_internal - ****************************************************************************/ - -static inline int lowvsyslog_internal(FAR const char *fmt, va_list ap) -{ - struct lib_outstream_s stream; - - /* Wrap the stdout in a stream object and let lib_vsprintf do the work. */ - -#ifdef CONFIG_SYSLOG - lib_syslogstream((FAR struct lib_outstream_s *)&stream); -#else - lib_lowoutstream((FAR struct lib_outstream_s *)&stream); -#endif - return lib_vsprintf((FAR struct lib_outstream_s *)&stream, fmt, ap); -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: lowvsyslog - ****************************************************************************/ - -int lowvsyslog(int priority, FAR const char *fmt, va_list ap) -{ - int ret = 0; - - /* Check if this priority is enabled */ - - if ((g_syslog_mask & LOG_MASK(priority)) != 0) - { - /* Yes.. let vsylog_internal to the deed */ - - ret = lowvsyslog_internal(fmt, ap); - } - - return ret; -} - -/**************************************************************************** - * Name: lowsyslog - ****************************************************************************/ - -int lowsyslog(int priority, FAR const char *fmt, ...) -{ - va_list ap; - int ret; - - /* Let lowvsyslog do the work */ - - va_start(ap, fmt); - ret = lowvsyslog(priority, fmt, ap); - va_end(ap); - - return ret; -} - -#endif /* CONFIG_ARCH_LOWPUTC || CONFIG_SYSLOG */ diff --git a/nuttx/fs/syslog/fs_setlogmask.c b/nuttx/fs/syslog/fs_setlogmask.c deleted file mode 100644 index d34341723..000000000 --- a/nuttx/fs/syslog/fs_setlogmask.c +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** - * fs/syslog/fs_setlogmask.c - * - * Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <gnutt@nuttx.org> - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include <nuttx/config.h> - -#include <stdint.h> -#include <syslog.h> - -#include <arch/irq.h> - -#include "syslog/syslog.h" - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/* The currently enabled set of syslog priorities */ - -uint8_t g_syslog_mask = LOG_ALL; - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: setlogmask - * - * Description: - * Enable or disable debug output. - * - ****************************************************************************/ - -int setlogmask(int mask) -{ - uint8_t oldmask; - irqstate_t flags; - - /* These operations must be exclusive with respect to other threads as well - * as interrupts. - */ - - flags = irqsave(); - - oldmask = g_syslog_mask; - g_syslog_mask = (uint8_t)mask; - - irqrestore(flags); - return oldmask; -} diff --git a/nuttx/fs/syslog/fs_syslog.c b/nuttx/fs/syslog/fs_syslog.c deleted file mode 100644 index cb5e96256..000000000 --- a/nuttx/fs/syslog/fs_syslog.c +++ /dev/null @@ -1,169 +0,0 @@ -/**************************************************************************** - * libc/syslog/fs_syslog.c - * - * Copyright (C) 2007-2009, 2011-2014 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <gnutt@nuttx.org> - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include <nuttx/config.h> - -#include <stdio.h> -#include <syslog.h> - -#include <nuttx/streams.h> - -#include "syslog/syslog.h" - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Type Declarations - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Global Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Global Constant Data - ****************************************************************************/ - -/**************************************************************************** - * Global Variables - ****************************************************************************/ - -/**************************************************************************** - * Private Constant Data - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: vsyslog_internal - ****************************************************************************/ - -static inline int vsyslog_internal(FAR const char *fmt, va_list ap) -{ -#if defined(CONFIG_SYSLOG) - - struct lib_outstream_s stream; - - /* Wrap the low-level output in a stream object and let lib_vsprintf - * do the work. - */ - - lib_syslogstream((FAR struct lib_outstream_s *)&stream); - return lib_vsprintf((FAR struct lib_outstream_s *)&stream, fmt, ap); - -#elif CONFIG_NFILE_DESCRIPTORS > 0 - - struct lib_rawoutstream_s rawoutstream; - - /* Wrap the stdout in a stream object and let lib_vsprintf - * do the work. - */ - - lib_rawoutstream(&rawoutstream, 1); - return lib_vsprintf(&rawoutstream.public, fmt, ap); - -#elif defined(CONFIG_ARCH_LOWPUTC) - - struct lib_outstream_s stream; - - /* Wrap the low-level output in a stream object and let lib_vsprintf - * do the work. - */ - - lib_lowoutstream((FAR struct lib_outstream_s *)&stream); - return lib_vsprintf((FAR struct lib_outstream_s *)&stream, fmt, ap); - -#else - return 0; -#endif -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: vsyslog - ****************************************************************************/ - -int vsyslog(int priority, FAR const char *fmt, va_list ap) -{ - int ret = 0; - - /* Check if this priority is enabled */ - - if ((g_syslog_mask & LOG_MASK(priority)) != 0) - { - /* Yes.. let vsylog_internal to the deed */ - - ret = vsyslog_internal(fmt, ap); - } - - return ret; -} - -/**************************************************************************** - * Name: syslog - ****************************************************************************/ - -int syslog(int priority, FAR const char *fmt, ...) -{ - va_list ap; - int ret; - - /* Let vsyslog do the work */ - - va_start(ap, fmt); - ret = vsyslog(priority, fmt, ap); - va_end(ap); - - return ret; -} diff --git a/nuttx/fs/syslog/fs_syslogstream.c b/nuttx/fs/syslog/fs_syslogstream.c deleted file mode 100644 index 4c6cfa8c2..000000000 --- a/nuttx/fs/syslog/fs_syslogstream.c +++ /dev/null @@ -1,123 +0,0 @@ -/**************************************************************************** - * libc/syslog/lib_syslogstream.c - * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <gnutt@nuttx.org> - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include <nuttx/config.h> - -#include <stdio.h> -#include <unistd.h> -#include <assert.h> -#include <errno.h> - -#include <nuttx/syslog/syslog.h> -#include <nuttx/streams.h> - -#include "syslog/syslog.h" - -#ifdef CONFIG_SYSLOG - -/**************************************************************************** - * Pre-processor definition - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: syslogstream_putc - ****************************************************************************/ - -static void syslogstream_putc(FAR struct lib_outstream_s *this, int ch) -{ - int ret; - - /* Try writing until the write was successful or until an irrecoverable - * error occurs. - */ - - do - { - /* Write the character to the supported logging device. On failure, - * syslog_putc returns EOF with the errno value set; - */ - - ret = syslog_putc(ch); - if (ret != EOF) - { - this->nput++; - return; - } - - /* The special errno value -EINTR means that syslog_putc() was - * awakened by a signal. This is not a real error and must be - * ignored in this context. - */ - } - while (errno == -EINTR); -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: lib_syslogstream - * - * Description: - * Initializes a stream for use with the configured syslog interface. - * - * Input parameters: - * lowoutstream - User allocated, uninitialized instance of struct - * lib_lowoutstream_s to be initialized. - * - * Returned Value: - * None (User allocated instance initialized). - * - ****************************************************************************/ - -void lib_syslogstream(FAR struct lib_outstream_s *stream) -{ - stream->put = syslogstream_putc; -#ifdef CONFIG_STDIO_LINEBUFFER - stream->flush = lib_noflush; -#endif - stream->nput = 0; -} - -#endif /* CONFIG_SYSLOG */ diff --git a/nuttx/fs/syslog/syslog.h b/nuttx/fs/syslog/syslog.h deleted file mode 100644 index eb31ebd84..000000000 --- a/nuttx/fs/syslog/syslog.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** - * libc/syslog/syslog.h - * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <gnutt@nuttx.org> - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************/ - -#ifndef __LIBC_SYSLOG_SYSLOG_H -#define __LIBC_SYSLOG_SYSLOG_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include <nuttx/config.h> -#include <stdbool.h> - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Types - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -#undef EXTERN -#if defined(__cplusplus) -#define EXTERN extern "C" -extern "C" -{ -#else -#define EXTERN extern -#endif - -/* The currently enabled set of syslog priorities */ - -EXTERN uint8_t g_syslog_mask; - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -#undef EXTERN -#if defined(__cplusplus) -} -#endif - -#endif /* __LIBC_SYSLOG_SYSLOG_H */ |