Replace glib threadpool usage with a 'dumb' thread implementation.
authorErich Keane <erich.keane@intel.com>
Thu, 16 Apr 2015 00:11:23 +0000 (17:11 -0700)
committerErich Keane <erich.keane@intel.com>
Mon, 27 Apr 2015 22:48:18 +0000 (22:48 +0000)
We are attempting to remove glib as a necessity for the build, so this
patch replaces the glib threadpool implementation with a 'dumb' dispatch
thread model.

It renames u_threadpool with ca_threadpool to be more internally consistent
with naming conventions.

Finally, it removes all glib build dependencies for non-Tizen build scripts.

Change-Id: Icc64b758ae6c00ff426adda1c74d8f86e56a8fc5
Signed-off-by: Erich Keane <erich.keane@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/747
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Joseph Morrow <joseph.l.morrow@intel.com>
Reviewed-by: Sashi Penta <sashi.kumar.penta@intel.com>
103 files changed:
build_common/SConscript
build_common/android/SConscript
build_common/darwin/SConscript
build_common/iotivityconfig/__init__.py
build_common/iotivityconfig/compiler/configuration.py
build_common/linux/SConscript
examples/OICMiddle/SConscript
resource/SConscript
resource/csdk/connectivity/build/android/README.txt
resource/csdk/connectivity/build/android/SConscript
resource/csdk/connectivity/build/linux/Makefile
resource/csdk/connectivity/build/linux/SConscript
resource/csdk/connectivity/build/tizen/packaging/com.oic.ca.spec
resource/csdk/connectivity/common/SConscript
resource/csdk/connectivity/common/inc/camutex.h
resource/csdk/connectivity/common/inc/cathreadpool.h [moved from resource/csdk/connectivity/common/inc/uthreadpool.h with 64% similarity]
resource/csdk/connectivity/common/src/camutex_glib.c [deleted file]
resource/csdk/connectivity/common/src/camutex_pthreads.c [moved from resource/csdk/connectivity/common/src/camutex_pthread.c with 74% similarity]
resource/csdk/connectivity/common/src/cathreadpool_pthreads.c [new file with mode: 0644]
resource/csdk/connectivity/common/src/uthreadpool.c [deleted file]
resource/csdk/connectivity/inc/caedradapter.h
resource/csdk/connectivity/inc/caedrclient.h
resource/csdk/connectivity/inc/caedrinterface.h
resource/csdk/connectivity/inc/caedrserver.h
resource/csdk/connectivity/inc/caedrutils.h
resource/csdk/connectivity/inc/caethernetadapter.h
resource/csdk/connectivity/inc/caethernetinterface.h
resource/csdk/connectivity/inc/cainterfacecontroller.h
resource/csdk/connectivity/inc/caleadapter.h
resource/csdk/connectivity/inc/calecore.h
resource/csdk/connectivity/inc/caleinterface.h
resource/csdk/connectivity/inc/calenwmonitor.h
resource/csdk/connectivity/inc/caleserver.h
resource/csdk/connectivity/inc/caleutils.h
resource/csdk/connectivity/inc/caqueueingthread.h
resource/csdk/connectivity/inc/caretransmission.h
resource/csdk/connectivity/inc/cawifiadapter.h
resource/csdk/connectivity/inc/cawifiinterface.h
resource/csdk/connectivity/lib/android/glib_build.sh [deleted file]
resource/csdk/connectivity/lib/android/glibpatch_Readme.txt [deleted file]
resource/csdk/connectivity/lib/android/jni/Android.mk
resource/csdk/connectivity/lib/android/patches/glib-2.40.2-withoutMakefile.patch [deleted file]
resource/csdk/connectivity/lib/android/patches/glib-2.40.2-x64-withoutMakefile.patch [deleted file]
resource/csdk/connectivity/lib/android/patches/glib-2.40.2-x64.patch [deleted file]
resource/csdk/connectivity/lib/android/patches/glib-2.40.2.patch [deleted file]
resource/csdk/connectivity/samples/android/sample_service/jni/Android.mk
resource/csdk/connectivity/samples/linux/SConscript
resource/csdk/connectivity/samples/linux/threadpool/Makefile
resource/csdk/connectivity/samples/linux/threadpool/main.c
resource/csdk/connectivity/src/bt_edr_adapter/android/caedrclient.c
resource/csdk/connectivity/src/bt_edr_adapter/android/caedrnwmonitor.c
resource/csdk/connectivity/src/bt_edr_adapter/android/caedrserver.c
resource/csdk/connectivity/src/bt_edr_adapter/android/caedrutils.c
resource/csdk/connectivity/src/bt_edr_adapter/caedradapter.c
resource/csdk/connectivity/src/bt_edr_adapter/linux/caedradapter.c
resource/csdk/connectivity/src/bt_edr_adapter/tizen/caedrclient.c
resource/csdk/connectivity/src/bt_edr_adapter/tizen/caedrserver.c
resource/csdk/connectivity/src/bt_le_adapter/android/caleadapter.c
resource/csdk/connectivity/src/bt_le_adapter/android/caleclient.c
resource/csdk/connectivity/src/bt_le_adapter/android/caleserver.c
resource/csdk/connectivity/src/bt_le_adapter/android/caleutils.c
resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c
resource/csdk/connectivity/src/bt_le_adapter/linux/caleadapter.c
resource/csdk/connectivity/src/bt_le_adapter/tizen/cableclient.c
resource/csdk/connectivity/src/bt_le_adapter/tizen/cableclient.h
resource/csdk/connectivity/src/bt_le_adapter/tizen/cableserver.c
resource/csdk/connectivity/src/bt_le_adapter/tizen/cableserver.h
resource/csdk/connectivity/src/cainterfacecontroller.c
resource/csdk/connectivity/src/camessagehandler.c
resource/csdk/connectivity/src/caqueueingthread.c
resource/csdk/connectivity/src/caretransmission.c
resource/csdk/connectivity/src/ethernet_adapter/caethernetadapter.c
resource/csdk/connectivity/src/ethernet_adapter/linux/caethernetnwmonitor.c
resource/csdk/connectivity/src/ethernet_adapter/linux/caethernetserver.c
resource/csdk/connectivity/src/wifi_adapter/android/cawifinwmonitor.c
resource/csdk/connectivity/src/wifi_adapter/android/cawifiserver.c
resource/csdk/connectivity/src/wifi_adapter/cawifiadapter.c
resource/csdk/connectivity/src/wifi_adapter/linux/cawifinwmonitor.c
resource/csdk/connectivity/src/wifi_adapter/linux/cawifiserver.c
resource/csdk/connectivity/src/wifi_adapter/tizen/cawifinwmonitor.c
resource/csdk/connectivity/src/wifi_adapter/tizen/cawifiserver.c
resource/csdk/connectivity/test/SConscript
resource/csdk/connectivity/test/camutex_tests.cpp
resource/csdk/stack/samples/linux/SimpleClientServer/SConscript
resource/csdk/stack/samples/linux/secure/SConscript
resource/csdk/stack/test/SConscript
resource/docs/devdox/ca_functional.dox
resource/docs/devdox/dot/ca_arch.gv
resource/examples/SConscript
resource/third_party_libs.scons
resource/unit_tests.scons
resource/unittests/SConscript
service/notification-manager/SampleApp/linux/SConscript
service/protocol-plugin/sample-app/linux/SConscript
service/soft-sensor-manager/SConscript
service/soft-sensor-manager/SampleApp/linux/HeightSensorApp/SConscript
service/soft-sensor-manager/SampleApp/linux/SSMTesterApp/SConscript
service/soft-sensor-manager/SampleApp/linux/THSensorApp/SConscript
service/soft-sensor-manager/SampleApp/linux/THSensorApp1/SConscript
service/soft-sensor-manager/SampleApp/linux/WeightSensorApp/SConscript
service/things-manager/sampleapp/linux/configuration/SConscript
service/things-manager/sampleapp/linux/groupaction/SConscript
service/things-manager/sampleapp/linux/groupsyncaction/SConscript

index 6a31598..b2d73a5 100644 (file)
@@ -48,7 +48,7 @@ target_arch = ARGUMENTS.get('TARGET_ARCH', default_arch) # target arch
 
 # True if binary needs to be installed on board. (Might need root permissions)
 # set to 'no', 'false' or 0 for only compilation
-require_upload = ARGUMENTS.get('UPLOAD', False) 
+require_upload = ARGUMENTS.get('UPLOAD', False)
 
 if ARGUMENTS.get('TEST'):
        logging_default = False
@@ -205,8 +205,8 @@ Export('env')
 ######################################################################
 if target_os == "yocto":
     '''
-    This code injects Yocto cross-compilation tools+flags into scons' 
-    build environment in order to invoke the relevant tools while 
+    This code injects Yocto cross-compilation tools+flags into scons'
+    build environment in order to invoke the relevant tools while
     performing a build.
     '''
     import os.path
@@ -244,7 +244,7 @@ if target_os == "yocto":
     env['TARGET_OS'] = 'linux'
     '''
     We want to preserve debug symbols to allow BitBake to generate both DEBUG and
-    RELEASE packages for OIC. 
+    RELEASE packages for OIC.
     '''
     env['CCFLAGS'].append('-g')
     Export('env')
@@ -258,15 +258,36 @@ else:
     else:
                env.SConscript(target_os + '/SConscript')
 
-env.SConscript('external_libs.scons')
-
 # Delete the temp files of configuration
 if env.GetOption('clean'):
        dir = env.get('SRC_DIR')
 
        if os.path.exists(dir + '/config.log'):
                Execute(Delete(dir + '/config.log'))
+       if os.path.exists(dir + '/.sconsign.dblite'):
                Execute(Delete(dir + '/.sconsign.dblite'))
+       if os.path.exists(dir + '/.sconf_temp'):
                Execute(Delete(dir + '/.sconf_temp'))
 
+######################################################################
+# Check for PThreads support
+######################################################################
+import iotivityconfig
+from iotivityconfig import *
+
+conf = Configure(env,
+        custom_tests =
+        {
+            'CheckPThreadsSupport' : iotivityconfig.check_pthreads
+        } )
+
+# Identify whether we have pthreads support, which is necessary for
+# threading and mutexes.  This will set the environment variable
+# POSIX_SUPPORTED, 1 if it is supported, 0 otherwise
+conf.CheckPThreadsSupport()
+
+env = conf.Finish()
+######################################################################
+
+env.SConscript('external_libs.scons')
 Return('env')
index eb43bac..f74f660 100644 (file)
@@ -23,20 +23,6 @@ if not android_ndk:
 '''
        Exit(1)
 
-# check 'glib' library
-src_dir = env.get('SRC_DIR')
-if not os.path.exists(src_dir + '/extlibs/glib/glib-2.40.2'):
-       print '''
-*********************************** Error: **************************************
-* Android glib library does not exist. please download gnome glib to            *
-* extlibs/glib directory                                                        *
-* To build Android glib libraries please follow the instructions as below :     *
-* Download Gnome Glib from http://ftp.gnome.org/pub/GNOME/sources/glib/2.40/    *
-* Please go through build instructions at :                                     *
-* resource/csdk/connectivity/lib/android/glibpatch_Readme.txt                   *
-*********************************************************************************
-       '''
-       Exit(1)
 # Overwrite suffixes and prefixes
 if env['HOST_OS'] == 'win32':
        env['OBJSUFFIX'] = '.o'
@@ -196,11 +182,11 @@ env.AppendUnique(CCFLAGS = ['-Wall', '-fPIC'])
 
 env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
 env.AppendUnique(LIBPATH = [src_dir + '/resource/csdk/connectivity/lib/android'])
-env.AppendUnique(LIBS = ['log', 'glib-2.40.2', 'gthread-2.40.2', 'coap'])
+env.AppendUnique(LIBS = ['log', 'coap'])
 
 if env.get('SECURED') == '1':
        env.AppendUnique(LIBS = ['tinydtls'])
-       
+
 # From android-5 (API > 20), all application must be built with flags '-fPIE' '-pie'.
 # Due to the limitation of Scons, it's required to added it into the command line
 # directly (otherwise, it will also be added when build share library)
index 1987fc3..2b0386a 100644 (file)
@@ -39,8 +39,6 @@ else:
        env.AppendUnique(CCFLAGS = ['-g'])
        env.AppendUnique(LINKFLAGS = ['-g'])
 
-env.ParseConfig("pkg-config glib-2.0 gthread-2.0 --cflags --libs")
-
 if target_os == 'darwin':
        sys_root = '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX' + sys_version + '.sdk/'
 else:
@@ -56,4 +54,4 @@ env.AppendUnique(LINKFLAGS = ['-arch', target_arch, '-isysroot', sys_root])
 if target_os == 'darwin':
        flag = '-mmacosx-version-min=' + sys_version
        env.AppendUnique(CCFLAGS = [flag])
-       env.AppendUnique(LINKFLAGS = [flag])
\ No newline at end of file
+       env.AppendUnique(LINKFLAGS = [flag])
index ea18ea1..3a2ef6a 100644 (file)
@@ -94,3 +94,17 @@ def check_cxx11_flags(context):
     _inform_user_of_broken_gcc_headers(context, ret)
 
     return ret
+
+def check_pthreads(context):
+    """
+    Check if pthreads are supported for this platform.
+
+    Sets POSIX_SUPPORTED based on the result.
+    """
+    context.Message('Checking for POSIX Thread Support...')
+    config = factory.make_c_compiler_config(context)
+
+    ret = config.has_pthreads_support()
+    context.env['POSIX_SUPPORTED'] = ret
+    context.Result(ret)
+    return ret
index e328e28..3dbf4e1 100644 (file)
@@ -65,6 +65,16 @@ class Configuration:
                                  '.cpp',
                                  'CXXFLAGS')
 
+    def has_pthreads_support(self):
+        """
+        Check if PThreads are supported by this system
+
+        Returns 1 if this system DOES support pthreads, 0
+        otherwise
+        """
+
+        return self._context.TryCompile(self._pthreads_test_program(), '.c')
+
     # --------------------------------------------------------------
     # Check if flag is required to build the given test program.
     #
@@ -148,3 +158,21 @@ class Configuration:
     # --------------------------------------------------------------
     def _cxx11_flags(self):
         raise NotImplementedError('unimplemented method')
+
+    # --------------------------------------------------------------
+    # Return a test program to be used when checking for PThreads
+    # support
+    #
+    # --------------------------------------------------------------
+    def _pthreads_test_program(self):
+        return """
+#include <unistd.h>
+#include <pthread.h>
+int main()
+{
+    #ifndef _POSIX_THREADS
+    # error POSIX Threads support not available
+    #endif
+    return 0;
+}
+"""
index 4f0722a..5c67e25 100644 (file)
@@ -21,10 +21,9 @@ env.AppendUnique(CFLAGS = ['-std=c99'])
 env.AppendUnique(CCFLAGS = ['-Wall', '-fPIC'])
 env.AppendUnique(LINKFLAGS = ['-ldl', '-lpthread'])
 
-env.ParseConfig("pkg-config glib-2.0 gthread-2.0 --cflags --libs")
-
 if env.get('TARGET_OS') == 'tizen':
     env.AppendUnique(CCFLAGS = ['-D__TIZEN__', '-DSLP_SDK_LOG', '-D_GNU_SOURCE', '-DTIZEN_DEBUG_ENABLE'])
+    env.ParseConfig("pkg-config glib-2.0 gthread-2.0 --cflags --libs")
     env.ParseConfig("pkg-config dlog --cflags --libs")
 
 # Set arch flags
index 04b26fe..6748493 100644 (file)
@@ -49,12 +49,11 @@ if target_os not in ['windows', 'winrt']:
                examples_env.AppendUnique(LIBS = ['-lpthread'])
 
 examples_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
-examples_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap'])
+examples_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'connectivity_abstraction',
+        'coap', 'rt'])
 if env.get('SECURED') == '1':
     examples_env.AppendUnique(LIBS = ['tinydtls'])
 
-examples_env.ParseConfig('pkg-config --libs glib-2.0');
-
 if target_os == 'android':
        examples_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
        examples_env.AppendUnique(LIBS = ['gnustl_static'])
index cacd5d4..e9cddf5 100644 (file)
@@ -30,6 +30,9 @@ Import('env')
 target_os = env.get('TARGET_OS')
 src_dir = env.get('SRC_DIR')
 
+if target_os not in ['arduino', 'darwin', 'ios']:
+       env.AppendUnique(LIBS=['rt'])
+
 # Build libcoap
 SConscript('csdk/connectivity/lib/libcoap-4.1.1/SConscript')
 
index b890949..10fb9a3 100644 (file)
@@ -2,8 +2,7 @@ Compiling Interface APIs FOR Android:
 ===================================
 â€¢Preconditons :
        Please download the following
-       1) glib directory and keep at $(CA_HOME)/lib/android/glib-2.40.2
-       2) tinydlts library and keep at $(CA_HOME)/lib/tinydtls
+       1) tinydlts library and keep at $(CA_HOME)/lib/tinydtls
 â€¢Supported version : 5.0 ( Lollipop )
 â€¢Required NDK version : android-ndk-r10d ( https://developer.android.com/tools/sdk/ndk/index.html )
 â€¢ Modify Makefile ( connectivity/build/android/Makefile )
index 751b52f..3c7cd74 100644 (file)
@@ -23,19 +23,6 @@ if not android_ndk:
 '''
        Exit(1)
 
-# check 'glib' library
-src_dir = env.get('SRC_DIR')
-if not os.path.exists(src_dir + '/../../../../extlibs/glib/glib-2.40.2'):
-        print '''
-*********************************** Error: **************************************
-* Android glib library does not exist. please download gnome glib to            *
-* extlibs/glib directory                                                        *
-* To build Android glib libraries please follow the instructions as below :     *
-* Download Gnome Glib from http://ftp.gnome.org/pub/GNOME/sources/glib/2.40/    *
-* Please go through build instructions at :                                     *
-* lib/android/glibpatch_Readme.txt                                              *
-*********************************************************************************
-        '''
 # Overwrite suffixes and prefixes
 if env['HOST_OS'] == 'win32':
        env['OBJSUFFIX'] = '.o'
@@ -185,7 +172,7 @@ env.AppendUnique(CCFLAGS = ['-Wall', '-fPIC'])
 
 env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
 env.AppendUnique(LIBPATH = [src_dir + '/lib/android'])
-env.AppendUnique(LIBS = ['log', 'glib-2.40.2', 'gthread-2.40.2', 'coap'])
+env.AppendUnique(LIBS = ['log', 'coap'])
 if env.get('SECURED') == '1':
        env.AppendUnique(LIBS = ['tinydtls'])
 
index 3fcaeab..d56e641 100644 (file)
@@ -95,7 +95,7 @@ RELEASE_DIR = ./release
 ##
 ##     file declaration
 ##
-COMPONENT_SRCS := logger.c oic_logger.c oic_console_logger.c oic_malloc.c oic_string.c uqueue.c uarraylist.c umutex.c uthreadpool.c
+COMPONENT_SRCS := logger.c oic_logger.c oic_console_logger.c oic_malloc.c oic_string.c uqueue.c uarraylist.c umutex.c cathreadpool_pthreads.c
 COMPONENT_SRCS += caretransmission.c
 COMPONENT_SRCS += caconnectivitymanager.c caremotehandler.c cainterfacecontroller.c camessagehandler.c caqueueingthread.c canetworkconfigurator.c caprotocolmessage.c
 COMPONENT_SRCS += caadapterutils.c
index cda841b..bc0176d 100644 (file)
@@ -20,8 +20,6 @@ env.AppendUnique(CPPDEFINES = ['WITH_POSIX', '__linux__'])
 env.AppendUnique(CCFLAGS = ['-Wall', '-fPIC'])
 env.AppendUnique(LINKFLAGS = ['-ldl', '-lpthread'])
 
-env.ParseConfig("pkg-config --cflags --libs glib-2.0 gthread-2.0")
-
 # Set arch flags
 target_arch = env.get('TARGET_ARCH')
 if target_arch in ['x86']:
index cea0eb1..a8689a3 100644 (file)
@@ -44,7 +44,7 @@ cp -f %{ROOTDIR}/con/src/libconnectivity_abstraction.a %{buildroot}/%{_libdir}
 cp -f %{ROOTDIR}/con/lib/libcoap-4.1.1/libcoap.a %{buildroot}/%{_libdir}
 cp -rf %{ROOTDIR}/con/api/cacommon.h* %{DEST_INC_DIR}/
 cp -rf %{ROOTDIR}/con/inc/caadapterinterface.h* %{DEST_INC_DIR}/
-cp -rf %{ROOTDIR}/con/common/inc/uthreadpool.h* %{DEST_INC_DIR}/
+cp -rf %{ROOTDIR}/con/common/inc/cathreadpool.h* %{DEST_INC_DIR}/
 cp -rf %{ROOTDIR}/con/inc/cawifiadapter.h* %{DEST_INC_DIR}/
 cp -rf %{ROOTDIR}/con/inc/caethernetadapter.h* %{DEST_INC_DIR}/
 cp -rf %{ROOTDIR}/con/inc/caedradapter.h* %{DEST_INC_DIR}/
index f082dd8..7c6c558 100644 (file)
@@ -13,19 +13,10 @@ root_dir = './../'
 
 ca_common_path = root_dir + 'common/'
 ca_common_src_path = ca_common_path + 'src/'
-no_glib = 'darwin,ios'
 
 env.AppendUnique(CPPPATH = [
        'common/inc/',
        ])
-       
-if ca_os == 'android':
-       main_dir  = Dir('.').srcnode().abspath
-       glib_dir = main_dir + '/../../../../extlibs/glib/glib-2.40.2/'
-       env.AppendUnique(CPPPATH = [
-                                       glib_dir,
-                                       glib_dir + 'glib',
-                                       glib_dir + 'gthread'])
 
 temp = env['CPPPATH']
 header = ' '
@@ -47,25 +38,23 @@ if ca_os == 'arduino':
        platform_src = [
                env.get('BUILD_DIR') + 'logger.c.o',
        ]
