diff options
Diffstat (limited to 'pjlib/include/pj/compat')
26 files changed, 1186 insertions, 1106 deletions
diff --git a/pjlib/include/pj/compat/assert.h b/pjlib/include/pj/compat/assert.h index c3df94e0..658a0a97 100644 --- a/pjlib/include/pj/compat/assert.h +++ b/pjlib/include/pj/compat/assert.h @@ -1,38 +1,38 @@ -/* $Header: /pjproject-0.3/pjlib/src/pj/compat/assert.h 3 9/22/05 10:31a Bennylp $ */
-/* $Log: /pjproject-0.3/pjlib/src/pj/compat/assert.h $
- *
- * 3 9/22/05 10:31a Bennylp
- * Moving all *.h files to include/.
- *
- * 2 9/21/05 1:39p Bennylp
- * Periodic checkin for backup.
- *
- * 1 9/17/05 10:36a Bennylp
- * Created.
- *
- */
-#ifndef __PJ_COMPAT_ASSERT_H__
-#define __PJ_COMPAT_ASSERT_H__
-
-/**
- * @file assert.h
- * @brief Provides assert() macro.
- */
-
-#if defined(PJ_HAS_ASSERT_H) && PJ_HAS_ASSERT_H != 0
-# include <assert.h>
-
-#elif defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL != 0
-# define assert(expr) do { \
- if (!(expr)) \
- printk("!!ASSERTION FAILED: [%s:%d] \"" #expr "\"\n",\
- __FILE__, __LINE__); \
- } while (0)
-
-#else
-# warning "assert() is not implemented"
-# define assert(expr)
-#endif
-
-#endif /* __PJ_COMPAT_ASSERT_H__ */
-
+/* $Header: /pjproject-0.3/pjlib/src/pj/compat/assert.h 3 9/22/05 10:31a Bennylp $ */ +/* $Log: /pjproject-0.3/pjlib/src/pj/compat/assert.h $ + * + * 3 9/22/05 10:31a Bennylp + * Moving all *.h files to include/. + * + * 2 9/21/05 1:39p Bennylp + * Periodic checkin for backup. + * + * 1 9/17/05 10:36a Bennylp + * Created. + * + */ +#ifndef __PJ_COMPAT_ASSERT_H__ +#define __PJ_COMPAT_ASSERT_H__ + +/** + * @file assert.h + * @brief Provides assert() macro. + */ + +#if defined(PJ_HAS_ASSERT_H) && PJ_HAS_ASSERT_H != 0 +# include <assert.h> + +#elif defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL != 0 +# define assert(expr) do { \ + if (!(expr)) \ + printk("!!ASSERTION FAILED: [%s:%d] \"" #expr "\"\n",\ + __FILE__, __LINE__); \ + } while (0) + +#else +# warning "assert() is not implemented" +# define assert(expr) +#endif + +#endif /* __PJ_COMPAT_ASSERT_H__ */ + diff --git a/pjlib/include/pj/compat/cc_gcc.h b/pjlib/include/pj/compat/cc_gcc.h index dcae099d..83ae430f 100644 --- a/pjlib/include/pj/compat/cc_gcc.h +++ b/pjlib/include/pj/compat/cc_gcc.h @@ -1,32 +1,32 @@ -/* $Header: /pjproject-0.3/pjlib/src/pj/compat/cc_gcc.h 2 9/17/05 10:37a Bennylp $ */
-/* $Log: /pjproject-0.3/pjlib/src/pj/compat/cc_gcc.h $
- *
- * 2 9/17/05 10:37a Bennylp
- * Major reorganization towards version 0.3.
- *
- */
-#ifndef __PJ_COMPAT_CC_GCC_H__
-#define __PJ_COMPAT_CC_GCC_H__
-
-/**
- * @file cc_gcc.h
- * @brief Describes GCC compiler specifics.
- */
-
-#ifndef __GNUC__
-# error "This file is only for gcc!"
-#endif
-
-#define PJ_INLINE_SPECIFIER static inline
-#define PJ_THREAD_FUNC
-#define PJ_NORETURN
-#define PJ_ATTR_NORETURN __attribute__ ((noreturn))
-
-#define PJ_HAS_INT64 1
-
-typedef long long pj_int64_t;
-typedef unsigned long long pj_uint64_t;
-
-
-#endif /* __PJ_COMPAT_CC_GCC_H__ */
-
+/* $Header: /pjproject-0.3/pjlib/src/pj/compat/cc_gcc.h 2 9/17/05 10:37a Bennylp $ */ +/* $Log: /pjproject-0.3/pjlib/src/pj/compat/cc_gcc.h $ + * + * 2 9/17/05 10:37a Bennylp + * Major reorganization towards version 0.3. + * + */ +#ifndef __PJ_COMPAT_CC_GCC_H__ +#define __PJ_COMPAT_CC_GCC_H__ + +/** + * @file cc_gcc.h + * @brief Describes GCC compiler specifics. + */ + +#ifndef __GNUC__ +# error "This file is only for gcc!" +#endif + +#define PJ_INLINE_SPECIFIER static inline +#define PJ_THREAD_FUNC +#define PJ_NORETURN +#define PJ_ATTR_NORETURN __attribute__ ((noreturn)) + +#define PJ_HAS_INT64 1 + +typedef long long pj_int64_t; +typedef unsigned long long pj_uint64_t; + + +#endif /* __PJ_COMPAT_CC_GCC_H__ */ + diff --git a/pjlib/include/pj/compat/cc_msvc.h b/pjlib/include/pj/compat/cc_msvc.h index 39f0acd9..f9271bae 100644 --- a/pjlib/include/pj/compat/cc_msvc.h +++ b/pjlib/include/pj/compat/cc_msvc.h @@ -1,40 +1,40 @@ -/* $Header: /pjproject-0.3/pjlib/include/pj/compat/cc_msvc.h 3 10/14/05 12:26a Bennylp $ */
-/* $Log: /pjproject-0.3/pjlib/include/pj/compat/cc_msvc.h $
- *
- * 3 10/14/05 12:26a Bennylp
- * Finished error code framework, some fixes in ioqueue, etc. Pretty
- * major.
- *
- * 2 9/17/05 10:37a Bennylp
- * Major reorganization towards version 0.3.
- *
- */
-#ifndef __PJ_COMPAT_CC_MSVC_H__
-#define __PJ_COMPAT_CC_MSVC_H__
-
-/**
- * @file cc_msvc.h
- * @brief Describes Microsoft Visual C compiler specifics.
- */
-
-#ifndef _MSC_VER
-# error "This header file is only for Visual C compiler!"
-#endif
-
-# pragma warning(disable: 4127) // conditional expression is constant
-# pragma warning(disable: 4611) // not wise to mix setjmp with C++
-# pragma warning(disable: 4514) // unreferenced inline function has been removed
-# ifdef __cplusplus
-# define PJ_INLINE_SPECIFIER inline
-# else
-# define PJ_INLINE_SPECIFIER static __inline
-# endif
-# define PJ_THREAD_FUNC
-# define PJ_NORETURN __declspec(noreturn)
-# define PJ_ATTR_NORETURN
-
-# define PJ_HAS_INT64 1
-typedef __int64 pj_int64_t;
-typedef unsigned __int64 pj_uint64_t;
-
-#endif /* __PJ_COMPAT_CC_MSVC_H__ */
+/* $Header: /pjproject-0.3/pjlib/include/pj/compat/cc_msvc.h 3 10/14/05 12:26a Bennylp $ */ +/* $Log: /pjproject-0.3/pjlib/include/pj/compat/cc_msvc.h $ + * + * 3 10/14/05 12:26a Bennylp + * Finished error code framework, some fixes in ioqueue, etc. Pretty + * major. + * + * 2 9/17/05 10:37a Bennylp + * Major reorganization towards version 0.3. + * + */ +#ifndef __PJ_COMPAT_CC_MSVC_H__ +#define __PJ_COMPAT_CC_MSVC_H__ + +/** + * @file cc_msvc.h + * @brief Describes Microsoft Visual C compiler specifics. + */ + +#ifndef _MSC_VER +# error "This header file is only for Visual C compiler!" +#endif + +# pragma warning(disable: 4127) // conditional expression is constant +# pragma warning(disable: 4611) // not wise to mix setjmp with C++ +# pragma warning(disable: 4514) // unreferenced inline function has been removed +# ifdef __cplusplus +# define PJ_INLINE_SPECIFIER inline +# else +# define PJ_INLINE_SPECIFIER static __inline +# endif +# define PJ_THREAD_FUNC +# define PJ_NORETURN __declspec(noreturn) +# define PJ_ATTR_NORETURN + +# define PJ_HAS_INT64 1 +typedef __int64 pj_int64_t; +typedef unsigned __int64 pj_uint64_t; + +#endif /* __PJ_COMPAT_CC_MSVC_H__ */ diff --git a/pjlib/include/pj/compat/ctype.h b/pjlib/include/pj/compat/ctype.h index 18e8d475..7b53bf54 100644 --- a/pjlib/include/pj/compat/ctype.h +++ b/pjlib/include/pj/compat/ctype.h @@ -1,42 +1,42 @@ -/* $Header: /pjproject-0.3/pjlib/include/pj/compat/ctype.h 3 10/14/05 12:26a Bennylp $ */
-/* $Log: /pjproject-0.3/pjlib/include/pj/compat/ctype.h $
- *
- * 3 10/14/05 12:26a Bennylp
- * Finished error code framework, some fixes in ioqueue, etc. Pretty
- * major.
- *
- * 2 9/22/05 10:31a Bennylp
- * Moving all *.h files to include/.
- *
- * 1 9/17/05 10:36a Bennylp
- * Created.
- *
- */
-#ifndef __PJ_COMPAT_CTYPE_H__
-#define __PJ_COMPAT_CTYPE_H__
-
-/**
- * @file ctype.h
- * @brief Provides ctype function family.
- */
-
-#if defined(PJ_HAS_CTYPE_H) && PJ_HAS_CTYPE_H != 0
-# include <ctype.h>
-#else
-# define isalnum(c) (isalpha(c) || isdigit(c))
-# define isalpha(c) (islower(c) || isupper(c))
-# define isascii(c) (((unsigned char)(c))<=0x7f)
-# define isdigit(c) ((c)>='0' && (c)<='9')
-# define isspace(c) ((c)==' ' || (c)=='\t' ||\
- (c)=='\n' || (c)=='\r' || (c)=='\v')
-# define islower(c) ((c)>='a' && (c)<='z')
-# define isupper(c) ((c)>='A' && (c)<='Z')
-# define isxdigit(c) (isdigit(c) || (tolower(c)>='a'&&tolower(c)<='f'))
-# define tolower(c) (((c) >= 'A' && (c) <= 'Z') ? (c)+('a'-'A') : (c))
-# define toupper(c) (((c) >= 'a' && (c) <= 'z') ? (c)-('a'-'A') : (c))
-#endif
-
-#define isblank(c) (c==' ' || c=='\t')
-
-
-#endif /* __PJ_COMPAT_CTYPE_H__ */
+/* $Header: /pjproject-0.3/pjlib/include/pj/compat/ctype.h 3 10/14/05 12:26a Bennylp $ */ +/* $Log: /pjproject-0.3/pjlib/include/pj/compat/ctype.h $ + * + * 3 10/14/05 12:26a Bennylp + * Finished error code framework, some fixes in ioqueue, etc. Pretty + * major. + * + * 2 9/22/05 10:31a Bennylp + * Moving all *.h files to include/. + * + * 1 9/17/05 10:36a Bennylp + * Created. + * + */ +#ifndef __PJ_COMPAT_CTYPE_H__ +#define __PJ_COMPAT_CTYPE_H__ + +/** + * @file ctype.h + * @brief Provides ctype function family. + */ + +#if defined(PJ_HAS_CTYPE_H) && PJ_HAS_CTYPE_H != 0 +# include <ctype.h> +#else +# define isalnum(c) (isalpha(c) || isdigit(c)) +# define isalpha(c) (islower(c) || isupper(c)) +# define isascii(c) (((unsigned char)(c))<=0x7f) +# define isdigit(c) ((c)>='0' && (c)<='9') +# define isspace(c) ((c)==' ' || (c)=='\t' ||\ + (c)=='\n' || (c)=='\r' || (c)=='\v') +# define islower(c) ((c)>='a' && (c)<='z') +# define isupper(c) ((c)>='A' && (c)<='Z') +# define isxdigit(c) (isdigit(c) || (tolower(c)>='a'&&tolower(c)<='f')) +# define tolower(c) (((c) >= 'A' && (c) <= 'Z') ? (c)+('a'-'A') : (c)) +# define toupper(c) (((c) >= 'a' && (c) <= 'z') ? (c)-('a'-'A') : (c)) +#endif + +#define isblank(c) (c==' ' || c=='\t') + + +#endif /* __PJ_COMPAT_CTYPE_H__ */ diff --git a/pjlib/include/pj/compat/errno.h b/pjlib/include/pj/compat/errno.h index a0ea2ea6..959f57fe 100644 --- a/pjlib/include/pj/compat/errno.h +++ b/pjlib/include/pj/compat/errno.h @@ -1,26 +1,27 @@ -/* $Header: /pjproject-0.3/pjlib/include/pj/compat/errno.h 2 10/14/05 12:26a Bennylp $ */
-#ifndef __PJ_COMPAT_ERRNO_H__
-#define __PJ_COMPAT_ERRNO_H__
-
-#if defined(PJ_WIN32) && PJ_WIN32 != 0
-
- typedef unsigned long pj_os_err_type;
-# define pj_get_native_os_error() GetLastError()
-# define pj_get_native_netos_error() WSAGetLastError()
-
-#elif (defined(PJ_LINUX) && PJ_LINUX != 0) || \
- (defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL != 0)
-
- typedef int pj_os_err_type;
-# define pj_get_native_os_error() (errno)
-# define pj_get_native_netos_error() (errno)
-
-#else
-
-# error "Please define pj_os_err_type for this platform here!"
-
-#endif
-
-
-#endif /* __PJ_COMPAT_ERRNO_H__ */
-
+/* $Header: /pjproject-0.3/pjlib/include/pj/compat/errno.h 2 10/14/05 12:26a Bennylp $ */ +#ifndef __PJ_COMPAT_ERRNO_H__ +#define __PJ_COMPAT_ERRNO_H__ + +#if defined(PJ_WIN32) && PJ_WIN32 != 0 + + typedef unsigned long pj_os_err_type; +# define pj_get_native_os_error() GetLastError() +# define pj_get_native_netos_error() WSAGetLastError() + +#elif (defined(PJ_LINUX) && PJ_LINUX != 0) || \ + (defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL != 0) || \ + (defined(PJ_SUNOS) && PJ_SUNOS != 0) + + typedef int pj_os_err_type; +# define pj_get_native_os_error() (errno) +# define pj_get_native_netos_error() (errno) + +#else + +# error "Please define pj_os_err_type for this platform here!" + +#endif + + +#endif /* __PJ_COMPAT_ERRNO_H__ */ + diff --git a/pjlib/include/pj/compat/high_precision.h b/pjlib/include/pj/compat/high_precision.h index 2004fb2a..a29f5886 100644 --- a/pjlib/include/pj/compat/high_precision.h +++ b/pjlib/include/pj/compat/high_precision.h @@ -1,83 +1,85 @@ -/* $Header: /pjproject-0.3/pjlib/include/pj/compat/high_precision.h 3 10/29/05 11:51a Bennylp $ */
-#ifndef __PJ_COMPAT_HIGH_PRECISION_H__
-#define __PJ_COMPAT_HIGH_PRECISION_H__
-
-
-#if defined(PJ_HAS_FLOATING_POINT) && PJ_HAS_FLOATING_POINT != 0
- /*
- * The first choice for high precision math is to use double.
- */
-# include <math.h>
- typedef double pj_highprec_t;
-
-# define PJ_HIGHPREC_VALUE_IS_ZERO(a) (a==0)
-# define pj_highprec_mod(a,b) (a=fmod(a,b))
-
-#elif defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL != 0
-
-# include <asm/div64.h>
-
- typedef pj_int64_t pj_highprec_t;
-
-# define pj_highprec_div(a1,a2) do_div(a1,a2)
-# define pj_highprec_mod(a1,a2) (a1=do_mod(a1, a2))
-
- PJ_INLINE(pj_int64_t) do_mod( pj_int64_t a1, pj_int64_t a2)
- {
- return do_div(a1,a2);
- }
-
-
-#elif defined(PJ_HAS_INT64) && PJ_HAS_INT64 != 0
- /*
- * Next choice is to use 64-bit arithmatics.
- */
- typedef pj_int64_t pj_highprec_t;
-
-#else
- /*
- * Last, fallback to 32-bit arithmetics.
- */
- typedef pj_int32_t pj_highprec_t;
-
-#endif
-
-/**
- * @def pj_highprec_mul
- * pj_highprec_mul(a1, a2) - High Precision Multiplication
- * Multiply a1 and a2, and store the result in a1.
- */
-#ifndef pj_highprec_mul
-# define pj_highprec_mul(a1,a2) (a1 = a1 * a2)
-#endif
-
-/**
- * @def pj_highprec_div
- * pj_highprec_div(a1, a2) - High Precision Division
- * Divide a2 from a1, and store the result in a1.
- */
-#ifndef pj_highprec_div
-# define pj_highprec_div(a1,a2) (a1 = a1 / a2)
-#endif
-
-/**
- * @def pj_highprec_mod
- * pj_highprec_mod(a1, a2) - High Precision Modulus
- * Get the modulus a2 from a1, and store the result in a1.
- */
-#ifndef pj_highprec_mod
-# define pj_highprec_mod(a1,a2) (a1 = a1 % a2)
-#endif
-
-
-/**
- * @def PJ_HIGHPREC_VALUE_IS_ZERO(a)
- * Test if the specified high precision value is zero.
- */
-#ifndef PJ_HIGHPREC_VALUE_IS_ZERO
-# define PJ_HIGHPREC_VALUE_IS_ZERO(a) (a==0)
-#endif
-
-
-#endif /* __PJ_COMPAT_HIGH_PRECISION_H__ */
-
+/* $Header: /pjproject-0.3/pjlib/include/pj/compat/high_precision.h 3 10/29/05 11:51a Bennylp $ */ +#ifndef __PJ_COMPAT_HIGH_PRECISION_H__ +#define __PJ_COMPAT_HIGH_PRECISION_H__ + + +#if defined(PJ_HAS_FLOATING_POINT) && PJ_HAS_FLOATING_POINT != 0 + /* + * The first choice for high precision math is to use double. + */ +# include <math.h> + typedef double pj_highprec_t; + +# define PJ_HIGHPREC_VALUE_IS_ZERO(a) (a==0) +# define pj_highprec_mod(a,b) (a=fmod(a,b)) + +#elif defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL != 0 + +# include <asm/div64.h> + + typedef pj_int64_t pj_highprec_t; + +# define pj_highprec_div(a1,a2) do_div(a1,a2) +# define pj_highprec_mod(a1,a2) (a1=do_mod(a1, a2)) + + PJ_INLINE(pj_int64_t) do_mod( pj_int64_t a1, pj_int64_t a2) + { + return do_div(a1,a2); + } + + +#elif defined(PJ_HAS_INT64) && PJ_HAS_INT64 != 0 + /* + * Next choice is to use 64-bit arithmatics. + */ + typedef pj_int64_t pj_highprec_t; + +#else +# warning "High precision math is not available" + + /* + * Last, fallback to 32-bit arithmetics. + */ + typedef pj_int32_t pj_highprec_t; + +#endif + +/** + * @def pj_highprec_mul + * pj_highprec_mul(a1, a2) - High Precision Multiplication + * Multiply a1 and a2, and store the result in a1. + */ +#ifndef pj_highprec_mul +# define pj_highprec_mul(a1,a2) (a1 = a1 * a2) +#endif + +/** + * @def pj_highprec_div + * pj_highprec_div(a1, a2) - High Precision Division + * Divide a2 from a1, and store the result in a1. + */ +#ifndef pj_highprec_div +# define pj_highprec_div(a1,a2) (a1 = a1 / a2) +#endif + +/** + * @def pj_highprec_mod + * pj_highprec_mod(a1, a2) - High Precision Modulus + * Get the modulus a2 from a1, and store the result in a1. + */ +#ifndef pj_highprec_mod +# define pj_highprec_mod(a1,a2) (a1 = a1 % a2) +#endif + + +/** + * @def PJ_HIGHPREC_VALUE_IS_ZERO(a) + * Test if the specified high precision value is zero. + */ +#ifndef PJ_HIGHPREC_VALUE_IS_ZERO +# define PJ_HIGHPREC_VALUE_IS_ZERO(a) (a==0) +#endif + + +#endif /* __PJ_COMPAT_HIGH_PRECISION_H__ */ + diff --git a/pjlib/include/pj/compat/m_alpha.h b/pjlib/include/pj/compat/m_alpha.h index a112e0c2..02681b82 100644 --- a/pjlib/include/pj/compat/m_alpha.h +++ b/pjlib/include/pj/compat/m_alpha.h @@ -1,23 +1,23 @@ -/* $Header: /pjproject-0.3/pjlib/include/pj/compat/m_alpha.h 1 10/29/05 5:23p Bennylp $ */
-/*
- * $Log: /pjproject-0.3/pjlib/include/pj/compat/m_alpha.h $
- *
- * 1 10/29/05 5:23p Bennylp
- * Created.
- *
- */
-#ifndef __PJ_COMPAT_M_ALPHA_H__
-#define __PJ_COMPAT_M_ALPHA_H__
-
-/**
- * @file m_alpha.h
- * @brief Describes Alpha processor family specifics.
- */
-
-#define PJ_HAS_PENTIUM 0
-#define PJ_IS_LITTLE_ENDIAN 1
-#define PJ_IS_BIG_ENDIAN 0
-
-
-#endif /* __PJ_COMPAT_M_ALPHA_H__ */
-
+/* $Header: /pjproject-0.3/pjlib/include/pj/compat/m_alpha.h 1 10/29/05 5:23p Bennylp $ */ +/* + * $Log: /pjproject-0.3/pjlib/include/pj/compat/m_alpha.h $ + * + * 1 10/29/05 5:23p Bennylp + * Created. + * + */ +#ifndef __PJ_COMPAT_M_ALPHA_H__ +#define __PJ_COMPAT_M_ALPHA_H__ + +/** + * @file m_alpha.h + * @brief Describes Alpha processor family specifics. + */ + +#define PJ_HAS_PENTIUM 0 +#define PJ_IS_LITTLE_ENDIAN 1 +#define PJ_IS_BIG_ENDIAN 0 + + +#endif /* __PJ_COMPAT_M_ALPHA_H__ */ + diff --git a/pjlib/include/pj/compat/m_i386.h b/pjlib/include/pj/compat/m_i386.h index 2c9ef262..b291aee2 100644 --- a/pjlib/include/pj/compat/m_i386.h +++ b/pjlib/include/pj/compat/m_i386.h @@ -1,26 +1,26 @@ -/* $Header: /pjproject-0.3/pjlib/src/pj/compat/m_i386.h 3 9/21/05 1:39p Bennylp $ */
-/* $Log: /pjproject-0.3/pjlib/src/pj/compat/m_i386.h $
- *
- * 3 9/21/05 1:39p Bennylp
- * Periodic checkin for backup.
- *
- * 2 9/17/05 10:37a Bennylp
- * Major reorganization towards version 0.3.
- *
- */
-#ifndef __PJ_COMPAT_M_i386_H__
-#define __PJ_COMPAT_M_i386_H__
-
-/**
- * @file m_i386.h
- * @brief Describes Intel i386 family processor specifics.
- */
-
-#define PJ_M_I386 1
-
-#define PJ_HAS_PENTIUM 1
-#define PJ_IS_LITTLE_ENDIAN 1
-#define PJ_IS_BIG_ENDIAN 0
-
-
-#endif /* __PJ_COMPAT_M_i386_H__ */
+/* $Header: /pjproject-0.3/pjlib/src/pj/compat/m_i386.h 3 9/21/05 1:39p Bennylp $ */ +/* $Log: /pjproject-0.3/pjlib/src/pj/compat/m_i386.h $ + * + * 3 9/21/05 1:39p Bennylp + * Periodic checkin for backup. + * + * 2 9/17/05 10:37a Bennylp + * Major reorganization towards version 0.3. + * + */ +#ifndef __PJ_COMPAT_M_i386_H__ +#define __PJ_COMPAT_M_i386_H__ + +/** + * @file m_i386.h + * @brief Describes Intel i386 family processor specifics. + */ + +#define PJ_M_I386 1 + +#define PJ_HAS_PENTIUM 1 +#define PJ_IS_LITTLE_ENDIAN 1 +#define PJ_IS_BIG_ENDIAN 0 + + +#endif /* __PJ_COMPAT_M_i386_H__ */ diff --git a/pjlib/include/pj/compat/m_m68k.h b/pjlib/include/pj/compat/m_m68k.h index 5cdcde53..bb126d16 100644 --- a/pjlib/include/pj/compat/m_m68k.h +++ b/pjlib/include/pj/compat/m_m68k.h @@ -1,21 +1,21 @@ -/* $Header: /pjproject-0.3/pjlib/src/pj/compat/m_m68k.h 2 9/17/05 10:37a Bennylp $ */
-/* $Log: /pjproject-0.3/pjlib/src/pj/compat/m_m68k.h $
- *
- * 2 9/17/05 10:37a Bennylp
- * Major reorganization towards version 0.3.
- *
- */
-#ifndef __PJ_COMPAT_M_M68K_H__
-#define __PJ_COMPAT_M_M68K_H__
-
-/**
- * @file m_m68k.h
- * @brief Describes Motorola m68k family processor specifics.
- */
-
-#define PJ_HAS_PENTIUM 0
-#define PJ_IS_LITTLE_ENDIAN 1
-#define PJ_IS_BIG_ENDIAN 0
-
-
-#endif /* __PJ_COMPAT_M_M68K_H__ */
+/* $Header: /pjproject-0.3/pjlib/src/pj/compat/m_m68k.h 2 9/17/05 10:37a Bennylp $ */ +/* $Log: /pjproject-0.3/pjlib/src/pj/compat/m_m68k.h $ + * + * 2 9/17/05 10:37a Bennylp + * Major reorganization towards version 0.3. + * + */ +#ifndef __PJ_COMPAT_M_M68K_H__ +#define __PJ_COMPAT_M_M68K_H__ + +/** + * @file m_m68k.h + * @brief Describes Motorola m68k family processor specifics. + */ + +#define PJ_HAS_PENTIUM 0 +#define PJ_IS_LITTLE_ENDIAN 1 +#define PJ_IS_BIG_ENDIAN 0 + + +#endif /* __PJ_COMPAT_M_M68K_H__ */ diff --git a/pjlib/include/pj/compat/m_sparc.h b/pjlib/include/pj/compat/m_sparc.h new file mode 100644 index 00000000..f0b55732 --- /dev/null +++ b/pjlib/include/pj/compat/m_sparc.h @@ -0,0 +1,21 @@ +/* $Header: $ */ +/* + *$Log: $ + * + */ +#ifndef __PJ_COMPAT_M_SPARC_H__ +#define __PJ_COMPAT_M_SPARC_H__ + +/** + * @file m_sparc.h + * @brief Describes SPARC family processor specifics. + */ + +#define PJ_SPARC 1 + +#define PJ_HAS_PENTIUM 0 +#define PJ_IS_LITTLE_ENDIAN 0 +#define PJ_IS_BIG_ENDIAN 1 + + +#endif /* __PJ_COMPAT_M_SPARC_H__ */ diff --git a/pjlib/include/pj/compat/malloc.h b/pjlib/include/pj/compat/malloc.h index b5a81265..225713c2 100644 --- a/pjlib/include/pj/compat/malloc.h +++ b/pjlib/include/pj/compat/malloc.h @@ -1,25 +1,25 @@ -/* $Header: /pjproject-0.3/pjlib/src/pj/compat/malloc.h 2 9/17/05 10:37a Bennylp $ */
-/* $Log: /pjproject-0.3/pjlib/src/pj/compat/malloc.h $
- *
- * 2 9/17/05 10:37a Bennylp
- * Major reorganization towards version 0.3.
- *
- * 1 9/16/05 10:02p Bennylp
- * Created.
- *
- */
-#ifndef __PJ_COMPAT_MALLOC_H__
-#define __PJ_COMPAT_MALLOC_H__
-
-/**
- * @file malloc.h
- * @brief Provides malloc() and free() functions.
- */
-
-#if defined(PJ_HAS_MALLOC_H) && PJ_HAS_MALLOC_H != 0
-# include <malloc.h>
-#elif defined(PJ_HAS_STDLIB_H) && PJ_HAS_STDLIB_H != 0
-# include <stdlib.h>
-#endif
-
-#endif /* __PJ_COMPAT_MALLOC_H__ */
+/* $Header: /pjproject-0.3/pjlib/src/pj/compat/malloc.h 2 9/17/05 10:37a Bennylp $ */ +/* $Log: /pjproject-0.3/pjlib/src/pj/compat/malloc.h $ + * + * 2 9/17/05 10:37a Bennylp + * Major reorganization towards version 0.3. + * + * 1 9/16/05 10:02p Bennylp + * Created. + * + */ +#ifndef __PJ_COMPAT_MALLOC_H__ +#define __PJ_COMPAT_MALLOC_H__ + +/** + * @file malloc.h + * @brief Provides malloc() and free() functions. + */ + +#if defined(PJ_HAS_MALLOC_H) && PJ_HAS_MALLOC_H != 0 +# include <malloc.h> +#elif defined(PJ_HAS_STDLIB_H) && PJ_HAS_STDLIB_H != 0 +# include <stdlib.h> +#endif + +#endif /* __PJ_COMPAT_MALLOC_H__ */ diff --git a/pjlib/include/pj/compat/os_linux.h b/pjlib/include/pj/compat/os_linux.h index 2f5e65af..2779f58f 100644 --- a/pjlib/include/pj/compat/os_linux.h +++ b/pjlib/include/pj/compat/os_linux.h @@ -1,69 +1,69 @@ -/* $Header: /pjproject-0.3/pjlib/include/pj/compat/os_linux.h 6 10/29/05 11:51a Bennylp $ */
-/* $Log: /pjproject-0.3/pjlib/include/pj/compat/os_linux.h $
- *
- * 6 10/29/05 11:51a Bennylp
- * Version 0.3-pre2.
- *
- * 5 10/14/05 12:26a Bennylp
- * Finished error code framework, some fixes in ioqueue, etc. Pretty
- * major.
- *
- * 4 9/22/05 10:31a Bennylp
- * Moving all *.h files to include/.
- *
- * 3 9/21/05 1:39p Bennylp
- * Periodic checkin for backup.
- *
- * 2 9/17/05 10:37a Bennylp
- * Major reorganization towards version 0.3.
- *
- */
-#ifndef __PJ_COMPAT_OS_LINUX_H__
-#define __PJ_COMPAT_OS_LINUX_H__
-
-/**
- * @file os_linux.h
- * @brief Describes Linux operating system specifics.
- */
-
-#define PJ_HAS_ARPA_INET_H 1
-#define PJ_HAS_ASSERT_H 1
-#define PJ_HAS_CTYPE_H 1
-#define PJ_HAS_ERRNO_H 1
-#define PJ_HAS_LINUX_SOCKET_H 0
-#define PJ_HAS_MALLOC_H 1
-#define PJ_HAS_NETDB_H 1
-#define PJ_HAS_NETINET_IN_H 1
-#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 1
-#define PJ_HAS_SYS_SELECT_H 1
-#define PJ_HAS_SYS_SOCKET_H 1
-#define PJ_HAS_SYS_TIMEB_H 1
-#define PJ_HAS_SYS_TYPES_H 1
-#define PJ_HAS_TIME_H 1
-#define PJ_HAS_UNISTD_H 1
-
-#define PJ_HAS_MSWSOCK_H 0
-#define PJ_HAS_WINSOCK_H 0
-#define PJ_HAS_WINSOCK2_H 0
-
-#define PJ_SOCK_HAS_INET_ATON 1
-
-/* 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 0
-
-#define PJ_ATOMIC_VALUE_TYPE long
-
-#endif /* __PJ_COMPAT_OS_LINUX_H__ */
-
+/* $Header: /pjproject-0.3/pjlib/include/pj/compat/os_linux.h 6 10/29/05 11:51a Bennylp $ */ +/* $Log: /pjproject-0.3/pjlib/include/pj/compat/os_linux.h $ + * + * 6 10/29/05 11:51a Bennylp + * Version 0.3-pre2. + * + * 5 10/14/05 12:26a Bennylp + * Finished error code framework, some fixes in ioqueue, etc. Pretty + * major. + * + * 4 9/22/05 10:31a Bennylp + * Moving all *.h files to include/. + * + * 3 9/21/05 1:39p Bennylp + * Periodic checkin for backup. + * + * 2 9/17/05 10:37a Bennylp + * Major reorganization towards version 0.3. + * + */ +#ifndef __PJ_COMPAT_OS_LINUX_H__ +#define __PJ_COMPAT_OS_LINUX_H__ + +/** + * @file os_linux.h + * @brief Describes Linux operating system specifics. + */ + +#define PJ_HAS_ARPA_INET_H 1 +#define PJ_HAS_ASSERT_H 1 +#define PJ_HAS_CTYPE_H 1 +#define PJ_HAS_ERRNO_H 1 +#define PJ_HAS_LINUX_SOCKET_H 0 +#define PJ_HAS_MALLOC_H 1 +#define PJ_HAS_NETDB_H 1 +#define PJ_HAS_NETINET_IN_H 1 +#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 1 +#define PJ_HAS_SYS_SELECT_H 1 +#define PJ_HAS_SYS_SOCKET_H 1 +#define PJ_HAS_SYS_TIMEB_H 1 +#define PJ_HAS_SYS_TYPES_H 1 +#define PJ_HAS_TIME_H 1 +#define PJ_HAS_UNISTD_H 1 + +#define PJ_HAS_MSWSOCK_H 0 +#define PJ_HAS_WINSOCK_H 0 +#define PJ_HAS_WINSOCK2_H 0 + +#define PJ_SOCK_HAS_INET_ATON 1 + +/* 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 0 + +#define PJ_ATOMIC_VALUE_TYPE long + +#endif /* __PJ_COMPAT_OS_LINUX_H__ */ + diff --git a/pjlib/include/pj/compat/os_linux_kernel.h b/pjlib/include/pj/compat/os_linux_kernel.h index 2ebbb322..e2cec344 100644 --- a/pjlib/include/pj/compat/os_linux_kernel.h +++ b/pjlib/include/pj/compat/os_linux_kernel.h @@ -1,86 +1,86 @@ -/* $Header: /pjproject-0.3/pjlib/include/pj/compat/os_linux_kernel.h 4 10/29/05 11:51a Bennylp $ */
-/* $Log: /pjproject-0.3/pjlib/include/pj/compat/os_linux_kernel.h $
- *
- * 4 10/29/05 11:51a Bennylp
- * Version 0.3-pre2.
- *
- * 3 10/14/05 12:26a Bennylp
- * Finished error code framework, some fixes in ioqueue, etc. Pretty
- * major.
- *
- * 2 9/22/05 10:31a Bennylp
- * Moving all *.h files to include/.
- *
- * 1 9/21/05 1:38p Bennylp
- * Created.
- *
- */
-#ifndef __PJ_COMPAT_OS_LINUX_KERNEL_H__
-#define __PJ_COMPAT_OS_LINUX_KERNEL_H__
-
-/**
- * @file os_linux.h
- * @brief Describes Linux operating system specifics.
- */
-
-#define PJ_HAS_ARPA_INET_H 0
-#define PJ_HAS_ASSERT_H 0
-#define PJ_HAS_CTYPE_H 0
-#define PJ_HAS_ERRNO_H 0
-#define PJ_HAS_LINUX_SOCKET_H 1
-#define PJ_HAS_MALLOC_H 0
-#define PJ_HAS_NETDB_H 0
-#define PJ_HAS_NETINET_IN_H 0
-#define PJ_HAS_SETJMP_H 0
-#define PJ_HAS_STDARG_H 1
-#define PJ_HAS_STDDEF_H 0
-#define PJ_HAS_STDIO_H 0
-#define PJ_HAS_STDLIB_H 0
-#define PJ_HAS_STRING_H 0
-#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
-#define PJ_HAS_SYS_TYPES_H 0
-#define PJ_HAS_TIME_H 0
-#define PJ_HAS_UNISTD_H 0
-
-#define PJ_HAS_MSWSOCK_H 0
-#define PJ_HAS_WINSOCK_H 0
-#define PJ_HAS_WINSOCK2_H 0
-
-#define PJ_SOCK_HAS_INET_ATON 0
-
-#ifndef PJ_HAS_THREADS
-# define PJ_HAS_THREADS (1)
-#endif
-
-
-/*
- * Declare __FD_SETSIZE now before including <linux*>.
- */
-#define __FD_SETSIZE PJ_IOQUEUE_MAX_HANDLES
-
-#define NULL ((void*)0)
-
-#include <linux/module.h> /* Needed by all modules */
-#include <linux/kernel.h> /* Needed for KERN_INFO */
-
-#define __PJ_EXPORT_SYMBOL(a) EXPORT_SYMBOL(a);
-
-/*
- * Override features.
- */
-#define PJ_HAS_FLOATING_POINT 0
-#define PJ_HAS_MALLOC 0
-#define PJ_HAS_SEMAPHORE 0
-#define PJ_HAS_EVENT_OBJ 0
-#define PJ_HAS_HIGH_RES_TIMER 1
-#define PJ_OS_HAS_CHECK_STACK 0
-#define PJ_TERM_HAS_COLOR 0
-
-#define PJ_ATOMIC_VALUE_TYPE int
-#define PJ_THREAD_DESC_SIZE 128
-
-#endif /* __PJ_COMPAT_OS_LINUX_KERNEL_H__ */
-
+/* $Header: /pjproject-0.3/pjlib/include/pj/compat/os_linux_kernel.h 4 10/29/05 11:51a Bennylp $ */ +/* $Log: /pjproject-0.3/pjlib/include/pj/compat/os_linux_kernel.h $ + * + * 4 10/29/05 11:51a Bennylp + * Version 0.3-pre2. + * + * 3 10/14/05 12:26a Bennylp + * Finished error code framework, some fixes in ioqueue, etc. Pretty + * major. + * + * 2 9/22/05 10:31a Bennylp + * Moving all *.h files to include/. + * + * 1 9/21/05 1:38p Bennylp + * Created. + * + */ +#ifndef __PJ_COMPAT_OS_LINUX_KERNEL_H__ +#define __PJ_COMPAT_OS_LINUX_KERNEL_H__ + +/** + * @file os_linux.h + * @brief Describes Linux operating system specifics. + */ + +#define PJ_HAS_ARPA_INET_H 0 +#define PJ_HAS_ASSERT_H 0 +#define PJ_HAS_CTYPE_H 0 +#define PJ_HAS_ERRNO_H 0 +#define PJ_HAS_LINUX_SOCKET_H 1 +#define PJ_HAS_MALLOC_H 0 +#define PJ_HAS_NETDB_H 0 +#define PJ_HAS_NETINET_IN_H 0 +#define PJ_HAS_SETJMP_H 0 +#define PJ_HAS_STDARG_H 1 +#define PJ_HAS_STDDEF_H 0 +#define PJ_HAS_STDIO_H 0 +#define PJ_HAS_STDLIB_H 0 +#define PJ_HAS_STRING_H 0 +#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 +#define PJ_HAS_SYS_TYPES_H 0 +#define PJ_HAS_TIME_H 0 +#define PJ_HAS_UNISTD_H 0 + +#define PJ_HAS_MSWSOCK_H 0 +#define PJ_HAS_WINSOCK_H 0 +#define PJ_HAS_WINSOCK2_H 0 + +#define PJ_SOCK_HAS_INET_ATON 0 + +#ifndef PJ_HAS_THREADS +# define PJ_HAS_THREADS (1) +#endif + + +/* + * Declare __FD_SETSIZE now before including <linux*>. + */ +#define __FD_SETSIZE PJ_IOQUEUE_MAX_HANDLES + +#define NULL ((void*)0) + +#include <linux/module.h> /* Needed by all modules */ +#include <linux/kernel.h> /* Needed for KERN_INFO */ + +#define __PJ_EXPORT_SYMBOL(a) EXPORT_SYMBOL(a); + +/* + * Override features. + */ +#define PJ_HAS_FLOATING_POINT 0 +#define PJ_HAS_MALLOC 0 +#define PJ_HAS_SEMAPHORE 0 +#define PJ_HAS_EVENT_OBJ 0 +#define PJ_HAS_HIGH_RES_TIMER 1 +#define PJ_OS_HAS_CHECK_STACK 0 +#define PJ_TERM_HAS_COLOR 0 + +#define PJ_ATOMIC_VALUE_TYPE int +#define PJ_THREAD_DESC_SIZE 128 + +#endif /* __PJ_COMPAT_OS_LINUX_KERNEL_H__ */ + diff --git a/pjlib/include/pj/compat/os_palmos.h b/pjlib/include/pj/compat/os_palmos.h index 1242bec1..109b020a 100644 --- a/pjlib/include/pj/compat/os_palmos.h +++ b/pjlib/include/pj/compat/os_palmos.h @@ -1,54 +1,54 @@ -/* $Header: /pjproject-0.3/pjlib/src/pj/compat/os_palmos.h 3 9/21/05 1:39p Bennylp $ */
-/* $Log: /pjproject-0.3/pjlib/src/pj/compat/os_palmos.h $
- *
- * 3 9/21/05 1:39p Bennylp
- * Periodic checkin for backup.
- *
- * 2 9/17/05 10:37a Bennylp
- * Major reorganization towards version 0.3.
- *
- */
-#ifndef __PJ_COMPAT_OS_PALMOS_H__
-#define __PJ_COMPAT_OS_PALMOS_H__
-
-/**
- * @file os_palmos.h
- * @brief Describes PalmOS operating system specifics.
- */
-
-#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
-#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
-#define PJ_HAS_SYS_TYPES_H 1
-#define PJ_HAS_TIME_H 1
-#define PJ_HAS_UNISTD_H 0
-
-#define PJ_HAS_MSWSOCK_H 0
-#define PJ_HAS_WINSOCK_H 0
-#define PJ_HAS_WINSOCK2_H 0
-
-#define PJ_SOCK_HAS_INET_ATON 0
-
-/* 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_OS_HAS_CHECK_STACK 0
-
-#endif /* __PJ_COMPAT_OS_PALMOS_H__ */
+/* $Header: /pjproject-0.3/pjlib/src/pj/compat/os_palmos.h 3 9/21/05 1:39p Bennylp $ */ +/* $Log: /pjproject-0.3/pjlib/src/pj/compat/os_palmos.h $ + * + * 3 9/21/05 1:39p Bennylp + * Periodic checkin for backup. + * + * 2 9/17/05 10:37a Bennylp + * Major reorganization towards version 0.3. + * + */ +#ifndef __PJ_COMPAT_OS_PALMOS_H__ +#define __PJ_COMPAT_OS_PALMOS_H__ + +/** + * @file os_palmos.h + * @brief Describes PalmOS operating system specifics. + */ + +#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 +#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 +#define PJ_HAS_SYS_TYPES_H 1 +#define PJ_HAS_TIME_H 1 +#define PJ_HAS_UNISTD_H 0 + +#define PJ_HAS_MSWSOCK_H 0 +#define PJ_HAS_WINSOCK_H 0 +#define PJ_HAS_WINSOCK2_H 0 + +#define PJ_SOCK_HAS_INET_ATON 0 + +/* 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_OS_HAS_CHECK_STACK 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 new file mode 100644 index 00000000..1704ceda --- /dev/null +++ b/pjlib/include/pj/compat/os_sunos.h @@ -0,0 +1,56 @@ +/* $Header: $ */ +/* $Log: $ + * + */ +#ifndef __PJ_COMPAT_OS_SUNOS_H__ +#define __PJ_COMPAT_OS_SUNOS_H__ + +/** + * @file os_sunos.h + * @brief Describes SunOS/Solaris operating system specifics. + */ + +#define PJ_HAS_ARPA_INET_H 1 +#define PJ_HAS_ASSERT_H 1 +#define PJ_HAS_CTYPE_H 1 +#define PJ_HAS_ERRNO_H 1 +#define PJ_HAS_LINUX_SOCKET_H 0 +#define PJ_HAS_MALLOC_H 1 +#define PJ_HAS_NETDB_H 1 +#define PJ_HAS_NETINET_IN_H 1 +#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 1 +#define PJ_HAS_SYS_SELECT_H 1 +#define PJ_HAS_SYS_SOCKET_H 1 +#define PJ_HAS_SYS_TIMEB_H 1 +#define PJ_HAS_SYS_TYPES_H 1 +#define PJ_HAS_TIME_H 1 +#define PJ_HAS_UNISTD_H 1 + +#define PJ_HAS_MSWSOCK_H 0 +#define PJ_HAS_WINSOCK_H 0 +#define PJ_HAS_WINSOCK2_H 0 + +#define PJ_SOCK_HAS_INET_ATON 0 + +/* 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 0 + +#define PJ_ATOMIC_VALUE_TYPE long + +/* Get BSD related identifers in Sun's include files */ +#define BSD_COMP + +#endif /* __PJ_COMPAT_OS_SUNOS_H__ */ + diff --git a/pjlib/include/pj/compat/os_win32.h b/pjlib/include/pj/compat/os_win32.h index d7a92c9b..13a4a690 100644 --- a/pjlib/include/pj/compat/os_win32.h +++ b/pjlib/include/pj/compat/os_win32.h @@ -1,72 +1,72 @@ -/* $Header: /pjproject-0.3/pjlib/include/pj/compat/os_win32.h 6 10/29/05 11:51a Bennylp $ */
-/* $Log: /pjproject-0.3/pjlib/include/pj/compat/os_win32.h $
- *
- * 6 10/29/05 11:51a Bennylp
- * Version 0.3-pre2.
- *
- * 5 10/14/05 12:26a Bennylp
- * Finished error code framework, some fixes in ioqueue, etc. Pretty
- * major.
- *
- * 4 9/22/05 10:31a Bennylp
- * Moving all *.h files to include/.
- *
- * 3 9/21/05 1:39p Bennylp
- * Periodic checkin for backup.
- *
- * 2 9/17/05 10:37a Bennylp
- * Major reorganization towards version 0.3.
- *
- */
-#ifndef __PJ_COMPAT_OS_WIN32_H__
-#define __PJ_COMPAT_OS_WIN32_H__
-
-/**
- * @file os_win32.h
- * @brief Describes Win32 operating system family specifics.
- */
-
-#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 1
-#define PJ_HAS_SYS_TYPES_H 1
-#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
-
-/* 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
-
-#endif /* __PJ_COMPAT_OS_WIN32_H__ */
+/* $Header: /pjproject-0.3/pjlib/include/pj/compat/os_win32.h 6 10/29/05 11:51a Bennylp $ */ +/* $Log: /pjproject-0.3/pjlib/include/pj/compat/os_win32.h $ + * + * 6 10/29/05 11:51a Bennylp + * Version 0.3-pre2. + * + * 5 10/14/05 12:26a Bennylp + * Finished error code framework, some fixes in ioqueue, etc. Pretty + * major. + * + * 4 9/22/05 10:31a Bennylp + * Moving all *.h files to include/. + * + * 3 9/21/05 1:39p Bennylp + * Periodic checkin for backup. + * + * 2 9/17/05 10:37a Bennylp + * Major reorganization towards version 0.3. + * + */ +#ifndef __PJ_COMPAT_OS_WIN32_H__ +#define __PJ_COMPAT_OS_WIN32_H__ + +/** + * @file os_win32.h + * @brief Describes Win32 operating system family specifics. + */ + +#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 1 +#define PJ_HAS_SYS_TYPES_H 1 +#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 + +/* 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 + +#endif /* __PJ_COMPAT_OS_WIN32_H__ */ diff --git a/pjlib/include/pj/compat/rand.h b/pjlib/include/pj/compat/rand.h index 31461b37..60c2be59 100644 --- a/pjlib/include/pj/compat/rand.h +++ b/pjlib/include/pj/compat/rand.h @@ -1,65 +1,65 @@ -/* $Header: /pjproject-0.3/pjlib/include/pj/compat/rand.h 3 10/14/05 12:26a Bennylp $ */
-/* $Log: /pjproject-0.3/pjlib/include/pj/compat/rand.h $
- *
- * 3 10/14/05 12:26a Bennylp
- * Finished error code framework, some fixes in ioqueue, etc. Pretty
- * major.
- *
- * 2 9/21/05 1:39p Bennylp
- * Periodic checkin for backup.
- *
- * 1 9/17/05 10:36a Bennylp
- * Created.
- *
- */
-#ifndef __PJ_COMPAT_RAND_H__
-#define __PJ_COMPAT_RAND_H__
-
-/**
- * @file rand.h
- * @brief Provides platform_rand() and platform_srand() functions.
- */
-
-#if defined(PJ_HAS_STDLIB_H) && PJ_HAS_STDLIB_H != 0
- /*
- * Use stdlib based rand() and srand().
- */
-# include <stdlib.h>
-# define platform_srand srand
-# if defined(RAND_MAX) && RAND_MAX <= 0xFFFF
- /*
- * When rand() is only 16 bit strong, double the strength
- * by calling it twice!
- */
- PJ_INLINE(int) platform_rand(void)
- {
- return ((rand() & 0xFFFF) << 16) | (rand() & 0xFFFF);
- }
-# else
-# define platform_rand rand
-# endif
-
-#elif defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL != 0
- /*
- * Linux kernel mode random number generator.
- */
-# include <linux/random.h>
-# define platform_srand(seed)
-
- PJ_INLINE(int) platform_rand(void)
- {
- int value;
- get_random_bytes((void*)&value, sizeof(value));
- return value;
- }
-
-#else
-# warning "platform_rand() is not implemented"
-# define platform_rand() 1
-# define platform_srand(seed)
-
-#endif
-
-
-#endif /* __PJ_COMPAT_RAND_H__ */
-
+/* $Header: /pjproject-0.3/pjlib/include/pj/compat/rand.h 3 10/14/05 12:26a Bennylp $ */ +/* $Log: /pjproject-0.3/pjlib/include/pj/compat/rand.h $ + * + * 3 10/14/05 12:26a Bennylp + * Finished error code framework, some fixes in ioqueue, etc. Pretty + * major. + * + * 2 9/21/05 1:39p Bennylp + * Periodic checkin for backup. + * + * 1 9/17/05 10:36a Bennylp + * Created. + * + */ +#ifndef __PJ_COMPAT_RAND_H__ +#define __PJ_COMPAT_RAND_H__ + +/** + * @file rand.h + * @brief Provides platform_rand() and platform_srand() functions. + */ + +#if defined(PJ_HAS_STDLIB_H) && PJ_HAS_STDLIB_H != 0 + /* + * Use stdlib based rand() and srand(). + */ +# include <stdlib.h> +# define platform_srand srand +# if defined(RAND_MAX) && RAND_MAX <= 0xFFFF + /* + * When rand() is only 16 bit strong, double the strength + * by calling it twice! + */ + PJ_INLINE(int) platform_rand(void) + { + return ((rand() & 0xFFFF) << 16) | (rand() & 0xFFFF); + } +# else +# define platform_rand rand +# endif + +#elif defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL != 0 + /* + * Linux kernel mode random number generator. + */ +# include <linux/random.h> +# define platform_srand(seed) + + PJ_INLINE(int) platform_rand(void) + { + int value; + get_random_bytes((void*)&value, sizeof(value)); + return value; + } + +#else +# warning "platform_rand() is not implemented" +# define platform_rand() 1 +# define platform_srand(seed) + +#endif + + +#endif /* __PJ_COMPAT_RAND_H__ */ + diff --git a/pjlib/include/pj/compat/setjmp.h b/pjlib/include/pj/compat/setjmp.h index 2bbd0cd4..1ffd9eab 100644 --- a/pjlib/include/pj/compat/setjmp.h +++ b/pjlib/include/pj/compat/setjmp.h @@ -1,89 +1,89 @@ -/* $Header: /pjproject-0.3/pjlib/include/pj/compat/setjmp.h 4 10/14/05 12:26a Bennylp $ */
-/* $Log: /pjproject-0.3/pjlib/include/pj/compat/setjmp.h $
- *
- * 4 10/14/05 12:26a Bennylp
- * Finished error code framework, some fixes in ioqueue, etc. Pretty
- * major.
- *
- * 3 9/22/05 10:31a Bennylp
- * Moving all *.h files to include/.
- *
- * 2 9/21/05 1:39p Bennylp
- * Periodic checkin for backup.
- *
- * 1 9/17/05 10:36a Bennylp
- * Created.
- *
- */
-#ifndef __PJ_COMPAT_SETJMP_H__
-#define __PJ_COMPAT_SETJMP_H__
-
-/**
- * @file setjmp.h
- * @brief Provides setjmp.h functionality.
- */
-
-#if defined(PJ_HAS_SETJMP_H) && PJ_HAS_SETJMP_H != 0
-# include <setjmp.h>
- typedef jmp_buf pj_jmp_buf;
-# define pj_setjmp(buf) setjmp(buf)
-# define pj_longjmp(buf,d) longjmp(buf,d)
-
-#elif defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL != 0 && \
- defined(PJ_M_I386) && PJ_M_I386 != 0
-
- /*
- * These are taken from uClibc.
- * Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org>
- */
-# if defined __USE_MISC || defined _ASM
-# define JB_BX 0
-# define JB_SI 1
-# define JB_DI 2
-# define JB_BP 3
-# define JB_SP 4
-# define JB_PC 5
-# define JB_SIZE 24
-# endif
-
-# ifndef _ASM
- typedef int __jmp_buf[6];
-
- /* A `sigset_t' has a bit for each signal. */
-# define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int)))
- typedef struct __sigset_t_tag
- {
- unsigned long int __val[_SIGSET_NWORDS];
- } __sigset_t;
-
- /* Calling environment, plus possibly a saved signal mask. */
- typedef struct __jmp_buf_tag /* C++ doesn't like tagless structs. */
- {
- /* NOTE: The machine-dependent definitions of `__sigsetjmp'
- assume that a `jmp_buf' begins with a `__jmp_buf' and that
- `__mask_was_saved' follows it. Do not move these members
- or add others before it. */
- __jmp_buf __jmpbuf; /* Calling environment. */
- int __mask_was_saved; /* Saved the signal mask? */
- // we never saved the mask.
- __sigset_t __saved_mask; /* Saved signal mask. */
- } jmp_buf[1];
-
- typedef jmp_buf sigjmp_buf;
- typedef jmp_buf pj_jmp_buf;
-
- PJ_DECL(int) pj_setjmp(pj_jmp_buf env);
- PJ_DECL(void) pj_longjmp(pj_jmp_buf env, int val) __attribute__((noreturn));
-
-# endif /* _ASM */
-
-#else
-# warning "setjmp()/longjmp() is not implemented"
- typedef int pj_jmp_buf[1];
-# define pj_setjmp(buf) 0
-# define pj_longjmp(buf,d) 0
-#endif
-
-
-#endif /* __PJ_COMPAT_SETJMP_H__ */
-
+/* $Header: /pjproject-0.3/pjlib/include/pj/compat/setjmp.h 4 10/14/05 12:26a Bennylp $ */ +/* $Log: /pjproject-0.3/pjlib/include/pj/compat/setjmp.h $ + * + * 4 10/14/05 12:26a Bennylp + * Finished error code framework, some fixes in ioqueue, etc. Pretty + * major. + * + * 3 9/22/05 10:31a Bennylp + * Moving all *.h files to include/. + * + * 2 9/21/05 1:39p Bennylp + * Periodic checkin for backup. + * + * 1 9/17/05 10:36a Bennylp + * Created. + * + */ +#ifndef __PJ_COMPAT_SETJMP_H__ +#define __PJ_COMPAT_SETJMP_H__ + +/** + * @file setjmp.h + * @brief Provides setjmp.h functionality. + */ + +#if defined(PJ_HAS_SETJMP_H) && PJ_HAS_SETJMP_H != 0 +# include <setjmp.h> + typedef jmp_buf pj_jmp_buf; +# define pj_setjmp(buf) setjmp(buf) +# define pj_longjmp(buf,d) longjmp(buf,d) + +#elif defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL != 0 && \ + defined(PJ_M_I386) && PJ_M_I386 != 0 + + /* + * These are taken from uClibc. + * Copyright (C) 2000-2003 Erik Andersen <andersen@uclibc.org> + */ +# if defined __USE_MISC || defined _ASM +# define JB_BX 0 +# define JB_SI 1 +# define JB_DI 2 +# define JB_BP 3 +# define JB_SP 4 +# define JB_PC 5 +# define JB_SIZE 24 +# endif + +# ifndef _ASM + typedef int __jmp_buf[6]; + + /* A `sigset_t' has a bit for each signal. */ +# define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int))) + typedef struct __sigset_t_tag + { + unsigned long int __val[_SIGSET_NWORDS]; + } __sigset_t; + + /* Calling environment, plus possibly a saved signal mask. */ + typedef struct __jmp_buf_tag /* C++ doesn't like tagless structs. */ + { + /* NOTE: The machine-dependent definitions of `__sigsetjmp' + assume that a `jmp_buf' begins with a `__jmp_buf' and that + `__mask_was_saved' follows it. Do not move these members + or add others before it. */ + __jmp_buf __jmpbuf; /* Calling environment. */ + int __mask_was_saved; /* Saved the signal mask? */ + // we never saved the mask. + __sigset_t __saved_mask; /* Saved signal mask. */ + } jmp_buf[1]; + + typedef jmp_buf sigjmp_buf; + typedef jmp_buf pj_jmp_buf; + + PJ_DECL(int) pj_setjmp(pj_jmp_buf env); + PJ_DECL(void) pj_longjmp(pj_jmp_buf env, int val) __attribute__((noreturn)); + +# endif /* _ASM */ + +#else +# warning "setjmp()/longjmp() is not implemented" + typedef int pj_jmp_buf[1]; +# define pj_setjmp(buf) 0 +# define pj_longjmp(buf,d) 0 +#endif + + +#endif /* __PJ_COMPAT_SETJMP_H__ */ + diff --git a/pjlib/include/pj/compat/size_t.h b/pjlib/include/pj/compat/size_t.h index 39b41665..80064a76 100644 --- a/pjlib/include/pj/compat/size_t.h +++ b/pjlib/include/pj/compat/size_t.h @@ -1,23 +1,23 @@ -/* $Header: /pjproject-0.3/pjlib/src/pj/compat/size_t.h 2 9/21/05 1:39p Bennylp $ */
-/* $Log: /pjproject-0.3/pjlib/src/pj/compat/size_t.h $
- *
- * 2 9/21/05 1:39p Bennylp
- * Periodic checkin for backup.
- *
- * 1 9/17/05 10:36a Bennylp
- * Created.
- *
- */
-#ifndef __PJ_COMPAT_SIZE_T_H__
-#define __PJ_COMPAT_SIZE_T_H__
-
-/**
- * @file size_t.h
- * @brief Provides size_t type.
- */
-#if PJ_HAS_STDDEF_H
-# include <stddef.h>
-#endif
-
-#endif /* __PJ_COMPAT_SIZE_T_H__ */
-
+/* $Header: /pjproject-0.3/pjlib/src/pj/compat/size_t.h 2 9/21/05 1:39p Bennylp $ */ +/* $Log: /pjproject-0.3/pjlib/src/pj/compat/size_t.h $ + * + * 2 9/21/05 1:39p Bennylp + * Periodic checkin for backup. + * + * 1 9/17/05 10:36a Bennylp + * Created. + * + */ +#ifndef __PJ_COMPAT_SIZE_T_H__ +#define __PJ_COMPAT_SIZE_T_H__ + +/** + * @file size_t.h + * @brief Provides size_t type. + */ +#if PJ_HAS_STDDEF_H +# include <stddef.h> +#endif + +#endif /* __PJ_COMPAT_SIZE_T_H__ */ + diff --git a/pjlib/include/pj/compat/socket.h b/pjlib/include/pj/compat/socket.h index 35befaea..561218b5 100644 --- a/pjlib/include/pj/compat/socket.h +++ b/pjlib/include/pj/compat/socket.h @@ -1,129 +1,129 @@ -/* $Header: /pjproject-0.3/pjlib/include/pj/compat/socket.h 5 10/29/05 11:51a Bennylp $*/
-/* $Log: /pjproject-0.3/pjlib/include/pj/compat/socket.h $
- *
- * 5 10/29/05 11:51a Bennylp
- * Version 0.3-pre2.
- *
- * 4 10/14/05 12:26a Bennylp
- * Finished error code framework, some fixes in ioqueue, etc. Pretty
- * major.
- *
- * 3 9/21/05 1:39p Bennylp
- * Periodic checkin for backup.
- *
- * 2 9/17/05 10:37a Bennylp
- * Major reorganization towards version 0.3.
- *
- */
-#ifndef __PJ_COMPAT_SOCKET_H__
-#define __PJ_COMPAT_SOCKET_H__
-
-/**
- * @file socket.h
- * @brief Provides all socket related functions,data types, error codes, etc.
- */
-
-#if defined(PJ_HAS_WINSOCK_H) && PJ_HAS_WINSOCK_H != 0
-# include <winsock.h>
-#endif
-
-#if defined(PJ_HAS_WINSOCK2_H) && PJ_HAS_WINSOCK2_H != 0
-# include <winsock2.h>
-#endif
-
-#if defined(PJ_HAS_SYS_TYPES_H) && PJ_HAS_SYS_TYPES_H != 0
-# include <sys/types.h>
-#endif
-
-#if defined(PJ_HAS_SYS_SOCKET_H) && PJ_HAS_SYS_SOCKET_H != 0
-# include <sys/socket.h>
-#endif
-
-#if defined(PJ_HAS_LINUX_SOCKET_H) && PJ_HAS_LINUX_SOCKET_H != 0
-# include <linux/socket.h>
-#endif
-
-#if defined(PJ_HAS_SYS_SELECT_H) && PJ_HAS_SYS_SELECT_H != 0
-# include <sys/select.h>
-#endif
-
-#if defined(PJ_HAS_NETINET_IN_H) && PJ_HAS_NETINET_IN_H != 0
-# include <netinet/in.h>
-#endif
-
-#if defined(PJ_HAS_ARPA_INET_H) && PJ_HAS_ARPA_INET_H != 0
-# include <arpa/inet.h>
-#endif
-
-#if defined(PJ_HAS_SYS_IOCTL_H) && PJ_HAS_SYS_IOCTL_H != 0
-# include <sys/ioctl.h> /* FBIONBIO */
-#endif
-
-#if defined(PJ_HAS_ERRNO_H) && PJ_HAS_ERRNO_H != 0
-# include <errno.h>
-#endif
-
-#if defined(PJ_HAS_NETDB_H) && PJ_HAS_NETDB_H != 0
-# include <netdb.h>
-#endif
-
-#if defined(PJ_HAS_UNISTD_H) && PJ_HAS_UNISTD_H != 0
-# include <unistd.h>
-#endif
-
-
-/*
- * Define common errors.
- */
-#ifdef PJ_WIN32
-# define OSERR_EWOULDBLOCK WSAEWOULDBLOCK
-# define OSERR_EINPROGRESS WSAEINPROGRESS
-#else
-# define OSERR_EWOULDBLOCK EWOULDBLOCK
-# define OSERR_EINPROGRESS EINPROGRESS
-#endif
-
-
-/*
- * And undefine this..
- */
-#undef s_addr
-
-/*
- * Linux kernel specifics
- */
-#ifdef PJ_LINUX_KERNEL
-# include <linux/net.h>
-# include <asm/ioctls.h> /* FIONBIO */
-# include <linux/syscalls.h> /* sys_select() */
-# include <asm/uaccess.h> /* set/get_fs() */
-
- typedef int socklen_t;
-# define getsockopt sys_getsockopt
-
- /*
- * Wrapper for select() in Linux kernel.
- */
- PJ_INLINE(int) select(int n, fd_set *inp, fd_set *outp, fd_set *exp,
- struct timeval *tvp)
- {
- int count;
- mm_segment_t oldfs = get_fs();
- set_fs(KERNEL_DS);
- count = sys_select(n, inp, outp, exp, tvp);
- set_fs(oldfs);
- return count;
- }
-#endif /* PJ_LINUX_KERNEL */
-
-
-/*
- * Windows specific
- */
-#ifdef PJ_WIN32
- typedef int socklen_t;;
-#endif
-
-
-#endif /* __PJ_COMPAT_SOCKET_H__ */
-
+/* $Header: /pjproject-0.3/pjlib/include/pj/compat/socket.h 5 10/29/05 11:51a Bennylp $*/ +/* $Log: /pjproject-0.3/pjlib/include/pj/compat/socket.h $ + * + * 5 10/29/05 11:51a Bennylp + * Version 0.3-pre2. + * + * 4 10/14/05 12:26a Bennylp + * Finished error code framework, some fixes in ioqueue, etc. Pretty + * major. + * + * 3 9/21/05 1:39p Bennylp + * Periodic checkin for backup. + * + * 2 9/17/05 10:37a Bennylp + * Major reorganization towards version 0.3. + * + */ +#ifndef __PJ_COMPAT_SOCKET_H__ +#define __PJ_COMPAT_SOCKET_H__ + +/** + * @file socket.h + * @brief Provides all socket related functions,data types, error codes, etc. + */ + +#if defined(PJ_HAS_WINSOCK_H) && PJ_HAS_WINSOCK_H != 0 +# include <winsock.h> +#endif + +#if defined(PJ_HAS_WINSOCK2_H) && PJ_HAS_WINSOCK2_H != 0 +# include <winsock2.h> +#endif + +#if defined(PJ_HAS_SYS_TYPES_H) && PJ_HAS_SYS_TYPES_H != 0 +# include <sys/types.h> +#endif + +#if defined(PJ_HAS_SYS_SOCKET_H) && PJ_HAS_SYS_SOCKET_H != 0 +# include <sys/socket.h> +#endif + +#if defined(PJ_HAS_LINUX_SOCKET_H) && PJ_HAS_LINUX_SOCKET_H != 0 +# include <linux/socket.h> +#endif + +#if defined(PJ_HAS_SYS_SELECT_H) && PJ_HAS_SYS_SELECT_H != 0 +# include <sys/select.h> +#endif + +#if defined(PJ_HAS_NETINET_IN_H) && PJ_HAS_NETINET_IN_H != 0 +# include <netinet/in.h> +#endif + +#if defined(PJ_HAS_ARPA_INET_H) && PJ_HAS_ARPA_INET_H != 0 +# include <arpa/inet.h> +#endif + +#if defined(PJ_HAS_SYS_IOCTL_H) && PJ_HAS_SYS_IOCTL_H != 0 +# include <sys/ioctl.h> /* FBIONBIO */ +#endif + +#if defined(PJ_HAS_ERRNO_H) && PJ_HAS_ERRNO_H != 0 +# include <errno.h> +#endif + +#if defined(PJ_HAS_NETDB_H) && PJ_HAS_NETDB_H != 0 +# include <netdb.h> +#endif + +#if defined(PJ_HAS_UNISTD_H) && PJ_HAS_UNISTD_H != 0 +# include <unistd.h> +#endif + + +/* + * Define common errors. + */ +#ifdef PJ_WIN32 +# define OSERR_EWOULDBLOCK WSAEWOULDBLOCK +# define OSERR_EINPROGRESS WSAEINPROGRESS +#else +# define OSERR_EWOULDBLOCK EWOULDBLOCK +# define OSERR_EINPROGRESS EINPROGRESS +#endif + + +/* + * And undefine this.. + */ +#undef s_addr + +/* + * Linux kernel specifics + */ +#ifdef PJ_LINUX_KERNEL +# include <linux/net.h> +# include <asm/ioctls.h> /* FIONBIO */ +# include <linux/syscalls.h> /* sys_select() */ +# include <asm/uaccess.h> /* set/get_fs() */ + + typedef int socklen_t; +# define getsockopt sys_getsockopt + + /* + * Wrapper for select() in Linux kernel. + */ + PJ_INLINE(int) select(int n, fd_set *inp, fd_set *outp, fd_set *exp, + struct timeval *tvp) + { + int count; + mm_segment_t oldfs = get_fs(); + set_fs(KERNEL_DS); + count = sys_select(n, inp, outp, exp, tvp); + set_fs(oldfs); + return count; + } +#endif /* PJ_LINUX_KERNEL */ + + +/* + * Windows specific + */ +#ifdef PJ_WIN32 + typedef int socklen_t;; +#endif + + +#endif /* __PJ_COMPAT_SOCKET_H__ */ + diff --git a/pjlib/include/pj/compat/sprintf.h b/pjlib/include/pj/compat/sprintf.h index 7ecc929b..21353fb9 100644 --- a/pjlib/include/pj/compat/sprintf.h +++ b/pjlib/include/pj/compat/sprintf.h @@ -1,31 +1,31 @@ -/* $Header: /pjproject-0.3/pjlib/include/pj/compat/sprintf.h 2 10/14/05 12:26a Bennylp $ */
-/* $Log: /pjproject-0.3/pjlib/include/pj/compat/sprintf.h $
- *
- * 2 10/14/05 12:26a Bennylp
- * Finished error code framework, some fixes in ioqueue, etc. Pretty
- * major.
- *
- * 1 9/17/05 10:36a Bennylp
- * Created.
- *
- */
-#ifndef __PJ_COMPAT_SPRINTF_H__
-#define __PJ_COMPAT_SPRINTF_H__
-
-/**
- * @file sprintf.h
- * @brief Provides sprintf() and snprintf() functions.
- */
-
-#if defined(PJ_HAS_STDIO_H) && PJ_HAS_STDIO_H != 0
-# include <stdio.h>
-#endif
-
-#if defined(_MSC_VER)
-# define snprintf _snprintf
-#endif
-
-#define pj_sprintf sprintf
-#define pj_snprintf snprintf
-
-#endif /* __PJ_COMPAT_SPRINTF_H__ */
+/* $Header: /pjproject-0.3/pjlib/include/pj/compat/sprintf.h 2 10/14/05 12:26a Bennylp $ */ +/* $Log: /pjproject-0.3/pjlib/include/pj/compat/sprintf.h $ + * + * 2 10/14/05 12:26a Bennylp + * Finished error code framework, some fixes in ioqueue, etc. Pretty + * major. + * + * 1 9/17/05 10:36a Bennylp + * Created. + * + */ +#ifndef __PJ_COMPAT_SPRINTF_H__ +#define __PJ_COMPAT_SPRINTF_H__ + +/** + * @file sprintf.h + * @brief Provides sprintf() and snprintf() functions. + */ + +#if defined(PJ_HAS_STDIO_H) && PJ_HAS_STDIO_H != 0 +# include <stdio.h> +#endif + +#if defined(_MSC_VER) +# define snprintf _snprintf +#endif + +#define pj_sprintf sprintf +#define pj_snprintf snprintf + +#endif /* __PJ_COMPAT_SPRINTF_H__ */ diff --git a/pjlib/include/pj/compat/stdarg.h b/pjlib/include/pj/compat/stdarg.h index 574cabb9..3c550ffc 100644 --- a/pjlib/include/pj/compat/stdarg.h +++ b/pjlib/include/pj/compat/stdarg.h @@ -1,20 +1,20 @@ -/* $Header: /pjproject-0.3/pjlib/src/pj/compat/stdarg.h 1 9/17/05 10:36a Bennylp $ */
-/* $Log: /pjproject-0.3/pjlib/src/pj/compat/stdarg.h $
- *
- * 1 9/17/05 10:36a Bennylp
- * Created.
- *
- */
-#ifndef __PJ_COMPAT_STDARG_H__
-#define __PJ_COMPAT_STDARG_H__
-
-/**
- * @file stdarg.h
- * @brief Provides stdarg functionality.
- */
-
-#if defined(PJ_HAS_STDARG_H) && PJ_HAS_STDARG_H != 0
-# include <stdarg.h>
-#endif
-
-#endif /* __PJ_COMPAT_STDARG_H__ */
+/* $Header: /pjproject-0.3/pjlib/src/pj/compat/stdarg.h 1 9/17/05 10:36a Bennylp $ */ +/* $Log: /pjproject-0.3/pjlib/src/pj/compat/stdarg.h $ + * + * 1 9/17/05 10:36a Bennylp + * Created. + * + */ +#ifndef __PJ_COMPAT_STDARG_H__ +#define __PJ_COMPAT_STDARG_H__ + +/** + * @file stdarg.h + * @brief Provides stdarg functionality. + */ + +#if defined(PJ_HAS_STDARG_H) && PJ_HAS_STDARG_H != 0 +# include <stdarg.h> +#endif + +#endif /* __PJ_COMPAT_STDARG_H__ */ diff --git a/pjlib/include/pj/compat/stdfileio.h b/pjlib/include/pj/compat/stdfileio.h index 40b0c341..a9926a71 100644 --- a/pjlib/include/pj/compat/stdfileio.h +++ b/pjlib/include/pj/compat/stdfileio.h @@ -1,20 +1,20 @@ -/* $Header: /pjproject-0.3/pjlib/src/pj/compat/stdfileio.h 1 9/17/05 10:36a Bennylp $ */
-/* $Log: /pjproject-0.3/pjlib/src/pj/compat/stdfileio.h $
- *
- * 1 9/17/05 10:36a Bennylp
- * Created.
- *
- */
-#ifndef __PJ_COMPAT_STDFILEIO_H__
-#define __PJ_COMPAT_STDFILEIO_H__
-
-/**
- * @file stdfileio.h
- * @brief Compatibility for ANSI file I/O like fputs, fflush, etc.
- */
-
-#if defined(PJ_HAS_STDIO_H) && PJ_HAS_STDIO_H != 0
-# include <stdio.h>
-#endif
-
-#endif /* __PJ_COMPAT_STDFILEIO_H__ */
+/* $Header: /pjproject-0.3/pjlib/src/pj/compat/stdfileio.h 1 9/17/05 10:36a Bennylp $ */ +/* $Log: /pjproject-0.3/pjlib/src/pj/compat/stdfileio.h $ + * + * 1 9/17/05 10:36a Bennylp + * Created. + * + */ +#ifndef __PJ_COMPAT_STDFILEIO_H__ +#define __PJ_COMPAT_STDFILEIO_H__ + +/** + * @file stdfileio.h + * @brief Compatibility for ANSI file I/O like fputs, fflush, etc. + */ + +#if defined(PJ_HAS_STDIO_H) && PJ_HAS_STDIO_H != 0 +# include <stdio.h> +#endif + +#endif /* __PJ_COMPAT_STDFILEIO_H__ */ diff --git a/pjlib/include/pj/compat/string.h b/pjlib/include/pj/compat/string.h index 86c8bd6b..3230fbdd 100644 --- a/pjlib/include/pj/compat/string.h +++ b/pjlib/include/pj/compat/string.h @@ -1,41 +1,41 @@ -/* $Header: /pjproject-0.3/pjlib/src/pj/compat/string.h 3 9/22/05 10:31a Bennylp $ */
-/* $Log: /pjproject-0.3/pjlib/src/pj/compat/string.h $
- *
- * 3 9/22/05 10:31a Bennylp
- * Moving all *.h files to include/.
- *
- * 2 9/21/05 1:39p Bennylp
- * Periodic checkin for backup.
- *
- * 1 9/17/05 10:36a Bennylp
- * Created.
- *
- */
-#ifndef __PJ_COMPAT_STRING_H__
-#define __PJ_COMPAT_STRING_H__
-
-/**
- * @file string.h
- * @brief Provides string manipulation functions found in ANSI string.h.
- */
-
-#if defined(PJ_HAS_STRING_H) && PJ_HAS_STRING_H != 0
-# include <string.h>
-#else
-
- PJ_DECL(int) strcasecmp(const char *s1, const char *s2);
- PJ_DECL(int) strncasecmp(const char *s1, const char *s2, int len);
-
-#endif
-
-#if defined(_MSC_VER)
-# define strcasecmp stricmp
-# define strncasecmp strnicmp
-# define snprintf _snprintf
-#else
-# define stricmp strcasecmp
-# define strnicmp strncasecmp
-#endif
-
-
-#endif /* __PJ_COMPAT_STRING_H__ */
+/* $Header: /pjproject-0.3/pjlib/src/pj/compat/string.h 3 9/22/05 10:31a Bennylp $ */ +/* $Log: /pjproject-0.3/pjlib/src/pj/compat/string.h $ + * + * 3 9/22/05 10:31a Bennylp + * Moving all *.h files to include/. + * + * 2 9/21/05 1:39p Bennylp + * Periodic checkin for backup. + * + * 1 9/17/05 10:36a Bennylp + * Created. + * + */ +#ifndef __PJ_COMPAT_STRING_H__ +#define __PJ_COMPAT_STRING_H__ + +/** + * @file string.h + * @brief Provides string manipulation functions found in ANSI string.h. + */ + +#if defined(PJ_HAS_STRING_H) && PJ_HAS_STRING_H != 0 +# include <string.h> +#else + + PJ_DECL(int) strcasecmp(const char *s1, const char *s2); + PJ_DECL(int) strncasecmp(const char *s1, const char *s2, int len); + +#endif + +#if defined(_MSC_VER) +# define strcasecmp stricmp +# define strncasecmp strnicmp +# define snprintf _snprintf +#else +# define stricmp strcasecmp +# define strnicmp strncasecmp +#endif + + +#endif /* __PJ_COMPAT_STRING_H__ */ diff --git a/pjlib/include/pj/compat/time.h b/pjlib/include/pj/compat/time.h index 45585cb1..f76c1e41 100644 --- a/pjlib/include/pj/compat/time.h +++ b/pjlib/include/pj/compat/time.h @@ -1,25 +1,25 @@ -/* $Header: /pjproject-0.3/pjlib/src/pj/compat/time.h 1 9/17/05 10:36a Bennylp $ */
-/* $Log: /pjproject-0.3/pjlib/src/pj/compat/time.h $
- *
- * 1 9/17/05 10:36a Bennylp
- * Created.
- *
- */
-#ifndef __PJ_COMPAT_TIME_H__
-#define __PJ_COMPAT_TIME_H__
-
-/**
- * @file time.h
- * @brief Provides ftime() and localtime() etc functions.
- */
-
-#if defined(PJ_HAS_TIME_H) && PJ_HAS_TIME_H != 0
-# include <time.h>
-#endif
-
-#if defined(PJ_HAS_SYS_TIMEB_H) && PJ_HAS_SYS_TIMEB_H != 0
-# include <sys/timeb.h>
-#endif
-
-
-#endif /* __PJ_COMPAT_TIME_H__ */
+/* $Header: /pjproject-0.3/pjlib/src/pj/compat/time.h 1 9/17/05 10:36a Bennylp $ */ +/* $Log: /pjproject-0.3/pjlib/src/pj/compat/time.h $ + * + * 1 9/17/05 10:36a Bennylp + * Created. + * + */ +#ifndef __PJ_COMPAT_TIME_H__ +#define __PJ_COMPAT_TIME_H__ + +/** + * @file time.h + * @brief Provides ftime() and localtime() etc functions. + */ + +#if defined(PJ_HAS_TIME_H) && PJ_HAS_TIME_H != 0 +# include <time.h> +#endif + +#if defined(PJ_HAS_SYS_TIMEB_H) && PJ_HAS_SYS_TIMEB_H != 0 +# include <sys/timeb.h> +#endif + + +#endif /* __PJ_COMPAT_TIME_H__ */ diff --git a/pjlib/include/pj/compat/vsprintf.h b/pjlib/include/pj/compat/vsprintf.h index 3d2bd341..cc93bc55 100644 --- a/pjlib/include/pj/compat/vsprintf.h +++ b/pjlib/include/pj/compat/vsprintf.h @@ -1,26 +1,26 @@ -/* $Header: /pjproject-0.3/pjlib/src/pj/compat/vsprintf.h 1 9/17/05 10:36a Bennylp $ */
-/* $Log: /pjproject-0.3/pjlib/src/pj/compat/vsprintf.h $
- *
- * 1 9/17/05 10:36a Bennylp
- * Created.
- *
- */
-#ifndef __PJ_COMPAT_VSPRINTF_H__
-#define __PJ_COMPAT_VSPRINTF_H__
-
-/**
- * @file vsprintf.h
- * @brief Provides vsprintf and vsnprintf function.
- */
-
-#if defined(PJ_HAS_STDIO_H) && PJ_HAS_STDIO_H != 0
-# include <stdio.h>
-#endif
-
-#if defined(_MSC_VER)
-# define vsnprintf _vsnprintf
-#endif
-
-#define pj_vsnprintf vsnprintf
-
-#endif /* __PJ_COMPAT_VSPRINTF_H__ */
+/* $Header: /pjproject-0.3/pjlib/src/pj/compat/vsprintf.h 1 9/17/05 10:36a Bennylp $ */ +/* $Log: /pjproject-0.3/pjlib/src/pj/compat/vsprintf.h $ + * + * 1 9/17/05 10:36a Bennylp + * Created. + * + */ +#ifndef __PJ_COMPAT_VSPRINTF_H__ +#define __PJ_COMPAT_VSPRINTF_H__ + +/** + * @file vsprintf.h + * @brief Provides vsprintf and vsnprintf function. + */ + +#if defined(PJ_HAS_STDIO_H) && PJ_HAS_STDIO_H != 0 +# include <stdio.h> +#endif + +#if defined(_MSC_VER) +# define vsnprintf _vsnprintf +#endif + +#define pj_vsnprintf vsnprintf + +#endif /* __PJ_COMPAT_VSPRINTF_H__ */ |