New compile time option -DCRYPTO_MDEBUG_THREAD.
[openssl.git] / crypto / crypto.h
index 0b35fc387615df07abc8e7ce5a5eae4034b998ca..8ad8c25e5a4a2d859613de7dacc1a3853c602ff9 100644 (file)
 extern "C" {
 #endif
 
+#ifndef NO_FP_API
+#include <stdio.h>
+#endif
+
 #include <openssl/stack.h>
 #include <openssl/opensslv.h>
 
+#ifdef CHARSET_EBCDIC
+#include <openssl/ebcdic.h>
+#endif
+
 /* Backward compatibility to SSLeay */
 /* This is more to be used to check the correct DLL is being used
  * in the MS world. */
@@ -94,13 +102,16 @@ extern "C" {
 #define        CRYPTO_LOCK_SSL_CTX             12
 #define        CRYPTO_LOCK_SSL_CERT            13
 #define        CRYPTO_LOCK_SSL_SESSION         14
-#define        CRYPTO_LOCK_SSL                 15
-#define        CRYPTO_LOCK_RAND                16
-#define        CRYPTO_LOCK_MALLOC              17
-#define        CRYPTO_LOCK_BIO                 18
-#define        CRYPTO_LOCK_BIO_GETHOSTBYNAME   19
-#define CRYPTO_LOCK_RSA_BLINDING       20
-#define        CRYPTO_NUM_LOCKS                21
+#define        CRYPTO_LOCK_SSL_SESS_CERT       15
+#define        CRYPTO_LOCK_SSL                 16
+#define        CRYPTO_LOCK_RAND                17
+#define        CRYPTO_LOCK_MALLOC              18
+#define        CRYPTO_LOCK_BIO                 19
+#define        CRYPTO_LOCK_GETHOSTBYNAME       20
+#define        CRYPTO_LOCK_GETSERVBYNAME       21
+#define        CRYPTO_LOCK_READDIR             22
+#define        CRYPTO_LOCK_RSA_BLINDING        23
+#define        CRYPTO_NUM_LOCKS                24
 
 #define CRYPTO_LOCK            1
 #define CRYPTO_UNLOCK          2
@@ -189,6 +200,21 @@ typedef struct crypto_ex_data_func_st
        (char *(*)())realloc,\
        (void (*)())free)
 
+#ifdef CRYPTO_MDEBUG_ALL
+# ifndef CRYPTO_MDEBUG_TIME
+#  define CRYPTO_MDEBUG_TIME
+# endif
+# ifndef CRYPTO_MDEBUG_THREAD
+#  define CRYPTO_MDEBUG_THREAD
+# endif
+#endif
+
+#if defined CRYPTO_MDEBUG_TIME || defined CRYPTO_MDEBUG_THREAD
+# ifndef CRYPTO_MDEBUG /* avoid duplicate #define */
+#  define CRYPTO_MDEBUG
+# endif
+#endif
+
 #ifdef CRYPTO_MDEBUG
 #define MemCheck_start() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON)
 #define MemCheck_stop()        CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_OFF)
@@ -227,11 +253,10 @@ typedef struct crypto_ex_data_func_st
 #endif /* MDEBUG */
 
 /* Case insensiteve linking causes problems.... */
-#ifdef WIN16
+#if defined(WIN16) || defined(VMS)
 #define ERR_load_CRYPTO_strings        ERR_load_CRYPTOlib_strings
 #endif
 
-#ifndef NOPROTO
 
 const char *SSLeay_version(int type);
 unsigned long SSLeay(void);
@@ -246,6 +271,8 @@ void CRYPTO_new_ex_data(STACK *meth, char *obj, CRYPTO_EX_DATA *ad);
 
 int CRYPTO_mem_ctrl(int mode);
 int CRYPTO_get_new_lockid(char *name);
+
+int CRYPTO_num_locks(void); /* return CRYPTO_NUM_LOCKS (shared libs!) */
 void CRYPTO_lock(int mode, int type,const char *file,int line);
 void CRYPTO_set_locking_callback(void (*func)(int mode,int type,
                                              const char *file,int line));
@@ -287,51 +314,6 @@ void CRYPTO_mem_leaks_cb(void (*cb)());
 
 void ERR_load_CRYPTO_strings(void );
 
-#else 
-
-int CRYPTO_get_ex_new_index();
-int CRYPTO_set_ex_data();
-char *CRYPTO_get_ex_data();
-int CRYPTO_dup_ex_data();
-void CRYPTO_free_ex_data();
-void CRYPTO_new_ex_data();
-
-int CRYPTO_mem_ctrl();
-char *SSLeay_version();
-unsigned long SSLeay();
-
-int CRYPTO_get_new_lockid();
-void CRYPTO_lock();
-void CRYPTO_set_locking_callback();
-void (*CRYPTO_get_locking_callback())();
-void CRYPTO_set_add_lock_callback();
-int (*CRYPTO_get_add_lock_callback())();
-void CRYPTO_set_id_callback();
-unsigned long (*CRYPTO_get_id_callback())();
-unsigned long CRYPTO_thread_id();
-const char *CRYPTO_get_lock_name();
-int CRYPTO_add_lock();
-
-void CRYPTO_set_mem_functions();
-void CRYPTO_get_mem_functions();
-void *CRYPTO_malloc();
-void *CRYPTO_realloc();
-void CRYPTO_free();
-void *CRYPTO_remalloc();
-void *CRYPTO_dbg_remalloc();
-void *CRYPTO_dbg_malloc();
-void *CRYPTO_dbg_realloc();
-void CRYPTO_dbg_free();
-#ifndef NO_FP_API
-void CRYPTO_mem_leaks_fp();
-#endif
-void CRYPTO_mem_leaks();
-void CRYPTO_mem_leaks_cb();
-
-void ERR_load_CRYPTO_strings();
-
-#endif
-
 /* BEGIN ERROR CODES */
 /* The following lines are auto generated by the script mkerr.pl. Any changes
  * made after this point may be overwritten when the script is next run.