-else:
-       if ca_os in no_glib:
-               platform_src = [
-                                       ca_common_src_path + 'logger.c',
-                                       ca_common_src_path + 'oic_logger.c',
-                                       ca_common_src_path + 'oic_console_logger.c',
-                                       ca_common_src_path + 'uthreadpool.c',
-                                       ca_common_src_path + 'camutex_pthread.c'
-               ]
-       else:
-               platform_src = [
+elif env['POSIX_SUPPORTED']:
+       platform_src = [
                                        ca_common_src_path + 'logger.c',
                                        ca_common_src_path + 'oic_logger.c',
                                        ca_common_src_path + 'oic_console_logger.c',
-                                       ca_common_src_path + 'uthreadpool.c',
-                                       ca_common_src_path + 'camutex_glib.c'
+                                       ca_common_src_path + 'cathreadpool_pthreads.c',
+                                       ca_common_src_path + 'camutex_pthreads.c'
+       ]
+else:
+       platform_src = [
+               ca_common_src_path + 'logger.c',
+               ca_common_src_path + 'oic_logger.c',
+               ca_common_src_path + 'oic_console_logger.c'
                ]
 
 
+
 env.AppendUnique(CA_SRC = ca_common_src)
 env.AppendUnique(CA_SRC = platform_src)
 
index 4bedeb8..e138006 100644 (file)
@@ -38,7 +38,7 @@ typedef struct ca_mutex_internal *ca_mutex;
 typedef struct ca_cond_internal *ca_cond;
 
 /**
- * Enums for ca_cond_wait_until return values
+ * Enums for ca_cond_wait_for return values
  */
 typedef enum
 {
@@ -124,20 +124,20 @@ void ca_cond_wait(ca_cond cond, ca_mutex mutex);
 
 /**
  * Waits until this thread woken up on @cond,
- * but not longer than until the time specified by microseconds.
+ * but not longer than the interval specified by microseconds.
  * The mutex is unlocked before falling asleep and locked again before resuming.
- * If microseconds is 0 or under, ca_cond_wait_until() acts like ca_cond_wait().
+ * If microseconds is 0, ca_cond_wait_for() acts like ca_cond_wait().
  *
  * @param  cond  The condtion to be wait for to signal
  * @param  mutex  The mutex which is currently locked from calling thread
- * @param  microseconds  absolute time for waiting, microseconds
+ * @param  microseconds  relative time for waiting, microseconds
  *
  * @return CA_WAIT_SUCCESS if the condition was signaled.
  *         CA_WAIT_TIMEDDOUT if wait period exceeded
  *         CA_WAIT_INVAL for invalid parameters
  *
  */
-CAWaitResult_t ca_cond_wait_until(ca_cond cond, ca_mutex mutex, uint64_t microseconds);
+CAWaitResult_t ca_cond_wait_for(ca_cond cond, ca_mutex mutex, uint64_t microseconds);
 
 /**
  * Free the condition.
 /**
  * @file
  *
- * This file provides APIs related to thread pool.
+ * This file provides APIs related to thread pool.  Implementations are provided
+ * by adding a new .c file for each implementation, and adding them conditionally
+ * via the SCONS build script.  Currently, cathreadpool_pthreads.c is implemented,
+ * with cathreadpool_winthreads.c being considered.  RTOS implementations should use
+ * a name that best describes the used technology, not the OS.
  */
 
-#ifndef __UTHREAD_POOL_H_
-#define __UTHREAD_POOL_H_
-
-#include <glib.h>
+#ifndef CATHREAD_POOL_H_
+#define CATHREAD_POOL_H_
 
 #include "cacommon.h"
 
 #ifdef __cplusplus
 extern "C"
 {
-#endif /* __cplusplus */
+#endif // __cplusplus
 
 /**
- * @var u_thread_func
- * @brief Callback type can be registered to thread pool.
+ * Callback type can be registered to thread pool.
  */
-typedef void (*u_thread_func)(void *);
+typedef void (*ca_thread_func)(void *);
 
+struct ca_thread_pool_details_t;
 /**
- * @struct u_thread_msg_t
- * @brief Structure to maintain the data which needs to send to task function.
+ * Thread pool type.
  */
-typedef struct
+typedef struct ca_thread_pool
 {
-    void *data;
-    u_thread_func func;
-} u_thread_msg_t;
-
-/**
- * @var u_thread_pool_t
- * @brief Thread pool type.
- */
-typedef void *u_thread_pool_t;
+    struct ca_thread_pool_details_t* details;
+}*ca_thread_pool_t;
 
 /**
  * This function creates a newly allocated thread pool.
@@ -65,7 +59,7 @@ typedef void *u_thread_pool_t;
  * @param thread_pool_handle Handle to newly create thread pool.
  * @return Error code, CA_STATUS_OK if success, else error number.
  */
-CAResult_t u_thread_pool_init(uint32_t num_of_threads, u_thread_pool_t *thread_pool_handle);
+CAResult_t ca_thread_pool_init(int32_t num_of_threads, ca_thread_pool_t *thread_pool_handle);
 
 /**
  * This function adds a routine to be executed by the thread pool at some future time.
@@ -77,7 +71,7 @@ CAResult_t u_thread_pool_init(uint32_t num_of_threads, u_thread_pool_t *thread_p
  * @return CA_STATUS_OK on success.
  * @return Error on failure.
  */
-CAResult_t u_thread_pool_add_task(u_thread_pool_t thread_pool, u_thread_func method,
+CAResult_t ca_thread_pool_add_task(ca_thread_pool_t thread_pool, ca_thread_func method,
                     void *data);
 
 /**
@@ -86,11 +80,11 @@ CAResult_t u_thread_pool_add_task(u_thread_pool_t thread_pool, u_thread_func met
  *
  * @param thread_pool The thread pool structure.
  */
-void u_thread_pool_free(u_thread_pool_t thread_pool);
+void ca_thread_pool_free(ca_thread_pool_t thread_pool);
 
 #ifdef __cplusplus
 } /* extern "C" */
 #endif /* __cplusplus */
 
-#endif /* __UTHREAD_POOL_H_ */
+#endif /* CATHREAD_POOL_H_ */
 
diff --git a/resource/csdk/connectivity/common/src/camutex_glib.c b/resource/csdk/connectivity/common/src/camutex_glib.c
deleted file mode 100644 (file)
index cbbdaf1..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-/* ****************************************************************
- *
- * Copyright 2014 Samsung Electronics All Rights Reserved.
- *
- *
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************/
-
-/**
- * @file
- * This file provides APIs related to mutex and semaphores.
- */
-
-#include "camutex.h"
-#include <glib.h>
-#include <string.h>
-#include "logger.h"
-
-/**
- * @def TAG
- * @brief Logging tag for module name
- */
-#define TAG PCF("UMUTEX")
-
-ca_mutex ca_mutex_new(void)
-{
-    GMutex *mutexLock = g_new(GMutex, 1);
-    g_mutex_init(mutexLock);
-    return (ca_mutex) mutexLock;
-}
-
-void ca_mutex_lock(ca_mutex mutex)
-{
-    if (NULL == mutex)
-    {
-        OIC_LOG(ERROR, TAG , "ca_mutex_lock, Invalid mutex !");
-        return;
-    }
-
-    GMutex *mutexLock = (GMutex *) mutex;
-    g_mutex_lock(mutexLock);
-}
-
-bool ca_mutex_trylock(ca_mutex mutex)
-{
-    if (NULL == mutex)
-    {
-        OIC_LOG(ERROR, TAG, "ca_mutex_trylock, Invalid mutex !");
-        return false;
-    }
-
-    GMutex *mutexLock = (GMutex *) mutex;
-
-    return(g_mutex_trylock(mutexLock));
-}
-
-void ca_mutex_unlock(ca_mutex mutex)
-{
-    if (NULL == mutex)
-    {
-        OIC_LOG(ERROR, TAG, "ca_mutex_unlock, Invalid mutex !");
-        return;
-    }
-
-    GMutex *mutexLock = (GMutex *) mutex;
-    g_mutex_unlock(mutexLock);
-}
-
-bool ca_mutex_free(ca_mutex mutex)
-{
-    if (NULL == mutex)
-    {
-        OIC_LOG(ERROR, TAG, "ca_mutex_free, Invalid mutex !");
-        return false;
-    }
-
-    GMutex *mutexLock = (GMutex *) mutex;
-    g_mutex_clear(mutexLock);
-    g_free(mutexLock);
-    return true;
-}
-
-ca_cond ca_cond_new(void)
-{
-    GCond *condition = g_new(GCond, 1);
-    g_cond_init(condition);
-    return (ca_cond) condition;
-}
-
-void ca_cond_signal(ca_cond cond)
-{
-    if (NULL == cond)
-    {
-        OIC_LOG(ERROR, TAG, "ca_cond_signal, Invalid condition !");
-        return;
-    }
-
-    GCond *condition = (GCond *) cond;
-    g_cond_signal(condition);
-}
-
-void ca_cond_broadcast(ca_cond cond)
-{
-    if (NULL == cond)
-    {
-        OIC_LOG(ERROR, TAG, "ca_cond_broadcast, Invalid condition !");
-        return;
-    }
-
-    GCond *condition = (GCond *) cond;
-    g_cond_broadcast(condition);
-}
-
-void ca_cond_wait(ca_cond cond, ca_mutex mutex)
-{
-    if (NULL == mutex)
-    {
-        OIC_LOG(ERROR, TAG, "ca_cond_wait, Invalid mutex !");
-        return;
-    }
-
-    if (NULL == cond)
-    {
-        OIC_LOG(ERROR, TAG, "ca_cond_wait, Invalid condition !");
-        return;
-    }
-
-    GMutex *mutexLock = (GMutex *) mutex;
-    GCond *condition = (GCond *) cond;
-    g_cond_wait(condition, mutexLock);
-}
-
-CAWaitResult_t ca_cond_wait_until(ca_cond cond, ca_mutex mutex, uint64_t microseconds)
-{
-    if (NULL == mutex)
-    {
-        OIC_LOG(ERROR, TAG, "ca_cond_wait, Invalid mutex !");
-        return CA_WAIT_INVAL;
-    }
-
-    if (NULL == cond)
-    {
-        OIC_LOG(ERROR, TAG, "ca_cond_wait, Invalid condition !");
-        return CA_WAIT_INVAL;
-    }
-
-    GMutex *mutexLock = (GMutex *) mutex;
-    GCond *condition = (GCond *) cond;
-
-    if (microseconds == 0)
-    {
-        g_cond_wait(condition, mutexLock);
-        return CA_WAIT_SUCCESS;
-    }
-
-    gboolean bRet = g_cond_wait_until(condition, mutexLock, microseconds);
-    return bRet ? CA_WAIT_SUCCESS : CA_WAIT_TIMEDOUT;
-}
-
-void ca_cond_free(ca_cond cond)
-{
-    if (NULL == cond)
-    {
-        OIC_LOG(ERROR, TAG, "ca_cond_free, Invalid condition !");
-        return;
-    }
-
-    GCond *condition = (GCond *) cond;
-    g_cond_clear(condition);
-    g_free(condition);
-}
-
-
  * This file provides APIs related to mutex and semaphores.
  */
 
+// Defining _POSIX_C_SOURCE macro with 199309L (or greater) as value
+// causes header files to expose definitions
+// corresponding to the POSIX.1b, Real-time extensions
+// (IEEE Std 1003.1b-1993) specification
+//
+// For this specific file, see use of clock_gettime and PTHREAD_MUTEX_DEFAULT
+#ifndef _POSIX_C_SOURCE
+#define _POSIX_C_SOURCE 200809L
+#endif
+
 #include <string.h>
 #include <pthread.h>
 #include <errno.h>
@@ -44,8 +54,9 @@
  */
 #define TAG PCF("UMUTEX")
 
-static const uint64_t USECS_PER_SEC = 1000000;
-static const uint64_t NANOSECS_PER_USECS = 1000;
+static const uint64_t USECS_PER_SEC         = 1000000;
+static const uint64_t NANOSECS_PER_USECS    = 1000;
+static const uint64_t NANOSECS_PER_SEC      = 1000000000L;
 
 typedef struct _tagMutexInfo_t
 {
@@ -55,6 +66,7 @@ typedef struct _tagMutexInfo_t
 typedef struct _tagEventInfo_t
 {
     pthread_cond_t cond;
+    pthread_condattr_t condattr;
 } ca_cond_internal;
 
 ca_mutex ca_mutex_new(void)
@@ -112,6 +124,7 @@ void ca_mutex_lock(ca_mutex mutex)
     {
         int ret = pthread_mutex_lock(&mutexInfo->mutex);
         assert(0 == ret);
+        (void)ret;
     }
     else
     {
@@ -157,7 +170,8 @@ void ca_mutex_unlock(ca_mutex mutex)
     if (mutexInfo)
     {
         int ret = pthread_mutex_unlock(&mutexInfo->mutex);
-        assert(ret == 0);
+        assert ( 0 == ret);
+        (void)ret;
     }
     else
     {
@@ -172,7 +186,25 @@ ca_cond ca_cond_new(void)
     ca_cond_internal *eventInfo = (ca_cond_internal*) OICMalloc(sizeof(ca_cond_internal));
     if (NULL != eventInfo)
     {
-        int ret = pthread_cond_init(&(eventInfo->cond), NULL);
+        int ret = pthread_condattr_init(&(eventInfo->condattr));
+        if(0 != ret)
+        {
+            OIC_LOG_V(ERROR, TAG, "%s: Failed to initialize condition variable attribute %d!",
+                    __func__, ret);
+            return retVal;
+        }
+
+#if defined(__ANDROID__) || _POSIX_TIMERS > 0
+        ret = pthread_condattr_setclock(&(eventInfo->condattr), CLOCK_MONOTONIC);
+
+        if(0 != ret)
+        {
+            OIC_LOG_V(ERROR, TAG, "%s: Failed to set condition variable clock %d!",
+                    __func__, ret);
+            return retVal;
+        }
+#endif
+        ret = pthread_cond_init(&(eventInfo->cond), &(eventInfo->condattr));
         if (0 == ret)
         {
             retVal = (ca_cond) eventInfo;
@@ -193,13 +225,15 @@ void ca_cond_free(ca_cond cond)
     if (eventInfo != NULL)
     {
         int ret = pthread_cond_destroy(&(eventInfo->cond));
-        if (0 == ret)
+        int ret2 = pthread_condattr_destroy(&(eventInfo->condattr));
+        if (0 == ret && 0 == ret2)
         {
             OICFree(cond);
         }
         else
         {
-            OIC_LOG_V(ERROR, TAG, "%s: Failed to destroy condition variable %d", __func__, ret);
+            OIC_LOG_V(ERROR, TAG, "%s: Failed to destroy condition variable %d, %d",
+                    __func__, ret, ret2);
         }
     }
     else
@@ -244,10 +278,36 @@ void ca_cond_broadcast(ca_cond cond)
 
 void ca_cond_wait(ca_cond cond, ca_mutex mutex)
 {
-    ca_cond_wait_until(cond, mutex, 0L);
+    ca_cond_wait_for(cond, mutex, 0L);
+}
+
+struct timespec ca_get_current_time()
+{
+#if defined(__ANDROID__) || _POSIX_TIMERS > 0
+    struct timespec ts;
+    clock_gettime(CLOCK_MONOTONIC, &ts);
+    return ts;
+#else
+    struct timeval tv;
+    gettimeofday(&tv, NULL);
+    struct timespec ts;
+    TIMEVAL_TO_TIMESPEC(&tv, &ts);
+    return ts;
+#endif
+}
+
+void ca_add_microseconds_to_timespec(struct timespec* ts, uint64_t microseconds)
+{
+    time_t secPart = microseconds/USECS_PER_SEC;
+    uint64_t nsecPart = (microseconds % USECS_PER_SEC) * NANOSECS_PER_USECS;
+    uint64_t totalNs = ts->tv_nsec + nsecPart;
+    time_t secOfNs = totalNs/NANOSECS_PER_SEC;
+
+    ts->tv_nsec = (totalNs)% NANOSECS_PER_SEC;
+    ts->tv_sec += secPart + secOfNs;
 }
 
-CAWaitResult_t ca_cond_wait_until(ca_cond cond, ca_mutex mutex, uint64_t microseconds)
+CAWaitResult_t ca_cond_wait_for(ca_cond cond, ca_mutex mutex, uint64_t microseconds)
 {
     CAWaitResult_t retVal = CA_WAIT_INVAL;
 
@@ -268,9 +328,8 @@ CAWaitResult_t ca_cond_wait_until(ca_cond cond, ca_mutex mutex, uint64_t microse
 
     if (microseconds > 0)
     {
-        struct timespec abstime;
-        abstime.tv_sec = (microseconds / USECS_PER_SEC);
-        abstime.tv_nsec = ((microseconds % USECS_PER_SEC) * NANOSECS_PER_USECS);
+        struct timespec abstime = ca_get_current_time();
+        ca_add_microseconds_to_timespec(&abstime, microseconds);
 
         //Wait for the given time
         int ret = pthread_cond_timedwait(&(eventInfo->cond), &(mutexInfo->mutex), &abstime);
diff --git a/resource/csdk/connectivity/common/src/cathreadpool_pthreads.c b/resource/csdk/connectivity/common/src/cathreadpool_pthreads.c
new file mode 100644 (file)
index 0000000..2bdafab
--- /dev/null
@@ -0,0 +1,146 @@
+/* ****************************************************************
+ *
+ * Copyright 2014 Samsung Electronics All Rights Reserved.
+ *
+ *
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************/
+
+/**
+ * @file
+ *
+ * This file provides APIs related to thread pool.
+ */
+
+#include <pthread.h>
+#include "cathreadpool.h"
+#include "logger.h"
+#include "oic_malloc.h"
+
+#define TAG PCF("UTHREADPOOL")
+
+/**
+ * empty struct to represent the details.  This implementation has no data
+ * that it needs to keep track of, so it only uses NULL for the internal value.
+ */
+typedef struct ca_thread_pool_details_t
+{
+} ca_thread_pool_details_t;
+
+/**
+ * struct to wrap the pthreads callback properly.  The function pointer for
+ * pthreads requires a void* return value, however u_thread_func is a void.
+ */
+typedef struct ca_thread_pool_callback_info_t
+{
+    ca_thread_func func;
+    void* data;
+} ca_thread_pool_callback_info_t;
+
+// passthrough function to convert the pthreads call to a u_thread_func call
+void* ca_thread_pool_pthreads_delegate(void* data)
+{
+    ca_thread_pool_callback_info_t* info = (ca_thread_pool_callback_info_t*)data;
+    info->func(info->data);
+    OICFree(info);
+    return NULL;
+}
+
+// this implementation doesn't do a thread pool, so this function is essentially
+// a no-op besides creating a valid ca_thread_pool_t object.  It was determined after
+// reading through the existing implementation that the thread-pooling was unnecessary
+// for the posix platforms.  Behavior shouldn't be changed since previously num_of_threads
+// was greater than the number of requested threads.
+CAResult_t ca_thread_pool_init(int32_t num_of_threads, ca_thread_pool_t *thread_pool)
+{
+    OIC_LOG(DEBUG, TAG, "IN");
+
+    if(!thread_pool)
+    {
+        OIC_LOG(ERROR, TAG, "Parameter thraed_pool was null!");
+        return CA_STATUS_INVALID_PARAM;
+    }
+
+    if(num_of_threads <= 0)
+    {
+        OIC_LOG(ERROR, TAG, "num_of_threads must be positive and non-zero");
+        return CA_STATUS_INVALID_PARAM;
+    }
+
+    *thread_pool = OICMalloc(sizeof(struct ca_thread_pool));
+
+    if(!*thread_pool)
+    {
+        OIC_LOG(ERROR, TAG, "Failed to allocate for thread-pool");
+        return CA_MEMORY_ALLOC_FAILED;
+    }
+
+    OIC_LOG(DEBUG, TAG, "OUT");
+    return CA_STATUS_OK;
+}
+
+CAResult_t ca_thread_pool_add_task(ca_thread_pool_t thread_pool, ca_thread_func method,
+                                    void *data)
+{
+    OIC_LOG(DEBUG, TAG, "IN");
+
+    if(NULL == thread_pool || NULL == method)
+    {
+        OIC_LOG(ERROR, TAG, "thread_pool or method was NULL");
+        return CA_STATUS_INVALID_PARAM;
+    }
+
+    ca_thread_pool_callback_info_t* info = OICMalloc(sizeof(ca_thread_pool_callback_info_t));
+    if(!info)
+    {
+        OIC_LOG(ERROR, TAG, "Failed to allocate for memory wrapper");
+        return CA_MEMORY_ALLOC_FAILED;
+    }
+
+    info->func = method;
+    info->data = data;
+
+    pthread_t threadHandle;
+
+    int result = pthread_create(&threadHandle, NULL, ca_thread_pool_pthreads_delegate, info);
+
+    if(result != 0)
+    {
+        OIC_LOG_V(ERROR, TAG, "Thread start failed with error %d", result);
+        return CA_STATUS_FAILED;
+    }
+
+    // detach will cause the thread to either terminate normally and clean up after
+    // itself, which prevents us from having to do any manual join/cleanup later, or
+    // it will be terminated upon application exit.
+    result = pthread_detach(threadHandle);
+
+    if(result != 0)
+    {
+        OIC_LOG_V(ERROR, TAG, "Thread detach failed with error %d", result);
+        return CA_STATUS_FAILED;
+    }
+
+    OIC_LOG(DEBUG, TAG, "OUT");
+    return CA_STATUS_OK;
+}
+
+void ca_thread_pool_free(ca_thread_pool_t thread_pool)
+{
+    OIC_LOG(DEBUG, TAG, "IN");
+
+    OICFree(thread_pool);
+    OIC_LOG(DEBUG, TAG, "OUT");
+}
diff --git a/resource/csdk/connectivity/common/src/uthreadpool.c b/resource/csdk/connectivity/common/src/uthreadpool.c
deleted file mode 100644 (file)
index ea1752d..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/* ****************************************************************
- *
- * Copyright 2014 Samsung Electronics All Rights Reserved.
- *
- *
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************/
-
-/**
- * @file
- *
- * This file provides APIs related to thread pool.
- */
-
-#include "uthreadpool.h"
-#include "logger.h"
-#include "oic_malloc.h"
-
-#define TAG PCF("UTHREADPOOL")
-
-/**
- * @fn run
- * @brief function which is registed to glib thread pool.
- */
-static void run(void *thread_data, void *user_data);
-
-CAResult_t u_thread_pool_init(uint32_t num_of_threads, u_thread_pool_t *thread_pool)
-{
-    OIC_LOG(DEBUG, TAG, "IN");
-
-    GError *error = NULL;
-
-    GThreadPool *threadPool = g_thread_pool_new(run, NULL, num_of_threads, TRUE, &error);
-
-    if (NULL == threadPool)
-    {
-        OIC_LOG(ERROR, TAG, "g_thread_pool_new failed!");
-        if (NULL != error)
-        {
-            OIC_LOG_V(ERROR, TAG, "Error is: %s", error->message);
-            g_error_free(error);
-        }
-        return CA_STATUS_FAILED;
-    }
-
-    *thread_pool = (u_thread_pool_t) threadPool;
-
-    OIC_LOG(DEBUG, TAG, "OUT");
-    return CA_STATUS_OK;
-}
-
-CAResult_t u_thread_pool_add_task(u_thread_pool_t thread_pool, u_thread_func method,
-                                    void *data)
-{
-    OIC_LOG(DEBUG, TAG, "IN");
-
-    if (NULL == method)
-    {
-        OIC_LOG(ERROR, TAG, "routine is NULL!");
-        return CA_STATUS_FAILED;
-    }
-
-    u_thread_msg_t *message = (u_thread_msg_t *) OICMalloc(sizeof(u_thread_msg_t));
-    if (NULL == message)
-    {
-        OIC_LOG(ERROR, TAG, "Memory allocation failed!");
-        return CA_MEMORY_ALLOC_FAILED;
-    }
-
-    message->data = data;
-    message->func = method;
-
-    g_thread_pool_push((GThreadPool *) thread_pool, (void *) message, NULL);
-
-    OIC_LOG(DEBUG, TAG, "OUT");
-    return CA_STATUS_OK;
-}
-
-void u_thread_pool_free(u_thread_pool_t thread_pool)
-{
-    OIC_LOG(DEBUG, TAG, "IN");
-    if (NULL == thread_pool)
-    {
-        OIC_LOG(DEBUG, TAG, "thread_pool is NULL. Its already freed.");
-        return;
-    }
-
-    GThreadPool *threadpool = (GThreadPool *) thread_pool;
-    g_thread_pool_free(threadpool, TRUE, TRUE);
-
-    OIC_LOG(DEBUG, TAG, "OUT");
-}
-
-void run(void *thread_data, void *user_data)
-{
-    u_thread_msg_t *message = (u_thread_msg_t *) thread_data;
-
-    if (NULL == message)
-    {
-        OIC_LOG(ERROR, TAG, "Invalid task data");
-        return;
-    }
-
-    if(message->func)
-    {
-        OIC_LOG(DEBUG, TAG, "Calling routine with data as parameter");
-        message->func(message->data);
-    }
-
-    // Free message
-    OICFree(message);
-}
-
index 5a3b28d..b6bbc90 100644 (file)
@@ -32,7 +32,7 @@
  **/
 #include "cacommon.h"
 #include "caadapterinterface.h"
-#include "uthreadpool.h" /* for thread pool */
+#include "cathreadpool.h" /* for thread pool */
 
 #ifdef __cplusplus
 extern "C"
@@ -58,7 +58,7 @@ extern "C"
 CAResult_t CAInitializeEDR(CARegisterConnectivityCallback registerCallback,
                            CANetworkPacketReceivedCallback reqRespCallback,
                            CANetworkChangeCallback netCallback,
-                           u_thread_pool_t handle);
+                           ca_thread_pool_t handle);
 
 /**
  * @brief  Starts EDR connectivity adapters. As its peer to peer it doesnot require to start
index c44e8c8..926abf5 100644 (file)
@@ -30,7 +30,7 @@
 #include <stdbool.h>
 
 #include "cacommon.h"
-#include "uthreadpool.h"
+#include "cathreadpool.h"
 #include "jni.h"
 
 
@@ -58,7 +58,7 @@ void CAEDRCreateJNIInterfaceObject(jobject context);
  * @param   handle           [IN] thread pool handle object
  * @return  None
  */
-void CAEDRInitialize(u_thread_pool_t handle);
+void CAEDRInitialize(ca_thread_pool_t handle);
 
 /**
  * @brief   Terminate server for EDR
index 05ae1d9..64e74ee 100644 (file)
@@ -154,7 +154,7 @@ void CAEDRClientUnsetCallbacks(void);
  * @brief Used to initialize the EDR client module where mutex is initialized
  * @return NONE
  */
-void CAEDRInitializeClient(u_thread_pool_t handle);
+void CAEDRInitializeClient(ca_thread_pool_t handle);
 
 /**
  * @brief Destroys the Device list and mutex.
@@ -214,7 +214,7 @@ CAResult_t CAEDRGetInterfaceInformation(CALocalConnectivity_t **info);
  * @retval #CA_STATUS_FAILED Operation failed
  *
  */
-CAResult_t CAEDRServerStart(const char *serviceUUID, int *serverFD, u_thread_pool_t handle);
+CAResult_t CAEDRServerStart(const char *serviceUUID, int *serverFD, ca_thread_pool_t handle);
 
 /**
  * @brief  Stop RFCOMM server
index 71d5c56..b2e6b4f 100644 (file)
@@ -30,7 +30,7 @@
 #include <stdbool.h>
 
 #include "cacommon.h"
-#include "uthreadpool.h"
+#include "cathreadpool.h"
 #include "jni.h"
 
 
@@ -55,7 +55,7 @@ void CAEDRServerJniInit(JNIEnv *env, JavaVM *jvm);
  * @param   handle           [IN] thread pool handle object
  * @return  None
  */
-void CAEDRServerInitialize(u_thread_pool_t handle);
+void CAEDRServerInitialize(ca_thread_pool_t handle);
 
 /**
  * @brief   Start unicast server
index 010f1e6..57e6e99 100644 (file)
@@ -28,7 +28,7 @@
 #define __CA_EDRUTILES_H_
 
 #include "cacommon.h"
-#include "uthreadpool.h"
+#include "cathreadpool.h"
 #include "uarraylist.h"
 #include "jni.h"
 
index 9f77a00..482c699 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "cacommon.h"
 #include "caadapterinterface.h"
-#include "uthreadpool.h"
+#include "cathreadpool.h"
 
 #ifdef __cplusplus
 extern "C"
@@ -49,7 +49,7 @@ extern "C"
  */
 CAResult_t CAInitializeEthernet(CARegisterConnectivityCallback registerCallback,
                                 CANetworkPacketReceivedCallback networkPacketCallback,
-                                CANetworkChangeCallback netCallback, u_thread_pool_t handle);
+                                CANetworkChangeCallback netCallback, ca_thread_pool_t handle);
 
 /**
  * @brief Start Ethernet Interface adapter.
index abd301d..25fc68e 100644 (file)
@@ -30,7 +30,7 @@
 #include <stdbool.h>
 
 #include "cacommon.h"
-#include "uthreadpool.h" /* for thread pool */
+#include "cathreadpool.h" /* for thread pool */
 
 #ifdef __cplusplus
 extern "C"
@@ -78,7 +78,7 @@ typedef void (*CAEthernetExceptionCallback)(CAAdapterServerType_t type);
  * @retval  #CA_STATUS_INVALID_PARAM Invalid input data
  * @retval  #CA_STATUS_FAILED Initialization failed
  */
-CAResult_t CAEthernetInitializeServer(const u_thread_pool_t threadPool);
+CAResult_t CAEthernetInitializeServer(const ca_thread_pool_t threadPool);
 
 /**
  * @brief  Terminate Ethernet server
@@ -250,7 +250,7 @@ typedef void (*CAEthernetConnectionStateChangeCallback)(const char *ipAddress,
  * @retval  #CA_STATUS_INVALID_PARAM Invalid input data
  * @retval  #CA_STATUS_FAILED Initialization failed
  */
-CAResult_t CAEthernetInitializeNetworkMonitor(const u_thread_pool_t threadPool);
+CAResult_t CAEthernetInitializeNetworkMonitor(const ca_thread_pool_t threadPool);
 
 /**
  * @brief Terminate Ethernet network monitor
index 7bf227c..79fbf27 100644 (file)
@@ -28,7 +28,7 @@
 #define __CA_INTERFACE_CONTROLLER_H_
 
 #include "caadapterinterface.h"
-#include "uthreadpool.h" /* for thread pool */
+#include "cathreadpool.h" /* for thread pool */
 
 #ifdef __cplusplus
 extern "C"
@@ -40,7 +40,7 @@ extern "C"
  * @param   handle         [IN]    thread pool handle created by message handler for different adapters.
  * @return  none
  */
-void CAInitializeAdapters(u_thread_pool_t handle);
+void CAInitializeAdapters(ca_thread_pool_t handle);
 
 /**
  * @brief   Set the received packets callback for message handler
index 2cfe27a..29994e2 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "cacommon.h"
 #include "caadapterinterface.h"
-#include "uthreadpool.h" /* for thread pool */
+#include "cathreadpool.h" /* for thread pool */
 
 /**
  * BLE Interface APIs.
@@ -66,7 +66,7 @@ typedef struct
 CAResult_t CAInitializeLE(CARegisterConnectivityCallback registerCallback,
                           CANetworkPacketReceivedCallback reqRespCallback,
                           CANetworkChangeCallback netCallback,
-                          u_thread_pool_t handle);
+                          ca_thread_pool_t handle);
 
 /**
  * @brief Starting LE connectivity adapters.
index 07f1bf3..f3c2cdf 100644 (file)
@@ -28,7 +28,7 @@
 #define __CA_LECORE_H_
 
 #include "cacommon.h"
-#include "uthreadpool.h"
+#include "cathreadpool.h"
 #include "jni.h"
 
 #ifdef __cplusplus
@@ -64,7 +64,7 @@ void CALeCreateJniInterfaceObject();
  * @param   handle           [IN] thread pool handle object
  * @return  None
  */
-void CALEInitialize(u_thread_pool_t handle);
+void CALEInitialize(ca_thread_pool_t handle);
 
 /**
  * @brief   terminate client for BLE
index d7cc5e7..a882bcc 100644 (file)
@@ -249,7 +249,7 @@ void CASetBLEReqRespClientCallback(CABLEClientDataReceivedCallback callback);
  * @retval #CA_STATUS_INVALID_PARAM  Invalid input argumets
  * @retval #CA_STATUS_FAILED Operation failed
  */
-void CASetBleServerThreadPoolHandle(u_thread_pool_t handle);
+void CASetBleServerThreadPoolHandle(ca_thread_pool_t handle);
 
 /**
 * @brief  Used to Set the gThreadPool handle which is required for spawning new thread.
@@ -257,7 +257,7 @@ void CASetBleServerThreadPoolHandle(u_thread_pool_t handle);
 *                    task.
 * @return NONE
 */
-void CASetBleClientThreadPoolHandle(u_thread_pool_t handle);
+void CASetBleClientThreadPoolHandle(ca_thread_pool_t handle);
 
 /**
  * @brief  Used to unset the callback of adapter connection state change.
index b971b08..09cddc2 100644 (file)
@@ -28,7 +28,7 @@
 #define __CA_LENWMONITOR_H_
 
 #include "cacommon.h"
-#include "uthreadpool.h"
+#include "cathreadpool.h"
 #include "uarraylist.h"
 #include "jni.h"
 
index f411652..3d4885b 100644 (file)
@@ -28,7 +28,7 @@
 #define __CA_LESERVER_H_
 
 #include "cacommon.h"
-#include "uthreadpool.h"
+#include "cathreadpool.h"
 #include "uarraylist.h"
 #include "jni.h"
 
@@ -52,7 +52,7 @@ typedef void (*CAPacketReceiveCallback)(const char *address,
  * @param   handle           [IN] thread pool handle object
  * @return  None
  */
-void CALEServerInitialize(u_thread_pool_t handle);
+void CALEServerInitialize(ca_thread_pool_t handle);
 
 /**
  * @brief   terminate client for BLE
index 7ae44bb..dc9a92f 100644 (file)
@@ -28,7 +28,7 @@
 #define __CA_LEUTILES_H_
 
 #include "cacommon.h"
-#include "uthreadpool.h"
+#include "cathreadpool.h"
 #include "uarraylist.h"
 #include "jni.h"
 
index 3f3c16e..deb7296 100644 (file)
@@ -29,7 +29,7 @@
 
 #include <stdint.h>
 
-#include "uthreadpool.h"
+#include "cathreadpool.h"
 #include "camutex.h"
 #include "uqueue.h"
 #include "cacommon.h"
@@ -47,7 +47,7 @@ typedef void (*CADataDestroyFunction)(void *data, uint32_t size);
 typedef struct
 {
     /** Thread pool of the thread started **/
-    u_thread_pool_t threadPool;
+    ca_thread_pool_t threadPool;
     /** mutex for synchrnoization **/
     ca_mutex threadMutex;
     /** conditional mutex for synchrnoization **/
@@ -70,7 +70,7 @@ typedef struct
  * @param   destroy     [IN] function to data destroy
  * @return  CA_STATUS_OK or ERROR CODES ( CAResult_t error codes in cacommon.h)
  */
-CAResult_t CAQueueingThreadInitialize(CAQueueingThread_t *thread, u_thread_pool_t handle,
+CAResult_t CAQueueingThreadInitialize(CAQueueingThread_t *thread, ca_thread_pool_t handle,
                                       CAThreadTask task, CADataDestroyFunction destroy);
 
 /**
index 6265ad1..aef0f65 100644 (file)
@@ -28,7 +28,7 @@
 
 #include <stdint.h>
 
-#include "uthreadpool.h"
+#include "cathreadpool.h"
 #include "camutex.h"
 #include "uarraylist.h"
 #include "cacommon.h"
@@ -66,7 +66,7 @@ typedef struct
 typedef struct
 {
     /** Thread pool of the thread started **/
-    u_thread_pool_t threadPool;
+    ca_thread_pool_t threadPool;
 
     /** mutex for synchronization **/
     ca_mutex threadMutex;
@@ -106,7 +106,7 @@ extern "C"
  *                                           if NULL is coming, it will set default values.
  * @return  CA_STATUS_OK or ERROR CODES (CAResult_t error codes in cacommon.h)
  */
-CAResult_t CARetransmissionInitialize(CARetransmission_t *context, u_thread_pool_t handle,
+CAResult_t CARetransmissionInitialize(CARetransmission_t *context, ca_thread_pool_t handle,
                                       CADataSendMethod_t retransmissionSendMethod,
                                       CATimeoutCallback_t timeoutCallback,
                                       CARetransmissionConfig_t* config);
index 4d45123..8365323 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "cacommon.h"
 #include "caadapterinterface.h"
-#include "uthreadpool.h" /* for thread pool */
+#include "cathreadpool.h" /* for thread pool */
 
 #ifdef __cplusplus
 extern "C"
@@ -49,7 +49,7 @@ extern "C"
  */
 CAResult_t CAInitializeWIFI(CARegisterConnectivityCallback registerCallback,
                             CANetworkPacketReceivedCallback networkPacketCallback,
-                            CANetworkChangeCallback netCallback, u_thread_pool_t handle);
+                            CANetworkChangeCallback netCallback, ca_thread_pool_t handle);
 
 /**
  * @brief Start WIFI Interface adapter.
index 6d4a1bc..28bc84a 100644 (file)
@@ -31,7 +31,7 @@
 #include <stdbool.h>
 
 #include "cacommon.h"
-#include "uthreadpool.h"
+#include "cathreadpool.h"
 
 #ifdef __cplusplus
 extern "C"
@@ -78,7 +78,7 @@ typedef void (*CAWiFiExceptionCallback)(CAAdapterServerType_t type);
  * @retval  #CA_STATUS_INVALID_PARAM Invalid input data
  * @retval  #CA_STATUS_FAILED Initialization failed
  */
-CAResult_t CAWiFiInitializeServer(const u_thread_pool_t threadPool);
+CAResult_t CAWiFiInitializeServer(const ca_thread_pool_t threadPool);
 
 
 /**
@@ -247,7 +247,7 @@ typedef void (*CAWiFiConnectionStateChangeCallback)(const char *ipAddress,
  * @retval  #CA_STATUS_INVALID_PARAM Invalid input data
  * @retval  #CA_STATUS_FAILED Initialization failed
  */
-CAResult_t CAWiFiInitializeNetworkMonitor(const u_thread_pool_t threadPool);
+CAResult_t CAWiFiInitializeNetworkMonitor(const ca_thread_pool_t threadPool);
 
 /**
  * @brief Terminate WIFI network monitor
diff --git a/resource/csdk/connectivity/lib/android/glib_build.sh b/resource/csdk/connectivity/lib/android/glib_build.sh
deleted file mode 100644 (file)
index 89ad3ce..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#/******************************************************************
-#*
-#* Copyright 2015 Samsung Electronics All Rights Reserved.
-#*
-#*
-#*
-#* Licensed under the Apache License, Version 2.0 (the "License");
-#* you may not use this file except in compliance with the License.
-#* You may obtain a copy of the License at
-#*
-#*      http://www.apache.org/licenses/LICENSE-2.0
-#*
-#* Unless required by applicable law or agreed to in writing, software
-#* distributed under the License is distributed on an "AS IS" BASIS,
-#* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#* See the License for the specific language governing permissions and
-#* limitations under the License.
-#*
-#******************************************************************/
-rm -f *.so
-
-set NDK_PATH="~/ndk"
-$NDK_PATH/ndk-build clean
-$NDK_PATH/ndk-build
-
-#change the folder path as per TARGET_ARCH
-cp libs/armeabi/*.* .
-
diff --git a/resource/csdk/connectivity/lib/android/glibpatch_Readme.txt b/resource/csdk/connectivity/lib/android/glibpatch_Readme.txt
deleted file mode 100644 (file)
index 21e1b91..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/******************************************************************
-*
-* Copyright 2014 Samsung Electronics All Rights Reserved.
-*
-*
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*      http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-******************************************************************/
-
-Pre-requisites :
-Install libffi6 and libffi-dev packages
-#sudo apt-get install libffi6 libffi-dev
-
-
-Download Gnome Glib 2.40.2 from http://ftp.gnome.org/pub/GNOME/sources/glib/2.40/
-1.Download glib-2.40.2.tar.xz
-
-2.untar the Downloaded file
-#tar -xJf glib-2.40.2.tar.xz
-
-3.change to glib-2.40.2 directory
-#cd glib-2.40.2
-
-4.
-#./configure
-
-5.If configure is successful, your base folder is ready to apply the patch :
-#cd ..
-#patch -p1 < resource/csdk/connectivity/lib/android/patches/glib-2.40.2.patch
-
-There are two kinds of patches :
-       - with Android.mk files, automatically added in the respective folders
-       - without Android.mk files (If you want to use your own Android.mk files)
-
-       glib-2.40.2.patch
-       glib-2.40.2-wihtoutMakefile.patch
-
-       glib-2.40.2-x64.patch
-       glib-2.40.2-x64-wihtoutMakefile.patch
-
-If you are using 64-bit linux build, please apply the patch named with "x64"
-
-6.To build glib libraries for Android, Andoroid.mk and Application.mk are placed at
-resource/csdk/connectivity/lib/android/jni
-#cd resource/csdk/connectivity/lib/android
-
-7.Edit the resource/csdk/connectivity/lib/android/jni/Android.mk
-#vi jni/Android.mk
-
-8.Copy your glib-2.40.2 directory to extlibs/glib.
-Edit the GLIB_SRC_PATH and add the path to glib source directory
-GLIB_SRC_PATH ?= ../../../../../extlibs/glib/glib-2.40.2
-
-9a-1.run the ndk-build
-#$(NDK_PATH)/ndk-build
-
-9a-2.copy libglib-2.40.2.so and libgthread-2.40.2.so from libs/armeabi folder to
-resource/csdk/connectivity/lib/android directory
-Change the folder path as per the TARGET_ARCH
-#cp libs/armeabi/*.* ./
-
-or
-
-9b-1.
-#chmod 777 ./glib_build.sh
-
-9b-2. Edit the NDK_PATH and set the ndk folder path
-#vi glib_build.sh
-NDK_PATH = ~/ndk
-
-9b-3 Edit the folder path as per TARGET_ARCH
-#cp libs/armeabi/*.* .
-
-9b-4.
-#./glib_build.sh
-
-10.This will build the glib libraries and copy to the current folder
-
-11. To build with NDK Edit the resource/csdk/connectivity/build/Android.mk file.
-set the GLIB_PATH to your glib-2.40.2 folder path.
-
-GLIB_PATH                              = $(PROJECT_LIB_PATH)/android/glib-2.40.2
-
index a8f7bf9..ee3d6a1 100644 (file)
@@ -20,9 +20,6 @@
 #define build type
 BUILD = debug
 
-#you can set the path to ../../../../../extlibs/glib
-GLIB_SRC_PATH  ?= $(YOUR_GLIB_PATH)/glib-2.40.2
-
 DEFINE_FLAG = -D__ANDROID__
 
 
@@ -31,6 +28,4 @@ BUILD_FLAG = $(BUILD_FLAG.$(BUILD))
 
 LOCAL_PATH = ../
 
-#Build glib
 include $(CLEAR_VARS)
-include $(GLIB_SRC_PATH)/Android.mk
diff --git a/resource/csdk/connectivity/lib/android/patches/glib-2.40.2-withoutMakefile.patch b/resource/csdk/connectivity/lib/android/patches/glib-2.40.2-withoutMakefile.patch
deleted file mode 100644 (file)
index 9f9db8c..0000000
+++ /dev/null
@@ -1,289 +0,0 @@
-diff -rupN glibref/glib-2.40.2/config.h glibpatch/glib-2.40.2/config.h
---- glibref/glib-2.40.2/config.h       2015-03-31 16:25:56.882894898 +0900
-+++ glibpatch/glib-2.40.2/config.h     2015-04-01 13:21:19.593558693 +0900
-@@ -31,8 +31,9 @@
- /* #undef ENABLE_GC_FRIENDLY_DEFAULT */
- /* always defined to indicate that i18n is enabled */
-+#ifndef _GLIB_ANDROID_
- #define ENABLE_NLS 1
--
-+#endif /* _GLIB_ANDROID__ */
- /* Define the gettext package to be used */
- #define GETTEXT_PACKAGE "glib20"
-@@ -100,8 +101,9 @@
- /* #undef HAVE_COCOA */
- /* Have nl_langinfo (CODESET) */
-+#ifndef _GLIB_ANDROID_
- #define HAVE_CODESET 1
--
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the <crt_externs.h> header file. */
- /* #undef HAVE_CRT_EXTERNS_H */
-@@ -130,8 +132,10 @@
- /* we have the eventfd(2) system call */
- #define HAVE_EVENTFD 1
-+#ifndef _GLIB_ANDROID_
- /* Define to 1 if you have the `fallocate' function. */
- #define HAVE_FALLOCATE 1
-+#endif /* _GLIB_ANDROID_ */
- /* Define if we have FAM */
- /* #undef HAVE_FAM */
-@@ -224,6 +228,7 @@
- /* Define to 1 if you have the `kqueue' function. */
- /* #undef HAVE_KQUEUE */
-+#ifndef _GLIB_ANDROID_
- /* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
- #define HAVE_LANGINFO_CODESET 1
-@@ -232,6 +237,7 @@
- /* Have nl_langinfo (PM_STR) */
- #define HAVE_LANGINFO_TIME 1
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the `lchmod' function. */
- /* #undef HAVE_LCHMOD */
-@@ -283,9 +289,10 @@
- /* Define to 1 if you have the <memory.h> header file. */
- #define HAVE_MEMORY_H 1
--
-+#ifndef _GLIB_ANDROID_
- /* Define to 1 if you have the `mmap' function. */
- #define HAVE_MMAP 1
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the <mntent.h> header file. */
- #define HAVE_MNTENT_H 1
-@@ -317,8 +324,10 @@
- /* Have POSIX function getgrgid_r */
- #define HAVE_POSIX_GETGRGID_R 1
-+#ifndef _GLIB_ANDROID_
- /* Have POSIX function getpwuid_r */
- #define HAVE_POSIX_GETPWUID_R 1
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the `posix_memalign' function. */
- #define HAVE_POSIX_MEMALIGN 1
-@@ -333,8 +342,11 @@
- #define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
- /* Have function pthread_cond_timedwait_relative_np */
-+#ifndef _GLIB_ANDROID_
- /* #undef HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP */
--
-+#else
-+#define HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP 0
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if the system has the type `ptrdiff_t'. */
- #define HAVE_PTRDIFF_T 1
-@@ -384,8 +396,10 @@
- /* Define to 1 if you have the <stdlib.h> header file. */
- #define HAVE_STDLIB_H 1
-+#ifndef _GLIB_ANDROID_
- /* Define to 1 if you have the `stpcpy' function. */
- #define HAVE_STPCPY 1
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the `strcasecmp' function. */
- #define HAVE_STRCASECMP 1
-@@ -532,10 +546,10 @@
- /* Define to 1 if you have the <sys/xattr.h> header file. */
- #define HAVE_SYS_XATTR_H 1
--
-+#ifndef _GLIB_ANDROID_
- /* Define to 1 if you have the `timegm' function. */
- #define HAVE_TIMEGM 1
--
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the <unistd.h> header file. */
- #define HAVE_UNISTD_H 1
-@@ -563,7 +577,7 @@
- /* Define to 1 if you have the `vsnprintf' function. */
- #define HAVE_VSNPRINTF 1
--
-+#ifndef _GLIB_ANDROID_
- /* Define if you have the 'wchar_t' type. */
- #define HAVE_WCHAR_T 1
-@@ -575,12 +589,14 @@
- /* Define to 1 if xattr is available */
- #define HAVE_XATTR 1
--
-+#endif
- /* Define to 1 if xattr API uses XATTR_NOFOLLOW */
- /* #undef HAVE_XATTR_NOFOLLOW */
- /* Define to 1 if you have the <xlocale.h> header file. */
-+#ifndef _GLIB_ANDROID_
- #define HAVE_XLOCALE_H 1
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the `_NSGetEnviron' function. */
- /* #undef HAVE__NSGETENVIRON */
-diff -rupN glibref/glib-2.40.2/glib/gconvert.c glibpatch/glib-2.40.2/glib/gconvert.c
---- glibref/glib-2.40.2/glib/gconvert.c        2015-03-31 16:25:56.946894901 +0900
-+++ glibpatch/glib-2.40.2/glib/gconvert.c      2015-03-31 16:40:50.546926503 +0900
-@@ -22,7 +22,11 @@
- #include "glibconfig.h"
- #ifndef G_OS_WIN32
-+
-+#ifndef _GLIB_ANDROID_
- #include <iconv.h>
-+#endif /* _GLIB_ANDROID_ */
-+
- #endif
- #include <errno.h>
- #include <stdio.h>
-@@ -168,6 +172,7 @@
- G_DEFINE_QUARK (g_convert_error, g_convert_error)
-+#ifndef _GLIB_ANDROID_
- static gboolean
- try_conversion (const char *to_codeset,
-               const char *from_codeset,
-@@ -197,9 +202,9 @@ try_to_aliases (const char **to_aliases,
-         p++;
-       }
-     }
--
-   return FALSE;
- }
-+#endif /* _GLIB_ANDROID_ */
- /**
-  * g_iconv_open:
-@@ -220,6 +225,7 @@ GIConv
- g_iconv_open (const gchar  *to_codeset,
-             const gchar  *from_codeset)
- {
-+#ifndef _GLIB_ANDROID_
-   iconv_t cd;
-   
-   if (!try_conversion (to_codeset, from_codeset, &cd))
-@@ -248,6 +254,9 @@ g_iconv_open (const gchar  *to_codeset,
-  out:
-   return (cd == (iconv_t)-1) ? (GIConv)-1 : (GIConv)cd;
-+#else
-+  return (GIConv)-1;
-+#endif /* _GLIB_ANDROID_ */
- }
- /**
-@@ -274,9 +283,13 @@ g_iconv (GIConv   converter,
-        gchar  **outbuf,
-        gsize   *outbytes_left)
- {
-+#ifndef _GLIB_ANDROID_
-   iconv_t cd = (iconv_t)converter;
-   return iconv (cd, inbuf, inbytes_left, outbuf, outbytes_left);
-+#else
-+  return -1;
-+#endif /* _GLIB_ANDROID_ */
- }
- /**
-@@ -297,9 +310,13 @@ g_iconv (GIConv   converter,
- gint
- g_iconv_close (GIConv converter)
- {
-+#ifndef _GLIB_ANDROID_
-   iconv_t cd = (iconv_t)converter;
-   return iconv_close (cd);
-+#else
-+  return -1;
-+#endif /* _GLIB_ANDROID_ */
- }
- static GIConv
-diff -rupN glibref/glib-2.40.2/glib/gfileutils.c glibpatch/glib-2.40.2/glib/gfileutils.c
---- glibref/glib-2.40.2/glib/gfileutils.c      2015-03-31 16:25:57.170894910 +0900
-+++ glibpatch/glib-2.40.2/glib/gfileutils.c    2015-03-31 16:37:29.594919396 +0900
-@@ -54,7 +54,9 @@
- #ifdef HAVE_LINUX_MAGIC_H /* for btrfs check */
- #include <linux/magic.h>
-+#ifndef _GLIB_ANDROID_
- #include <sys/vfs.h>
-+#endif /* _GLIB_ANDROID_ */
- #endif
-diff -rupN glibref/glib-2.40.2/glib/ggettext.c glibpatch/glib-2.40.2/glib/ggettext.c
---- glibref/glib-2.40.2/glib/ggettext.c        2015-03-31 16:25:57.182894907 +0900
-+++ glibpatch/glib-2.40.2/glib/ggettext.c      2015-03-31 16:37:55.538920314 +0900
-@@ -40,7 +40,10 @@
- #include <string.h>
- #include <locale.h>
-+
-+#ifndef _GLIB_ANDROID_
- #include <libintl.h>
-+#endif /* _GLIB_ANDROID_ */
- #ifdef G_OS_WIN32
-diff -rupN glibref/glib-2.40.2/glib/glibconfig.h glibpatch/glib-2.40.2/glib/glibconfig.h
---- glibref/glib-2.40.2/glib/glibconfig.h      2015-03-31 16:25:57.166894909 +0900
-+++ glibpatch/glib-2.40.2/glib/glibconfig.h    2015-03-31 16:38:06.954920717 +0900
-@@ -154,7 +154,9 @@ typedef unsigned int guintptr;
- #define G_THREADS_ENABLED
- #define G_THREADS_IMPL_POSIX
-+#ifndef _GLIB_ANDROID_
- #define G_ATOMIC_LOCK_FREE
-+#endif /* _GLIB_ANDROID_ */
- #define GINT16_TO_LE(val)     ((gint16) (val))
- #define GUINT16_TO_LE(val)    ((guint16) (val))
-diff -rupN glibref/glib-2.40.2/glib/gslice.c glibpatch/glib-2.40.2/glib/gslice.c
---- glibref/glib-2.40.2/glib/gslice.c  2015-03-31 16:25:56.946894901 +0900
-+++ glibpatch/glib-2.40.2/glib/gslice.c        2015-03-31 16:38:38.302921827 +0900
-@@ -388,7 +388,9 @@ slice_config_init (SliceConfig *config)
-        * This way it's possible to force gslice to be enabled under
-        * valgrind just by setting G_SLICE to the empty string.
-        */
-+ #ifndef _GLIB_ANDROID_
-       if (RUNNING_ON_VALGRIND)
-+#endif /* _GLIB_ANDROID_ */
-         config->always_malloc = TRUE;
-     }
- }
-diff -rupN glibref/glib-2.40.2/glib/gstrfuncs.c glibpatch/glib-2.40.2/glib/gstrfuncs.c
---- glibref/glib-2.40.2/glib/gstrfuncs.c       2015-03-31 16:25:56.950894901 +0900
-+++ glibpatch/glib-2.40.2/glib/gstrfuncs.c     2015-03-31 16:39:00.154922598 +0900
-@@ -309,6 +309,7 @@ static const guint16 ascii_table_data[25
- const guint16 * const g_ascii_table = ascii_table_data;
-+#ifndef _GLIB_ANDROID_
- #if defined (HAVE_NEWLOCALE) && \
-     defined (HAVE_USELOCALE) && \
-     defined (HAVE_STRTOD_L) && \
-@@ -316,6 +317,7 @@ const guint16 * const g_ascii_table = as
-     defined (HAVE_STRTOLL_L)
- #define USE_XLOCALE 1
- #endif
-+#endif /* _GLIB_ANDROID_ */
- #ifdef USE_XLOCALE
- static locale_t
diff --git a/resource/csdk/connectivity/lib/android/patches/glib-2.40.2-x64-withoutMakefile.patch b/resource/csdk/connectivity/lib/android/patches/glib-2.40.2-x64-withoutMakefile.patch
deleted file mode 100644 (file)
index ee75f35..0000000
+++ /dev/null
@@ -1,456 +0,0 @@
-diff -rupN glibremake/glibbase/glib-2.40.2/config.h glibremake/glib-2.40.2/config.h
---- glibremake/glibbase/glib-2.40.2/config.h   2015-03-31 18:56:48.099484578 +0900
-+++ glibremake/glib-2.40.2/config.h    2015-03-31 19:36:57.139558379 +0900
-@@ -8,10 +8,10 @@
- #define ALIGNOF_GUINT32 4
- /* The normal alignment of `guint64', in bytes. */
--#define ALIGNOF_GUINT64 8
-+#define ALIGNOF_GUINT64 4
- /* The normal alignment of `unsigned long', in bytes. */
--#define ALIGNOF_UNSIGNED_LONG 8
-+#define ALIGNOF_UNSIGNED_LONG 4
- /* poll doesn't work on devices */
- /* #undef BROKEN_POLL */
-@@ -31,8 +31,9 @@
- /* #undef ENABLE_GC_FRIENDLY_DEFAULT */
- /* always defined to indicate that i18n is enabled */
-+#ifndef _GLIB_ANDROID_
- #define ENABLE_NLS 1
--
-+#endif /* _GLIB_ANDROID__ */
- /* Define the gettext package to be used */
- #define GETTEXT_PACKAGE "glib20"
-@@ -100,8 +101,9 @@
- /* #undef HAVE_COCOA */
- /* Have nl_langinfo (CODESET) */
-+#ifndef _GLIB_ANDROID_
- #define HAVE_CODESET 1
--
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the <crt_externs.h> header file. */
- /* #undef HAVE_CRT_EXTERNS_H */
-@@ -130,8 +132,10 @@
- /* we have the eventfd(2) system call */
- #define HAVE_EVENTFD 1
-+#ifndef _GLIB_ANDROID_
- /* Define to 1 if you have the `fallocate' function. */
- #define HAVE_FALLOCATE 1
-+#endif /* _GLIB_ANDROID_ */
- /* Define if we have FAM */
- /* #undef HAVE_FAM */
-@@ -224,6 +228,7 @@
- /* Define to 1 if you have the `kqueue' function. */
- /* #undef HAVE_KQUEUE */
-+#ifndef _GLIB_ANDROID_
- /* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
- #define HAVE_LANGINFO_CODESET 1
-@@ -232,6 +237,7 @@
- /* Have nl_langinfo (PM_STR) */
- #define HAVE_LANGINFO_TIME 1
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the `lchmod' function. */
- /* #undef HAVE_LCHMOD */
-@@ -283,9 +289,10 @@
- /* Define to 1 if you have the <memory.h> header file. */
- #define HAVE_MEMORY_H 1
--
-+#ifndef _GLIB_ANDROID_
- /* Define to 1 if you have the `mmap' function. */
- #define HAVE_MMAP 1
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the <mntent.h> header file. */
- #define HAVE_MNTENT_H 1
-@@ -317,8 +324,10 @@
- /* Have POSIX function getgrgid_r */
- #define HAVE_POSIX_GETGRGID_R 1
-+#ifndef _GLIB_ANDROID_
- /* Have POSIX function getpwuid_r */
- #define HAVE_POSIX_GETPWUID_R 1
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the `posix_memalign' function. */
- #define HAVE_POSIX_MEMALIGN 1
-@@ -333,8 +342,11 @@
- #define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
- /* Have function pthread_cond_timedwait_relative_np */
-+#ifndef _GLIB_ANDROID_
- /* #undef HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP */
--
-+#else
-+#define HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP 0
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if the system has the type `ptrdiff_t'. */
- #define HAVE_PTRDIFF_T 1
-@@ -384,8 +396,10 @@
- /* Define to 1 if you have the <stdlib.h> header file. */
- #define HAVE_STDLIB_H 1
-+#ifndef _GLIB_ANDROID_
- /* Define to 1 if you have the `stpcpy' function. */
- #define HAVE_STPCPY 1
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the `strcasecmp' function. */
- #define HAVE_STRCASECMP 1
-@@ -532,10 +546,10 @@
- /* Define to 1 if you have the <sys/xattr.h> header file. */
- #define HAVE_SYS_XATTR_H 1
--
-+#ifndef _GLIB_ANDROID_
- /* Define to 1 if you have the `timegm' function. */
- #define HAVE_TIMEGM 1
--
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the <unistd.h> header file. */
- #define HAVE_UNISTD_H 1
-@@ -563,7 +577,7 @@
- /* Define to 1 if you have the `vsnprintf' function. */
- #define HAVE_VSNPRINTF 1
--
-+#ifndef _GLIB_ANDROID_
- /* Define if you have the 'wchar_t' type. */
- #define HAVE_WCHAR_T 1
-@@ -575,12 +589,14 @@
- /* Define to 1 if xattr is available */
- #define HAVE_XATTR 1
--
-+#endif
- /* Define to 1 if xattr API uses XATTR_NOFOLLOW */
- /* #undef HAVE_XATTR_NOFOLLOW */
- /* Define to 1 if you have the <xlocale.h> header file. */
-+#ifndef _GLIB_ANDROID_
- #define HAVE_XLOCALE_H 1
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the `_NSGetEnviron' function. */
- /* #undef HAVE__NSGETENVIRON */
-@@ -628,7 +644,7 @@
- #define SIZEOF_INT 4
- /* The size of `long', as computed by sizeof. */
--#define SIZEOF_LONG 8
-+#define SIZEOF_LONG 4
- /* The size of `long long', as computed by sizeof. */
- #define SIZEOF_LONG_LONG 8
-@@ -637,13 +653,13 @@
- #define SIZEOF_SHORT 2
- /* The size of `size_t', as computed by sizeof. */
--#define SIZEOF_SIZE_T 8
-+#define SIZEOF_SIZE_T 4
- /* The size of `ssize_t', as computed by sizeof. */
--#define SIZEOF_SSIZE_T 8
-+#define SIZEOF_SSIZE_T 4
- /* The size of `void *', as computed by sizeof. */
--#define SIZEOF_VOID_P 8
-+#define SIZEOF_VOID_P 4
- /* The size of `__int64', as computed by sizeof. */
- #define SIZEOF___INT64 0
-@@ -720,13 +736,8 @@
- # endif
- #endif
--/* Enable large inode numbers on Mac OS X 10.5.  */
--#ifndef _DARWIN_USE_64_BIT_INODE
--# define _DARWIN_USE_64_BIT_INODE 1
--#endif
--
- /* Number of bits in a file offset, on hosts where this is settable. */
--/* #undef _FILE_OFFSET_BITS */
-+#define _FILE_OFFSET_BITS 64
- /* defines how to decorate public symbols while building */
- #define _GLIB_EXTERN __attribute__((visibility("default"))) extern
-diff -rupN glibremake/glibbase/glib-2.40.2/glib/gconvert.c glibremake/glib-2.40.2/glib/gconvert.c
---- glibremake/glibbase/glib-2.40.2/glib/gconvert.c    2015-03-31 18:56:47.783484568 +0900
-+++ glibremake/glib-2.40.2/glib/gconvert.c     2015-03-31 19:00:09.863490759 +0900
-@@ -22,7 +22,11 @@
- #include "glibconfig.h"
- #ifndef G_OS_WIN32
-+
-+#ifndef _GLIB_ANDROID_
- #include <iconv.h>
-+#endif /* _GLIB_ANDROID_ */
-+
- #endif
- #include <errno.h>
- #include <stdio.h>
-@@ -168,6 +172,7 @@
- G_DEFINE_QUARK (g_convert_error, g_convert_error)
-+#ifndef _GLIB_ANDROID_
- static gboolean
- try_conversion (const char *to_codeset,
-               const char *from_codeset,
-@@ -200,6 +205,7 @@ try_to_aliases (const char **to_aliases,
-   return FALSE;
- }
-+#endif /* _GLIB_ANDROID_ */
- /**
-  * g_iconv_open:
-@@ -220,6 +226,7 @@ GIConv
- g_iconv_open (const gchar  *to_codeset,
-             const gchar  *from_codeset)
- {
-+#ifndef _GLIB_ANDROID_
-   iconv_t cd;
-   
-   if (!try_conversion (to_codeset, from_codeset, &cd))
-@@ -248,6 +255,9 @@ g_iconv_open (const gchar  *to_codeset,
-  out:
-   return (cd == (iconv_t)-1) ? (GIConv)-1 : (GIConv)cd;
-+#else
-+  return (GIConv)-1;
-+#endif /* _GLIB_ANDROID_ */
- }
- /**
-@@ -274,9 +284,13 @@ g_iconv (GIConv   converter,
-        gchar  **outbuf,
-        gsize   *outbytes_left)
- {
-+#ifndef _GLIB_ANDROID_
-   iconv_t cd = (iconv_t)converter;
-   return iconv (cd, inbuf, inbytes_left, outbuf, outbytes_left);
-+#else
-+  return -1;
-+#endif /* _GLIB_ANDROID_ */
- }
- /**
-@@ -297,9 +311,13 @@ g_iconv (GIConv   converter,
- gint
- g_iconv_close (GIConv converter)
- {
-+#ifndef _GLIB_ANDROID_
-   iconv_t cd = (iconv_t)converter;
-   return iconv_close (cd);
-+#else
-+  return -1;
-+#endif /* _GLIB_ANDROID_ */
- }
- static GIConv
-diff -rupN glibremake/glibbase/glib-2.40.2/glib/gfileutils.c glibremake/glib-2.40.2/glib/gfileutils.c
---- glibremake/glibbase/glib-2.40.2/glib/gfileutils.c  2015-03-31 18:56:47.687484565 +0900
-+++ glibremake/glib-2.40.2/glib/gfileutils.c   2015-03-31 18:59:50.395490162 +0900
-@@ -54,7 +54,7 @@
- #ifdef HAVE_LINUX_MAGIC_H /* for btrfs check */
- #include <linux/magic.h>
--#include <sys/vfs.h>
-+//#include <sys/vfs.h>
- #endif
-diff -rupN glibremake/glibbase/glib-2.40.2/glib/ggettext.c glibremake/glib-2.40.2/glib/ggettext.c
---- glibremake/glibbase/glib-2.40.2/glib/ggettext.c    2015-03-31 18:56:47.687484565 +0900
-+++ glibremake/glib-2.40.2/glib/ggettext.c     2015-03-31 19:27:28.671540964 +0900
-@@ -40,7 +40,10 @@
- #include <string.h>
- #include <locale.h>
-+
-+#ifndef _GLIB_ANDROID_
- #include <libintl.h>
-+#endif /* _GLIB_ANDROID_ */
- #ifdef G_OS_WIN32
-diff -rupN glibremake/glibbase/glib-2.40.2/glib/glibconfig.h glibremake/glib-2.40.2/glib/glibconfig.h
---- glibremake/glibbase/glib-2.40.2/glib/glibconfig.h  2015-03-31 18:56:47.783484568 +0900
-+++ glibremake/glib-2.40.2/glib/glibconfig.h   2015-03-31 19:33:14.071551545 +0900
-@@ -48,30 +48,30 @@ typedef unsigned int guint32;
- #define G_GUINT32_FORMAT "u"
- #define G_HAVE_GINT64 1          /* deprecated, always true */
--typedef signed long gint64;
--typedef unsigned long guint64;
-+G_GNUC_EXTENSION typedef signed long long gint64;
-+G_GNUC_EXTENSION typedef unsigned long long guint64;
--#define G_GINT64_CONSTANT(val)        (val##L)
--#define G_GUINT64_CONSTANT(val)       (val##UL)
--#define G_GINT64_MODIFIER "l"
--#define G_GINT64_FORMAT "li"
--#define G_GUINT64_FORMAT "lu"
--
--#define GLIB_SIZEOF_VOID_P 8
--#define GLIB_SIZEOF_LONG   8
--#define GLIB_SIZEOF_SIZE_T 8
--#define GLIB_SIZEOF_SSIZE_T 8
--
--typedef signed long gssize;
--typedef unsigned long gsize;
--#define G_GSIZE_MODIFIER "l"
--#define G_GSSIZE_MODIFIER "l"
--#define G_GSIZE_FORMAT "lu"
--#define G_GSSIZE_FORMAT "li"
--
--#define G_MAXSIZE     G_MAXULONG
--#define G_MINSSIZE    G_MINLONG
--#define G_MAXSSIZE    G_MAXLONG
-+#define G_GINT64_CONSTANT(val)        (G_GNUC_EXTENSION (val##LL))
-+#define G_GUINT64_CONSTANT(val)       (G_GNUC_EXTENSION (val##ULL))
-+#define G_GINT64_MODIFIER "ll"
-+#define G_GINT64_FORMAT "lli"
-+#define G_GUINT64_FORMAT "llu"
-+
-+#define GLIB_SIZEOF_VOID_P 4
-+#define GLIB_SIZEOF_LONG   4
-+#define GLIB_SIZEOF_SIZE_T 4
-+#define GLIB_SIZEOF_SSIZE_T 4
-+
-+typedef signed int gssize;
-+typedef unsigned int gsize;
-+#define G_GSIZE_MODIFIER ""
-+#define G_GSSIZE_MODIFIER ""
-+#define G_GSIZE_FORMAT "u"
-+#define G_GSSIZE_FORMAT "i"
-+
-+#define G_MAXSIZE     G_MAXUINT
-+#define G_MINSSIZE    G_MININT
-+#define G_MAXSSIZE    G_MAXINT
- typedef gint64 goffset;
- #define G_MINOFFSET   G_MININT64
-@@ -82,18 +82,18 @@ typedef gint64 goffset;
- #define G_GOFFSET_CONSTANT(val) G_GINT64_CONSTANT(val)
--#define GPOINTER_TO_INT(p)    ((gint)  (glong) (p))
--#define GPOINTER_TO_UINT(p)   ((guint) (gulong) (p))
-+#define GPOINTER_TO_INT(p)    ((gint)  (gint) (p))
-+#define GPOINTER_TO_UINT(p)   ((guint) (guint) (p))
--#define GINT_TO_POINTER(i)    ((gpointer) (glong) (i))
--#define GUINT_TO_POINTER(u)   ((gpointer) (gulong) (u))
-+#define GINT_TO_POINTER(i)    ((gpointer) (gint) (i))
-+#define GUINT_TO_POINTER(u)   ((gpointer) (guint) (u))
--typedef signed long gintptr;
--typedef unsigned long guintptr;
-+typedef signed int gintptr;
-+typedef unsigned int guintptr;
--#define G_GINTPTR_MODIFIER      "l"
--#define G_GINTPTR_FORMAT        "li"
--#define G_GUINTPTR_FORMAT       "lu"
-+#define G_GINTPTR_MODIFIER      ""
-+#define G_GINTPTR_FORMAT        "i"
-+#define G_GUINTPTR_FORMAT       "u"
- #ifndef G_DISABLE_DEPRECATED
- #define g_ATEXIT(proc)        (atexit (proc))
- #define g_memmove(dest,src,len) G_STMT_START { memmove ((dest), (src), (len)); } G_STMT_END
-@@ -107,7 +107,6 @@ typedef unsigned long guintptr;
- #define G_VA_COPY     va_copy
--#define G_VA_COPY_AS_ARRAY 1
- #ifdef        __cplusplus
- #define       G_HAVE_INLINE   1
-@@ -155,7 +154,9 @@ typedef unsigned long guintptr;
- #define G_THREADS_ENABLED
- #define G_THREADS_IMPL_POSIX
-+#ifndef _GLIB_ANDROID_
- #define G_ATOMIC_LOCK_FREE
-+#endif /* _GLIB_ANDROID_ */
- #define GINT16_TO_LE(val)     ((gint16) (val))
- #define GUINT16_TO_LE(val)    ((guint16) (val))
-@@ -169,18 +170,18 @@ typedef unsigned long guintptr;
- #define GUINT64_TO_LE(val)    ((guint64) (val))
- #define GINT64_TO_BE(val)     ((gint64) GUINT64_SWAP_LE_BE (val))
- #define GUINT64_TO_BE(val)    (GUINT64_SWAP_LE_BE (val))
--#define GLONG_TO_LE(val)      ((glong) GINT64_TO_LE (val))
--#define GULONG_TO_LE(val)     ((gulong) GUINT64_TO_LE (val))
--#define GLONG_TO_BE(val)      ((glong) GINT64_TO_BE (val))
--#define GULONG_TO_BE(val)     ((gulong) GUINT64_TO_BE (val))
-+#define GLONG_TO_LE(val)      ((glong) GINT32_TO_LE (val))
-+#define GULONG_TO_LE(val)     ((gulong) GUINT32_TO_LE (val))
-+#define GLONG_TO_BE(val)      ((glong) GINT32_TO_BE (val))
-+#define GULONG_TO_BE(val)     ((gulong) GUINT32_TO_BE (val))
- #define GINT_TO_LE(val)               ((gint) GINT32_TO_LE (val))
- #define GUINT_TO_LE(val)      ((guint) GUINT32_TO_LE (val))
- #define GINT_TO_BE(val)               ((gint) GINT32_TO_BE (val))
- #define GUINT_TO_BE(val)      ((guint) GUINT32_TO_BE (val))
--#define GSIZE_TO_LE(val)      ((gsize) GUINT64_TO_LE (val))
--#define GSSIZE_TO_LE(val)     ((gssize) GINT64_TO_LE (val))
--#define GSIZE_TO_BE(val)      ((gsize) GUINT64_TO_BE (val))
--#define GSSIZE_TO_BE(val)     ((gssize) GINT64_TO_BE (val))
-+#define GSIZE_TO_LE(val)      ((gsize) GUINT32_TO_LE (val))
-+#define GSSIZE_TO_LE(val)     ((gssize) GINT32_TO_LE (val))
-+#define GSIZE_TO_BE(val)      ((gsize) GUINT32_TO_BE (val))
-+#define GSSIZE_TO_BE(val)     ((gssize) GINT32_TO_BE (val))
- #define G_BYTE_ORDER G_LITTLE_ENDIAN
- #define GLIB_SYSDEF_POLLIN =1
-diff -rupN glibremake/glibbase/glib-2.40.2/glib/gslice.c glibremake/glib-2.40.2/glib/gslice.c
---- glibremake/glibbase/glib-2.40.2/glib/gslice.c      2015-03-31 18:56:47.775484568 +0900
-+++ glibremake/glib-2.40.2/glib/gslice.c       2015-03-31 18:57:16.255485440 +0900
-@@ -388,7 +388,9 @@ slice_config_init (SliceConfig *config)
-        * This way it's possible to force gslice to be enabled under
-        * valgrind just by setting G_SLICE to the empty string.
-        */
-+ #if 0
-       if (RUNNING_ON_VALGRIND)
-+#endif          
-         config->always_malloc = TRUE;
-     }
- }
-diff -rupN glibremake/glibbase/glib-2.40.2/glib/gstrfuncs.c glibremake/glib-2.40.2/glib/gstrfuncs.c
---- glibremake/glibbase/glib-2.40.2/glib/gstrfuncs.c   2015-03-31 18:56:47.683484565 +0900
-+++ glibremake/glib-2.40.2/glib/gstrfuncs.c    2015-03-31 18:57:07.783485181 +0900
-@@ -309,6 +309,7 @@ static const guint16 ascii_table_data[25
- const guint16 * const g_ascii_table = ascii_table_data;
-+#ifndef _GLIB_ANDROID_
- #if defined (HAVE_NEWLOCALE) && \
-     defined (HAVE_USELOCALE) && \
-     defined (HAVE_STRTOD_L) && \
-@@ -316,6 +317,7 @@ const guint16 * const g_ascii_table = as
-     defined (HAVE_STRTOLL_L)
- #define USE_XLOCALE 1
- #endif
-+#endif /* _GLIB_ANDROID_ */
- #ifdef USE_XLOCALE
- static locale_t
diff --git a/resource/csdk/connectivity/lib/android/patches/glib-2.40.2-x64.patch b/resource/csdk/connectivity/lib/android/patches/glib-2.40.2-x64.patch
deleted file mode 100644 (file)
index 1d0b47f..0000000
+++ /dev/null
@@ -1,670 +0,0 @@
-diff -rupN glibremake/glibbase/glib-2.40.2/Android.mk glibremake/glib-2.40.2/Android.mk
---- glibremake/glibbase/glib-2.40.2/Android.mk 1970-01-01 09:00:00.000000000 +0900
-+++ glibremake/glib-2.40.2/Android.mk  2015-03-31 19:38:39.067561502 +0900
-@@ -0,0 +1,14 @@
-+#GLIB Android Makefile to build GLIB modules
-+
-+LOCAL_PATH            := $(call my-dir)
-+GLIB_MAIN_DIR := $(LOCAL_PATH)
-+
-+GLIB_C_INCLUDES       := $(GLIB_MAIN_DIR) \
-+                 $(GLIB_MAIN_DIR)/glib
-+
-+GTHREAD_C_INCLUDES    := $(GLIB_MAIN_DIR) \
-+                         $(GLIB_MAIN_DIR)/gthread
-+
-+include $(GLIB_MAIN_DIR)/glib/Android.mk
-+include $(GLIB_MAIN_DIR)/gthread/Android.mk
-+
-diff -rupN glibremake/glibbase/glib-2.40.2/config.h glibremake/glib-2.40.2/config.h
---- glibremake/glibbase/glib-2.40.2/config.h   2015-03-31 18:56:48.099484578 +0900
-+++ glibremake/glib-2.40.2/config.h    2015-03-31 19:36:57.139558379 +0900
-@@ -8,10 +8,10 @@
- #define ALIGNOF_GUINT32 4
- /* The normal alignment of `guint64', in bytes. */
--#define ALIGNOF_GUINT64 8
-+#define ALIGNOF_GUINT64 4
- /* The normal alignment of `unsigned long', in bytes. */
--#define ALIGNOF_UNSIGNED_LONG 8
-+#define ALIGNOF_UNSIGNED_LONG 4
- /* poll doesn't work on devices */
- /* #undef BROKEN_POLL */
-@@ -31,8 +31,9 @@
- /* #undef ENABLE_GC_FRIENDLY_DEFAULT */
- /* always defined to indicate that i18n is enabled */
-+#ifndef _GLIB_ANDROID_
- #define ENABLE_NLS 1
--
-+#endif /* _GLIB_ANDROID__ */
- /* Define the gettext package to be used */
- #define GETTEXT_PACKAGE "glib20"
-@@ -100,8 +101,9 @@
- /* #undef HAVE_COCOA */
- /* Have nl_langinfo (CODESET) */
-+#ifndef _GLIB_ANDROID_
- #define HAVE_CODESET 1
--
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the <crt_externs.h> header file. */
- /* #undef HAVE_CRT_EXTERNS_H */
-@@ -130,8 +132,10 @@
- /* we have the eventfd(2) system call */
- #define HAVE_EVENTFD 1
-+#ifndef _GLIB_ANDROID_
- /* Define to 1 if you have the `fallocate' function. */
- #define HAVE_FALLOCATE 1
-+#endif /* _GLIB_ANDROID_ */
- /* Define if we have FAM */
- /* #undef HAVE_FAM */
-@@ -224,6 +228,7 @@
- /* Define to 1 if you have the `kqueue' function. */
- /* #undef HAVE_KQUEUE */
-+#ifndef _GLIB_ANDROID_
- /* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
- #define HAVE_LANGINFO_CODESET 1
-@@ -232,6 +237,7 @@
- /* Have nl_langinfo (PM_STR) */
- #define HAVE_LANGINFO_TIME 1
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the `lchmod' function. */
- /* #undef HAVE_LCHMOD */
-@@ -283,9 +289,10 @@
- /* Define to 1 if you have the <memory.h> header file. */
- #define HAVE_MEMORY_H 1
--
-+#ifndef _GLIB_ANDROID_
- /* Define to 1 if you have the `mmap' function. */
- #define HAVE_MMAP 1
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the <mntent.h> header file. */
- #define HAVE_MNTENT_H 1
-@@ -317,8 +324,10 @@
- /* Have POSIX function getgrgid_r */
- #define HAVE_POSIX_GETGRGID_R 1
-+#ifndef _GLIB_ANDROID_
- /* Have POSIX function getpwuid_r */
- #define HAVE_POSIX_GETPWUID_R 1
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the `posix_memalign' function. */
- #define HAVE_POSIX_MEMALIGN 1
-@@ -333,8 +342,11 @@
- #define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
- /* Have function pthread_cond_timedwait_relative_np */
-+#ifndef _GLIB_ANDROID_
- /* #undef HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP */
--
-+#else
-+#define HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP 0
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if the system has the type `ptrdiff_t'. */
- #define HAVE_PTRDIFF_T 1
-@@ -384,8 +396,10 @@
- /* Define to 1 if you have the <stdlib.h> header file. */
- #define HAVE_STDLIB_H 1
-+#ifndef _GLIB_ANDROID_
- /* Define to 1 if you have the `stpcpy' function. */
- #define HAVE_STPCPY 1
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the `strcasecmp' function. */
- #define HAVE_STRCASECMP 1
-@@ -532,10 +546,10 @@
- /* Define to 1 if you have the <sys/xattr.h> header file. */
- #define HAVE_SYS_XATTR_H 1
--
-+#ifndef _GLIB_ANDROID_
- /* Define to 1 if you have the `timegm' function. */
- #define HAVE_TIMEGM 1
--
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the <unistd.h> header file. */
- #define HAVE_UNISTD_H 1
-@@ -563,7 +577,7 @@
- /* Define to 1 if you have the `vsnprintf' function. */
- #define HAVE_VSNPRINTF 1
--
-+#ifndef _GLIB_ANDROID_
- /* Define if you have the 'wchar_t' type. */
- #define HAVE_WCHAR_T 1
-@@ -575,12 +589,14 @@
- /* Define to 1 if xattr is available */
- #define HAVE_XATTR 1
--
-+#endif
- /* Define to 1 if xattr API uses XATTR_NOFOLLOW */
- /* #undef HAVE_XATTR_NOFOLLOW */
- /* Define to 1 if you have the <xlocale.h> header file. */
-+#ifndef _GLIB_ANDROID_
- #define HAVE_XLOCALE_H 1
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the `_NSGetEnviron' function. */
- /* #undef HAVE__NSGETENVIRON */
-@@ -628,7 +644,7 @@
- #define SIZEOF_INT 4
- /* The size of `long', as computed by sizeof. */
--#define SIZEOF_LONG 8
-+#define SIZEOF_LONG 4
- /* The size of `long long', as computed by sizeof. */
- #define SIZEOF_LONG_LONG 8
-@@ -637,13 +653,13 @@
- #define SIZEOF_SHORT 2
- /* The size of `size_t', as computed by sizeof. */
--#define SIZEOF_SIZE_T 8
-+#define SIZEOF_SIZE_T 4
- /* The size of `ssize_t', as computed by sizeof. */
--#define SIZEOF_SSIZE_T 8
-+#define SIZEOF_SSIZE_T 4
- /* The size of `void *', as computed by sizeof. */
--#define SIZEOF_VOID_P 8
-+#define SIZEOF_VOID_P 4
- /* The size of `__int64', as computed by sizeof. */
- #define SIZEOF___INT64 0
-@@ -720,13 +736,8 @@
- # endif
- #endif
--/* Enable large inode numbers on Mac OS X 10.5.  */
--#ifndef _DARWIN_USE_64_BIT_INODE
--# define _DARWIN_USE_64_BIT_INODE 1
--#endif
--
- /* Number of bits in a file offset, on hosts where this is settable. */
--/* #undef _FILE_OFFSET_BITS */
-+#define _FILE_OFFSET_BITS 64
- /* defines how to decorate public symbols while building */
- #define _GLIB_EXTERN __attribute__((visibility("default"))) extern
-diff -rupN glibremake/glibbase/glib-2.40.2/glib/Android.mk glibremake/glib-2.40.2/glib/Android.mk
---- glibremake/glibbase/glib-2.40.2/glib/Android.mk    1970-01-01 09:00:00.000000000 +0900
-+++ glibremake/glib-2.40.2/glib/Android.mk     2015-03-31 19:40:22.323564665 +0900
-@@ -0,0 +1,115 @@
-+#glib Android Make File
-+
-+LOCAL_PATH            := $(call my-dir)
-+
-+include $(CLEAR_VARS)
-+
-+LOCAL_MODULE  := glib-2.40.2
-+
-+LOCAL_SRC_FILES       := \
-+    libcharset/localcharset.c \
-+    garray.c        \
-+    gasyncqueue.c   \
-+    gatomic.c       \
-+    gbacktrace.c    \
-+    gbase64.c       \
-+    gbitlock.c      \
-+    gbookmarkfile.c \
-+    gbytes.c      \
-+    gcharset.c      \
-+    gchecksum.c     \
-+    gconvert.c      \
-+    gdataset.c      \
-+    gdate.c         \
-+    gdatetime.c     \
-+    gdir.c          \
-+    gerror.c        \
-+    genviron.c      \
-+    gfileutils.c    \
-+    ggettext.c            \
-+    ghash.c         \
-+    ghmac.c         \
-+    ghook.c         \
-+    ghostutils.c    \
-+    giochannel.c    \
-+    gkeyfile.c      \
-+    glib-init.c           \
-+    glib-private.c  \
-+    glib-unix.c     \
-+    glist.c         \
-+    gmain.c         \
-+    gmappedfile.c   \
-+    gmarkup.c       \
-+    gmem.c          \
-+    gmessages.c     \
-+    gnode.c         \
-+    goption.c       \
-+    gpattern.c      \
-+    gpoll.c         \
-+    gprimes.c       \
-+    gqsort.c        \
-+    gquark.c        \
-+    gqueue.c        \
-+    grand.c         \
-+    gregex.c        \
-+    gscanner.c      \
-+    gsequence.c     \
-+    gshell.c        \
-+    gslice.c        \
-+    gslist.c        \
-+    gstdio.c        \
-+    gstrfuncs.c     \
-+    gstring.c       \
-+    gstringchunk.c  \
-+    gtestutils.c    \
-+    gthread.c       \
-+    gthreadpool.c   \
-+    gthread-posix.c \
-+    gtimer.c        \
-+    gtimezone.c     \
-+    gtranslit.c     \
-+    gtrashstack.c   \
-+    gtree.c         \
-+    guniprop.c      \
-+    gutf8.c         \
-+    gunibreak.c     \
-+    gunicollate.c   \
-+    gunidecomp.c    \
-+    gurifuncs.c     \
-+    gutils.c        \
-+    gvariant.c      \
-+    gvariant-core.c \
-+    gvariant-parser.c \
-+    gvariant-serialiser.c \
-+    gvarianttypeinfo.c \
-+    gvarianttype.c  \
-+    gprintf.c       \
-+    giounix.c       \
-+    gspawn.c        \
-+    gversion.c      \
-+    gwakeup.c
-+
-+LOCAL_C_INCLUDES := $(GLIB_MAIN_DIR) \
-+                  $(GLIB_MAIN_DIR)/glib \
-+                  $(GLIB_MAIN_DIR)/glib/deprecated \
-+                  $(GLIB_MAIN_DIR)/glib/libcharset \
-+                  $(GLIB_MAIN_DIR)/pcre \
-+
-+LOCAL_STATIC_LIBRARIES := pcre
-+
-+LOCAL_LD_LIBS := -llog
-+
-+LOCAL_CFLAGS  := \
-+      -D_GLIB_ANDROID_ \
-+      -DLIBDIR=\"$(libdir)\" \
-+      -DHAVE_CONFIG_H \
-+      -DG_LOG_DOMAIN=\"GLib\" \
-+      -DGLIB_COMPILATION \
-+      -DPCRE_STATIC \
-+      -DG_DISABLE_CAST_CHECKS
-+
-+include $(BUILD_SHARED_LIBRARY)
-+
-+include       $(GLIB_MAIN_DIR)/glib/pcre/Android.mk
-+
-+
-diff -rupN glibremake/glibbase/glib-2.40.2/glib/gconvert.c glibremake/glib-2.40.2/glib/gconvert.c
---- glibremake/glibbase/glib-2.40.2/glib/gconvert.c    2015-03-31 18:56:47.783484568 +0900
-+++ glibremake/glib-2.40.2/glib/gconvert.c     2015-03-31 19:00:09.863490759 +0900
-@@ -22,7 +22,11 @@
- #include "glibconfig.h"
- #ifndef G_OS_WIN32
-+
-+#ifndef _GLIB_ANDROID_
- #include <iconv.h>
-+#endif /* _GLIB_ANDROID_ */
-+
- #endif
- #include <errno.h>
- #include <stdio.h>
-@@ -168,6 +172,7 @@
- G_DEFINE_QUARK (g_convert_error, g_convert_error)
-+#ifndef _GLIB_ANDROID_
- static gboolean
- try_conversion (const char *to_codeset,
-               const char *from_codeset,
-@@ -200,6 +205,7 @@ try_to_aliases (const char **to_aliases,
-   return FALSE;
- }
-+#endif /* _GLIB_ANDROID_ */
- /**
-  * g_iconv_open:
-@@ -220,6 +226,7 @@ GIConv
- g_iconv_open (const gchar  *to_codeset,
-             const gchar  *from_codeset)
- {
-+#ifndef _GLIB_ANDROID_
-   iconv_t cd;
-   
-   if (!try_conversion (to_codeset, from_codeset, &cd))
-@@ -248,6 +255,9 @@ g_iconv_open (const gchar  *to_codeset,
-  out:
-   return (cd == (iconv_t)-1) ? (GIConv)-1 : (GIConv)cd;
-+#else
-+  return (GIConv)-1;
-+#endif /* _GLIB_ANDROID_ */
- }
- /**
-@@ -274,9 +284,13 @@ g_iconv (GIConv   converter,
-        gchar  **outbuf,
-        gsize   *outbytes_left)
- {
-+#ifndef _GLIB_ANDROID_
-   iconv_t cd = (iconv_t)converter;
-   return iconv (cd, inbuf, inbytes_left, outbuf, outbytes_left);
-+#else
-+  return -1;
-+#endif /* _GLIB_ANDROID_ */
- }
- /**
-@@ -297,9 +311,13 @@ g_iconv (GIConv   converter,
- gint
- g_iconv_close (GIConv converter)
- {
-+#ifndef _GLIB_ANDROID_
-   iconv_t cd = (iconv_t)converter;
-   return iconv_close (cd);
-+#else
-+  return -1;
-+#endif /* _GLIB_ANDROID_ */
- }
- static GIConv
-diff -rupN glibremake/glibbase/glib-2.40.2/glib/gfileutils.c glibremake/glib-2.40.2/glib/gfileutils.c
---- glibremake/glibbase/glib-2.40.2/glib/gfileutils.c  2015-03-31 18:56:47.687484565 +0900
-+++ glibremake/glib-2.40.2/glib/gfileutils.c   2015-03-31 18:59:50.395490162 +0900
-@@ -54,7 +54,7 @@
- #ifdef HAVE_LINUX_MAGIC_H /* for btrfs check */
- #include <linux/magic.h>
--#include <sys/vfs.h>
-+//#include <sys/vfs.h>
- #endif
-diff -rupN glibremake/glibbase/glib-2.40.2/glib/ggettext.c glibremake/glib-2.40.2/glib/ggettext.c
---- glibremake/glibbase/glib-2.40.2/glib/ggettext.c    2015-03-31 18:56:47.687484565 +0900
-+++ glibremake/glib-2.40.2/glib/ggettext.c     2015-03-31 19:27:28.671540964 +0900
-@@ -40,7 +40,10 @@
- #include <string.h>
- #include <locale.h>
-+
-+#ifndef _GLIB_ANDROID_
- #include <libintl.h>
-+#endif /* _GLIB_ANDROID_ */
- #ifdef G_OS_WIN32
-diff -rupN glibremake/glibbase/glib-2.40.2/glib/glibconfig.h glibremake/glib-2.40.2/glib/glibconfig.h
---- glibremake/glibbase/glib-2.40.2/glib/glibconfig.h  2015-03-31 18:56:47.783484568 +0900
-+++ glibremake/glib-2.40.2/glib/glibconfig.h   2015-03-31 19:33:14.071551545 +0900
-@@ -48,30 +48,30 @@ typedef unsigned int guint32;
- #define G_GUINT32_FORMAT "u"
- #define G_HAVE_GINT64 1          /* deprecated, always true */
--typedef signed long gint64;
--typedef unsigned long guint64;
-+G_GNUC_EXTENSION typedef signed long long gint64;
-+G_GNUC_EXTENSION typedef unsigned long long guint64;
--#define G_GINT64_CONSTANT(val)        (val##L)
--#define G_GUINT64_CONSTANT(val)       (val##UL)
--#define G_GINT64_MODIFIER "l"
--#define G_GINT64_FORMAT "li"
--#define G_GUINT64_FORMAT "lu"
--
--#define GLIB_SIZEOF_VOID_P 8
--#define GLIB_SIZEOF_LONG   8
--#define GLIB_SIZEOF_SIZE_T 8
--#define GLIB_SIZEOF_SSIZE_T 8
--
--typedef signed long gssize;
--typedef unsigned long gsize;
--#define G_GSIZE_MODIFIER "l"
--#define G_GSSIZE_MODIFIER "l"
--#define G_GSIZE_FORMAT "lu"
--#define G_GSSIZE_FORMAT "li"
--
--#define G_MAXSIZE     G_MAXULONG
--#define G_MINSSIZE    G_MINLONG
--#define G_MAXSSIZE    G_MAXLONG
-+#define G_GINT64_CONSTANT(val)        (G_GNUC_EXTENSION (val##LL))
-+#define G_GUINT64_CONSTANT(val)       (G_GNUC_EXTENSION (val##ULL))
-+#define G_GINT64_MODIFIER "ll"
-+#define G_GINT64_FORMAT "lli"
-+#define G_GUINT64_FORMAT "llu"
-+
-+#define GLIB_SIZEOF_VOID_P 4
-+#define GLIB_SIZEOF_LONG   4
-+#define GLIB_SIZEOF_SIZE_T 4
-+#define GLIB_SIZEOF_SSIZE_T 4
-+
-+typedef signed int gssize;
-+typedef unsigned int gsize;
-+#define G_GSIZE_MODIFIER ""
-+#define G_GSSIZE_MODIFIER ""
-+#define G_GSIZE_FORMAT "u"
-+#define G_GSSIZE_FORMAT "i"
-+
-+#define G_MAXSIZE     G_MAXUINT
-+#define G_MINSSIZE    G_MININT
-+#define G_MAXSSIZE    G_MAXINT
- typedef gint64 goffset;
- #define G_MINOFFSET   G_MININT64
-@@ -82,18 +82,18 @@ typedef gint64 goffset;
- #define G_GOFFSET_CONSTANT(val) G_GINT64_CONSTANT(val)
--#define GPOINTER_TO_INT(p)    ((gint)  (glong) (p))
--#define GPOINTER_TO_UINT(p)   ((guint) (gulong) (p))
-+#define GPOINTER_TO_INT(p)    ((gint)  (gint) (p))
-+#define GPOINTER_TO_UINT(p)   ((guint) (guint) (p))
--#define GINT_TO_POINTER(i)    ((gpointer) (glong) (i))
--#define GUINT_TO_POINTER(u)   ((gpointer) (gulong) (u))
-+#define GINT_TO_POINTER(i)    ((gpointer) (gint) (i))
-+#define GUINT_TO_POINTER(u)   ((gpointer) (guint) (u))
--typedef signed long gintptr;
--typedef unsigned long guintptr;
-+typedef signed int gintptr;
-+typedef unsigned int guintptr;
--#define G_GINTPTR_MODIFIER      "l"
--#define G_GINTPTR_FORMAT        "li"
--#define G_GUINTPTR_FORMAT       "lu"
-+#define G_GINTPTR_MODIFIER      ""
-+#define G_GINTPTR_FORMAT        "i"
-+#define G_GUINTPTR_FORMAT       "u"
- #ifndef G_DISABLE_DEPRECATED
- #define g_ATEXIT(proc)        (atexit (proc))
- #define g_memmove(dest,src,len) G_STMT_START { memmove ((dest), (src), (len)); } G_STMT_END
-@@ -107,7 +107,6 @@ typedef unsigned long guintptr;
- #define G_VA_COPY     va_copy
--#define G_VA_COPY_AS_ARRAY 1
- #ifdef        __cplusplus
- #define       G_HAVE_INLINE   1
-@@ -155,7 +154,9 @@ typedef unsigned long guintptr;
- #define G_THREADS_ENABLED
- #define G_THREADS_IMPL_POSIX
-+#ifndef _GLIB_ANDROID_
- #define G_ATOMIC_LOCK_FREE
-+#endif /* _GLIB_ANDROID_ */
- #define GINT16_TO_LE(val)     ((gint16) (val))
- #define GUINT16_TO_LE(val)    ((guint16) (val))
-@@ -169,18 +170,18 @@ typedef unsigned long guintptr;
- #define GUINT64_TO_LE(val)    ((guint64) (val))
- #define GINT64_TO_BE(val)     ((gint64) GUINT64_SWAP_LE_BE (val))
- #define GUINT64_TO_BE(val)    (GUINT64_SWAP_LE_BE (val))
--#define GLONG_TO_LE(val)      ((glong) GINT64_TO_LE (val))
--#define GULONG_TO_LE(val)     ((gulong) GUINT64_TO_LE (val))
--#define GLONG_TO_BE(val)      ((glong) GINT64_TO_BE (val))
--#define GULONG_TO_BE(val)     ((gulong) GUINT64_TO_BE (val))
-+#define GLONG_TO_LE(val)      ((glong) GINT32_TO_LE (val))
-+#define GULONG_TO_LE(val)     ((gulong) GUINT32_TO_LE (val))
-+#define GLONG_TO_BE(val)      ((glong) GINT32_TO_BE (val))
-+#define GULONG_TO_BE(val)     ((gulong) GUINT32_TO_BE (val))
- #define GINT_TO_LE(val)               ((gint) GINT32_TO_LE (val))
- #define GUINT_TO_LE(val)      ((guint) GUINT32_TO_LE (val))
- #define GINT_TO_BE(val)               ((gint) GINT32_TO_BE (val))
- #define GUINT_TO_BE(val)      ((guint) GUINT32_TO_BE (val))
--#define GSIZE_TO_LE(val)      ((gsize) GUINT64_TO_LE (val))
--#define GSSIZE_TO_LE(val)     ((gssize) GINT64_TO_LE (val))
--#define GSIZE_TO_BE(val)      ((gsize) GUINT64_TO_BE (val))
--#define GSSIZE_TO_BE(val)     ((gssize) GINT64_TO_BE (val))
-+#define GSIZE_TO_LE(val)      ((gsize) GUINT32_TO_LE (val))
-+#define GSSIZE_TO_LE(val)     ((gssize) GINT32_TO_LE (val))
-+#define GSIZE_TO_BE(val)      ((gsize) GUINT32_TO_BE (val))
-+#define GSSIZE_TO_BE(val)     ((gssize) GINT32_TO_BE (val))
- #define G_BYTE_ORDER G_LITTLE_ENDIAN
- #define GLIB_SYSDEF_POLLIN =1
-diff -rupN glibremake/glibbase/glib-2.40.2/glib/gslice.c glibremake/glib-2.40.2/glib/gslice.c
---- glibremake/glibbase/glib-2.40.2/glib/gslice.c      2015-03-31 18:56:47.775484568 +0900
-+++ glibremake/glib-2.40.2/glib/gslice.c       2015-03-31 18:57:16.255485440 +0900
-@@ -388,7 +388,9 @@ slice_config_init (SliceConfig *config)
-        * This way it's possible to force gslice to be enabled under
-        * valgrind just by setting G_SLICE to the empty string.
-        */
-+ #if 0
-       if (RUNNING_ON_VALGRIND)
-+#endif          
-         config->always_malloc = TRUE;
-     }
- }
-diff -rupN glibremake/glibbase/glib-2.40.2/glib/gstrfuncs.c glibremake/glib-2.40.2/glib/gstrfuncs.c
---- glibremake/glibbase/glib-2.40.2/glib/gstrfuncs.c   2015-03-31 18:56:47.683484565 +0900
-+++ glibremake/glib-2.40.2/glib/gstrfuncs.c    2015-03-31 18:57:07.783485181 +0900
-@@ -309,6 +309,7 @@ static const guint16 ascii_table_data[25
- const guint16 * const g_ascii_table = ascii_table_data;
-+#ifndef _GLIB_ANDROID_
- #if defined (HAVE_NEWLOCALE) && \
-     defined (HAVE_USELOCALE) && \
-     defined (HAVE_STRTOD_L) && \
-@@ -316,6 +317,7 @@ const guint16 * const g_ascii_table = as
-     defined (HAVE_STRTOLL_L)
- #define USE_XLOCALE 1
- #endif
-+#endif /* _GLIB_ANDROID_ */
- #ifdef USE_XLOCALE
- static locale_t
-diff -rupN glibremake/glibbase/glib-2.40.2/glib/pcre/Android.mk glibremake/glib-2.40.2/glib/pcre/Android.mk
---- glibremake/glibbase/glib-2.40.2/glib/pcre/Android.mk       1970-01-01 09:00:00.000000000 +0900
-+++ glibremake/glib-2.40.2/glib/pcre/Android.mk        2015-01-13 08:04:00.000000000 +0900
-@@ -0,0 +1,42 @@
-+#libpcre Android Make File
-+
-+LOCAL_PATH            := $(call my-dir)
-+
-+include $(CLEAR_VARS)
-+
-+LOCAL_MODULE  := pcre
-+
-+LOCAL_LD_LIBS := -llog
-+
-+LOCAL_CFLAGS  := \
-+      -DG_LOG_DOMAIN=\"GLib-GRegex\" \
-+      -DHAVE_CONFIG_H \
-+      -DHAVE_MEMMOVE \
-+      -DSUPPORT_UCP \
-+      -DSUPPORT_UTF \
-+      -DSUPPORT_UTF8 \
-+      -DNEWLINE=-1 \
-+      -DMATCH_LIMIT=10000000 \
-+      -DMATCH_LIMIT_RECURSION=8192 \
-+      -DMAX_NAME_SIZE=32 \
-+      -DMAX_NAME_COUNT=10000 \
-+      -DMAX_DUPLENGTH=30000 \
-+      -DLINK_SIZE=2 \
-+      -DPOSIX_MALLOC_THRESHOLD=10 \
-+      -DPCRE_STATIC \
-+      -DG_DISABLE_CAST_CHECKS \
-+      -DGLIB_COMPILATION \
-+      -D_GLIB_ANDROID_
-+
-+LOCAL_SRC_FILES       :=      pcre_xclass.c pcre_valid_utf8.c pcre_tables.c \
-+                                      pcre_study.c pcre_string_utils.c pcre_ord2utf8.c \
-+                                      pcre_newline.c pcre_jit_compile.c pcre_globals.c \
-+                                      pcre_get.c pcre_fullinfo.c pcre_exec.c \
-+                                      pcre_dfa_exec.c pcre_config.c pcre_compile.c \
-+                                      pcre_chartables.c pcre_byte_order.c
-+
-+LOCAL_C_INCLUDES := $(GLIB_MAIN_DIR) \
-+                                      $(GLIB_MAIN_DIR)/glib
-+
-+
-+include $(BUILD_STATIC_LIBRARY)
-\ No newline at end of file
-diff -rupN glibremake/glibbase/glib-2.40.2/gthread/Android.mk glibremake/glib-2.40.2/gthread/Android.mk
---- glibremake/glibbase/glib-2.40.2/gthread/Android.mk 1970-01-01 09:00:00.000000000 +0900
-+++ glibremake/glib-2.40.2/gthread/Android.mk  2015-03-31 19:39:47.151563588 +0900
-@@ -0,0 +1,25 @@
-+#gthread Android Make File
-+
-+LOCAL_PATH            := $(call my-dir)
-+
-+include $(CLEAR_VARS)
-+
-+LOCAL_MODULE  := gthread-2.40.2
-+
-+LOCAL_SRC_FILES       :=      gthread-impl.c
-+
-+LOCAL_C_INCLUDES := $(GLIB_MAIN_DIR) \
-+      $(GLIB_MAIN_DIR)/glib \
-+      $(GLIB_MAIN_DIR)/gthread
-+
-+
-+LOCAL_CFLAGS  := \
-+      -DG_LOG_DOMAIN=\"GThread\" \
-+      -DHAVE_CONFIG_H \
-+      -DG_DISABLE_CAST_CHECKS \
-+      -DG_DISABLE_DEPRECATED \
-+      -D_GLIB_ANDROID_
-+
-+
-+LOCAL_SHARED_LIBRARIES := glib-2.40.2
-+include $(BUILD_SHARED_LIBRARY)
-\ No newline at end of file
diff --git a/resource/csdk/connectivity/lib/android/patches/glib-2.40.2.patch b/resource/csdk/connectivity/lib/android/patches/glib-2.40.2.patch
deleted file mode 100644 (file)
index 264f2d0..0000000
+++ /dev/null
@@ -1,503 +0,0 @@
-diff -rupN glibref/glib-2.40.2/Android.mk glibpatch/glib-2.40.2/Android.mk
---- glibref/glib-2.40.2/Android.mk     1970-01-01 09:00:00.000000000 +0900
-+++ glibpatch/glib-2.40.2/Android.mk   2015-04-01 13:20:38.597557242 +0900
-@@ -0,0 +1,14 @@
-+#GLIB Android Makefile to build GLIB modules
-+
-+LOCAL_PATH    := $(call my-dir)
-+GLIB_MAIN_DIR := $(LOCAL_PATH)
-+
-+GLIB_C_INCLUDES       := $(GLIB_MAIN_DIR) \
-+                 $(GLIB_MAIN_DIR)/glib
-+
-+GTHREAD_C_INCLUDES    := $(GLIB_MAIN_DIR) \
-+                         $(GLIB_MAIN_DIR)/gthread
-+
-+include $(GLIB_MAIN_DIR)/glib/Android.mk
-+include $(GLIB_MAIN_DIR)/gthread/Android.mk
-+
-diff -rupN glibref/glib-2.40.2/config.h glibpatch/glib-2.40.2/config.h
---- glibref/glib-2.40.2/config.h       2015-03-31 16:25:56.882894898 +0900
-+++ glibpatch/glib-2.40.2/config.h     2015-04-01 13:21:19.593558693 +0900
-@@ -31,8 +31,9 @@
- /* #undef ENABLE_GC_FRIENDLY_DEFAULT */
- /* always defined to indicate that i18n is enabled */
-+#ifndef _GLIB_ANDROID_
- #define ENABLE_NLS 1
--
-+#endif /* _GLIB_ANDROID__ */
- /* Define the gettext package to be used */
- #define GETTEXT_PACKAGE "glib20"
-@@ -100,8 +101,9 @@
- /* #undef HAVE_COCOA */
- /* Have nl_langinfo (CODESET) */
-+#ifndef _GLIB_ANDROID_
- #define HAVE_CODESET 1
--
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the <crt_externs.h> header file. */
- /* #undef HAVE_CRT_EXTERNS_H */
-@@ -130,8 +132,10 @@
- /* we have the eventfd(2) system call */
- #define HAVE_EVENTFD 1
-+#ifndef _GLIB_ANDROID_
- /* Define to 1 if you have the `fallocate' function. */
- #define HAVE_FALLOCATE 1
-+#endif /* _GLIB_ANDROID_ */
- /* Define if we have FAM */
- /* #undef HAVE_FAM */
-@@ -224,6 +228,7 @@
- /* Define to 1 if you have the `kqueue' function. */
- /* #undef HAVE_KQUEUE */
-+#ifndef _GLIB_ANDROID_
- /* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
- #define HAVE_LANGINFO_CODESET 1
-@@ -232,6 +237,7 @@
- /* Have nl_langinfo (PM_STR) */
- #define HAVE_LANGINFO_TIME 1
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the `lchmod' function. */
- /* #undef HAVE_LCHMOD */
-@@ -283,9 +289,10 @@
- /* Define to 1 if you have the <memory.h> header file. */
- #define HAVE_MEMORY_H 1
--
-+#ifndef _GLIB_ANDROID_
- /* Define to 1 if you have the `mmap' function. */
- #define HAVE_MMAP 1
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the <mntent.h> header file. */
- #define HAVE_MNTENT_H 1
-@@ -317,8 +324,10 @@
- /* Have POSIX function getgrgid_r */
- #define HAVE_POSIX_GETGRGID_R 1
-+#ifndef _GLIB_ANDROID_
- /* Have POSIX function getpwuid_r */
- #define HAVE_POSIX_GETPWUID_R 1
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the `posix_memalign' function. */
- #define HAVE_POSIX_MEMALIGN 1
-@@ -333,8 +342,11 @@
- #define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
- /* Have function pthread_cond_timedwait_relative_np */
-+#ifndef _GLIB_ANDROID_
- /* #undef HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP */
--
-+#else
-+#define HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP 0
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if the system has the type `ptrdiff_t'. */
- #define HAVE_PTRDIFF_T 1
-@@ -384,8 +396,10 @@
- /* Define to 1 if you have the <stdlib.h> header file. */
- #define HAVE_STDLIB_H 1
-+#ifndef _GLIB_ANDROID_
- /* Define to 1 if you have the `stpcpy' function. */
- #define HAVE_STPCPY 1
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the `strcasecmp' function. */
- #define HAVE_STRCASECMP 1
-@@ -532,10 +546,10 @@
- /* Define to 1 if you have the <sys/xattr.h> header file. */
- #define HAVE_SYS_XATTR_H 1
--
-+#ifndef _GLIB_ANDROID_
- /* Define to 1 if you have the `timegm' function. */
- #define HAVE_TIMEGM 1
--
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the <unistd.h> header file. */
- #define HAVE_UNISTD_H 1
-@@ -563,7 +577,7 @@
- /* Define to 1 if you have the `vsnprintf' function. */
- #define HAVE_VSNPRINTF 1
--
-+#ifndef _GLIB_ANDROID_
- /* Define if you have the 'wchar_t' type. */
- #define HAVE_WCHAR_T 1
-@@ -575,12 +589,14 @@
- /* Define to 1 if xattr is available */
- #define HAVE_XATTR 1
--
-+#endif
- /* Define to 1 if xattr API uses XATTR_NOFOLLOW */
- /* #undef HAVE_XATTR_NOFOLLOW */
- /* Define to 1 if you have the <xlocale.h> header file. */
-+#ifndef _GLIB_ANDROID_
- #define HAVE_XLOCALE_H 1
-+#endif /* _GLIB_ANDROID_ */
- /* Define to 1 if you have the `_NSGetEnviron' function. */
- /* #undef HAVE__NSGETENVIRON */
-diff -rupN glibref/glib-2.40.2/glib/Android.mk glibpatch/glib-2.40.2/glib/Android.mk
---- glibref/glib-2.40.2/glib/Android.mk        1970-01-01 09:00:00.000000000 +0900
-+++ glibpatch/glib-2.40.2/glib/Android.mk      2015-03-31 17:10:22.722989176 +0900
-@@ -0,0 +1,115 @@
-+#glib Android Make File
-+
-+LOCAL_PATH            := $(call my-dir)
-+
-+include $(CLEAR_VARS)
-+
-+LOCAL_MODULE  := glib-2.40.2
-+
-+LOCAL_SRC_FILES       := \
-+    libcharset/localcharset.c \
-+    garray.c        \
-+    gasyncqueue.c   \
-+    gatomic.c       \
-+    gbacktrace.c    \
-+    gbase64.c       \
-+    gbitlock.c      \
-+    gbookmarkfile.c \
-+    gbytes.c      \
-+    gcharset.c      \
-+    gchecksum.c     \
-+    gconvert.c      \
-+    gdataset.c      \
-+    gdate.c         \
-+    gdatetime.c     \
-+    gdir.c          \
-+    gerror.c        \
-+    genviron.c      \
-+    gfileutils.c    \
-+    ggettext.c            \
-+    ghash.c         \
-+    ghmac.c         \
-+    ghook.c         \
-+    ghostutils.c    \
-+    giochannel.c    \
-+    gkeyfile.c      \
-+    glib-init.c           \
-+    glib-private.c  \
-+    glib-unix.c     \
-+    glist.c         \
-+    gmain.c         \
-+    gmappedfile.c   \
-+    gmarkup.c       \
-+    gmem.c          \
-+    gmessages.c     \
-+    gnode.c         \
-+    goption.c       \
-+    gpattern.c      \
-+    gpoll.c         \
-+    gprimes.c       \
-+    gqsort.c        \
-+    gquark.c        \
-+    gqueue.c        \
-+    grand.c         \
-+    gregex.c        \
-+    gscanner.c      \
-+    gsequence.c     \
-+    gshell.c        \
-+    gslice.c        \
-+    gslist.c        \
-+    gstdio.c        \
-+    gstrfuncs.c     \
-+    gstring.c       \
-+    gstringchunk.c  \
-+    gtestutils.c    \
-+    gthread.c       \
-+    gthreadpool.c   \
-+    gthread-posix.c \
-+    gtimer.c        \
-+    gtimezone.c     \
-+    gtranslit.c     \
-+    gtrashstack.c   \
-+    gtree.c         \
-+    guniprop.c      \
-+    gutf8.c         \
-+    gunibreak.c     \
-+    gunicollate.c   \
-+    gunidecomp.c    \
-+    gurifuncs.c     \
-+    gutils.c        \
-+    gvariant.c      \
-+    gvariant-core.c \
-+    gvariant-parser.c \
-+    gvariant-serialiser.c \
-+    gvarianttypeinfo.c \
-+    gvarianttype.c  \
-+    gprintf.c       \
-+    giounix.c       \
-+    gspawn.c        \
-+    gversion.c      \
-+    gwakeup.c
-+
-+LOCAL_C_INCLUDES := $(GLIB_MAIN_DIR) \
-+                  $(GLIB_MAIN_DIR)/glib \
-+                  $(GLIB_MAIN_DIR)/glib/deprecated \
-+                  $(GLIB_MAIN_DIR)/glib/libcharset \
-+                  $(GLIB_MAIN_DIR)/pcre \
-+
-+LOCAL_STATIC_LIBRARIES := pcre
-+
-+LOCAL_LD_LIBS := -llog
-+
-+LOCAL_CFLAGS  := \
-+      -D_GLIB_ANDROID_ \
-+      -DLIBDIR=\"$(libdir)\" \
-+      -DHAVE_CONFIG_H \
-+      -DG_LOG_DOMAIN=\"GLib\" \
-+      -DGLIB_COMPILATION \
-+      -DPCRE_STATIC \
-+      -DG_DISABLE_CAST_CHECKS
-+
-+include $(BUILD_SHARED_LIBRARY)
-+
-+include       $(GLIB_MAIN_DIR)/glib/pcre/Android.mk
-+
-+
-diff -rupN glibref/glib-2.40.2/glib/gconvert.c glibpatch/glib-2.40.2/glib/gconvert.c
---- glibref/glib-2.40.2/glib/gconvert.c        2015-03-31 16:25:56.946894901 +0900
-+++ glibpatch/glib-2.40.2/glib/gconvert.c      2015-03-31 16:40:50.546926503 +0900
-@@ -22,7 +22,11 @@
- #include "glibconfig.h"
- #ifndef G_OS_WIN32
-+
-+#ifndef _GLIB_ANDROID_
- #include <iconv.h>
-+#endif /* _GLIB_ANDROID_ */
-+
- #endif
- #include <errno.h>
- #include <stdio.h>
-@@ -168,6 +172,7 @@
- G_DEFINE_QUARK (g_convert_error, g_convert_error)
-+#ifndef _GLIB_ANDROID_
- static gboolean
- try_conversion (const char *to_codeset,
-               const char *from_codeset,
-@@ -197,9 +202,9 @@ try_to_aliases (const char **to_aliases,
-         p++;
-       }
-     }
--
-   return FALSE;
- }
-+#endif /* _GLIB_ANDROID_ */
- /**
-  * g_iconv_open:
-@@ -220,6 +225,7 @@ GIConv
- g_iconv_open (const gchar  *to_codeset,
-             const gchar  *from_codeset)
- {
-+#ifndef _GLIB_ANDROID_
-   iconv_t cd;
-   
-   if (!try_conversion (to_codeset, from_codeset, &cd))
-@@ -248,6 +254,9 @@ g_iconv_open (const gchar  *to_codeset,
-  out:
-   return (cd == (iconv_t)-1) ? (GIConv)-1 : (GIConv)cd;
-+#else
-+  return (GIConv)-1;
-+#endif /* _GLIB_ANDROID_ */
- }
- /**
-@@ -274,9 +283,13 @@ g_iconv (GIConv   converter,
-        gchar  **outbuf,
-        gsize   *outbytes_left)
- {
-+#ifndef _GLIB_ANDROID_
-   iconv_t cd = (iconv_t)converter;
-   return iconv (cd, inbuf, inbytes_left, outbuf, outbytes_left);
-+#else
-+  return -1;
-+#endif /* _GLIB_ANDROID_ */
- }
- /**
-@@ -297,9 +310,13 @@ g_iconv (GIConv   converter,
- gint
- g_iconv_close (GIConv converter)
- {
-+#ifndef _GLIB_ANDROID_
-   iconv_t cd = (iconv_t)converter;
-   return iconv_close (cd);
-+#else
-+  return -1;
-+#endif /* _GLIB_ANDROID_ */
- }
- static GIConv
-diff -rupN glibref/glib-2.40.2/glib/gfileutils.c glibpatch/glib-2.40.2/glib/gfileutils.c
---- glibref/glib-2.40.2/glib/gfileutils.c      2015-03-31 16:25:57.170894910 +0900
-+++ glibpatch/glib-2.40.2/glib/gfileutils.c    2015-03-31 16:37:29.594919396 +0900
-@@ -54,7 +54,9 @@
- #ifdef HAVE_LINUX_MAGIC_H /* for btrfs check */
- #include <linux/magic.h>
-+#ifndef _GLIB_ANDROID_
- #include <sys/vfs.h>
-+#endif /* _GLIB_ANDROID_ */
- #endif
-diff -rupN glibref/glib-2.40.2/glib/ggettext.c glibpatch/glib-2.40.2/glib/ggettext.c
---- glibref/glib-2.40.2/glib/ggettext.c        2015-03-31 16:25:57.182894907 +0900
-+++ glibpatch/glib-2.40.2/glib/ggettext.c      2015-03-31 16:37:55.538920314 +0900
-@@ -40,7 +40,10 @@
- #include <string.h>
- #include <locale.h>
-+
-+#ifndef _GLIB_ANDROID_
- #include <libintl.h>
-+#endif /* _GLIB_ANDROID_ */
- #ifdef G_OS_WIN32
-diff -rupN glibref/glib-2.40.2/glib/glibconfig.h glibpatch/glib-2.40.2/glib/glibconfig.h
---- glibref/glib-2.40.2/glib/glibconfig.h      2015-03-31 16:25:57.166894909 +0900
-+++ glibpatch/glib-2.40.2/glib/glibconfig.h    2015-03-31 16:38:06.954920717 +0900
-@@ -154,7 +154,9 @@ typedef unsigned int guintptr;
- #define G_THREADS_ENABLED
- #define G_THREADS_IMPL_POSIX
-+#ifndef _GLIB_ANDROID_
- #define G_ATOMIC_LOCK_FREE
-+#endif /* _GLIB_ANDROID_ */
- #define GINT16_TO_LE(val)     ((gint16) (val))
- #define GUINT16_TO_LE(val)    ((guint16) (val))
-diff -rupN glibref/glib-2.40.2/glib/gslice.c glibpatch/glib-2.40.2/glib/gslice.c
---- glibref/glib-2.40.2/glib/gslice.c  2015-03-31 16:25:56.946894901 +0900
-+++ glibpatch/glib-2.40.2/glib/gslice.c        2015-03-31 16:38:38.302921827 +0900
-@@ -388,7 +388,9 @@ slice_config_init (SliceConfig *config)
-        * This way it's possible to force gslice to be enabled under
-        * valgrind just by setting G_SLICE to the empty string.
-        */
-+ #ifndef _GLIB_ANDROID_
-       if (RUNNING_ON_VALGRIND)
-+#endif /* _GLIB_ANDROID_ */
-         config->always_malloc = TRUE;
-     }
- }
-diff -rupN glibref/glib-2.40.2/glib/gstrfuncs.c glibpatch/glib-2.40.2/glib/gstrfuncs.c
---- glibref/glib-2.40.2/glib/gstrfuncs.c       2015-03-31 16:25:56.950894901 +0900
-+++ glibpatch/glib-2.40.2/glib/gstrfuncs.c     2015-03-31 16:39:00.154922598 +0900
-@@ -309,6 +309,7 @@ static const guint16 ascii_table_data[25
- const guint16 * const g_ascii_table = ascii_table_data;
-+#ifndef _GLIB_ANDROID_
- #if defined (HAVE_NEWLOCALE) && \
-     defined (HAVE_USELOCALE) && \
-     defined (HAVE_STRTOD_L) && \
-@@ -316,6 +317,7 @@ const guint16 * const g_ascii_table = as
-     defined (HAVE_STRTOLL_L)
- #define USE_XLOCALE 1
- #endif
-+#endif /* _GLIB_ANDROID_ */
- #ifdef USE_XLOCALE
- static locale_t
-diff -rupN glibref/glib-2.40.2/glib/pcre/Android.mk glibpatch/glib-2.40.2/glib/pcre/Android.mk
---- glibref/glib-2.40.2/glib/pcre/Android.mk   1970-01-01 09:00:00.000000000 +0900
-+++ glibpatch/glib-2.40.2/glib/pcre/Android.mk 2015-01-13 08:04:00.000000000 +0900
-@@ -0,0 +1,42 @@
-+#libpcre Android Make File
-+
-+LOCAL_PATH            := $(call my-dir)
-+
-+include $(CLEAR_VARS)
-+
-+LOCAL_MODULE  := pcre
-+
-+LOCAL_LD_LIBS := -llog
-+
-+LOCAL_CFLAGS  := \
-+      -DG_LOG_DOMAIN=\"GLib-GRegex\" \
-+      -DHAVE_CONFIG_H \
-+      -DHAVE_MEMMOVE \
-+      -DSUPPORT_UCP \
-+      -DSUPPORT_UTF \
-+      -DSUPPORT_UTF8 \
-+      -DNEWLINE=-1 \
-+      -DMATCH_LIMIT=10000000 \
-+      -DMATCH_LIMIT_RECURSION=8192 \
-+      -DMAX_NAME_SIZE=32 \
-+      -DMAX_NAME_COUNT=10000 \
-+      -DMAX_DUPLENGTH=30000 \
-+      -DLINK_SIZE=2 \
-+      -DPOSIX_MALLOC_THRESHOLD=10 \
-+      -DPCRE_STATIC \
-+      -DG_DISABLE_CAST_CHECKS \
-+      -DGLIB_COMPILATION \
-+      -D_GLIB_ANDROID_
-+
-+LOCAL_SRC_FILES       :=      pcre_xclass.c pcre_valid_utf8.c pcre_tables.c \
-+                                      pcre_study.c pcre_string_utils.c pcre_ord2utf8.c \
-+                                      pcre_newline.c pcre_jit_compile.c pcre_globals.c \
-+                                      pcre_get.c pcre_fullinfo.c pcre_exec.c \
-+                                      pcre_dfa_exec.c pcre_config.c pcre_compile.c \
-+                                      pcre_chartables.c pcre_byte_order.c
-+
-+LOCAL_C_INCLUDES := $(GLIB_MAIN_DIR) \
-+                                      $(GLIB_MAIN_DIR)/glib
-+
-+
-+include $(BUILD_STATIC_LIBRARY)
-\ No newline at end of file
-diff -rupN glibref/glib-2.40.2/gthread/Android.mk glibpatch/glib-2.40.2/gthread/Android.mk
---- glibref/glib-2.40.2/gthread/Android.mk     1970-01-01 09:00:00.000000000 +0900
-+++ glibpatch/glib-2.40.2/gthread/Android.mk   2015-03-31 17:11:02.782990592 +0900
-@@ -0,0 +1,25 @@
-+#gthread Android Make File
-+
-+LOCAL_PATH            := $(call my-dir)
-+
-+include $(CLEAR_VARS)
-+
-+LOCAL_MODULE  := gthread-2.40.2
-+
-+LOCAL_SRC_FILES       :=      gthread-impl.c
-+
-+LOCAL_C_INCLUDES := $(GLIB_MAIN_DIR) \
-+      $(GLIB_MAIN_DIR)/glib \
-+      $(GLIB_MAIN_DIR)/gthread
-+
-+
-+LOCAL_CFLAGS  := \
-+      -DG_LOG_DOMAIN=\"GThread\" \
-+      -DHAVE_CONFIG_H \
-+      -DG_DISABLE_CAST_CHECKS \
-+      -DG_DISABLE_DEPRECATED \
-+      -D_GLIB_ANDROID_
-+
-+
-+LOCAL_SHARED_LIBRARIES := glib-2.40.2
-+include $(BUILD_SHARED_LIBRARY)
-\ No newline at end of file
index f96f224..55ac16d 100644 (file)
@@ -18,7 +18,7 @@ LOCAL_C_INCLUDES := ../../../api
 include $(BUILD_SHARED_LIBRARY)
 
 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-#Build glib CACommon CACoap CA
+#Build CACommon CACoap CA
 include $(CLEAR_VARS)
 PROJECT_ROOT_PATH                      = ../../..
 CA_LIB_PATH                            = $(PROJECT_ROOT_PATH)/build/android
index f832ad5..f753faf 100644 (file)
@@ -40,8 +40,6 @@ sample_env.PrependUnique(LIBPATH = [sample_env.get('BUILD_DIR'), '.',])
 sample_env.PrependUnique(RPATH = [sample_env.get('BUILD_DIR'), '.',])
 sample_env.PrependUnique(LIBS = ['connectivity_abstraction', 'coap',])
 
-sample_env.ParseConfig('pkg-config --libs glib-2.0');
-
 if secured == '1':
        sample_env.AppendUnique(CPPPATH = [root_dir + 'external/inc/'])
        sample_env.AppendUnique(LIBS = ['tinydtls'])
index 03ff73f..20f48c7 100644 (file)
@@ -3,13 +3,11 @@ ROOT_DIR = ../../..
 INC_DIR := -I$(ROOT_DIR)/api -I$(ROOT_DIR)/inc -I$(ROOT_DIR)/common/inc
 SRC_DIR := $(ROOT_DIR)/common/src/
 CFLAGS = -Wall
-COMPILEFLAGS = `pkg-config --cflags glib-2.0`
-LDFLAGS = `pkg-config --libs glib-2.0`
 
 OUT = threadpool
 
 all:
-       $(CC) $(CFLAGS) $(INC_DIR) $(COMPILEFLAGS) $(SRC_DIR)uthreadpool.c $(SRC_DIR)umutex.c $(SRC_DIR)/logger.c $(SRC_DIR)/oic_malloc.c main.c -o $(OUT) $(LDFLAGS)
+       $(CC) $(CFLAGS) $(INC_DIR) $(COMPILEFLAGS) $(SRC_DIR)cathreadpool_pthreads.c $(SRC_DIR)umutex.c $(SRC_DIR)/logger.c $(SRC_DIR)/oic_malloc.c main.c -o $(OUT) $(LDFLAGS)
 clean:
        rm -f $(OUT)
 
index 3ad9415..2e90d8c 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "uthreadpool.h"
+#include "cathreadpool.h"
 #include "camutex.h"
 
-u_thread_pool_t g_threadPoolHandle = NULL;
+ca_thread_pool_t g_threadPoolHandle = NULL;
 
 ca_mutex g_mutex = NULL;
 ca_cond g_cond = NULL;
@@ -44,14 +44,14 @@ void task(void *data)
 
 void testThreadPool(void)
 {
-    char *string = "Test glib thread pool";
+    char *string = "Test thread pool";
 
     //Initialize the mutex
     printf("[testThreadPool] Initializing mutex\n");
 
     //Initialize the thread pool
     printf("[testThreadPool] Initializing thread pool\n");
-    if (CA_STATUS_OK != u_thread_pool_init(2, &g_threadPoolHandle))
+    if (CA_STATUS_OK != ca_thread_pool_init(2, &g_threadPoolHandle))
     {
         printf("thread_pool_init failed!\n");
         return;
@@ -63,7 +63,7 @@ void testThreadPool(void)
     if (NULL == g_mutex)
     {
         printf("[testThreadPool] Failed to create mutex!\n");
-        u_thread_pool_free(g_threadPoolHandle);
+        ca_thread_pool_free(g_threadPoolHandle);
         return;
     }
 
@@ -74,7 +74,7 @@ void testThreadPool(void)
     {
         printf("[testThreadPool] Failed to create condition!\n");
         ca_mutex_free(g_mutex);
-        u_thread_pool_free(g_threadPoolHandle);
+        ca_thread_pool_free(g_threadPoolHandle);
         return;
     }
 
@@ -85,10 +85,10 @@ void testThreadPool(void)
     g_condFlag = false;
     //Add task to thread pool
     printf("[testThreadPool] Adding the task to thread pool\n");
-    if (CA_STATUS_OK != u_thread_pool_add_task(g_threadPoolHandle, task, (void *) string))
+    if (CA_STATUS_OK != ca_thread_pool_add_task(g_threadPoolHandle, task, (void *) string))
     {
         printf("[testThreadPool] thread_pool_add_task failed!\n");
-        u_thread_pool_free(g_threadPoolHandle);
+        ca_thread_pool_free(g_threadPoolHandle);
         ca_mutex_unlock(g_mutex);
         ca_mutex_free(g_mutex);
         ca_cond_free(g_cond);
@@ -110,7 +110,7 @@ void testThreadPool(void)
     printf("[testThreadPool] Task is completed and terminating threadpool\n");
     ca_cond_free(g_cond);
     ca_mutex_free(g_mutex);
-    u_thread_pool_free(g_threadPoolHandle);
+    ca_thread_pool_free(g_threadPoolHandle);
 
     printf("Exiting from testThreadPool\n");
 }
index c374516..6cda98d 100644 (file)
@@ -28,7 +28,7 @@
 #include "caleserver.h"
 #include "logger.h"
 #include "oic_malloc.h"
-#include "uthreadpool.h" /* for thread pool */
+#include "cathreadpool.h" /* for thread pool */
 #include "camutex.h"
 #include "uarraylist.h"
 #include "caadapterutils.h"
@@ -46,7 +46,7 @@ static const uint32_t MAX_PDU_BUFFER = 1024;
 static u_arraylist_t *g_deviceStateList = NULL;
 static u_arraylist_t *g_deviceObjectList = NULL;
 
-static u_thread_pool_t g_threadPoolHandle = NULL;
+static ca_thread_pool_t g_threadPoolHandle = NULL;
 
 static JavaVM *g_jvm;
 static jobject g_context;
@@ -357,7 +357,7 @@ static CAResult_t CAEDRCreateMutex()
     return CA_STATUS_OK;
 }
 
-void CAEDRInitialize(u_thread_pool_t handle)
+void CAEDRInitialize(ca_thread_pool_t handle)
 {
     OIC_LOG(DEBUG, TAG, "CAEDRInitialize");
 
@@ -1388,7 +1388,7 @@ void CAEDRReorderingDeviceSocketList(uint32_t index)
     g_deviceObjectList->length--;
 }
 
-void CAEDRInitializeClient(u_thread_pool_t handle)
+void CAEDRInitializeClient(ca_thread_pool_t handle)
 {
     OIC_LOG(DEBUG, TAG, "IN");
     CAEDRInitialize(handle);
index d55d787..055e409 100644 (file)
@@ -5,7 +5,7 @@
 #include "caedrinterface.h"
 #include "logger.h"
 #include "oic_malloc.h"
-#include "uthreadpool.h" /* for thread pool */
+#include "cathreadpool.h" /* for thread pool */
 #include "camutex.h"
 #include "uarraylist.h"
 #include "caadapterutils.h"
index 13979e1..0c07512 100644 (file)
@@ -27,7 +27,7 @@
 #include "caedrserver.h"
 #include "logger.h"
 #include "oic_malloc.h"
-#include "uthreadpool.h" /* for thread pool */
+#include "cathreadpool.h" /* for thread pool */
 #include "camutex.h"
 #include "uarraylist.h"
 #include "caadapterutils.h"
@@ -45,7 +45,7 @@ static const uint32_t MAX_PDU_BUFFER = 1024;
 static u_arraylist_t *g_deviceStateList = NULL;
 static u_arraylist_t *g_deviceObjectList = NULL;
 
-static u_thread_pool_t g_threadPoolHandle = NULL;
+static ca_thread_pool_t g_threadPoolHandle = NULL;
 
 static JavaVM *g_jvm;
 
@@ -230,7 +230,7 @@ static void CAAcceptHandler(void *data)
 
 // adapter common method
 
-CAResult_t CAEDRServerStart(const char *serviceUUID, int32_t *serverFD, u_thread_pool_t handle)
+CAResult_t CAEDRServerStart(const char *serviceUUID, int32_t *serverFD, ca_thread_pool_t handle)
 {
     OIC_LOG(DEBUG, TAG, "IN");
     CAEDRServerInitialize(handle);
@@ -330,7 +330,7 @@ void CAEDRServerJniInit(JNIEnv *env, JavaVM* jvm)
     g_jvm = jvm;
 }
 
-void CAEDRServerInitialize(u_thread_pool_t handle)
+void CAEDRServerInitialize(ca_thread_pool_t handle)
 {
     OIC_LOG(DEBUG, TAG, "CAEDRServerInitialize");
 
@@ -378,7 +378,7 @@ void CAEDRServerInitialize(u_thread_pool_t handle)
     }
 
     ctx->stopFlag = &g_stopAccept;
-    if (CA_STATUS_OK != u_thread_pool_add_task(g_threadPoolHandle, CAAcceptHandler, (void *)ctx))
+    if (CA_STATUS_OK != ca_thread_pool_add_task(g_threadPoolHandle, CAAcceptHandler, (void *)ctx))
     {
         OIC_LOG(ERROR, TAG, "Failed to create read thread!");
         OICFree((void *)ctx);
@@ -448,7 +448,7 @@ int32_t CAEDRStartUnicastServer(const char* address, bool isSecured)
 
     ctx->stopFlag = &g_stopUnicast;
     ctx->type = isSecured ? CA_SECURED_UNICAST_SERVER : CA_UNICAST_SERVER;
-    if (CA_STATUS_OK != u_thread_pool_add_task(g_threadPoolHandle, CAReceiveHandler, (void *)ctx))
+    if (CA_STATUS_OK != ca_thread_pool_add_task(g_threadPoolHandle, CAReceiveHandler, (void *)ctx))
     {
         OIC_LOG(ERROR, TAG, "Failed to create read thread!");
         ca_mutex_unlock(g_mutexUnicastServer);
@@ -488,7 +488,7 @@ int32_t CAEDRStartMulticastServer(bool isSecured)
     ctx->type = CA_MULTICAST_SERVER;
 
     g_stopMulticast = false;
-    if (CA_STATUS_OK != u_thread_pool_add_task(g_threadPoolHandle, CAReceiveHandler, (void *)ctx))
+    if (CA_STATUS_OK != ca_thread_pool_add_task(g_threadPoolHandle, CAReceiveHandler, (void *)ctx))
     {
         OIC_LOG(ERROR, TAG, "thread_pool_add_task failed!");
 
index c7e14cb..f779440 100644 (file)
@@ -24,7 +24,7 @@
 #include "caedrutils.h"
 #include "logger.h"
 #include "oic_malloc.h"
-#include "uthreadpool.h"
+#include "cathreadpool.h"
 #include "uarraylist.h"
 
 #define ERROR_CODE (-1)
index 5a24fae..e2ea8e5 100644 (file)
@@ -43,7 +43,7 @@
  * @var g_edrThreadPool
  * @brief Reference to threadpool.
  */
-static u_thread_pool_t g_edrThreadPool = NULL;
+static ca_thread_pool_t g_edrThreadPool = NULL;
 
 /**
  * @var g_sendQueueHandle
@@ -142,7 +142,7 @@ static void CAEDRDataDestroyer(void *data, uint32_t size);
 CAResult_t CAInitializeEDR(CARegisterConnectivityCallback registerCallback,
                            CANetworkPacketReceivedCallback packetReceivedCallback,
                            CANetworkChangeCallback networkStateChangeCallback,
-                           u_thread_pool_t handle)
+                           ca_thread_pool_t handle)
 {
     OIC_LOG(DEBUG, EDR_ADAPTER_TAG, "IN");
 
@@ -412,7 +412,7 @@ CAResult_t CAStartServer(void)
     {
         OIC_LOG(DEBUG, EDR_ADAPTER_TAG, "Bluetooth adapter is disabled!");
         // Setting g_serverState for starting Rfcommserver when adapter starts
-        g_serverState = TRUE;
+        g_serverState = true;
         return CA_STATUS_OK;
     }
 
@@ -882,7 +882,7 @@ void CAEDRNotifyNetworkStatus(CANetworkStatus_t status)
         CAEDRNetworkEvent *event = CAEDRCreateNetworkEvent(g_localConnectivity, status);
         if (NULL != event)
         {
-            if (CA_STATUS_OK != u_thread_pool_add_task(g_edrThreadPool, CAEDROnNetworkStatusChanged,
+            if (CA_STATUS_OK != ca_thread_pool_add_task(g_edrThreadPool, CAEDROnNetworkStatusChanged,
                     event))
             {
                 OIC_LOG(ERROR, EDR_ADAPTER_TAG, "Failed to create threadpool!");
index 6290396..a33d708 100644 (file)
 #define TAG PCF("CA")
 
 static CANetworkPacketReceivedCallback g_edrReceivedCallback = NULL;
-static u_thread_pool_t g_threadPoolHandle = NULL;
+static ca_thread_pool_t g_threadPoolHandle = NULL;
 
 CAResult_t CAInitializeEDR(CARegisterConnectivityCallback registerCallback,
         CANetworkPacketReceivedCallback reqRespCallback, CANetworkChangeCallback netCallback,
-        u_thread_pool_t handle)
+        ca_thread_pool_t handle)
 {
     OIC_LOG(DEBUG, TAG, "CAInitializeEDR");
 
index 9340481..b489dc3 100644 (file)
@@ -532,7 +532,7 @@ void CAEDRManagerTerminateMutex(void)
     OIC_LOG(DEBUG, EDR_ADAPTER_TAG, "OUT");
 }
 
-void CAEDRInitializeClient(u_thread_pool_t handle)
+void CAEDRInitializeClient(ca_thread_pool_t handle)
 {
     OIC_LOG(DEBUG, EDR_ADAPTER_TAG, "IN");
     CAEDRManagerInitializeMutex();
index a8665c3..c0ee01c 100644 (file)
@@ -38,7 +38,7 @@
 
 static int32_t g_maxPendingConnections = 10;
 
-CAResult_t CAEDRServerStart(const char *serviceUUID, int *serverFD, u_thread_pool_t handle)
+CAResult_t CAEDRServerStart(const char *serviceUUID, int *serverFD, ca_thread_pool_t handle)
 {
     OIC_LOG(DEBUG, EDR_ADAPTER_TAG, "IN");
 
index bde8cc4..4a3abec 100644 (file)
@@ -105,7 +105,7 @@ static void CALENetStateChangeCallback(const char* address, const uint32_t statu
 
 CAResult_t CAInitializeLE(CARegisterConnectivityCallback registerCallback,
                           CANetworkPacketReceivedCallback reqRespCallback,
-                          CANetworkChangeCallback netCallback, u_thread_pool_t handle)
+                          CANetworkChangeCallback netCallback, ca_thread_pool_t handle)
 {
     OIC_LOG(DEBUG, TAG, "IntializeBLE");
 
index 6b9e294..e4b8d64 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "logger.h"
 #include "oic_malloc.h"
-#include "uthreadpool.h" /* for thread pool */
+#include "cathreadpool.h" /* for thread pool */
 #include "camutex.h"
 #include "uarraylist.h"
 #include "com_iotivity_jar_caleinterface.h"
@@ -57,7 +57,7 @@ JavaVM *g_jvm;
 static u_arraylist_t *g_deviceList = NULL;
 static u_arraylist_t *g_gattObjectList = NULL;
 static CAPacketReceiveCallback g_packetReceiveCallback = NULL;
-static u_thread_pool_t g_threadPoolHandle = NULL;
+static ca_thread_pool_t g_threadPoolHandle = NULL;
 static jobject g_leScanCallback;
 static jobject g_leGattCallback;
 static jobject g_context;
@@ -165,7 +165,7 @@ void JNI_OnUnload(JavaVM *jvm, void *reserved)
     return;
 }
 
-void CALEInitialize(u_thread_pool_t handle)
+void CALEInitialize(ca_thread_pool_t handle)
 {
     OIC_LOG(DEBUG, TAG, "CALEInitialize");
 
index 0bb7420..e20103c 100644 (file)
@@ -27,7 +27,7 @@
 #include "caleutils.h"
 #include "logger.h"
 #include "oic_malloc.h"
-#include "uthreadpool.h"
+#include "cathreadpool.h"
 #include "uarraylist.h"
 #include "com_iotivity_jar_caleinterface.h"
 
@@ -48,7 +48,7 @@ static jobject g_leAdvertiseCallback;
 
 static CAPacketReceiveCallback g_packetReceiveCallback = NULL;
 static u_arraylist_t *g_connectedDeviceList = NULL;
-static u_thread_pool_t g_threadPoolHandle = NULL;
+static ca_thread_pool_t g_threadPoolHandle = NULL;
 
 static jboolean g_isStartServer;
 static jboolean g_isSendingMulticastData;
@@ -667,7 +667,7 @@ void CALeServerCreateJniInterfaceObject()
     }
 }
 
-void CALEServerInitialize(u_thread_pool_t handle)
+void CALEServerInitialize(ca_thread_pool_t handle)
 {
     OIC_LOG(DEBUG, TAG, "CALEServerInitialize");
 
index b585887..b6d90d0 100644 (file)
@@ -24,7 +24,7 @@
 #include "caleutils.h"
 #include "logger.h"
 #include "oic_malloc.h"
-#include "uthreadpool.h"
+#include "cathreadpool.h"
 #include "uarraylist.h"
 
 #define TAG PCF("CA_LE_UTILS")
index 1f20172..090bbba 100644 (file)
@@ -76,7 +76,7 @@ static ca_mutex g_bleLocalAddressMutex = NULL;
  * @var gBleClientThreadPool
  * @brief reference to threadpool
  */
-static u_thread_pool_t g_bleAdapterThreadPool = NULL;
+static ca_thread_pool_t g_bleAdapterThreadPool = NULL;
 
 /**
  * @var g_bleAdapterThreadPoolMutex
@@ -190,7 +190,7 @@ int32_t CALERegisterNetworkNotifications(CANetworkChangeCallback netCallback);
 * @return  void
 *
 */
-void CASetBleAdapterThreadPoolHandle(u_thread_pool_t handle);
+void CASetBleAdapterThreadPoolHandle(ca_thread_pool_t handle);
 
 /**
 * @fn  CALEDeviceStateChangedCb
@@ -228,7 +228,7 @@ static void CALEDataDestroyer(void *data, uint32_t size);
 CAResult_t CAInitializeLE(CARegisterConnectivityCallback registerCallback,
                           CANetworkPacketReceivedCallback reqRespCallback,
                           CANetworkChangeCallback netCallback,
-                          u_thread_pool_t handle)
+                          ca_thread_pool_t handle)
 {
     OIC_LOG(DEBUG, CALEADAPTER_TAG, "IN");
 
@@ -853,7 +853,7 @@ CAResult_t CAInitBleServerSenderQueue()
 
     if (CA_STATUS_OK != CAQueueingThreadStart(g_sendQueueHandle))
     {
-        OIC_LOG(ERROR, CALEADAPTER_TAG, "u_thread_pool_add_task failed ");
+        OIC_LOG(ERROR, CALEADAPTER_TAG, "ca_thread_pool_add_task failed ");
         OICFree(g_sendQueueHandle);
         g_sendQueueHandle = NULL;
         return CA_STATUS_FAILED;
@@ -892,7 +892,7 @@ CAResult_t CAInitBleClientSenderQueue()
 
     if (CA_STATUS_OK != CAQueueingThreadStart(g_bLEClientSendQueueHandle))
     {
-        OIC_LOG(ERROR, CALEADAPTER_TAG, "u_thread_pool_add_task failed ");
+        OIC_LOG(ERROR, CALEADAPTER_TAG, "ca_thread_pool_add_task failed ");
         OICFree(g_bLEClientSendQueueHandle);
         g_bLEClientSendQueueHandle = NULL;
         return CA_STATUS_FAILED;
@@ -932,7 +932,7 @@ CAResult_t CAInitBleServerReceiverQueue()
 
     if (CA_STATUS_OK != CAQueueingThreadStart(g_bleServerReceiverQueue))
     {
-        OIC_LOG(ERROR, CALEADAPTER_TAG, "u_thread_pool_add_task failed ");
+        OIC_LOG(ERROR, CALEADAPTER_TAG, "ca_thread_pool_add_task failed ");
         OICFree(g_bleServerReceiverQueue);
         g_bleServerReceiverQueue = NULL;
         return CA_STATUS_FAILED;
@@ -974,7 +974,7 @@ CAResult_t CAInitBleClientReceiverQueue()
     }
     if (CA_STATUS_OK != CAQueueingThreadStart(g_bleClientReceiverQueue))
     {
-        OIC_LOG(ERROR, CALEADAPTER_TAG, "u_thread_pool_add_task failed ");
+        OIC_LOG(ERROR, CALEADAPTER_TAG, "ca_thread_pool_add_task failed ");
         OICFree(g_bleClientReceiverQueue);
         g_bleClientReceiverQueue = NULL;
         return CA_STATUS_FAILED;
@@ -1678,7 +1678,7 @@ CAResult_t CABLEClientReceivedData(const char *remoteAddress, const char *servic
     return CA_STATUS_OK;
 }
 
-void CASetBleAdapterThreadPoolHandle(u_thread_pool_t handle)
+void CASetBleAdapterThreadPoolHandle(ca_thread_pool_t handle)
 {
     OIC_LOG(DEBUG, CALEADAPTER_TAG, "IN");
 
index f0fede2..92d1990 100644 (file)
 #define TAG PCF("CA")
 
 static CANetworkPacketReceivedCallback g_leReceivedCallback = NULL;
-static u_thread_pool_t g_threadPoolHandle = NULL;
+static ca_thread_pool_t g_threadPoolHandle = NULL;
 
 CAResult_t CAInitializeLE(CARegisterConnectivityCallback registerCallback,
                           CANetworkPacketReceivedCallback reqRespCallback, CANetworkChangeCallback netCallback,
-                          u_thread_pool_t handle)
+                          ca_thread_pool_t handle)
 {
     OIC_LOG(DEBUG, TAG, "CAInitializeLE");
 
index b7fb726..445cee6 100644 (file)
@@ -125,7 +125,7 @@ static GMainLoop *g_eventLoop = NULL;
  * @var g_bleClientThreadPool
  * @brief reference to threadpool
  */
-static u_thread_pool_t g_bleClientThreadPool = NULL;
+static ca_thread_pool_t g_bleClientThreadPool = NULL;
 
 /**
  * @struct stGattServiceInfo_t
@@ -234,12 +234,12 @@ void CABleGattDescriptorDiscoveredCb(int result, unsigned char format, int total
         return;
     }
 
-    CAResult_t ret = u_thread_pool_add_task(g_bleClientThreadPool,
+    CAResult_t ret = ca_thread_pool_add_task(g_bleClientThreadPool,
                                             CASetCharacteristicDescriptorValueThread,
                                             stTemp);
     if (CA_STATUS_OK != ret)
     {
-        OIC_LOG(ERROR, TZ_BLE_CLIENT_TAG, "u_thread_pool_add_task failed");
+        OIC_LOG(ERROR, TZ_BLE_CLIENT_TAG, "ca_thread_pool_add_task failed");
         bt_gatt_destroy_attribute_handle(stTemp->characteristic);
         OICFree(stTemp->desc);
         OICFree(stTemp);
@@ -342,13 +342,13 @@ bool CABleGattCharacteristicsDiscoveredCb(int result,
             return false;
         }
 
-        retVal = u_thread_pool_add_task(g_bleClientThreadPool,
+        retVal = ca_thread_pool_add_task(g_bleClientThreadPool,
                                         CADiscoverDescriptorThread,
                                         stTemp);
         if (CA_STATUS_OK != retVal)
         {
             OIC_LOG_V(ERROR, TZ_BLE_CLIENT_TAG,
-                      "u_thread_pool_add_task failed with ret [%d]", retVal);
+                      "ca_thread_pool_add_task failed with ret [%d]", retVal);
             bt_gatt_destroy_attribute_handle(stTemp->serviceInfo);
             OICFree(stTemp->address);
             OICFree(stTemp);
@@ -430,12 +430,12 @@ void CABtGattBondCreatedCb(int result, bt_device_info_s *device_info, void *user
             return;
         }
 
-        CAResult_t ret = u_thread_pool_add_task(g_bleClientThreadPool,
+        CAResult_t ret = ca_thread_pool_add_task(g_bleClientThreadPool,
                                                 CADiscoverCharThread, stTemp);
         if (CA_STATUS_OK != ret)
         {
             OIC_LOG_V(ERROR, TZ_BLE_CLIENT_TAG,
-                      "u_thread_pool_add_task failed with ret [%d]", ret);
+                      "ca_thread_pool_add_task failed with ret [%d]", ret);
             bt_gatt_destroy_attribute_handle(stTemp->serviceInfo);
             OICFree(stTemp->address);
             OICFree(stTemp);
@@ -548,13 +548,13 @@ bool CABleGattPrimaryServiceCb(bt_gatt_attribute_h service, int index, int count
             return false;
         }
 
-        result = u_thread_pool_add_task(g_bleClientThreadPool,
+        result = ca_thread_pool_add_task(g_bleClientThreadPool,
                                         CAGATTCreateBondThread,
                                         stTemp);
         if (CA_STATUS_OK != result)
         {
             OIC_LOG_V(ERROR, TZ_BLE_CLIENT_TAG,
-                      "u_thread_pool_add_task failed with ret [%d]", result);
+                      "ca_thread_pool_add_task failed with ret [%d]", result);
             OICFree(stTemp->address);
             OICFree(stTemp);
             ca_mutex_lock(g_bleServiceListMutex);
@@ -620,11 +620,11 @@ void CABleGattConnectionStateChangedCb(int result, bool connected,
             return;
         }
 
-        ret = u_thread_pool_add_task(g_bleClientThreadPool, CADiscoverBLEServicesThread,
+        ret = ca_thread_pool_add_task(g_bleClientThreadPool, CADiscoverBLEServicesThread,
                                      addr);
         if (CA_STATUS_OK != ret)
         {
-            OIC_LOG_V(ERROR, TZ_BLE_CLIENT_TAG, "u_thread_pool_add_task failed with ret [%d]", ret);
+            OIC_LOG_V(ERROR, TZ_BLE_CLIENT_TAG, "ca_thread_pool_add_task failed with ret [%d]", ret);
             OICFree(addr);
 
             ca_mutex_lock(g_bleServerBDAddressMutex);
@@ -695,12 +695,12 @@ void CABtAdapterLeDeviceDiscoveryStateChangedCb(int result,
                         return;
                     }
 
-                    CAResult_t ret = u_thread_pool_add_task(g_bleClientThreadPool,
+                    CAResult_t ret = ca_thread_pool_add_task(g_bleClientThreadPool,
                                                   CAGattConnectThread, addr);
                     if (CA_STATUS_OK != ret)
                     {
                         OIC_LOG_V(ERROR, TZ_BLE_CLIENT_TAG,
-                                  "u_thread_pool_add_task failed with ret [%d]", ret);
+                                  "ca_thread_pool_add_task failed with ret [%d]", ret);
                         OICFree(addr);
                         ca_mutex_unlock(g_bleClientThreadPoolMutex);
                         return;
@@ -746,7 +746,7 @@ void CAPrintDiscoveryInformation(const bt_adapter_le_device_discovery_info_s *di
     OIC_LOG(DEBUG, TZ_BLE_CLIENT_TAG, "OUT");
 }
 
-void CASetBleClientThreadPoolHandle(u_thread_pool_t handle)
+void CASetBleClientThreadPoolHandle(ca_thread_pool_t handle)
 {
     OIC_LOG(DEBUG, TZ_BLE_CLIENT_TAG, "IN");
 
@@ -792,11 +792,11 @@ CAResult_t CAStartBLEGattClient()
         return CA_STATUS_FAILED;
     }
 
-    retVal = u_thread_pool_add_task(g_bleClientThreadPool, CAStartBleGattClientThread,
+    retVal = ca_thread_pool_add_task(g_bleClientThreadPool, CAStartBleGattClientThread,
                                      NULL);
     if (CA_STATUS_OK != retVal)
     {
-        OIC_LOG(ERROR, TZ_BLE_CLIENT_TAG, "u_thread_pool_add_task failed");
+        OIC_LOG(ERROR, TZ_BLE_CLIENT_TAG, "ca_thread_pool_add_task failed");
         CATerminateGattClientMutexVariables();
         ca_mutex_unlock(g_bleClientThreadPoolMutex);
         return CA_STATUS_FAILED;
index e010621..ef5056c 100644 (file)
@@ -40,7 +40,7 @@
 #include "cableutil.h"
 #include "caadapterinterface.h"
 #include "logger.h"
-#include "uthreadpool.h"
+#include "cathreadpool.h"
 #include "caleinterface.h"
 #include "oic_malloc.h"
 
index df2f08c..02e01f4 100644 (file)
@@ -158,7 +158,7 @@ static GMainLoop *g_eventLoop = NULL;
  * @var g_bleServerThreadPool
  * @brief reference to threadpool
  */
-static u_thread_pool_t g_bleServerThreadPool = NULL;
+static ca_thread_pool_t g_bleServerThreadPool = NULL;
 
 void CABleGattServerConnectionStateChangedCb(int result, bool connected,
                                        const char *remoteAddress, void *userData)
@@ -202,11 +202,11 @@ CAResult_t CAStartBleGattServer()
         return CA_STATUS_FAILED;
     }
 
-    ret = u_thread_pool_add_task(g_bleServerThreadPool, CAStartBleGattServerThread,
+    ret = ca_thread_pool_add_task(g_bleServerThreadPool, CAStartBleGattServerThread,
                                  NULL);
     if (CA_STATUS_OK != ret)
     {
-        OIC_LOG_V(ERROR, TZ_BLE_SERVER_TAG, "u_thread_pool_add_task failed with ret [%d]", ret);
+        OIC_LOG_V(ERROR, TZ_BLE_SERVER_TAG, "ca_thread_pool_add_task failed with ret [%d]", ret);
         ca_mutex_unlock(g_bleServerThreadPoolMutex);
         return CA_STATUS_FAILED;
     }
@@ -541,7 +541,7 @@ CAResult_t CADeInitBleGattService()
     return CA_STATUS_OK;
 }
 
-void CASetBleServerThreadPoolHandle(u_thread_pool_t handle)
+void CASetBleServerThreadPoolHandle(ca_thread_pool_t handle)
 {
     OIC_LOG(DEBUG, TZ_BLE_SERVER_TAG, "IN");
     ca_mutex_lock(g_bleServerThreadPoolMutex);
index 0c0073c..69b3434 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "caadapterinterface.h"
 #include "logger.h"
-#include "uthreadpool.h"
+#include "cathreadpool.h"
 #include "caleinterface.h"
 
 /**
index 759b205..0c09fe4 100644 (file)
@@ -32,7 +32,7 @@
 #include "caremotehandler.h"
 #include "oic_malloc.h"
 #include "logger.h"
-#include "uthreadpool.h"
+#include "cathreadpool.h"
 
 #define TAG PCF("CA")
 
@@ -130,7 +130,7 @@ static void CANetworkChangedCallback(CALocalConnectivity_t *info,
     }
 }
 
-void CAInitializeAdapters(u_thread_pool_t handle)
+void CAInitializeAdapters(ca_thread_pool_t handle)
 {
     OIC_LOG(DEBUG, TAG, "initialize adapters..");
 
index f0855b1..1fc824e 100755 (executable)
@@ -33,7 +33,7 @@
 #include "uqueue.h"
 #include "logger.h"
 #include "config.h" /* for coap protocol */
-#include "uthreadpool.h" /* for thread pool */
+#include "cathreadpool.h" /* for thread pool */
 #include "caqueueingthread.h"
 #include "camutex.h"
 #include "oic_malloc.h"
@@ -60,7 +60,7 @@ typedef struct
 } CAData_t;
 
 // thread pool handle
-static u_thread_pool_t g_threadPoolHandle = NULL;
+static ca_thread_pool_t g_threadPoolHandle = NULL;
 
 // message handler main thread
 static CAQueueingThread_t g_sendThread;
@@ -840,7 +840,7 @@ CAResult_t CAInitializeMessageHandler()
     CASetNetworkChangeCallback(CANetworkChangedCallback);
 
     // create thread pool
-    CAResult_t res = u_thread_pool_init(MAX_THREAD_POOL_SIZE, &g_threadPoolHandle);
+    CAResult_t res = ca_thread_pool_init(MAX_THREAD_POOL_SIZE, &g_threadPoolHandle);
 
     if (res != CA_STATUS_OK)
     {
@@ -862,7 +862,7 @@ CAResult_t CAInitializeMessageHandler()
     if (res != CA_STATUS_OK)
     {
         OIC_LOG(ERROR, TAG, "thread start error(send thread).");
-        u_thread_pool_free(g_threadPoolHandle);
+        ca_thread_pool_free(g_threadPoolHandle);
         g_threadPoolHandle = NULL;
         return res;
     }
@@ -951,7 +951,7 @@ void CATerminateMessageHandler()
     // destroy thread pool
     if (NULL != g_threadPoolHandle)
     {
-        u_thread_pool_free(g_threadPoolHandle);
+        ca_thread_pool_free(g_threadPoolHandle);
         g_threadPoolHandle = NULL;
     }
 
index 7e57a13..9f8a97a 100644 (file)
@@ -119,7 +119,7 @@ static void CAQueueingThreadBaseRoutine(void *threadValue)
     OIC_LOG(DEBUG, TAG, "message handler main thread end..");
 }
 
-CAResult_t CAQueueingThreadInitialize(CAQueueingThread_t *thread, u_thread_pool_t handle,
+CAResult_t CAQueueingThreadInitialize(CAQueueingThread_t *thread, ca_thread_pool_t handle,
                                       CAThreadTask task, CADataDestroyFunction destroy)
 {
     if (NULL == thread)
@@ -174,7 +174,7 @@ CAResult_t CAQueueingThreadStart(CAQueueingThread_t *thread)
     // mutex unlock
     ca_mutex_unlock(thread->threadMutex);
 
-    CAResult_t res = u_thread_pool_add_task(thread->threadPool, CAQueueingThreadBaseRoutine,
+    CAResult_t res = ca_thread_pool_add_task(thread->threadPool, CAQueueingThreadBaseRoutine,
                                             thread);
     if (res != CA_STATUS_OK)
     {
index b420897..e10fa17 100644 (file)
@@ -231,9 +231,8 @@ static void CARetransmissionBaseRoutine(void *threadValue)
                       RETRANSMISSION_CHECK_PERIOD_SEC * (uint64_t) USECS_PER_SEC);
 
             // wait
-            uint64_t absTime=getCurrentTimeInMicroSeconds();
-            absTime += RETRANSMISSION_CHECK_PERIOD_SEC * (uint64_t) USECS_PER_SEC;
-            ca_cond_wait_until(context->threadCond, context->threadMutex, absTime );
+            uint64_t absTime = RETRANSMISSION_CHECK_PERIOD_SEC * (uint64_t) USECS_PER_SEC;
+            ca_cond_wait_for(context->threadCond, context->threadMutex, absTime );
         }
 
         // mutex unlock
@@ -254,7 +253,7 @@ static void CARetransmissionBaseRoutine(void *threadValue)
 
 }
 
-CAResult_t CARetransmissionInitialize(CARetransmission_t *context, u_thread_pool_t handle,
+CAResult_t CARetransmissionInitialize(CARetransmission_t *context, ca_thread_pool_t handle,
                                       CADataSendMethod_t retransmissionSendMethod,
                                       CATimeoutCallback_t timeoutCallback,
                                       CARetransmissionConfig_t* config)
@@ -315,7 +314,7 @@ CAResult_t CARetransmissionStart(CARetransmission_t *context)
         return CA_STATUS_INVALID_PARAM;
     }
 
-    CAResult_t res = u_thread_pool_add_task(context->threadPool, CARetransmissionBaseRoutine,
+    CAResult_t res = ca_thread_pool_add_task(context->threadPool, CARetransmissionBaseRoutine,
                                             context);
 
     if (CA_STATUS_OK != res)
index 030da86..d3fb8d1 100644 (file)
@@ -123,9 +123,9 @@ static CAQueueingThread_t *g_sendQueueHandle = NULL;
 
 /**
  * @var g_threadPool
- * @brief ThreadPool for storing u_thread_pool_t handle passed from CA
+ * @brief ThreadPool for storing ca_thread_pool_t handle passed from CA
  */
-static u_thread_pool_t g_threadPool = NULL;
+static ca_thread_pool_t g_threadPool = NULL;
 
 static CAResult_t CAEthernetInitializeQueueHandles();
 static void CAEthernetDeinitializeQueueHandles();
@@ -359,7 +359,7 @@ void CAEthernetPacketReceivedCB(const char *ipAddress, const uint16_t port,
 
 CAResult_t CAInitializeEthernet(CARegisterConnectivityCallback registerCallback,
                             CANetworkPacketReceivedCallback networkPacketCallback,
-                            CANetworkChangeCallback netCallback, u_thread_pool_t handle)
+                            CANetworkChangeCallback netCallback, ca_thread_pool_t handle)
 {
     OIC_LOG(DEBUG, ETHERNET_ADAPTER_TAG, "IN");
     VERIFY_NON_NULL(registerCallback, ETHERNET_ADAPTER_TAG, "registerCallback");
index ea5bb42..c6220f2 100644 (file)
@@ -98,9 +98,9 @@ static char *g_ethernetSubnetMask = NULL;
 
 /**
  * @var g_threadPool
- * @brief ThreadPool for storing u_thread_pool_t handle passed from adapter
+ * @brief ThreadPool for storing ca_thread_pool_t handle passed from adapter
  */
-static u_thread_pool_t g_threadPool = NULL;
+static ca_thread_pool_t g_threadPool = NULL;
 
 /**
  * @var g_stopNetworkMonitor
@@ -123,7 +123,7 @@ static void CAEthernetGetInterfaceInformation(const char *interfacePrefix,
 
 static void CANetworkMonitorThread(void *threadData);
 
-CAResult_t CAEthernetInitializeNetworkMonitor(const u_thread_pool_t threadPool)
+CAResult_t CAEthernetInitializeNetworkMonitor(const ca_thread_pool_t threadPool)
 {
     OIC_LOG(DEBUG, ETHERNET_MONITOR_TAG, "IN");
 
@@ -190,7 +190,7 @@ CAResult_t CAEthernetStartNetworkMonitor(void)
         return CA_STATUS_FAILED;
     }
 
-    if (CA_STATUS_OK != u_thread_pool_add_task(g_threadPool, (void *) CANetworkMonitorThread,
+    if (CA_STATUS_OK != ca_thread_pool_add_task(g_threadPool, (void *) CANetworkMonitorThread,
             (void *)NULL))
     {
         OIC_LOG(ERROR, ETHERNET_MONITOR_TAG, "[ThreadPool] thread_pool_add_task failed!");
index 9617eea..41de0d2 100644 (file)
@@ -155,9 +155,9 @@ static bool g_stopSecureUnicast = false;
 
 /**
  * @var g_threadPool
- * @brief ThreadPool for storing u_thread_pool_t handle passed from adapter
+ * @brief ThreadPool for storing ca_thread_pool_t handle passed from adapter
  */
-static u_thread_pool_t g_threadPool = NULL;
+static ca_thread_pool_t g_threadPool = NULL;
 
 /**
  * @var g_multicastServerInterface
@@ -541,7 +541,7 @@ static CAResult_t CAStartUnicastServer(const char *localAddress, uint16_t *port,
     ctx->stopFd = pipefd[PIPE_READ_FD]; // The read end of the pipe
     ctx->socket_fd = *serverFD;
     ctx->type = isSecured ? CA_SECURED_UNICAST_SERVER : CA_UNICAST_SERVER;
-    if (CA_STATUS_OK != u_thread_pool_add_task(g_threadPool, CAReceiveHandler, (void *)ctx))
+    if (CA_STATUS_OK != ca_thread_pool_add_task(g_threadPool, CAReceiveHandler, (void *)ctx))
     {
         OIC_LOG(ERROR, ETHERNET_SERVER_TAG, "Failed to create read thread!");
 
@@ -629,7 +629,7 @@ static CAResult_t CAEthernetServerCreateMutex(void)
     return CA_STATUS_OK;
 }
 
-CAResult_t CAEthernetInitializeServer(const u_thread_pool_t threadPool)
+CAResult_t CAEthernetInitializeServer(const ca_thread_pool_t threadPool)
 {
     OIC_LOG(DEBUG, ETHERNET_SERVER_TAG, "IN");
 
@@ -822,7 +822,7 @@ CAResult_t CAEthernetStartMulticastServer(const char *localAddress,
     ctx->type = CA_MULTICAST_SERVER;
 
     g_stopMulticast = false;
-    if (CA_STATUS_OK != u_thread_pool_add_task(g_threadPool, CAReceiveHandler, (void *)ctx))
+    if (CA_STATUS_OK != ca_thread_pool_add_task(g_threadPool, CAReceiveHandler, (void *)ctx))
     {
         OIC_LOG(ERROR, ETHERNET_SERVER_TAG, "thread_pool_add_task failed!");
 
index 46aca02..071a585 100644 (file)
@@ -69,9 +69,9 @@ static char *g_wifiSubnetMask = NULL;
 
 /**
  * @var g_threadPool
- * @brief ThreadPool for storing u_thread_pool_t handle passed from adapter
+ * @brief ThreadPool for storing ca_thread_pool_t handle passed from adapter
  */
-static u_thread_pool_t g_threadPool = NULL;
+static ca_thread_pool_t g_threadPool = NULL;
 
 /**
  * @var g_stopNetworkMonitor
@@ -115,7 +115,7 @@ static void CACreateWiFiJNIInterfaceObject(jobject context);
  */
 void CASendNetworkChangeCallback(CANetworkStatus_t currNetworkStatus);
 
-CAResult_t CAWiFiInitializeNetworkMonitor(const u_thread_pool_t threadPool)
+CAResult_t CAWiFiInitializeNetworkMonitor(const ca_thread_pool_t threadPool)
 {
     OIC_LOG(DEBUG, WIFI_MONITOR_TAG, "IN");
 
index a237ef6..cf7e5a7 100644 (file)
@@ -113,9 +113,9 @@ static bool g_stopSecureUnicast = false;
 
 /**
  * @var g_threadPool
- * @brief ThreadPool for storing u_thread_pool_t handle passed from adapter
+ * @brief ThreadPool for storing ca_thread_pool_t handle passed from adapter
  */
-static u_thread_pool_t g_threadPool = NULL;
+static ca_thread_pool_t g_threadPool = NULL;
 
 /**
  * @var g_multicastServerInterface
@@ -424,7 +424,7 @@ static CAResult_t CAStartUnicastServer(const char *localAddress, uint16_t *port,
     ctx->stopFlag = &g_stopUnicast;
     ctx->socket_fd = *serverFD;
     ctx->type = isSecured ? CA_SECURED_UNICAST_SERVER : CA_UNICAST_SERVER;
-    if (CA_STATUS_OK != u_thread_pool_add_task(g_threadPool, CAReceiveHandler, (void *)ctx))
+    if (CA_STATUS_OK != ca_thread_pool_add_task(g_threadPool, CAReceiveHandler, (void *)ctx))
     {
         OIC_LOG(ERROR, WIFI_SERVER_TAG, "Failed to create read thread!");
         OICFree(ctx);
@@ -498,7 +498,7 @@ static CAResult_t CAWiFiServerCreateMutex(void)
     return CA_STATUS_OK;
 }
 
-CAResult_t CAWiFiInitializeServer(const u_thread_pool_t threadPool)
+CAResult_t CAWiFiInitializeServer(const ca_thread_pool_t threadPool)
 {
     OIC_LOG(DEBUG, WIFI_SERVER_TAG, "IN");
 
@@ -680,7 +680,7 @@ CAResult_t CAWiFiStartMulticastServer(const char *localAddress, const char *mult
     ctx->type = CA_MULTICAST_SERVER;
 
     g_stopMulticast = false;
-    if (CA_STATUS_OK != u_thread_pool_add_task(g_threadPool, CAReceiveHandler, (void *)ctx))
+    if (CA_STATUS_OK != ca_thread_pool_add_task(g_threadPool, CAReceiveHandler, (void *)ctx))
     {
         OIC_LOG(ERROR, WIFI_SERVER_TAG, "thread_pool_add_task failed!");
 
index fd5707d..b58f2a4 100644 (file)
@@ -124,9 +124,9 @@ static CAQueueingThread_t *g_sendQueueHandle = NULL;
 
 /**
  * @var g_threadPool
- * @brief ThreadPool for storing u_thread_pool_t handle passed from CA
+ * @brief ThreadPool for storing ca_thread_pool_t handle passed from CA
  */
-static u_thread_pool_t g_threadPool = NULL;
+static ca_thread_pool_t g_threadPool = NULL;
 
 static CAResult_t CAWiFiInitializeQueueHandles();
 static void CAWiFiDeinitializeQueueHandles();
@@ -374,7 +374,7 @@ void CAWiFiPacketReceivedCB(const char *ipAddress, uint16_t port,
 
 CAResult_t CAInitializeWIFI(CARegisterConnectivityCallback registerCallback,
                             CANetworkPacketReceivedCallback networkPacketCallback,
-                            CANetworkChangeCallback netCallback, u_thread_pool_t handle)
+                            CANetworkChangeCallback netCallback, ca_thread_pool_t handle)
 {
     OIC_LOG(DEBUG, WIFI_ADAPTER_TAG, "IN");
     VERIFY_NON_NULL(registerCallback, WIFI_ADAPTER_TAG, "registerCallback");
index d143fdb..d37abf8 100644 (file)
@@ -90,9 +90,9 @@ static char *g_wifiSubnetMask = NULL;
 
 /**
  * @var g_threadPool
- * @brief ThreadPool for storing u_thread_pool_t handle passed from adapter
+ * @brief ThreadPool for storing ca_thread_pool_t handle passed from adapter
  */
-static u_thread_pool_t g_threadPool = NULL;
+static ca_thread_pool_t g_threadPool = NULL;
 
 /**
  * @var g_stopNetworkMonitor
@@ -115,7 +115,7 @@ static void CAWiFiGetInterfaceInformation(char **interfaceName, char **ipAddress
 
 static void CANetworkMonitorThread(void *threadData);
 
-CAResult_t CAWiFiInitializeNetworkMonitor(const u_thread_pool_t threadPool)
+CAResult_t CAWiFiInitializeNetworkMonitor(const ca_thread_pool_t threadPool)
 {
     OIC_LOG(DEBUG, WIFI_MONITOR_TAG, "IN");
 
@@ -183,7 +183,7 @@ CAResult_t CAWiFiStartNetworkMonitor(void)
         return CA_STATUS_FAILED;
     }
 
-    if (CA_STATUS_OK != u_thread_pool_add_task(g_threadPool,  CANetworkMonitorThread,
+    if (CA_STATUS_OK != ca_thread_pool_add_task(g_threadPool,  CANetworkMonitorThread,
             NULL))
     {
         OIC_LOG(ERROR, WIFI_MONITOR_TAG, "[ThreadPool] thread_pool_add_task failed!");
index a93fb5d..167c561 100644 (file)
@@ -154,9 +154,9 @@ static bool g_stopSecureUnicast = false;
 
 /**
  * @var g_threadPool
- * @brief ThreadPool for storing u_thread_pool_t handle passed from adapter
+ * @brief ThreadPool for storing ca_thread_pool_t handle passed from adapter
  */
-static u_thread_pool_t g_threadPool = NULL;
+static ca_thread_pool_t g_threadPool = NULL;
 
 /**
  * @var g_multicastServerInterface
@@ -536,7 +536,7 @@ static CAResult_t CAStartUnicastServer(const char *localAddress, uint16_t *port,
     ctx->stopFd = pipefd[PIPE_READ_FD]; // The read end of the pipe
     ctx->socket_fd = *serverFD;
     ctx->type = isSecured ? CA_SECURED_UNICAST_SERVER : CA_UNICAST_SERVER;
-    if (CA_STATUS_OK != u_thread_pool_add_task(g_threadPool, CAReceiveHandler, (void *) ctx))
+    if (CA_STATUS_OK != ca_thread_pool_add_task(g_threadPool, CAReceiveHandler, (void *) ctx))
     {
         OIC_LOG(ERROR, WIFI_SERVER_TAG, "Failed to create read thread!");
 
@@ -616,7 +616,7 @@ static CAResult_t CAWiFiServerCreateMutex(void)
     return CA_STATUS_OK;
 }
 
-CAResult_t CAWiFiInitializeServer(const u_thread_pool_t threadPool)
+CAResult_t CAWiFiInitializeServer(const ca_thread_pool_t threadPool)
 {
     OIC_LOG(DEBUG, WIFI_SERVER_TAG, "IN");
 
@@ -810,7 +810,7 @@ CAResult_t CAWiFiStartMulticastServer(const char *localAddress, const char *mult
     ctx->type = CA_MULTICAST_SERVER;
 
     g_stopMulticast = false;
-    if (CA_STATUS_OK != u_thread_pool_add_task(g_threadPool, CAReceiveHandler, (void *) ctx))
+    if (CA_STATUS_OK != ca_thread_pool_add_task(g_threadPool, CAReceiveHandler, (void *) ctx))
     {
         OIC_LOG(ERROR, WIFI_SERVER_TAG, "thread_pool_add_task failed!");
 
index c04a427..a47cd3c 100644 (file)
@@ -80,7 +80,7 @@ static void CAWIFIDeviceStateChangedCb(wifi_device_state_e state, void *userData
 static void CAWiFiGetInterfaceInformation(char **interfaceName, char **ipAddress,
         char **subnetMask);
 
-CAResult_t CAWiFiInitializeNetworkMonitor(const u_thread_pool_t threadPool)
+CAResult_t CAWiFiInitializeNetworkMonitor(const ca_thread_pool_t threadPool)
 {
     OIC_LOG(DEBUG, WIFI_MONITOR_TAG, "IN");
 
index ac43454..b3f19f1 100644 (file)
@@ -113,9 +113,9 @@ static bool g_stopSecureUnicast = false;
 
 /**
  * @var g_threadPool
- * @brief ThreadPool for storing u_thread_pool_t handle passed from adapter
+ * @brief ThreadPool for storing ca_thread_pool_t handle passed from adapter
  */
-static u_thread_pool_t g_threadPool = NULL;
+static ca_thread_pool_t g_threadPool = NULL;
 
 /**
  * @var g_multicastServerInterface
@@ -428,7 +428,7 @@ static CAResult_t CAStartUnicastServer(const char *localAddress, uint16_t *port,
     ctx->stopFlag = &g_stopUnicast;
     ctx->socket_fd = *serverFD;
     ctx->type = isSecured ? CA_SECURED_UNICAST_SERVER : CA_UNICAST_SERVER;
-    if (CA_STATUS_OK != u_thread_pool_add_task(g_threadPool, CAReceiveHandler, (void *)ctx))
+    if (CA_STATUS_OK != ca_thread_pool_add_task(g_threadPool, CAReceiveHandler, (void *)ctx))
     {
         OIC_LOG(ERROR, WIFI_SERVER_TAG, "Failed to create read thread!");
         OICFree(ctx);
@@ -510,7 +510,7 @@ static CAResult_t CAWiFiServerCreateMutex(void)
     return CA_STATUS_OK;
 }
 
-CAResult_t CAWiFiInitializeServer(const u_thread_pool_t threadPool)
+CAResult_t CAWiFiInitializeServer(const ca_thread_pool_t threadPool)
 {
     OIC_LOG(DEBUG, WIFI_SERVER_TAG, "IN");
 
@@ -691,7 +691,7 @@ CAResult_t CAWiFiStartMulticastServer(const char *localAddress, const char *mult
     ctx->type = CA_MULTICAST_SERVER;
 
     g_stopMulticast = false;
-    if (CA_STATUS_OK != u_thread_pool_add_task(g_threadPool, CAReceiveHandler, (void *)ctx))
+    if (CA_STATUS_OK != ca_thread_pool_add_task(g_threadPool, CAReceiveHandler, (void *)ctx))
     {
         OIC_LOG(ERROR, WIFI_SERVER_TAG, "thread_pool_add_task failed!");
 
index 42c044e..8e5d0fa 100644 (file)
@@ -55,12 +55,15 @@ catest_env.PrependUnique(LIBS = ['m',
                                     'gtest_main'])
 
 target_os = env.get('TARGET_OS')
+
+if target_os not in ['arduino', 'darwin', 'ios']:
+       catest_env.AppendUnique(LIBS=['rt'])
+
 if target_os != 'darwin':
     catest_env.PrependUnique(LIBS = ['oc_logger'])
 
 if env.get('SECURED') == '1':
     catest_env.AppendUnique(LIBS = ['tinydtls'])
-catest_env.ParseConfig('pkg-config --libs glib-2.0');
 
 if env.get('LOGGING'):
        catest_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
index ef9427e..f589784 100644 (file)
@@ -36,7 +36,7 @@
 #include "gtest/gtest.h"
 
 #include <camutex.h>
-#include <uthreadpool.h>
+#include <cathreadpool.h>
 
 #include <time.h>
 #include <sys/time.h>
@@ -140,9 +140,9 @@ void mutexFunc(void *context)
 
 TEST(MutexTests, TC_03_THREAD_LOCKING)
 {
-    u_thread_pool_t mythreadpool;
+    ca_thread_pool_t mythreadpool;
 
-    EXPECT_EQ(CA_STATUS_OK, u_thread_pool_init(3, &mythreadpool));
+    EXPECT_EQ(CA_STATUS_OK, ca_thread_pool_init(3, &mythreadpool));
 
     _func1_struct pData = {};
 
@@ -157,7 +157,7 @@ TEST(MutexTests, TC_03_THREAD_LOCKING)
         DBG_printf("test: starting thread\n");
         //start thread
         EXPECT_EQ(CA_STATUS_OK,
-                  u_thread_pool_add_task(mythreadpool, mutexFunc, &pData));
+                  ca_thread_pool_add_task(mythreadpool, mutexFunc, &pData));
 
         DBG_printf("test: waiting for thread to be up.\n");
 
@@ -188,7 +188,7 @@ TEST(MutexTests, TC_03_THREAD_LOCKING)
         ca_mutex_free(pData.mutex);
     }
 
-    u_thread_pool_free(mythreadpool);
+    ca_thread_pool_free(mythreadpool);
 }
 
 TEST(ConditionTests, TC_01_CREATE)
@@ -236,9 +236,9 @@ void condFunc(void *context)
 TEST(ConditionTests, TC_02_SIGNAL)
 {
     const int MAX_WAIT_MS = 2000;
-    u_thread_pool_t mythreadpool;
+    ca_thread_pool_t mythreadpool;
 
-    EXPECT_EQ(CA_STATUS_OK, u_thread_pool_init(3, &mythreadpool));
+    EXPECT_EQ(CA_STATUS_OK, ca_thread_pool_init(3, &mythreadpool));
 
     ca_mutex sharedMutex = ca_mutex_new();
     ca_cond sharedCond = ca_cond_new();
@@ -252,13 +252,15 @@ TEST(ConditionTests, TC_02_SIGNAL)
     if (pData1.mutex != NULL)
     {
         DBG_printf("starting thread\n");
-        //start thread
+        // start threads
+        EXPECT_EQ(CA_STATUS_OK,
+                  ca_thread_pool_add_task(mythreadpool, condFunc, &pData1));
         EXPECT_EQ(CA_STATUS_OK,
-                  u_thread_pool_add_task(mythreadpool, condFunc, &pData1));
+                  ca_thread_pool_add_task(mythreadpool, condFunc, &pData2));
 
         //start thread
         EXPECT_EQ(CA_STATUS_OK,
-                  u_thread_pool_add_task(mythreadpool, condFunc, &pData2));
+                  ca_thread_pool_add_task(mythreadpool, condFunc, &pData2));
 
         DBG_printf("test    : sleeping\n");
 
@@ -329,15 +331,15 @@ TEST(ConditionTests, TC_02_SIGNAL)
 
     ca_cond_free(pData1.condition);
 
-    u_thread_pool_free(mythreadpool);
+    ca_thread_pool_free(mythreadpool);
 }
 
 TEST(ConditionTests, TC_03_BROADCAST)
 {
     const int MAX_WAIT_MS = 2000;
-    u_thread_pool_t mythreadpool;
+    ca_thread_pool_t mythreadpool;
 
-    EXPECT_EQ(CA_STATUS_OK, u_thread_pool_init(3, &mythreadpool));
+    EXPECT_EQ(CA_STATUS_OK, ca_thread_pool_init(3, &mythreadpool));
 
     ca_mutex sharedMutex = ca_mutex_new();
     ca_cond sharedCond = ca_cond_new();
@@ -351,13 +353,15 @@ TEST(ConditionTests, TC_03_BROADCAST)
     if (pData1.mutex != NULL)
     {
         DBG_printf("starting thread\n");
-        //start thread
+        // start threads
         EXPECT_EQ(CA_STATUS_OK,
-                  u_thread_pool_add_task(mythreadpool, condFunc, &pData1));
+                  ca_thread_pool_add_task(mythreadpool, condFunc, &pData1));
+        EXPECT_EQ(CA_STATUS_OK,
+                  ca_thread_pool_add_task(mythreadpool, condFunc, &pData2));
 
         //start thread
         EXPECT_EQ(CA_STATUS_OK,
-                  u_thread_pool_add_task(mythreadpool, condFunc, &pData2));
+                  ca_thread_pool_add_task(mythreadpool, condFunc, &pData2));
 
         DBG_printf("test    : sleeping\n");
 
@@ -397,7 +401,7 @@ TEST(ConditionTests, TC_03_BROADCAST)
 
     ca_cond_free(sharedCond);
 
-    u_thread_pool_free(mythreadpool);
+    ca_thread_pool_free(mythreadpool);
 }
 
 TEST(CondTests, TC_04_TIMECHECK)
@@ -419,23 +423,21 @@ void timedFunc(void *context)
 
     ca_mutex_lock(pData->mutex);
 
-    uint64_t abs = getAbsTime();
-    abs += USECS_PER_SEC / 2; // 1/2 second
+    uint64_t abs = USECS_PER_SEC / 2; // 1/2 seconds
 
     // test UTIMEDOUT
-    CAWaitResult_t ret = ca_cond_wait_until(pData->condition,
-                                            pData->mutex, abs);
+    CAWaitResult_t ret = ca_cond_wait_for(pData->condition,
+                                          pData->mutex, abs);
     EXPECT_EQ(CA_WAIT_TIMEDOUT, ret);
 
     pData->thread_up = true;
 
     DBG_printf("Thread_%d: waiting for signal \n", pData->id);
 
-    abs = getAbsTime();
-    abs += 5 * USECS_PER_SEC; // 5 seconds
+    abs = 5 * USECS_PER_SEC; // 5 seconds
 
     // test signal
-    ret = ca_cond_wait_until(pData->condition, pData->mutex, abs);
+    ret = ca_cond_wait_for(pData->condition, pData->mutex, abs);
     EXPECT_EQ(CA_WAIT_SUCCESS, ret);
 
     pData->finished = true; // assignment guarded by lock
@@ -448,9 +450,9 @@ void timedFunc(void *context)
 TEST(ConditionTests, TC_05_WAIT)
 {
     const int MAX_WAIT_MS = 5000;
-    u_thread_pool_t mythreadpool;
+    ca_thread_pool_t mythreadpool;
 
-    EXPECT_EQ(CA_STATUS_OK, u_thread_pool_init(3, &mythreadpool));
+    EXPECT_EQ(CA_STATUS_OK, ca_thread_pool_init(3, &mythreadpool));
 
     ca_mutex sharedMutex = ca_mutex_new();
     ca_cond sharedCond = ca_cond_new();
@@ -464,7 +466,7 @@ TEST(ConditionTests, TC_05_WAIT)
         DBG_printf("test    : starting thread\n");
         //start thread
         EXPECT_EQ(CA_STATUS_OK,
-                  u_thread_pool_add_task(mythreadpool, timedFunc, &pData1));
+                  ca_thread_pool_add_task(mythreadpool, timedFunc, &pData1));
 
         DBG_printf("test    : waiting for thread to timeout once.\n");
 
@@ -499,10 +501,11 @@ TEST(ConditionTests, TC_05_WAIT)
 
     ca_cond_free(sharedCond);
 
-    u_thread_pool_free(mythreadpool);
- }
+    ca_thread_pool_free(mythreadpool);
+}
 
-TEST(ConditionTests, TC_06_INVALIDWAIT)
+// Disabled because this should no longer be a valid test
+TEST(ConditionTests, DISABLED_TC_06_INVALIDWAIT)
 {
 
     ca_mutex sharedMutex = ca_mutex_new();
@@ -510,13 +513,13 @@ TEST(ConditionTests, TC_06_INVALIDWAIT)
 
     ca_mutex_lock(sharedMutex);
 
-    int ret = ca_cond_wait_until(NULL, sharedMutex, 5000);
+    int ret = ca_cond_wait_for(NULL, sharedMutex, 5000);
     EXPECT_EQ(CA_WAIT_INVAL,ret);
 
-    ret = ca_cond_wait_until(sharedCond, NULL, 5000);
+    ret = ca_cond_wait_for(sharedCond, NULL, 5000);
     EXPECT_EQ(CA_WAIT_INVAL,ret);
 
-    ret = ca_cond_wait_until(NULL, NULL, 5000);
+    ret = ca_cond_wait_for(NULL, NULL, 5000);
     EXPECT_EQ(CA_WAIT_INVAL,ret);
 
     ca_mutex_unlock(sharedMutex);
@@ -537,11 +540,10 @@ TEST(ConditionTests, TC_07_WAITDURATION)
 
     ca_mutex_lock(sharedMutex);
 
-    uint64_t abs = getAbsTime();
-    uint64_t beg = abs;
-    abs += TARGET_WAIT * USECS_PER_SEC;
+    uint64_t beg = getAbsTime();
 
-    CAWaitResult_t ret = ca_cond_wait_until(sharedCond, sharedMutex, abs);
+    CAWaitResult_t ret = ca_cond_wait_for(sharedCond, sharedMutex,
+                                          TARGET_WAIT * USECS_PER_SEC);
     EXPECT_EQ(CA_WAIT_TIMEDOUT,ret);
 
     uint64_t end = getAbsTime();
index dde64c2..b3250b7 100644 (file)
@@ -40,12 +40,12 @@ samples_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
 
 if target_os in ['darwin', 'ios']:
        samples_env.PrependUnique(LIBS = ['m','octbstack', 'connectivity_abstraction','coap' ])
-else:
+elif target_os not in ['arduino']:
        samples_env.PrependUnique(LIBS = ['m', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap'])
+       samples_env.AppendUnique(LIBS = ['rt'])
 
 if env.get('SECURED') == '1':
     samples_env.AppendUnique(LIBS = ['tinydtls'])
-samples_env.ParseConfig('pkg-config --libs glib-2.0');
 
 samples_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
 
index c312d35..82a298d 100644 (file)
@@ -47,8 +47,6 @@ if env.get('SECURED') == '1':
 
 samples_env.Append(LINKFLAGS = ['-Wl,--no-as-needed'])
 
-samples_env.ParseConfig('pkg-config --libs glib-2.0');
-
 if target_os == 'android':
        samples_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
        samples_env.AppendUnique(LIBS = ['gnustl_static'])
index 7cd80fd..a331fa3 100644 (file)
@@ -56,7 +56,6 @@ if target_os != 'darwin':
 
 if env.get('SECURED') == '1':
     stacktest_env.AppendUnique(LIBS = ['tinydtls'])
-stacktest_env.ParseConfig('pkg-config --libs glib-2.0');
 
 if env.get('LOGGING'):
        stacktest_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
index e99a417..c469fe0 100644 (file)
@@ -55,7 +55,7 @@ The message handler owns athread pool and send and reive queue.
 
 @paragraph caf_ovr_comm_netinterface_control Interface controller
 
-This directly controls the individual adapters. Calling CAInitializeAdapters(u_thread_pool_t handle)
+This directly controls the individual adapters. Calling CAInitializeAdapters(ca_thread_pool_t handle)
 will invoke whatever config had been established by compile-time flags.
 
 @paragraph caf_ovr_comm_netinterface_eth Ethernet Adapter
@@ -86,4 +86,4 @@ is more of a sketch and is not 100% complete.
 
 @dotfile ca_arch.gv
 
-*/
\ No newline at end of file
+*/
index 43ae5cf..eee3d5b 100644 (file)
@@ -38,7 +38,7 @@ digraph G {
         label = <<table border="1" cellspacing="0" cellborder="0">
                     <tr><td port="a" tooltip="Message Handler" bgcolor="gray">Message Handler</td></tr>
                     <hr/>
-                    <tr><td align="left" href="\ref g_threadPoolHandle" tooltip="-g_threadPoolHandle: u_thread_pool_t">-g_threadPoolHandle: u_thread_pool_t</td></tr>
+                    <tr><td align="left" href="\ref g_threadPoolHandle" tooltip="-g_threadPoolHandle: ca_thread_pool_t">-g_threadPoolHandle: ca_thread_pool_t</td></tr>
                     <tr><td align="left" href="\ref g_sendThread" tooltip="-g_sendThread: CAQueueingThread_t">-g_sendThread: CAQueueingThread_t</td></tr>
                     <tr><td align="left" href="\ref g_receiveThread" tooltip="-g_receiveThread: CAQueueingThread_t">-g_receiveThread: CAQueueingThread_t</td></tr>
                     <tr><td align="left" href="\ref g_retransmissionContext" tooltip="-g_retransmissionContext: CARetransmission_t">-g_retransmissionContext: CARetransmission_t</td></tr>
@@ -52,22 +52,22 @@ digraph G {
 
     threadpool [
         shape = none
-        margin = 0        
+        margin = 0
         label = <<table border="1" cellspacing="0" cellborder="0">
-                    <tr><td href="\ref u_thread_pool_t" tooltip="u_threadpool_t" bgcolor="gray">u_threadpool_t</td></tr>
+                    <tr><td href="\ref ca_thread_pool_t" tooltip="ca_threadpool_t" bgcolor="gray">ca_threadpool_t</td></tr>
                     <hr/>
                     <tr><td> </td></tr>
                     <hr/>
-                    <tr><td align="left" href="\ref u_thread_pool_init()" tooltip="+u_thread_pool_init">+u_thread_pool_init</td></tr>
-                    <tr><td align="left" href="\ref u_thread_pool_free()" tooltip="+u_thread_pool_free">+u_thread_pool_free</td></tr>
-                    <tr><td align="left" href="\ref u_thread_pool_add_task()" tooltip="+u_thread_pool_add_task">+u_thread_pool_add_task</td></tr>
+                    <tr><td align="left" href="\ref ca_thread_pool_init()" tooltip="+ca_thread_pool_init">+ca_thread_pool_init</td></tr>
+                    <tr><td align="left" href="\ref ca_thread_pool_free()" tooltip="+ca_thread_pool_free">+ca_thread_pool_free</td></tr>
+                    <tr><td align="left" href="\ref ca_thread_pool_add_task()" tooltip="+ca_thread_pool_add_task">+ca_thread_pool_add_task</td></tr>
                 </table>>
     ]
 
 
     thread_out [
         shape = none
-        margin = 0        
+        margin = 0
         label = <<table border="1" cellspacing="0" cellborder="0">
                     <tr><td href="\ref CASendThreadProcess()" tooltip="Send Thread" bgcolor="gray">Send Thread</td></tr>
                     <hr/>
@@ -79,7 +79,7 @@ digraph G {
 
     thread_in [
         shape = none
-        margin = 0        
+        margin = 0
         label = <<table border="1" cellspacing="0" cellborder="0">
                     <tr><td href="\ref CAReceiveThreadProcess()" tooltip="Receive Thread" bgcolor="gray">Receive Thread</td></tr>
                     <hr/>
@@ -91,7 +91,7 @@ digraph G {
 
     thread_retrans [
         shape = none
-        margin = 0        
+        margin = 0
         label = <<table border="1" cellspacing="0" cellborder="0">
                     <tr><td href="\ref CASendUnicastData()" tooltip="Retransmit Thread" bgcolor="gray">Retransmit Thread</td></tr>
                     <hr/>
@@ -108,7 +108,7 @@ digraph G {
 
 
         shape = none
-        margin = 0        
+        margin = 0
         label = <<table border="1" cellspacing="0" cellborder="0">
                     <tr><td href="\ref CAInitializeAdapters()" tooltip="Interface Controller" bgcolor="gray">Interface Controller</td></tr>
                     <hr/>
@@ -130,7 +130,7 @@ digraph G {
 
     conn_handler [
         shape = none
-        margin = 0        
+        margin = 0
         label = <<table border="1" cellspacing="0" cellborder="0">
                     <tr><td href="\ref CAConnectivityHandler_t" tooltip="CAConnectivityHandler_t" bgcolor="gray">CAConnectivityHandler_t</td></tr>
                     <hr/>
index 1be8651..115f424 100644 (file)
@@ -54,8 +54,6 @@ examples_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'connectivity
 if env.get('SECURED') == '1':
     examples_env.AppendUnique(LIBS = ['tinydtls'])
 
-examples_env.ParseConfig('pkg-config --libs glib-2.0');
-
 if target_os == 'android':
        examples_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
        examples_env.AppendUnique(LIBS = ['gnustl_static'])
index 8f18728..9932616 100644 (file)
@@ -48,9 +48,8 @@ if target_os in ['linux', 'tizen']:
 
                conf = Configure(lib_env)
 
-               if not conf.CheckLib('glib-2.0'):
-                       print 'Install glib-2 on ubuntu with the following command'
-                       print 'sudo apt-get install libglib2.0-dev'
+               if target_os in ['tizen'] and not conf.CheckLib('glib-2.0'):
+                       print 'Install glib-2.0 to compile on Tizen platforms'
                        Exit(1)
 
                conf.Finish()
index 7624233..51bc316 100644 (file)
@@ -29,7 +29,6 @@ target_os = env.get('TARGET_OS')
 src_dir = env.get('SRC_DIR')
 build_dir = env.get('BUILD_DIR')
 
-
 if target_os == 'linux':
        # Verify that 'google unit test' library is installed.  If not,
        # get it and install it
index 4ecda8a..35118f4 100644 (file)
@@ -55,7 +55,6 @@ unittests_env.PrependUnique(LIBS = [
 
 if env.get('SECURED') == '1':
     unittests_env.AppendUnique(LIBS = ['tinydtls'])
-unittests_env.ParseConfig('pkg-config --libs glib-2.0');
 
 if env.get('LOGGING'):
        unittests_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
index 74dd166..36ae8bc 100755 (executable)
@@ -21,15 +21,9 @@ notimgr_c_env.AppendUnique(LIBS = ['octbstack', 'oc_logger', 'connectivity_abstr
 
 if env.get('SECURED') == '1':
     notimgr_env.AppendUnique(LIBS = ['tinydtls'])
-notimgr_env.ParseConfig('pkg-config --libs glib-2.0')
-notimgr_env.ParseConfig('pkg-config --cflags glib-2.0')
+    notimgr_c_env.AppendUnique(LIBS = ['tinydtls'])
 if 'rt' in notimgr_env.get('LIBS'):
     notimgr_env.Append(LIBS = ['rt'])
-
-if env.get('SECURED') == '1':
-    notimgr_c_env.AppendUnique(LIBS = ['tinydtls'])
-notimgr_c_env.ParseConfig('pkg-config --libs glib-2.0')
-notimgr_c_env.ParseConfig('pkg-config --cflags glib-2.0')
 if 'rt' in notimgr_c_env.get('LIBS'):
     notimgr_c_env.Append(LIBS = ['rt'])
 
index 078522d..e30b177 100644 (file)
@@ -46,8 +46,6 @@ sample_env.AppendUnique(LIBS = ['oc', 'oc_logger', 'octbstack',
 if env.get('SECURED') == '1':
     sample_env.AppendUnique(LIBS = ['tinydtls'])
 
-sample_env.ParseConfig('pkg-config --libs glib-2.0')
-
 # On some platforms link order can miss functions so librt needs to be
 # re-scanned at the end if present. gcc 4.6 is one with this issue.
 if 'rt' in sample_env.get('LIBS'):
index 81ca47d..38e8f88 100644 (file)
@@ -156,7 +156,7 @@ ssmcore_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
 ssmcore_env.AppendUnique(LIBS = ['oc', 'octbstack', 'oc_logger',
             'connectivity_abstraction', 'coap'])
 
-if target_os not in ['android']:
+if target_os in ['tizen']:
        ssmcore_env.ParseConfig('pkg-config --libs glib-2.0');
 
 shared_libssmcore = ssmcore_env.SharedLibrary(
index 49b8dff..2400b34 100755 (executable)
@@ -25,7 +25,6 @@ linux_sample_env.AppendUnique(LIBS = ['pthread'])
 
 if env.get('SECURED') == '1':
     linux_sample_env.AppendUnique(LIBS = ['tinydtls'])
-linux_sample_env.ParseConfig('pkg-config --libs glib-2.0')
 
 # On some platforms link order can miss functions so librt needs to be
 # re-scanned at the end if present. gcc 4.6 is one with this issue.
index 39563c3..b7a0b4d 100644 (file)
@@ -50,8 +50,6 @@ linux_sample_env.AppendUnique(LIBS = ['dl'])
 if env.get('SECURED') == '1':
     linux_sample_env.AppendUnique(LIBS = ['tinydtls'])
 
-linux_sample_env.ParseConfig('pkg-config --libs glib-2.0')
-
 # On some platforms link order can miss functions so librt needs to be
 # re-scanned at the end if present. gcc 4.6 is one with this issue.
 if 'rt' in linux_sample_env.get('LIBS'):
index 6660356..78b6119 100644 (file)
@@ -25,8 +25,7 @@ linux_sample_env.AppendUnique(LIBS = ['pthread'])
 
 if env.get('SECURED') == '1':
     linux_sample_env.AppendUnique(LIBS = ['tinydtls'])
-linux_sample_env.ParseConfig('pkg-config --libs glib-2.0')
-
+#
 # On some platforms link order can miss functions so librt needs to be
 # re-scanned at the end if present. gcc 4.6 is one with this issue.
 if 'rt' in linux_sample_env.get('LIBS'):
index 1942933..6fc0eb9 100644 (file)
@@ -25,7 +25,6 @@ linux_sample_env.AppendUnique(LIBS = ['pthread'])
 
 if env.get('SECURED') == '1':
     linux_sample_env.AppendUnique(LIBS = ['tinydtls'])
-linux_sample_env.ParseConfig('pkg-config --libs glib-2.0')
 
 # On some platforms link order can miss functions so librt needs to be
 # re-scanned at the end if present. gcc 4.6 is one with this issue.
index 9e94029..f20cde8 100755 (executable)
@@ -25,7 +25,6 @@ linux_sample_env.AppendUnique(LIBS = ['pthread'])
 
 if env.get('SECURED') == '1':
     linux_sample_env.AppendUnique(LIBS = ['tinydtls'])
-linux_sample_env.ParseConfig('pkg-config --libs glib-2.0')
 
 # On some platforms link order can miss functions so librt needs to be
 # re-scanned at the end if present. gcc 4.6 is one with this issue.
index b768c08..c3332ce 100644 (file)
@@ -44,7 +44,6 @@ linux_sample_env.AppendUnique(LIBS = ['libTGMSDKLibrary', 'oc', 'octbstack',
                                       'libcoap', 'liboc_logger', 'dl', 'pthread'])
 if env.get('SECURED') == '1':
     linux_sample_env.AppendUnique(LIBS = ['tinydtls'])
-linux_sample_env.ParseConfig('pkg-config --libs glib-2.0')
 
 # On some platforms link order can miss functions so librt needs to be
 # re-scanned at the end if present. gcc 4.6 is one with this issue.
index 3d550ce..dd73a8a 100644 (file)
@@ -44,7 +44,6 @@ linux_sample_env.AppendUnique(LIBS = ['libTGMSDKLibrary', 'oc', 'octbstack',
                                       'libcoap', 'liboc_logger', 'dl', 'pthread'])
 if env.get('SECURED') == '1':
     linux_sample_env.AppendUnique(LIBS = ['tinydtls'])
-linux_sample_env.ParseConfig('pkg-config --libs glib-2.0')
 
 # On some platforms link order can miss functions so librt needs to be
 # re-scanned at the end if present. gcc 4.6 is one with this issue.
index 2a6546f..e4efebb 100644 (file)
@@ -24,8 +24,6 @@ linux_sample_env.AppendUnique(LIBS = ['libTGMSDKLibrary', 'oc', 'octbstack',
                                       'libcoap', 'liboc_logger', 'dl', 'pthread'])
 if env.get('SECURED') == '1':
     linux_sample_env.AppendUnique(LIBS = ['tinydtls'])
-linux_sample_env.ParseConfig('pkg-config --libs glib-2.0')
-
 
 # On some platforms link order can miss functions so librt needs to be
 # re-scanned at the end if present. gcc 4.6 is one with this issue.