summaryrefslogtreecommitdiffstats
path: root/avahi-compat-howl/include/salt
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-10-12 22:37:25 +0000
committerLennart Poettering <lennart@poettering.net>2005-10-12 22:37:25 +0000
commitc6bf0e465bceac2ef0e5f3a3ba97ae1f8b251a40 (patch)
treed08372753c9fda3f21939fba12fc6ef9ce598978 /avahi-compat-howl/include/salt
parentac550214812696d5ec68900d02df823d13724e47 (diff)
add howl headers
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@747 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-compat-howl/include/salt')
-rw-r--r--avahi-compat-howl/include/salt/address.h128
-rw-r--r--avahi-compat-howl/include/salt/debug.h230
-rw-r--r--avahi-compat-howl/include/salt/interface.h115
-rw-r--r--avahi-compat-howl/include/salt/platform.h438
-rw-r--r--avahi-compat-howl/include/salt/salt.h215
-rw-r--r--avahi-compat-howl/include/salt/signal.h61
-rw-r--r--avahi-compat-howl/include/salt/socket.h263
-rw-r--r--avahi-compat-howl/include/salt/time.h100
8 files changed, 1550 insertions, 0 deletions
diff --git a/avahi-compat-howl/include/salt/address.h b/avahi-compat-howl/include/salt/address.h
new file mode 100644
index 0000000..b18a4af
--- /dev/null
+++ b/avahi-compat-howl/include/salt/address.h
@@ -0,0 +1,128 @@
+#ifndef _salt_address_h
+#define _salt_address_h
+
+/*
+ * Copyright 2003, 2004 Porchdog Software. All rights reserved.
+ *
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY PORCHDOG SOFTWARE ``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 HOWL PROJECT 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.
+ *
+ * The views and conclusions contained in the software and documentation are those
+ * of the authors and should not be interpreted as representing official policies,
+ * either expressed or implied, of Porchdog Software.
+ */
+
+
+#include <salt/salt.h>
+
+
+#if defined(__cplusplus)
+extern "C"
+{
+#endif
+
+
+typedef struct _sw_ipv4_address
+{
+ sw_uint32 m_addr;
+} sw_ipv4_address;
+
+typedef sw_uint32 sw_saddr;
+
+
+sw_ipv4_address HOWL_API
+sw_ipv4_address_any(void);
+
+
+sw_ipv4_address HOWL_API
+sw_ipv4_address_loopback(void);
+
+
+sw_result HOWL_API
+sw_ipv4_address_init(
+ sw_ipv4_address * self);
+
+
+sw_result HOWL_API
+sw_ipv4_address_init_from_saddr(
+ sw_ipv4_address * self,
+ sw_saddr saddr);
+
+
+sw_result HOWL_API
+sw_ipv4_address_init_from_name(
+ sw_ipv4_address * self,
+ sw_const_string name);
+
+
+sw_result HOWL_API
+sw_ipv4_address_init_from_address(
+ sw_ipv4_address * self,
+ sw_ipv4_address addr);
+
+
+sw_result HOWL_API
+sw_ipv4_address_init_from_this_host(
+ sw_ipv4_address * self);
+
+
+sw_result HOWL_API
+sw_ipv4_address_fina(
+ sw_ipv4_address self);
+
+
+sw_bool HOWL_API
+sw_ipv4_address_is_any(
+ sw_ipv4_address self);
+
+
+sw_saddr HOWL_API
+sw_ipv4_address_saddr(
+ sw_ipv4_address self);
+
+
+sw_string HOWL_API
+sw_ipv4_address_name(
+ sw_ipv4_address self,
+ sw_string name,
+ sw_uint32 len);
+
+
+sw_result HOWL_API
+sw_ipv4_address_decompose(
+ sw_ipv4_address self,
+ sw_uint8 * a1,
+ sw_uint8 * a2,
+ sw_uint8 * a3,
+ sw_uint8 * a4);
+
+
+sw_bool HOWL_API
+sw_ipv4_address_equals(
+ sw_ipv4_address self,
+ sw_ipv4_address addr);
+
+
+#if defined(__cplusplus)
+}
+#endif
+
+
+#endif
diff --git a/avahi-compat-howl/include/salt/debug.h b/avahi-compat-howl/include/salt/debug.h
new file mode 100644
index 0000000..03bd453
--- /dev/null
+++ b/avahi-compat-howl/include/salt/debug.h
@@ -0,0 +1,230 @@
+#ifndef _salt_debug_h
+#define _salt_debug_h
+
+/*
+ * Copyright 2003, 2004 Porchdog Software. All rights reserved.
+ *
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY PORCHDOG SOFTWARE ``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 HOWL PROJECT 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.
+ *
+ * The views and conclusions contained in the software and documentation are those
+ * of the authors and should not be interpreted as representing official policies,
+ * either expressed or implied, of Porchdog Software.
+ */
+
+#include <salt/platform.h>
+#include <stdarg.h>
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+#define SW_LOG_WARNING 1 << 0
+#define SW_LOG_ERROR 1 << 1
+#define SW_LOG_NOTICE 1 << 2
+#define SW_LOG_VERBOSE 1 << 3
+#define SW_LOG_OFF 0x0
+
+
+#if (defined( __GNUC__))
+
+# if ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)))
+
+# define __C99_VA_ARGS__ 1
+
+# define __GNU_VA_ARGS__ 0
+
+# else
+
+# define __C99_VA_ARGS__ 0
+
+# define __GNU_VA_ARGS__ 1
+
+# endif
+
+#else
+
+# define __C99_VA_ARGS__ 0
+
+# define __GNU_VA_ARGS__ 0
+
+#endif
+
+
+# if ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 9)))
+
+# define __SW_FUNCTION__ __func__
+
+#elif (defined( __GNUC__))
+
+# define __SW_FUNCTION__ __PRETTY_FUNCTION__
+
+#elif( defined(_MSC_VER ) && !defined(_WIN32_WCE))
+
+# define __SW_FUNCTION__ __FUNCTION__
+
+#else
+
+# define __SW_FUNCTION__ ""
+
+#endif
+
+
+#define sw_check(expr, label, action) \
+do \
+{ \
+ if (!(expr)) \
+ { \
+ { \
+ action; \
+ } \
+ goto label; \
+ } \
+} while (0)
+
+
+#define sw_check_log(expr, label, action) \
+do \
+{ \
+ if (!(expr)) \
+ { \
+ sw_print_assert(0, NULL, __FILE__, __SW_FUNCTION__, __LINE__); \
+ { \
+ action; \
+ } \
+ goto label; \
+ } \
+} while (0)
+
+
+#define sw_check_okay(code, label) \
+do \
+{ \
+ if ((int) code != 0) \
+ { \
+ goto label; \
+ } \
+} while (0)
+
+
+#define sw_check_okay_log(code, label) \
+do \
+{ \
+ if ((int) code != 0) \
+ { \
+ sw_print_assert((int) code, NULL, __FILE__, __SW_FUNCTION__, __LINE__); \
+ goto label; \
+ } \
+} while ( 0 )
+
+
+#define sw_translate_error(expr, errno) ((expr) ? 0 : (errno))
+
+
+#if defined(WIN32)
+
+# define sw_socket_errno() (int) WSAGetLastError()
+# define sw_set_socket_errno(X) WSASetLastError(X)
+# define sw_system_errno() (int) GetLastError()
+# define sw_set_system_errno(X) SetLastError(X)
+
+#else
+
+# define sw_socket_errno() errno
+# define sw_set_socket_errno(X) errno = X
+# define sw_system_errno() errno
+# define sw_set_system_errno(X) errno = X
+
+#endif
+
+
+#if !defined(NDEBUG)
+
+# define sw_assert(X) \
+ \
+ do \
+ { \
+ if (!(X)) \
+ { \
+ sw_print_assert( 0, #X, __FILE__, __SW_FUNCTION__, __LINE__); \
+ } \
+ } while( 0 )
+
+#else
+
+# define sw_assert(X)
+
+#endif
+
+
+void HOWL_API
+sw_print_assert(
+ int code,
+ sw_const_string assert_string,
+ sw_const_string file,
+ sw_const_string func,
+ int line);
+
+
+#if !defined(NDEBUG)
+
+void HOWL_API
+sw_print_debug(
+ int level,
+ sw_const_string format,
+ ...);
+
+# if (__C99_VA_ARGS__)
+
+# define sw_debug(...) sw_print_debug(__VA_ARGS__)
+
+# else
+
+# define sw_debug sw_print_debug
+
+# endif
+
+#else
+
+# if (__C99_VA_ARGS__)
+
+# define sw_debug(...)
+
+# else
+
+# define sw_debug while( 0 )
+
+# endif
+
+#endif
+
+
+#define SW_UNUSED_PARAM(X) (void) (X)
+
+
+#if defined(__cplusplus)
+}
+#endif
+
+
+#endif
diff --git a/avahi-compat-howl/include/salt/interface.h b/avahi-compat-howl/include/salt/interface.h
new file mode 100644
index 0000000..5356398
--- /dev/null
+++ b/avahi-compat-howl/include/salt/interface.h
@@ -0,0 +1,115 @@
+#ifndef _sw_interface_h
+#define _sw_interface_h
+
+/*
+ * Copyright 2003, 2004 Porchdog Software. All rights reserved.
+ *
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY PORCHDOG SOFTWARE ``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 HOWL PROJECT 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.
+ *
+ * The views and conclusions contained in the software and documentation are those
+ * of the authors and should not be interpreted as representing official policies,
+ * either expressed or implied, of Porchdog Software.
+ */
+
+#include <salt/address.h>
+
+struct _sw_network_interface;
+typedef struct _sw_network_interface * sw_network_interface;
+
+
+typedef enum _sw_network_interface_state
+{
+ SW_NETWORK_INTERFACE_RUNNING = 0x1,
+} sw_network_interface_state;
+
+
+typedef struct _sw_mac_address
+{
+ sw_uint8 m_id[6];
+} sw_mac_address;
+
+
+sw_result HOWL_API
+sw_network_interfaces(
+ sw_uint32 * count,
+ sw_network_interface ** netifs);
+
+
+sw_result HOWL_API
+sw_network_interfaces_fina(
+ sw_uint32 count,
+ sw_network_interface * netifs);
+
+
+sw_result HOWL_API
+sw_network_interface_fina(
+ sw_network_interface netif);
+
+
+sw_result HOWL_API
+sw_network_interface_by_name(
+ sw_string name,
+ sw_network_interface * netif);
+
+
+sw_result HOWL_API
+sw_network_interface_name(
+ sw_network_interface netif,
+ sw_string name,
+ sw_uint32 len);
+
+
+sw_result HOWL_API
+sw_network_interface_mac_address(
+ sw_network_interface netif,
+ sw_mac_address * addr);
+
+
+sw_result HOWL_API
+sw_network_interface_ipv4_address(
+ sw_network_interface netif,
+ sw_ipv4_address * addr);
+
+
+sw_result HOWL_API
+sw_network_interface_set_ipv4_address(
+ sw_network_interface netif,
+ sw_ipv4_address addr);
+
+
+sw_result HOWL_API
+sw_network_interface_index(
+ sw_network_interface netif,
+ sw_uint32 * index);
+
+
+sw_result HOWL_API
+sw_network_interface_linked(
+ sw_network_interface netif,
+ sw_bool * linked);
+
+
+sw_result HOWL_API
+sw_network_interface_up(
+ sw_network_interface netif);
+
+
+#endif
diff --git a/avahi-compat-howl/include/salt/platform.h b/avahi-compat-howl/include/salt/platform.h
new file mode 100644
index 0000000..d0553e7
--- /dev/null
+++ b/avahi-compat-howl/include/salt/platform.h
@@ -0,0 +1,438 @@
+#ifndef _sw_platform_h
+#define _sw_platform_h
+
+/*
+ * Copyright 2003, 2004 Porchdog Software, Inc. All rights reserved.
+ *
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY PORCHDOG SOFTWARE ``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 HOWL PROJECT 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.
+ *
+ * The views and conclusions contained in the software and documentation are those
+ * of the authors and should not be interpreted as representing official policies,
+ * either expressed or implied, of Porchdog Software, Inc.
+ */
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+#if defined(__VXWORKS__)
+
+# define HOWL_API
+# include <vxworks.h>
+# include <sysLib.h>
+
+# define sw_snooze(SECS) taskDelay(sysClkRateGet() * SECS)
+
+#elif defined(WIN32)
+
+# define WIN32_LEAN_AND_MEAN
+# define HOWL_API __stdcall
+# pragma warning(disable:4127)
+# include <windows.h>
+# include <stdlib.h>
+
+typedef signed char int8_t;
+typedef unsigned char u_int8_t;
+typedef signed short int16_t;
+typedef unsigned short u_int16_t;
+typedef signed long int32_t;
+typedef unsigned long u_int32_t;
+typedef _int64 int64_t;
+typedef _int64 u_int64_t;
+
+# define sw_snooze(SECS) Sleep(SECS * 1000)
+
+#else
+
+# define HOWL_API
+# if defined(HOWL_KERNEL)
+# include <howl_config.h>
+# endif
+# include <sys/types.h>
+# include <stdlib.h>
+# include <unistd.h>
+
+# define sw_snooze(SECS) sleep(SECS)
+
+#endif
+
+#if defined(__sun)
+
+# define u_int8_t uint8_t
+# define u_int16_t uint16_t
+# define u_int32_t uint32_t
+# define u_int64_t uint64_t
+
+#endif
+
+typedef void * sw_opaque;
+typedef void * sw_opaque_t;
+typedef int8_t sw_int8;
+typedef u_int8_t sw_uint8;
+typedef u_int8_t sw_bool;
+typedef int16_t sw_int16;
+typedef u_int16_t sw_uint16;
+typedef int32_t sw_int32;
+typedef u_int32_t sw_uint32;
+typedef int64_t sw_int64;
+typedef u_int64_t sw_uint64;
+typedef char * sw_string;
+typedef sw_uint8 * sw_octets;
+#if !defined(__VXWORKS__) || defined(__cplusplus)
+typedef const char * sw_const_string;
+typedef const u_int8_t * sw_const_octets;
+#else
+typedef char * sw_const_string;
+typedef u_int8_t * sw_const_octets;
+#endif
+typedef size_t sw_size_t;
+typedef int sw_result;
+
+
+
+/* --------------------------------------------------------
+ *
+ * Endian-osity
+ *
+ * SW_ENDIAN is 0 for big endian platforms, 1
+ * for little endian platforms.
+ *
+ * The macro WORDS_BIGENDIAN will be defined
+ * by autoconf. If you are using Howl on
+ * a platform that doesn't have autoconf, define
+ * SW_ENDIAN directly
+ * --------------------------------------------------------
+ */
+
+#if !defined(SW_ENDIAN)
+
+# if WORDS_BIGENDIAN == 1
+
+# define SW_ENDIAN 0
+
+# else
+
+# define SW_ENDIAN 1
+
+# endif
+
+#endif
+
+
+/* --------------------------------------------------------
+ *
+ * Strings
+ *
+ * These macros supports cross platform string functions
+ * for the following OSes
+ *
+ * Win32
+ * *NIX
+ * PalmOS
+ * VxWorks
+ *
+ * --------------------------------------------------------
+ */
+
+#if defined(WIN32)
+
+# include <string.h>
+
+# define sw_memset(ARG1, ARG2, ARG3) memset((char*) ARG1, ARG2, ARG3)
+# define sw_memcpy(ARG1, ARG2, ARG3) memmove((char*) ARG1, (char*) ARG2, ARG3)
+# define sw_memcmp(ARG1, ARG2, ARG3) memcmp((char*) ARG1, ARG2, ARG3)
+# define sw_strcasecmp(ARG1, ARG2) stricmp(ARG1, ARG2)
+# define sw_strncasecmp(ARG1, ARG2) strnicmp(ARG1, ARG2)
+# define sw_strcat(ARG1, ARG2) strcat(ARG1, ARG2)
+# define sw_strncat(ARG1, ARG2) strncat(ARG1, ARG2)
+# define sw_strchr(ARG1, ARG2) strchr(ARG1, ARG2)
+# define sw_strcmp(ARG1, ARG2) strcmp(ARG1, ARG2)
+# define sw_strncmp(ARG1, ARG2) strncmp(ARG1, ARG2)
+# define sw_strcoll(ARG1, ARG2) strcoll(ARG1, ARG2)
+# define sw_strcpy(ARG1, ARG2) (ARG2) ? strcpy(ARG1, ARG2) : strcpy(ARG1, "")
+# define sw_strncpy(ARG1, ARG2, N) (ARG2) ? strncpy(ARG1, ARG2, N) : strcpy(ARG1, "")
+# define sw_strcspn(ARG1, ARG2) strcspn(ARG1, ARG2)
+# define sw_strlen(ARG1) strlen(ARG1)
+# define sw_strstr(ARG1, ARG2) strstr(ARG1, ARG2)
+# define sw_strtok_r(ARG1, ARG2, ARG3) strtok_r(ARG1, ARG2, ARG3)
+
+#elif defined(__VXWORKS__)
+
+# include <string.h>
+
+extern sw_int32
+sw_strcasecmp(
+ sw_const_string arg1,
+ sw_const_string arg2);
+
+extern sw_int32
+sw_strncasecmp(
+ sw_const_string arg1,
+ sw_const_string arg2,
+ sw_len n);
+
+extern sw_string
+sw_strtok_r(
+ sw_string arg1,
+ sw_const_string arg2,
+ sw_string * lasts);
+
+# define sw_memset(ARG1, ARG2, ARG3) memset((char*) ARG1, ARG2, ARG3)
+# define sw_memcpy(ARG1, ARG2, ARG3) memcpy((char*) ARG1, (char*) ARG2, ARG3)
+# define sw_memcmp(ARG1, ARG2, ARG3) memcmp((char*) ARG1, ARG2, ARG3)
+# define sw_strcat(ARG1, ARG2) strcat(ARG1, ARG2)
+# define sw_strncat(ARG1, ARG2) strncat(ARG1, ARG2)
+# define sw_strchr(ARG1, ARG2) strchr(ARG1, ARG2)
+# define sw_strcmp(ARG1, ARG2) strcmp(ARG1, ARG2)
+# define sw_strncmp(ARG1, ARG2) strncmp(ARG1, ARG2)
+# define sw_strcoll(ARG1, ARG2) strcoll(ARG1, ARG2)
+# define sw_strcpy(ARG1, ARG2) ARG2 ? strcpy(ARG1, ARG2) : strcpy(ARG1, "")
+# define sw_strncpy(ARG1, ARG2, N) ARG2 ? strncpy(ARG1, ARG2, N) : strcpy(ARG1, "")
+# define sw_strcspn(ARG1, ARG2) strcspn(ARG1, ARG2)
+# define sw_strlen(ARG1) strlen(ARG1)
+# define sw_strstr(ARG1, ARG2) strstr(ARG1, ARG2)
+
+#elif defined(__PALMOS__)
+
+# include <StringMgr.h>
+
+# define sw_strcasecmp(ARG1, ARG2) strcasecmp(ARG1, ARG2)
+# define sw_strncasecmp(ARG1, ARG2) strncasecmp(ARG1, ARG2)
+# define sw_strcat(ARG1, ARG2) StrCat(ARG1, ARG2)
+# define sw_strncat(ARG1, ARG2) StrNCat(ARG1, ARG2)
+# define sw_strchr(ARG1, ARG2) StrChr(ARG1, ARG2)
+# define sw_strcmp(ARG1, ARG2) StrCampare(ARG1, ARG2)
+# define sw_strncmp(ARG1, ARG2) StrNCompare(ARG1, ARG2)
+# define sw_strcoll(ARG1, ARG2) strcoll(ARG1, ARG2)
+# define sw_strcpy(ARG1, ARG2) ARG2 ? StrCopy(ARG1, ARG2) : StrCopy(ARG1, "")
+# define sw_strncpy(ARG1, ARG2, N) ARG2 ? StrNCopy(ARG1, ARG2, N) : StrCopy(ARG1, "")
+# define sw_strcspn(ARG1, ARG2) strcspn(ARG1, ARG2)
+# define sw_strlen(ARG1) StrLen(ARG1)
+# define sw_strstr(ARG1, ARG2) strstr(ARG1, ARG2)
+# define sw_strtok_r(ARG1, ARG2, ARG3) strtok_r(ARG1, ARG2, ARG3)
+
+#else
+
+# include <string.h>
+
+# if defined(__Lynx__)
+ char * strchr(char*, int);
+# endif
+
+# define sw_memset(ARG1, ARG2, ARG3) memset((char*) ARG1, ARG2, ARG3)
+# define sw_memcpy(ARG1, ARG2, ARG3) memcpy((char*) ARG1, (char*) ARG2, ARG3)
+# define sw_memcmp(ARG1, ARG2, ARG3) memcmp((char*) ARG1, ARG2, ARG3)
+# define sw_strcasecmp(ARG1, ARG2) strcasecmp(ARG1, ARG2)
+# define sw_strncasecmp(ARG1, ARG2) strncasecmp(ARG1, ARG2)
+# define sw_strcat(ARG1, ARG2) strcat(ARG1, ARG2)
+# define sw_strncat(ARG1, ARG2) strncat(ARG1, ARG2)
+# define sw_strchr(ARG1, ARG2) strchr(ARG1, ARG2)
+# define sw_strcmp(ARG1, ARG2) strcmp(ARG1, ARG2)
+# define sw_strncmp(ARG1, ARG2) strncmp(ARG1, ARG2)
+# define sw_strcoll(ARG1, ARG2) strcoll(ARG1, ARG2)
+# define sw_strcpy(ARG1, ARG2) ARG2 ? strcpy(ARG1, ARG2) : strcpy(ARG1, "")
+# define sw_strncpy(ARG1, ARG2, N) ARG2 ? strncpy(ARG1, ARG2, N) : strcpy(ARG1, "")
+# define sw_strcspn(ARG1, ARG2) strcspn(ARG1, ARG2)
+# define sw_strlen(ARG1) strlen(ARG1)
+# define sw_strstr(ARG1, ARG2) strstr(ARG1, ARG2)
+# define sw_strtok_r(ARG1, ARG2, ARG3) strtok_r(ARG1, ARG2, ARG3)
+
+#endif
+
+
+sw_string
+sw_strdup(
+ sw_const_string str);
+
+
+/* --------------------------------------------------------
+ *
+ * Memory
+ *
+ * These macros support cross platform heap functions.
+ * When compiling with DEBUG, some extra checking is
+ * done which can aid in tracking down heap corruption
+ * problems
+ *
+ * --------------------------------------------------------
+ */
+
+#if defined(NDEBUG)
+
+# define sw_malloc(SIZE) malloc(SIZE)
+# define sw_realloc(MEM,SIZE) realloc(MEM, SIZE)
+# define sw_free(MEM) if (MEM) free(MEM)
+
+#else
+
+# define sw_malloc(SIZE) _sw_debug_malloc(SIZE, __SW_FUNCTION__, __FILE__, __LINE__)
+# define sw_realloc(MEM,SIZE) _sw_debug_realloc(MEM, SIZE, __SW_FUNCTION__, __FILE__, __LINE__)
+# define sw_free(MEM) if (MEM) _sw_debug_free(MEM, __SW_FUNCTION__, __FILE__, __LINE__)
+
+#endif
+
+
+sw_opaque HOWL_API
+_sw_debug_malloc(
+ sw_size_t size,
+ sw_const_string function,
+ sw_const_string file,
+ sw_uint32 line);
+
+
+sw_opaque HOWL_API
+_sw_debug_realloc(
+ sw_opaque_t mem,
+ sw_size_t size,
+ sw_const_string function,
+ sw_const_string file,
+ sw_uint32 line);
+
+
+void HOWL_API
+_sw_debug_free(
+ sw_opaque_t mem,
+ sw_const_string function,
+ sw_const_string file,
+ sw_uint32 line);
+
+
+
+/* --------------------------------------------------------
+ *
+ * Sockets
+ *
+ * These macros and APIs support cross platform socket
+ * calls. I am relying on BSD APIs, but even with those
+ * there are subtle and not so subtle platform differences
+ *
+ * --------------------------------------------------------
+ */
+
+#if defined(__VXWORKS__)
+
+# include <vxworks.h>
+# include <hostLib.h>
+# include <sockLib.h>
+# include <ioLib.h>
+# include <inetLib.h>
+
+typedef int sw_sockdesc_t;
+typedef socklen_t sw_socklen_t;
+
+#elif defined(WIN32)
+
+# include <winsock2.h>
+
+typedef SOCKET sw_sockdesc_t;
+typedef int sw_socklen_t;
+
+# define SW_E_WOULDBLOCK WSAEWOULDBLOCK
+# define SW_INVALID_SOCKET INVALID_SOCKET
+# define SW_SOCKET_ERROR SOCKET_ERROR
+
+# define sw_close_socket(X) closesocket(X)
+
+#else
+
+# if defined(sun)
+
+# include <unistd.h>
+
+# endif
+
+# include <sys/types.h>
+# include <signal.h>
+
+# if defined(__Lynx__)
+
+# include <socket.h>
+
+# else
+
+# include <sys/socket.h>
+
+# endif
+
+# include <netinet/in.h>
+# include <netinet/tcp.h>
+# include <netdb.h>
+# include <arpa/inet.h>
+# include <stdlib.h>
+# include <unistd.h>
+# include <sys/ioctl.h>
+# include <stdio.h>
+# include <errno.h>
+
+typedef sw_int32 sw_sockdesc_t;
+typedef socklen_t sw_socklen_t;
+
+# define SW_E_WOULDBLOCK EWOULDBLOCK
+# define SW_INVALID_SOCKET -1
+# define SW_SOCKET_ERROR -1
+
+# define sw_close_socket(X) close(X)
+
+#endif
+
+
+/* --------------------------------------------------------
+ *
+ * strerror()
+ *
+ * This function will print a string rep of a system error
+ * code
+ *
+ * --------------------------------------------------------
+ */
+
+sw_const_string
+sw_strerror();
+
+
+/*
+ * Obsolete types and macros.
+ *
+ * These are here for backwards compatibility, but will
+ * be removed in the future
+ */
+#define sw_char sw_int8
+#define sw_uchar sw_uint8
+#define sw_octet sw_uint8
+#define sw_short sw_int16
+#define sw_ushort sw_uint16
+#define sw_long sw_int32
+#define sw_ulong sw_uint32
+
+
+#define SW_TRY(EXPR) { sw_result result; if ((result = EXPR) != SW_OKAY) return result; } ((void) 0)
+#define SW_TRY_GOTO(EXPR) { if ((result = EXPR) != SW_OKAY) goto exit; } ((void) 0)
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/avahi-compat-howl/include/salt/salt.h b/avahi-compat-howl/include/salt/salt.h
new file mode 100644
index 0000000..88ac0d9
--- /dev/null
+++ b/avahi-compat-howl/include/salt/salt.h
@@ -0,0 +1,215 @@
+#ifndef _sw_salt_h
+#define _sw_salt_h
+
+/*
+ * Copyright 2003, 2004 Porchdog Software, Inc. All rights reserved.
+ *
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY PORCHDOG SOFTWARE ``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 HOWL PROJECT 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.
+ *
+ * The views and conclusions contained in the software and documentation are those
+ * of the authors and should not be interpreted as representing official policies,
+ * either expressed or implied, of Porchdog Software, Inc.
+ */
+
+#include <salt/platform.h>
+#include <salt/time.h>
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+typedef enum _sw_socket_event
+{
+ SW_SOCKET_READ = (1 << 0),
+ SW_SOCKET_WRITE = (1 << 1),
+ SW_SOCKET_OOB = (1 << 2)
+} sw_socket_event;
+
+
+struct _sw_salt;
+typedef struct _sw_salt * sw_salt;
+struct _sw_socket;
+struct _sw_timer;
+struct _sw_network_interface;
+struct _sw_signal;
+
+typedef sw_opaque sw_socket_handler;
+typedef sw_result
+(HOWL_API *sw_socket_handler_func)(
+ sw_socket_handler handler,
+ sw_salt salt,
+ struct _sw_socket * socket,
+ sw_socket_event events,
+ sw_opaque extra);
+
+
+typedef sw_opaque sw_timer_handler;
+typedef sw_result
+(HOWL_API *sw_timer_handler_func)(
+ sw_timer_handler handler,
+ sw_salt salt,
+ struct _sw_timer * timer,
+ sw_time timeout,
+ sw_opaque extra);
+
+typedef sw_opaque sw_network_interface_handler;
+typedef sw_result
+(HOWL_API *sw_network_interface_handler_func)(
+ sw_network_interface_handler handler,
+ sw_salt salt,
+ struct _sw_network_interface * netif,
+ sw_opaque extra);
+
+typedef sw_opaque sw_signal_handler;
+typedef sw_result
+(HOWL_API *sw_signal_handler_func)(
+ sw_signal_handler handler,
+ sw_salt salt,
+ struct _sw_signal * signal,
+ sw_opaque extra);
+
+
+sw_result HOWL_API
+sw_salt_init(
+ sw_salt * self,
+ int argc,
+ char ** argv);
+
+
+sw_result HOWL_API
+sw_salt_fina(
+ sw_salt self);
+
+
+sw_result HOWL_API
+sw_salt_register_socket(
+ sw_salt self,
+ struct _sw_socket * socket,
+ sw_socket_event events,
+ sw_socket_handler handler,
+ sw_socket_handler_func func,
+ sw_opaque extra);
+
+
+sw_result HOWL_API
+sw_salt_unregister_socket(
+ sw_salt self,
+ struct _sw_socket * socket);
+
+
+sw_result HOWL_API
+sw_salt_register_timer(
+ sw_salt self,
+ struct _sw_timer * timer,
+ sw_time timeout,
+ sw_timer_handler handler,
+ sw_timer_handler_func func,
+ sw_opaque extra);
+
+
+sw_result HOWL_API
+sw_salt_unregister_timer(
+ sw_salt self,
+ struct _sw_timer * timer);
+
+
+sw_result HOWL_API
+sw_salt_register_network_interface(
+ sw_salt self,
+ struct _sw_network_interface * netif,
+ sw_network_interface_handler handler,
+ sw_network_interface_handler_func func,
+ sw_opaque extra);
+
+
+sw_result HOWL_API
+sw_salt_unregister_network_interface_handler(
+ sw_salt self);
+
+
+sw_result HOWL_API
+sw_salt_register_signal(
+ sw_salt self,
+ struct _sw_signal * signal,
+ sw_signal_handler handler,
+ sw_signal_handler_func func,
+ sw_opaque extra);
+
+
+sw_result HOWL_API
+sw_salt_unregister_signal(
+ sw_salt self,
+ struct _sw_signal * signal);
+
+
+sw_result HOWL_API
+sw_salt_lock(
+ sw_salt self);
+
+
+sw_result HOWL_API
+sw_salt_unlock(
+ sw_salt self);
+
+
+sw_result HOWL_API
+sw_salt_step(
+ sw_salt self,
+ sw_uint32 * msec);
+
+
+sw_result HOWL_API
+sw_salt_run(
+ sw_salt self);
+
+
+sw_result HOWL_API
+sw_salt_stop_run(
+ sw_salt self);
+
+
+#define SW_FALSE 0
+#define SW_TRUE 1
+#define SW_OKAY 0
+
+
+/*
+ * error codes
+ */
+#define SW_E_CORE_BASE 0x80000000
+#define SW_E_UNKNOWN (SW_E_CORE_BASE) + 1
+#define SW_E_INIT (SW_E_CORE_BASE) + 2
+#define SW_E_MEM (SW_E_CORE_BASE) + 3
+#define SW_E_EOF (SW_E_CORE_BASE) + 4
+#define SW_E_NO_IMPL (SW_E_CORE_BASE) + 5
+#define SW_E_FILE_LOCKED (SW_E_CORE_BASE) + 6
+#define SW_E_PROTOCOL_NOT_FOUND (SW_E_CORE_BASE) + 7
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/avahi-compat-howl/include/salt/signal.h b/avahi-compat-howl/include/salt/signal.h
new file mode 100644
index 0000000..2ae5bb3
--- /dev/null
+++ b/avahi-compat-howl/include/salt/signal.h
@@ -0,0 +1,61 @@
+#ifndef _salt_signal_h
+#define _salt_signal_h
+
+/*
+ * Copyright 2003, 2004 Porchdog Software. All rights reserved.
+ *
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY PORCHDOG SOFTWARE ``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 HOWL PROJECT 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.
+ *
+ * The views and conclusions contained in the software and documentation are those
+ * of the authors and should not be interpreted as representing official policies,
+ * either expressed or implied, of Porchdog Software.
+ */
+
+#include <salt/platform.h>
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+struct _sw_signal;
+typedef struct _sw_signal * sw_signal;
+
+
+sw_result HOWL_API
+sw_signal_init(
+ sw_signal * self,
+ int signal);
+
+
+sw_result HOWL_API
+sw_signal_fina(
+ sw_signal self);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/avahi-compat-howl/include/salt/socket.h b/avahi-compat-howl/include/salt/socket.h
new file mode 100644
index 0000000..88773e4
--- /dev/null
+++ b/avahi-compat-howl/include/salt/socket.h
@@ -0,0 +1,263 @@
+#ifndef _sw_socket_h
+#define _sw_socket_h
+
+/*
+ * Copyright 2003, 2004 Porchdog Software. All rights reserved.
+ *
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY PORCHDOG SOFTWARE ``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 HOWL PROJECT 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.
+ *
+ * The views and conclusions contained in the software and documentation are those
+ * of the authors and should not be interpreted as representing official policies,
+ * either expressed or implied, of Porchdog Software.
+ */
+
+#include <salt/platform.h>
+#include <salt/address.h>
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+struct _sw_socket;
+typedef struct _sw_socket * sw_socket;
+struct _sw_socket_options;
+typedef struct _sw_socket_options * sw_socket_options;
+typedef sw_uint16 sw_port;
+
+
+
+sw_result HOWL_API
+sw_tcp_socket_init(
+ sw_socket * self);
+
+
+sw_result HOWL_API
+sw_tcp_socket_init_with_desc(
+ sw_socket * self,
+ sw_sockdesc_t desc);
+
+
+sw_result HOWL_API
+sw_udp_socket_init(
+ sw_socket * self);
+
+
+sw_result HOWL_API
+sw_multicast_socket_init(
+ sw_socket * self);
+
+
+sw_result HOWL_API
+sw_socket_fina(
+ sw_socket self);
+
+
+sw_result HOWL_API
+sw_socket_bind(
+ sw_socket self,
+ sw_ipv4_address address,
+ sw_port port);
+
+
+sw_result HOWL_API
+sw_socket_join_multicast_group(
+ sw_socket self,
+ sw_ipv4_address local_address,
+ sw_ipv4_address multicast_address,
+ sw_uint32 ttl);
+
+
+sw_result HOWL_API
+sw_socket_leave_multicast_group(
+ sw_socket self);
+
+
+sw_result HOWL_API
+sw_socket_listen(
+ sw_socket self,
+ int qsize);
+
+
+sw_result HOWL_API
+sw_socket_connect(
+ sw_socket self,
+ sw_ipv4_address address,
+ sw_port port);
+
+
+sw_result HOWL_API
+sw_socket_accept(
+ sw_socket self,
+ sw_socket * socket);
+
+
+sw_result HOWL_API
+sw_socket_send(
+ sw_socket self,
+ sw_octets buffer,
+ sw_size_t len,
+ sw_size_t * bytesWritten);
+
+
+sw_result HOWL_API
+sw_socket_sendto(
+ sw_socket self,
+ sw_octets buffer,
+ sw_size_t len,
+ sw_size_t * bytesWritten,
+ sw_ipv4_address to,
+ sw_port port);
+
+
+sw_result HOWL_API
+sw_socket_recv(
+ sw_socket self,
+ sw_octets buffer,
+ sw_size_t max,
+ sw_size_t * len);
+
+
+sw_result HOWL_API
+sw_socket_recvfrom(
+ sw_socket self,
+ sw_octets buffer,
+ sw_size_t max,
+ sw_size_t * len,
+ sw_ipv4_address * from,
+ sw_port * port,
+ sw_ipv4_address * dest,
+ sw_uint32 * interface_index);
+
+
+sw_result HOWL_API
+sw_socket_set_blocking_mode(
+ sw_socket self,
+ sw_bool blocking_mode);
+
+
+sw_result HOWL_API
+sw_socket_set_options(
+ sw_socket self,
+ sw_socket_options options);
+
+
+sw_ipv4_address HOWL_API
+sw_socket_ipv4_address(
+ sw_socket self);
+
+
+sw_port HOWL_API
+sw_socket_port(
+ sw_socket self);
+
+
+sw_sockdesc_t HOWL_API
+sw_socket_desc(
+ sw_socket self);
+
+
+sw_result HOWL_API
+sw_socket_close(
+ sw_socket self);
+
+
+sw_result HOWL_API
+sw_socket_options_init(
+ sw_socket_options * self);
+
+
+sw_result HOWL_API
+sw_socket_options_fina(
+ sw_socket_options self);
+
+
+sw_result HOWL_API
+sw_socket_options_set_debug(
+ sw_socket_options self,
+ sw_bool val);
+
+
+sw_result HOWL_API
+sw_socket_options_set_nodelay(
+ sw_socket_options self,
+ sw_bool val);
+
+
+sw_result HOWL_API
+sw_socket_options_set_dontroute(
+ sw_socket_options self,
+ sw_bool val);
+
+
+sw_result HOWL_API
+sw_socket_options_set_keepalive(
+ sw_socket_options self,
+ sw_bool val);
+
+
+sw_result HOWL_API
+sw_socket_options_set_linger(
+ sw_socket_options self,
+ sw_bool onoff,
+ sw_uint32 linger);
+
+
+sw_result HOWL_API
+sw_socket_options_set_reuseaddr(
+ sw_socket_options self,
+ sw_bool val);
+
+
+sw_result HOWL_API
+sw_socket_options_set_rcvbuf(
+ sw_socket_options self,
+ sw_uint32 val);
+
+
+sw_result HOWL_API
+sw_socket_options_set_sndbuf(
+ sw_socket_options self,
+ sw_uint32 val);
+
+
+int
+sw_socket_error_code(void);
+
+
+#define SW_E_SOCKET_BASE 0x80000200
+#define SW_E_SOCKET (SW_E_SOCKET_BASE) + 1
+#define SW_E_BIND (SW_E_SOCKET_BASE) + 2
+#define SW_E_GETSOCKNAME (SW_E_SOCKET_BASE) + 3
+#define SW_E_ADD_MEMBERSHIP (SW_E_SOCKET_BASE) + 4
+#define SW_E_MULTICAST_TTL (SW_E_SOCKET_BASE) + 5
+#define SW_E_NOCONNECTION (SW_E_SOCKET_BASE) + 6
+#define SW_E_INPROGRESS (SW_E_SOCKET_BASE) + 7
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif
diff --git a/avahi-compat-howl/include/salt/time.h b/avahi-compat-howl/include/salt/time.h
new file mode 100644
index 0000000..b3ec226
--- /dev/null
+++ b/avahi-compat-howl/include/salt/time.h
@@ -0,0 +1,100 @@
+#ifndef _salt_time_h
+#define _salt_time_h
+
+/*
+ * Copyright 2003, 2004 Porchdog Software. All rights reserved.
+ *
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY PORCHDOG SOFTWARE ``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 HOWL PROJECT 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.
+ *
+ * The views and conclusions contained in the software and documentation are those
+ * of the authors and should not be interpreted as representing official policies,
+ * either expressed or implied, of Porchdog Software.
+ */
+
+#include <salt/platform.h>
+
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+
+struct _sw_timer;
+typedef struct _sw_timer * sw_timer;
+
+
+sw_result HOWL_API
+sw_timer_init(
+ sw_timer * self);
+
+
+sw_result HOWL_API
+sw_timer_fina(
+ sw_timer self);
+
+
+typedef struct _sw_time
+{
+ sw_uint32 m_secs;
+ sw_uint32 m_usecs;
+} sw_time;
+
+
+sw_result HOWL_API
+sw_time_init(
+ sw_time * self);
+
+
+sw_result HOWL_API
+sw_time_init_now(
+ sw_time * self);
+
+
+sw_result HOWL_API
+sw_time_fina(
+ sw_time self);
+
+
+sw_time HOWL_API
+sw_time_add(
+ sw_time self,
+ sw_time y);
+
+
+sw_time HOWL_API
+sw_time_sub(
+ sw_time self,
+ sw_time y);
+
+
+sw_int32 HOWL_API
+sw_time_cmp(
+ sw_time self,
+ sw_time y);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif