summaryrefslogtreecommitdiff
path: root/pjlib/include
diff options
context:
space:
mode:
Diffstat (limited to 'pjlib/include')
-rw-r--r--pjlib/include/pj/compat/errno.h3
-rw-r--r--pjlib/include/pj/compat/m_arm.h38
-rw-r--r--pjlib/include/pj/compat/os_linux.h1
-rw-r--r--pjlib/include/pj/compat/os_linux_kernel.h1
-rw-r--r--pjlib/include/pj/compat/os_palmos.h1
-rw-r--r--pjlib/include/pj/compat/os_sunos.h1
-rw-r--r--pjlib/include/pj/compat/os_win32.h1
-rw-r--r--pjlib/include/pj/compat/os_win32_wince.h99
-rw-r--r--pjlib/include/pj/compat/socket.h6
-rw-r--r--pjlib/include/pj/compat/string.h6
-rw-r--r--pjlib/include/pj/compat/unicode.h45
-rw-r--r--pjlib/include/pj/config.h4
-rw-r--r--pjlib/include/pj/log.h1
-rw-r--r--pjlib/include/pj/types.h4
14 files changed, 204 insertions, 7 deletions
diff --git a/pjlib/include/pj/compat/errno.h b/pjlib/include/pj/compat/errno.h
index a4246d72..8c86daa9 100644
--- a/pjlib/include/pj/compat/errno.h
+++ b/pjlib/include/pj/compat/errno.h
@@ -19,7 +19,8 @@
#ifndef __PJ_COMPAT_ERRNO_H__
#define __PJ_COMPAT_ERRNO_H__
-#if defined(PJ_WIN32) && PJ_WIN32 != 0
+#if defined(PJ_WIN32) && PJ_WIN32 != 0 || \
+ defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE != 0
typedef unsigned long pj_os_err_type;
# define pj_get_native_os_error() GetLastError()
diff --git a/pjlib/include/pj/compat/m_arm.h b/pjlib/include/pj/compat/m_arm.h
new file mode 100644
index 00000000..b81ce32c
--- /dev/null
+++ b/pjlib/include/pj/compat/m_arm.h
@@ -0,0 +1,38 @@
+/* $Id$ */
+/*
+ * Copyright (C)2003-2006 Benny Prijono <benny@prijono.org>
+ *
+ * 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 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef __PJ_COMPAT_M_ARM_H__
+#define __PJ_COMPAT_M_ARM_H__
+
+/**
+ * @file m_arm.h
+ * @brief Describes ARM family processor specifics.
+ */
+
+/*
+ * This file covers PJ_M_ARMV4 etc.
+ */
+
+#define PJ_M_NAME "ARM"
+
+#define PJ_HAS_PENTIUM 0
+#define PJ_IS_LITTLE_ENDIAN 1
+#define PJ_IS_BIG_ENDIAN 0
+
+
+#endif /* __PJ_COMPAT_M_ARM_H__ */
diff --git a/pjlib/include/pj/compat/os_linux.h b/pjlib/include/pj/compat/os_linux.h
index 7f90164f..ab26852f 100644
--- a/pjlib/include/pj/compat/os_linux.h
+++ b/pjlib/include/pj/compat/os_linux.h
@@ -77,6 +77,7 @@
#define PJ_HAS_HIGH_RES_TIMER 1
#define PJ_HAS_MALLOC 1
#define PJ_OS_HAS_CHECK_STACK 0
+#define PJ_NATIVE_STRING_IS_UNICODE 0
#define PJ_ATOMIC_VALUE_TYPE long
diff --git a/pjlib/include/pj/compat/os_linux_kernel.h b/pjlib/include/pj/compat/os_linux_kernel.h
index 164cde52..11e22da0 100644
--- a/pjlib/include/pj/compat/os_linux_kernel.h
+++ b/pjlib/include/pj/compat/os_linux_kernel.h
@@ -96,6 +96,7 @@
#define PJ_HAS_HIGH_RES_TIMER 1
#define PJ_OS_HAS_CHECK_STACK 0
#define PJ_TERM_HAS_COLOR 0
+#define PJ_NATIVE_STRING_IS_UNICODE 0
#define PJ_ATOMIC_VALUE_TYPE int
#define PJ_THREAD_DESC_SIZE 128
diff --git a/pjlib/include/pj/compat/os_palmos.h b/pjlib/include/pj/compat/os_palmos.h
index 9f62fe28..3d540a3b 100644
--- a/pjlib/include/pj/compat/os_palmos.h
+++ b/pjlib/include/pj/compat/os_palmos.h
@@ -75,5 +75,6 @@
#define PJ_HAS_HIGH_RES_TIMER 1
#define PJ_OS_HAS_CHECK_STACK 0
+#define PJ_NATIVE_STRING_IS_UNICODE 0
#endif /* __PJ_COMPAT_OS_PALMOS_H__ */
diff --git a/pjlib/include/pj/compat/os_sunos.h b/pjlib/include/pj/compat/os_sunos.h
index 9a3ff335..269631ff 100644
--- a/pjlib/include/pj/compat/os_sunos.h
+++ b/pjlib/include/pj/compat/os_sunos.h
@@ -77,6 +77,7 @@
#define PJ_HAS_HIGH_RES_TIMER 1
#define PJ_HAS_MALLOC 1
#define PJ_OS_HAS_CHECK_STACK 0
+#define PJ_NATIVE_STRING_IS_UNICODE 0
#define PJ_ATOMIC_VALUE_TYPE long
diff --git a/pjlib/include/pj/compat/os_win32.h b/pjlib/include/pj/compat/os_win32.h
index 03c4f544..a078a7e7 100644
--- a/pjlib/include/pj/compat/os_win32.h
+++ b/pjlib/include/pj/compat/os_win32.h
@@ -81,6 +81,7 @@
#define PJ_HAS_HIGH_RES_TIMER 1
#define PJ_HAS_MALLOC 1
#define PJ_OS_HAS_CHECK_STACK 1
+#define PJ_NATIVE_STRING_IS_UNICODE 0
#define PJ_ATOMIC_VALUE_TYPE long
diff --git a/pjlib/include/pj/compat/os_win32_wince.h b/pjlib/include/pj/compat/os_win32_wince.h
new file mode 100644
index 00000000..05b89187
--- /dev/null
+++ b/pjlib/include/pj/compat/os_win32_wince.h
@@ -0,0 +1,99 @@
+/* $Id$ */
+/*
+ * Copyright (C)2003-2006 Benny Prijono <benny@prijono.org>
+ *
+ * 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 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef __PJ_COMPAT_OS_WIN32_WINCE_H__
+#define __PJ_COMPAT_OS_WIN32_WINCE_H__
+
+/**
+ * @file os_win32.h
+ * @brief Describes Win32 operating system family specifics.
+ */
+
+#define PJ_OS_NAME "win32-wince"
+
+#define WIN32_LEAN_AND_MEAN
+//#define PJ_WIN32_WINNT 0x0400
+//#define _WIN32_WINNT PJ_WIN32_WINNT
+
+#define PJ_HAS_ARPA_INET_H 0
+#define PJ_HAS_ASSERT_H 1
+#define PJ_HAS_CTYPE_H 1
+#define PJ_HAS_ERRNO_H 0 /* Must be zero, otherwise errno_test() fails. */
+#define PJ_HAS_LINUX_SOCKET_H 0
+#define PJ_HAS_MALLOC_H 1
+#define PJ_HAS_NETDB_H 0
+#define PJ_HAS_NETINET_IN_H 0
+#define PJ_HAS_SETJMP_H 1
+#define PJ_HAS_STDARG_H 1
+#define PJ_HAS_STDDEF_H 1
+#define PJ_HAS_STDIO_H 1
+#define PJ_HAS_STDLIB_H 1
+#define PJ_HAS_STRING_H 1
+#define PJ_HAS_SYS_IOCTL_H 0
+#define PJ_HAS_SYS_SELECT_H 0
+#define PJ_HAS_SYS_SOCKET_H 0
+#define PJ_HAS_SYS_TIMEB_H 0 /* Doesn't have sys/timeb.h */
+#define PJ_HAS_SYS_TYPES_H 0 /* Doesn't have sys/types.h */
+#define PJ_HAS_TIME_H 1
+#define PJ_HAS_UNISTD_H 0
+
+#define PJ_HAS_MSWSOCK_H 1
+#define PJ_HAS_WINSOCK_H 0
+#define PJ_HAS_WINSOCK2_H 1
+
+#define PJ_SOCK_HAS_INET_ATON 0
+
+/* When this macro is set, getsockopt(SOL_SOCKET, SO_ERROR) will return
+ * the status of non-blocking connect() operation.
+ */
+#define PJ_HAS_SO_ERROR 0
+
+/* This value specifies the value set in errno by the OS when a non-blocking
+ * socket recv() or send() can not return immediately.
+ */
+#define PJ_BLOCKING_ERROR_VAL WSAEWOULDBLOCK
+
+/* This value specifies the value set in errno by the OS when a non-blocking
+ * socket connect() can not get connected immediately.
+ */
+#define PJ_BLOCKING_CONNECT_ERROR_VAL WSAEWOULDBLOCK
+
+/* Default threading is enabled, unless it's overridden. */
+#ifndef PJ_HAS_THREADS
+# define PJ_HAS_THREADS (1)
+#endif
+
+#define PJ_HAS_HIGH_RES_TIMER 1
+#define PJ_HAS_MALLOC 1
+#define PJ_OS_HAS_CHECK_STACK 1
+
+#define PJ_ATOMIC_VALUE_TYPE long
+
+/* TlsAlloc() error value. */
+#define TLS_OUT_OF_INDEXES 0xFFFFFFFF
+
+/* No console. */
+#define PJ_TERM_HAS_COLOR 0
+
+/* No rdtsc */
+#define PJ_TIMESTAMP_USE_RDTSC 0
+
+/* Native string is Unicode. */
+#define PJ_NATIVE_STRING_IS_UNICODE 1
+
+#endif /* __PJ_COMPAT_OS_WIN32_WINCE_H__ */
diff --git a/pjlib/include/pj/compat/socket.h b/pjlib/include/pj/compat/socket.h
index 1ef7fff3..ee4f3a6e 100644
--- a/pjlib/include/pj/compat/socket.h
+++ b/pjlib/include/pj/compat/socket.h
@@ -95,7 +95,7 @@
/*
* Linux kernel specifics
*/
-#ifdef PJ_LINUX_KERNEL
+#if defined(PJ_LINUX_KERNEL)
# include <linux/net.h>
# include <asm/ioctls.h> /* FIONBIO */
# include <linux/syscalls.h> /* sys_select() */
@@ -123,8 +123,8 @@
/*
* Windows specific
*/
-#ifdef PJ_WIN32
- typedef int socklen_t;;
+#if defined(PJ_WIN32) || defined(PJ_WIN32_WINCE)
+ typedef int socklen_t;
#endif
diff --git a/pjlib/include/pj/compat/string.h b/pjlib/include/pj/compat/string.h
index 56ae5c2f..fd041230 100644
--- a/pjlib/include/pj/compat/string.h
+++ b/pjlib/include/pj/compat/string.h
@@ -35,7 +35,11 @@
#if defined(_MSC_VER)
# define strcasecmp stricmp
-# define strncasecmp strnicmp
+# if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE!=0
+# define strncasecmp _strnicmp
+# else
+# define strncasecmp strnicmp
+# endif
# define snprintf _snprintf
#else
# define stricmp strcasecmp
diff --git a/pjlib/include/pj/compat/unicode.h b/pjlib/include/pj/compat/unicode.h
new file mode 100644
index 00000000..cefa44ce
--- /dev/null
+++ b/pjlib/include/pj/compat/unicode.h
@@ -0,0 +1,45 @@
+/* $Id$ */
+/*
+ * Copyright (C)2003-2006 Benny Prijono <benny@prijono.org>
+ *
+ * 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 of the License, 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef __PJ_COMPAT_UNICODE_H__
+#define __PJ_COMPAT_UNICODE_H__
+
+#include <pj/types.h>
+
+/**
+ * @file unicode.h
+ * @brief Provides Unicode conversion for Unicode OSes
+ */
+
+#if defined(PJ_NATIVE_STRING_IS_UNICODE) && PJ_NATIVE_STRING_IS_UNICODE!=0
+
+# define PJ_DECL_UNICODE_TEMP_BUF(var,size) wchar_t var[size]
+# define PJ_NATIVE_STRING(s,buf) pj_ansi_to_unicode(s,buf,PJ_ARRAY_SIZE(buf))
+
+ PJ_DECL(wchar_t*) pj_ansi_to_unicode(const char *s, wchar_t *buf,
+ pj_size_t buf_count);
+
+#else /* PJ_NATIVE_STRING_IS_UNICODE */
+
+# define PJ_DECL_UNICODE_TEMP_BUF(var,size)
+# define PJ_NATIVE_STRING(s, buf) s
+
+#endif /* PJ_NATIVE_STRING_IS_UNICODE */
+
+
+#endif /* __PJ_COMPAT_UNICODE_H__ */
diff --git a/pjlib/include/pj/config.h b/pjlib/include/pj/config.h
index ec21a529..205df1da 100644
--- a/pjlib/include/pj/config.h
+++ b/pjlib/include/pj/config.h
@@ -41,6 +41,8 @@
*/
#if defined(PJ_WIN32) && PJ_WIN32!=0
# include <pj/compat/os_win32.h>
+#elif defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE!=0
+# include <pj/compat/os_win32_wince.h>
#elif defined(PJ_LINUX) && PJ_LINUX!=0
# include <pj/compat/os_linux.h>
#elif defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL!=0
@@ -65,6 +67,8 @@
# include <pj/compat/m_alpha.h>
#elif defined (PJ_M_SPARC) && PJ_M_SPARC != 0
# include <pj/compat/m_sparc.h>
+#elif defined (PJ_M_ARMV4) && PJ_M_ARMV4 != 0
+# include <pj/compat/m_arm.h>
#else
# error "Please specify target machine."
#endif
diff --git a/pjlib/include/pj/log.h b/pjlib/include/pj/log.h
index 4d8dc14a..1cdf8577 100644
--- a/pjlib/include/pj/log.h
+++ b/pjlib/include/pj/log.h
@@ -77,6 +77,7 @@ enum pj_log_decoration
PJ_LOG_HAS_MICRO_SEC = 32, /**< Include microseconds [yes] */
PJ_LOG_HAS_SENDER = 64, /**< Include sender in the log [yes]. */
PJ_LOG_HAS_NEWLINE = 128, /**< Terminate each call with newline [yes].*/
+ PJ_LOG_HAS_CR = 256, /**< Include carriage return [no]. */
};
/**
diff --git a/pjlib/include/pj/types.h b/pjlib/include/pj/types.h
index 0099255f..5b22f75b 100644
--- a/pjlib/include/pj/types.h
+++ b/pjlib/include/pj/types.h
@@ -386,10 +386,10 @@ typedef struct pj_parsed_time
/** This represents day of week where value zero means Sunday */
int wday;
- /** This represents day of the year, 0-365, where zero means
+ /* This represents day of the year, 0-365, where zero means
* 1st of January.
*/
- int yday;
+ /*int yday; */
/** This represents day of month: 1-31 */
int day;