summaryrefslogtreecommitdiff
path: root/pjlib/include
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2011-07-19 03:42:28 +0000
committerNanang Izzuddin <nanang@teluu.com>2011-07-19 03:42:28 +0000
commitcd283c8825c9a94400f27735acb1c9385e90ffc8 (patch)
tree56d5722310fa8957ce5d1ba7cbd137cf8802dcc7 /pjlib/include
parented8f8d08abba9040f769e922aa0c1adbde86fbbc (diff)
Re #1326: Initial code integration from branch 2.0-dev to trunk as "2.0-pre-alpha-svn".
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3664 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/include')
-rw-r--r--pjlib/include/pj/compat/cc_gcc.h3
-rw-r--r--pjlib/include/pj/compat/cc_msvc.h3
-rw-r--r--pjlib/include/pj/config.h11
-rw-r--r--pjlib/include/pj/errno.h2
-rw-r--r--pjlib/include/pj/os.h30
5 files changed, 45 insertions, 4 deletions
diff --git a/pjlib/include/pj/compat/cc_gcc.h b/pjlib/include/pj/compat/cc_gcc.h
index d176a319..77d93f32 100644
--- a/pjlib/include/pj/compat/cc_gcc.h
+++ b/pjlib/include/pj/compat/cc_gcc.h
@@ -71,5 +71,8 @@
#define PJ_UNREACHED(x)
+#define PJ_ALIGN_DATA(declaration, alignment) declaration __attribute__((aligned (alignment)))
+
+
#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 10d0a32b..0b1fd68a 100644
--- a/pjlib/include/pj/compat/cc_msvc.h
+++ b/pjlib/include/pj/compat/cc_msvc.h
@@ -80,5 +80,8 @@ typedef unsigned __int64 pj_uint64_t;
#define PJ_UNREACHED(x)
+#define PJ_ALIGN_DATA(declaration, alignment) __declspec(align(alignment)) declaration
+
+
#endif /* __PJ_COMPAT_CC_MSVC_H__ */
diff --git a/pjlib/include/pj/config.h b/pjlib/include/pj/config.h
index 25758452..ec7c7449 100644
--- a/pjlib/include/pj/config.h
+++ b/pjlib/include/pj/config.h
@@ -20,7 +20,6 @@
#ifndef __PJ_CONFIG_H__
#define __PJ_CONFIG_H__
-#error "For PJSIP version 1.x, please switch your svn repository URL to https://svn.pjsip.org/repos/pjproject/branches/1.x"
/**
* @file config.h
@@ -46,6 +45,10 @@
# error "Unknown compiler."
#endif
+/* PJ_ALIGN_DATA is compiler specific directive to align data address */
+#ifndef PJ_ALIGN_DATA
+# error "PJ_ALIGN_DATA is not defined!"
+#endif
/********************************************************************
* Include target OS specific configuration.
@@ -1122,10 +1125,10 @@
PJ_BEGIN_DECL
/** PJLIB version major number. */
-#define PJ_VERSION_NUM_MAJOR 1
+#define PJ_VERSION_NUM_MAJOR 2
/** PJLIB version minor number. */
-#define PJ_VERSION_NUM_MINOR 10
+#define PJ_VERSION_NUM_MINOR 0
/** PJLIB version revision number. */
#define PJ_VERSION_NUM_REV 0
@@ -1134,7 +1137,7 @@ PJ_BEGIN_DECL
* Extra suffix for the version (e.g. "-trunk"), or empty for
* web release version.
*/
-#define PJ_VERSION_NUM_EXTRA "-svn"
+#define PJ_VERSION_NUM_EXTRA "-pre-alpha-svn"
/**
* PJLIB version number consists of three bytes with the following format:
diff --git a/pjlib/include/pj/errno.h b/pjlib/include/pj/errno.h
index 49fd7bbd..66fea949 100644
--- a/pjlib/include/pj/errno.h
+++ b/pjlib/include/pj/errno.h
@@ -468,6 +468,8 @@ PJ_DECL(pj_status_t) pj_register_strerror(pj_status_t start_code,
* - PJLIB_UTIL_ERRNO_START (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*3)
* - PJNATH_ERRNO_START (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*4)
* - PJMEDIA_AUDIODEV_ERRNO_START (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*5)
+ * - PJ_SSL_ERRNO_START (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*6)
+ * - PJMEDIA_VIDEODEV_ERRNO_START (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*7)
*/
/* Internal */
diff --git a/pjlib/include/pj/os.h b/pjlib/include/pj/os.h
index 45f9ce8f..3ce877af 100644
--- a/pjlib/include/pj/os.h
+++ b/pjlib/include/pj/os.h
@@ -1434,6 +1434,36 @@ PJ_DECL(pj_uint32_t) pj_elapsed_cycle( const pj_timestamp *start,
/* **************************************************************************/
/**
+ * @defgroup PJ_APP_OS Application execution
+ * @ingroup PJ_OS
+ * @{
+ */
+
+/* Type for main function. */
+typedef int (*pj_main_func_ptr)(int argc, char *argv[]);
+
+/**
+ * Run the application. This function has to be called in the main thread
+ * and after doing the necessary initialization according to the flags
+ * provided, it will call main_func() function.
+ *
+ * @param main_func Application's main function.
+ * @param argc Number of arguments from the main() function, which
+ * will be passed to main_func() function.
+ * @param argv The arguments from the main() function, which will
+ * be passed to main_func() function.
+ * @param flags Flags for application execution, currently must be 0.
+ *
+ * @return main_func()'s return value.
+ */
+int pj_run_app(pj_main_func_ptr main_func, int argc, char *argv[],
+ unsigned flags);
+
+/** @} */
+
+
+/* **************************************************************************/
+/**
* Internal PJLIB function to initialize the threading subsystem.
* @return PJ_SUCCESS or the appropriate error code.
*/