1 /***************************************************************************
3 * Project ___| | | | _ \| |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
8 * Copyright (C) 2014 - 2016, Steve Holme, <steve_holme@hotmail.com>.
10 * This software is licensed as described in the file COPYING, which
11 * you should have received as part of this distribution. The terms
12 * are also available at https://curl.haxx.se/docs/copyright.html.
14 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 * copies of the Software, and permit persons to whom the Software is
16 * furnished to do so, under the terms of the COPYING file.
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
21 ***************************************************************************/
24 * @file curl_extensions.cpp
25 * @brief external API functions for DLP
28 #ifdef USE_TIZEN_FEATURE_DLP
30 #include <extensions/curl_extensions.h>
32 #define LIBRARY_PATH "/usr/lib/libcurl_extension_dlp.so.0"
34 static int first_run = 1;
35 static void (*tizen_dlp_init)(void) = NULL;
36 static void (*tizen_dlp_check_leak)(const char *, char * const, size_t) = NULL;
39 * @fn void curl_extensions_init(void)
40 * @brief Load the extension shared library looking for the function call
41 * symbols it going to use
44 static void curl_extensions_init(void)
47 void *handle = dlopen(LIBRARY_PATH, RTLD_LAZY);
49 tizen_dlp_init = dlsym(handle, "tizen_dlp_init");
50 tizen_dlp_check_leak = dlsym(handle, "tizen_dlp_check_leak");
59 void curl_extensions_tizen_dlp_init(void)
61 curl_extensions_init();
70 void curl_extensions_tizen_dlp_check_leak(const char *hostname, char * const mem, size_t len)
72 if(tizen_dlp_check_leak)
73 tizen_dlp_check_leak(hostname, mem, len);
75 #endif /* USE_TIZEN_FEATURE_DLP */