diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2009-02-26 16:42:00 +0100 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2009-02-26 16:42:00 +0100 |
commit | 1be3647260a644118e94908eaf2dd64810842c5b (patch) | |
tree | 17be5c64ab4057ae8c17d50c93d1999211fe606d /include | |
parent | bc3e79ea24a0fb7fda6f54a6f72e3a46943b1cec (diff) | |
download | wolfbones-1be3647260a644118e94908eaf2dd64810842c5b.tar.gz wolfbones-1be3647260a644118e94908eaf2dd64810842c5b.tar.bz2 |
first walks on Windows, log.c and porting layer compile
Diffstat (limited to 'include')
-rw-r--r-- | include/wolf/log.h | 18 | ||||
-rw-r--r-- | include/wolf/port/sys.h | 18 |
2 files changed, 35 insertions, 1 deletions
diff --git a/include/wolf/log.h b/include/wolf/log.h index 76dd5ac..97db35b 100644 --- a/include/wolf/log.h +++ b/include/wolf/log.h @@ -55,6 +55,7 @@ typedef enum { WOLF_LOG_DEBUG5 = 12 /**< debug-level messages */ } wolf_log_level_t; +#if defined HAVE_SYSLOG_H /** * @brief Possible syslog facilities. Not the same on all Unix systems. */ @@ -84,7 +85,9 @@ typedef enum { WOLF_LOG_LOCAL6 = 22, /**< local facility 6 */ WOLF_LOG_LOCAL7 = 23 /**< local facility 7 */ } wolf_log_syslog_facility_t; +#endif /* defined HAVE_SYSLOG_H */ +#if defined HAVE_SYSLOG_H /** * @brief Options for opening the system logger, as defined by the Open Group. * @@ -95,12 +98,16 @@ typedef enum { WOLF_LOG_SYSLOG_PID = 1, /**< log the process ID with each message */ WOLF_LOG_SYSLOG_CONS = 2 /**< log to the system console on error */ } wolf_log_syslog_option_t; +#endif /* defined HAVE_SYSLOG_H */ /** * @brief The default options to pass to the system logger. */ +#if defined HAVE_SYSLOG_H #define WOLF_LOG_SYSLOG_DEFAULT_OPTIONS WOLF_LOG_SYSLOG_PID | WOLF_LOG_SYSLOG_CONS +#endif /* defined HAVE_SYSLOG_H */ +#if defined HAVE_SYSLOG_H /** * Convert a wolf_log_syslog_facility_t to its string representation. * @@ -108,7 +115,9 @@ typedef enum { * @return a string constant like "DAEMON" */ const char *wolf_log_syslog_facility_to_str( wolf_log_syslog_facility_t facility ); +#endif /* defined HAVE_SYSLOG_H */ +#if defined HAVE_SYSLOG_H /** * Convert a name of a syslog facility like "DAEMON" to the corresponding * wolf_log_syslog_facility_t @@ -118,7 +127,9 @@ const char *wolf_log_syslog_facility_to_str( wolf_log_syslog_facility_t facility * passed facility is not known */ wolf_log_syslog_facility_t wolf_log_str_to_syslog_facility( const char *facility ); +#endif /* defined HAVE_SYSLOG_H */ +#if defined HAVE_SYSLOG_H /** * Returns if the current platform knows about the given syslog facility. * @@ -126,6 +137,7 @@ wolf_log_syslog_facility_t wolf_log_str_to_syslog_facility( const char *facility * @return true if the facility exists, false if not */ bool wolf_log_platform_has_syslog_facility( wolf_log_syslog_facility_t facility ); +#endif /* defined HAVE_SYSLOG_H */ /** * Convert a wolf_log_level_t to its string representation. @@ -154,6 +166,7 @@ wolf_log_level_t wolf_log_str_to_level( const char *level ); */ void wolf_log_openlogtofile( const char *filename, wolf_log_level_t level ); +#if defined HAVE_SYSLOG_H /** * Open a channel to the Unix system logger. * @@ -169,6 +182,7 @@ void wolf_log_openlogtosyslog( const char *ident, wolf_log_syslog_facility_t facility, wolf_log_level_t level, int options ); +#endif /* defined HAVE_SYSLOG_H */ /** * Open a channel for logging to stderr. @@ -183,10 +197,12 @@ void wolf_log_openlogtostderr( wolf_log_level_t level ); */ void wolf_log_closelogtofile( void ); +#if defined HAVE_SYSLOG_H /** * Close logging to the Unix system logger. */ void wolf_log_closelogtosyslog( void ); +#endif /* defined HAVE_SYSLOG_H */ /** * Close logging to stderr. @@ -198,10 +214,12 @@ void wolf_log_closelogtostderr( void ); */ void wolf_log_reopenlogtofile( void ); +#if defined HAVE_SYSLOG_H /** * Reopen logging to the Unix system logger. */ void wolf_log_reopenlogtosyslog( void ); +#endif /* defined HAVE_SYSLOG_H */ /** * Write a formatted log message to the logger. diff --git a/include/wolf/port/sys.h b/include/wolf/port/sys.h index 3cd4e9e..28415cd 100644 --- a/include/wolf/port/sys.h +++ b/include/wolf/port/sys.h @@ -45,6 +45,7 @@ #define HAVE_STRCASECMP #define HAVE_STRNCASECMP #define HAVE_STRINGS_H +#define HAVE_SYSLOG_H #else #error unknown platform #endif /* defined OS_MINOR_VERSION == 6 */ @@ -66,6 +67,7 @@ #define HAVE_STRDUP #define HAVE_STRERROR_R #define HAVE_LOCKF +#define HAVE_SYSLOG_H #else #error unknown platform #endif /* defined OS_MINOR_VERSION == 0 */ @@ -82,6 +84,7 @@ #define HAVE_STRDUP #define HAVE_STRERROR_R #define HAVE_LOCKF +#define HAVE_SYSLOG_H #else #error unknown platform #endif /* defined OS_MINOR_VERSION == 2 */ @@ -104,6 +107,7 @@ #define HAVE_STRDUP #define HAVE_STRERROR_R #define HAVE_LOCKF +#define HAVE_SYSLOG_H #else #error unknown platform #endif /* defined OS_MINOR_VERSION >= 2 && OS_MINOR_VERSION <= 3 */ @@ -128,6 +132,7 @@ #define HAVE_STRCASECMP #define HAVE_STRNCASECMP #define HAVE_STRINGS_H +#define HAVE_SYSLOG_H #else #error unknown platform #endif /* defined OS_MINOR_VERSION == 2 */ @@ -153,6 +158,7 @@ #define HAVE_STRCASECMP #define HAVE_STRNCASECMP #define HAVE_STRINGS_H +#define HAVE_SYSLOG_H #else #if OS_MINOR_VERSION == 10 #if !defined __cplusplus @@ -169,6 +175,7 @@ #define HAVE_STRCASECMP #define HAVE_STRNCASECMP #define HAVE_STRINGS_H +#define HAVE_SYSLOG_H #else #error unknown platform #endif /* OS_MINOR_VERSION == 10 */ @@ -204,6 +211,7 @@ #define HAVE_PTRDIFF_T 1 #define HAVE_VA_COPY 0 #define HAVE___VA_COPY 0 +#define HAVE_SYSLOG_H #else #error unknown platform #endif /* OS_MINOR_VERSION >= 0 && OS_MINOR_VERSON <= 1 */ @@ -212,7 +220,13 @@ #endif /* OS_MAJOR_VERSION == 5 */ #endif /* defined CYGWIN */ -/** @} */ /* @addtogroup wolf_port */ +#if defined _WIN32 +/* TODO */ +#endif /* defined _WIN32 */ + +/* Microsoft Windows compiler */ +#if defined _MSC_VER +#endif /* defined _MSC_VER */ #if defined __INTEL_COMPILER @@ -227,4 +241,6 @@ #endif /* defined __INTEL_COMPILER */ +/** @} */ /* @addtogroup wolf_port */ + #endif /* ifndef WOLF_SYS_H */ |