polarssl/mbedtls: fix name space pollution

Global private symbols MUST start with Curl_!
This commit is contained in:
Daniel Stenberg 2015-10-23 16:14:29 +02:00
parent 6288cb9304
commit 03b6e07816
5 changed files with 34 additions and 34 deletions

View File

@ -72,12 +72,12 @@ static int entropy_init_initialized = 0;
static void entropy_init_mutex(mbedtls_entropy_context *ctx) static void entropy_init_mutex(mbedtls_entropy_context *ctx)
{ {
/* lock 0 = entropy_init_mutex() */ /* lock 0 = entropy_init_mutex() */
polarsslthreadlock_lock_function(0); Curl_polarsslthreadlock_lock_function(0);
if(entropy_init_initialized == 0) { if(entropy_init_initialized == 0) {
mbedtls_entropy_init(ctx); mbedtls_entropy_init(ctx);
entropy_init_initialized = 1; entropy_init_initialized = 1;
} }
polarsslthreadlock_unlock_function(0); Curl_polarsslthreadlock_unlock_function(0);
} }
/* end of entropy_init_mutex() */ /* end of entropy_init_mutex() */
@ -86,9 +86,9 @@ static int entropy_func_mutex(void *data, unsigned char *output, size_t len)
{ {
int ret; int ret;
/* lock 1 = entropy_func_mutex() */ /* lock 1 = entropy_func_mutex() */
polarsslthreadlock_lock_function(1); Curl_polarsslthreadlock_lock_function(1);
ret = mbedtls_entropy_func(data, output, len); ret = mbedtls_entropy_func(data, output, len);
polarsslthreadlock_unlock_function(1); Curl_polarsslthreadlock_unlock_function(1);
return ret; return ret;
} }
@ -765,12 +765,12 @@ Curl_mbedtls_connect(struct connectdata *conn,
*/ */
int mbedtls_init(void) int mbedtls_init(void)
{ {
return polarsslthreadlock_thread_setup(); return Curl_polarsslthreadlock_thread_setup();
} }
void mbedtls_cleanup(void) void mbedtls_cleanup(void)
{ {
(void)polarsslthreadlock_thread_cleanup(); (void)Curl_polarsslthreadlock_thread_cleanup();
} }
#endif /* USE_MBEDTLS */ #endif /* USE_MBEDTLS */

View File

@ -5,8 +5,8 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 2010 - 2011, Hoi-Ho Chan, <hoiho.chan@gmail.com>
* Copyright (C) 2012 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 2012 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 2010 - 2011, Hoi-Ho Chan, <hoiho.chan@gmail.com>
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -74,12 +74,12 @@ static int entropy_init_initialized = 0;
static void entropy_init_mutex(entropy_context *ctx) static void entropy_init_mutex(entropy_context *ctx)
{ {
/* lock 0 = entropy_init_mutex() */ /* lock 0 = entropy_init_mutex() */
polarsslthreadlock_lock_function(0); Curl_polarsslthreadlock_lock_function(0);
if(entropy_init_initialized == 0) { if(entropy_init_initialized == 0) {
entropy_init(ctx); entropy_init(ctx);
entropy_init_initialized = 1; entropy_init_initialized = 1;
} }
polarsslthreadlock_unlock_function(0); Curl_polarsslthreadlock_unlock_function(0);
} }
/* end of entropy_init_mutex() */ /* end of entropy_init_mutex() */
@ -88,9 +88,9 @@ static int entropy_func_mutex(void *data, unsigned char *output, size_t len)
{ {
int ret; int ret;
/* lock 1 = entropy_func_mutex() */ /* lock 1 = entropy_func_mutex() */
polarsslthreadlock_lock_function(1); Curl_polarsslthreadlock_lock_function(1);
ret = entropy_func(data, output, len); ret = entropy_func(data, output, len);
polarsslthreadlock_unlock_function(1); Curl_polarsslthreadlock_unlock_function(1);
return ret; return ret;
} }
@ -740,14 +740,14 @@ Curl_polarssl_connect(struct connectdata *conn,
* return 0 error initializing SSL * return 0 error initializing SSL
* return 1 SSL initialized successfully * return 1 SSL initialized successfully
*/ */
int polarssl_init(void) int Curl_polarssl_init(void)
{ {
return polarsslthreadlock_thread_setup(); return Curl_polarsslthreadlock_thread_setup();
} }
void polarssl_cleanup(void) void Curl_polarssl_cleanup(void)
{ {
(void)polarsslthreadlock_thread_cleanup(); (void)Curl_polarsslthreadlock_thread_cleanup();
} }
#endif /* USE_POLARSSL */ #endif /* USE_POLARSSL */

View File

@ -7,8 +7,8 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 2010, Hoi-Ho Chan, <hoiho.chan@gmail.com>
* Copyright (C) 2012 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 2012 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 2010, Hoi-Ho Chan, <hoiho.chan@gmail.com>
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -27,8 +27,8 @@
#ifdef USE_POLARSSL #ifdef USE_POLARSSL
/* Called on first use PolarSSL, setup threading if supported */ /* Called on first use PolarSSL, setup threading if supported */
int polarssl_init(void); int Curl_polarssl_init(void);
void polarssl_cleanup(void); void Curl_polarssl_cleanup(void);
CURLcode Curl_polarssl_connect(struct connectdata *conn, int sockindex); CURLcode Curl_polarssl_connect(struct connectdata *conn, int sockindex);
@ -51,8 +51,8 @@ int Curl_polarssl_shutdown(struct connectdata *conn, int sockindex);
#define have_curlssl_ca_path 1 #define have_curlssl_ca_path 1
/* API setup for PolarSSL */ /* API setup for PolarSSL */
#define curlssl_init() polarssl_init() #define curlssl_init() Curl_polarssl_init()
#define curlssl_cleanup() polarssl_cleanup() #define curlssl_cleanup() Curl_polarssl_cleanup()
#define curlssl_connect Curl_polarssl_connect #define curlssl_connect Curl_polarssl_connect
#define curlssl_connect_nonblocking Curl_polarssl_connect_nonblocking #define curlssl_connect_nonblocking Curl_polarssl_connect_nonblocking
#define curlssl_session_free(x) Curl_polarssl_session_free(x) #define curlssl_session_free(x) Curl_polarssl_session_free(x)

View File

@ -5,8 +5,8 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 2013-2015, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 2010, 2011, Hoi-Ho Chan, <hoiho.chan@gmail.com> * Copyright (C) 2010, 2011, Hoi-Ho Chan, <hoiho.chan@gmail.com>
* Copyright (C) 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -47,7 +47,7 @@
/* This array will store all of the mutexes available to PolarSSL. */ /* This array will store all of the mutexes available to PolarSSL. */
static POLARSSL_MUTEX_T *mutex_buf = NULL; static POLARSSL_MUTEX_T *mutex_buf = NULL;
int polarsslthreadlock_thread_setup(void) int Curl_polarsslthreadlock_thread_setup(void)
{ {
int i; int i;
int ret; int ret;
@ -73,7 +73,7 @@ int polarsslthreadlock_thread_setup(void)
return 1; /* OK */ return 1; /* OK */
} }
int polarsslthreadlock_thread_cleanup(void) int Curl_polarsslthreadlock_thread_cleanup(void)
{ {
int i; int i;
int ret; int ret;
@ -100,7 +100,7 @@ int polarsslthreadlock_thread_cleanup(void)
return 1; /* OK */ return 1; /* OK */
} }
int polarsslthreadlock_lock_function(int n) int Curl_polarsslthreadlock_lock_function(int n)
{ {
int ret; int ret;
#ifdef HAVE_PTHREAD_H #ifdef HAVE_PTHREAD_H
@ -125,7 +125,7 @@ int polarsslthreadlock_lock_function(int n)
return 1; /* OK */ return 1; /* OK */
} }
int polarsslthreadlock_unlock_function(int n) int Curl_polarsslthreadlock_unlock_function(int n)
{ {
int ret; int ret;
#ifdef HAVE_PTHREAD_H #ifdef HAVE_PTHREAD_H

View File

@ -7,8 +7,8 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 2013-2015, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 2010, Hoi-Ho Chan, <hoiho.chan@gmail.com> * Copyright (C) 2010, Hoi-Ho Chan, <hoiho.chan@gmail.com>
* Copyright (C) 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -34,17 +34,17 @@
#if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32) #if defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32)
int polarsslthreadlock_thread_setup(void); int Curl_polarsslthreadlock_thread_setup(void);
int polarsslthreadlock_thread_cleanup(void); int Curl_polarsslthreadlock_thread_cleanup(void);
int polarsslthreadlock_lock_function(int n); int Curl_polarsslthreadlock_lock_function(int n);
int polarsslthreadlock_unlock_function(int n); int Curl_polarsslthreadlock_unlock_function(int n);
#else #else
#define polarsslthreadlock_thread_setup() 1 #define Curl_polarsslthreadlock_thread_setup() 1
#define polarsslthreadlock_thread_cleanup() 1 #define Curl_polarsslthreadlock_thread_cleanup() 1
#define polarsslthreadlock_lock_function(x) 1 #define Curl_polarsslthreadlock_lock_function(x) 1
#define polarsslthreadlock_unlock_function(x) 1 #define Curl_polarsslthreadlock_unlock_function(x) 1
#endif /* USE_THREADS_POSIX || USE_THREADS_WIN32 */ #endif /* USE_THREADS_POSIX || USE_THREADS_WIN32 */