static unsigned long hash(CONF_VALUE *v);
static int cmp_conf(CONF_VALUE *a,CONF_VALUE *b);
+static IMPLEMENT_LHASH_HASH_FN(hash, CONF_VALUE *)
+static IMPLEMENT_LHASH_COMP_FN(cmp_conf, CONF_VALUE *)
+
/* Up until OpenSSL 0.9.5a, this was get_section */
CONF_VALUE *_CONF_get_section(CONF *conf, char *section)
{
return 0;
}
if (conf->data == NULL)
- if ((conf->data = lh_new((LHASH_HASH_FN_TYPE)hash,
- (LHASH_COMP_FN_TYPE)cmp_conf)) == NULL)
+ if ((conf->data = lh_new(LHASH_HASH_FN(hash),
+ LHASH_COMP_FN(cmp_conf))) == NULL)
{
return 0;
}
static int pid_cmp(ERR_STATE *a,ERR_STATE *pid);
static unsigned long get_error_values(int inc,const char **file,int *line,
const char **data,int *flags);
+
+static IMPLEMENT_LHASH_HASH_FN(err_hash, ERR_STRING_DATA *)
+static IMPLEMENT_LHASH_COMP_FN(err_cmp, ERR_STRING_DATA *)
+static IMPLEMENT_LHASH_HASH_FN(pid_hash, ERR_STATE *)
+static IMPLEMENT_LHASH_COMP_FN(pid_cmp, ERR_STATE *)
+
static void ERR_STATE_free(ERR_STATE *s);
#ifndef NO_ERR
static ERR_STRING_DATA ERR_str_libraries[]=
if (error_hash == NULL)
{
CRYPTO_w_lock(CRYPTO_LOCK_ERR_HASH);
- error_hash=lh_new((LHASH_HASH_FN_TYPE)err_hash,
- (LHASH_COMP_FN_TYPE)err_cmp);
+ error_hash=lh_new(LHASH_HASH_FN(err_hash),
+ LHASH_COMP_FN(err_cmp));
if (error_hash == NULL)
{
CRYPTO_w_unlock(CRYPTO_LOCK_ERR_HASH);
/* no entry yet in thread_hash for current thread -
* thus, it may have changed since we last looked at it */
if (thread_hash == NULL)
- thread_hash = lh_new((LHASH_HASH_FN_TYPE)pid_hash,
- (LHASH_COMP_FN_TYPE)pid_cmp);
+ thread_hash = lh_new(LHASH_HASH_FN(pid_hash),
+ LHASH_COMP_FN(pid_cmp));
if (thread_hash == NULL)
thread_state_exists = 0; /* allocation error */
else
return(ret);
}
+static IMPLEMENT_LHASH_HASH_FN(mem_hash, MEM *)
+static IMPLEMENT_LHASH_COMP_FN(mem_cmp, MEM *)
+
static int app_info_cmp(APP_INFO *a, APP_INFO *b)
{
return(a->thread != b->thread);
return(ret);
}
+static IMPLEMENT_LHASH_HASH_FN(app_info_hash, APP_INFO *)
+static IMPLEMENT_LHASH_COMP_FN(app_info_cmp, APP_INFO *)
+
static APP_INFO *pop_info(void)
{
APP_INFO tmp;
}
if (amih == NULL)
{
- if ((amih=lh_new((LHASH_HASH_FN_TYPE)app_info_hash,
- (LHASH_COMP_FN_TYPE)app_info_cmp)) == NULL)
+ if ((amih=lh_new(LHASH_HASH_FN(app_info_hash),
+ LHASH_COMP_FN(app_info_cmp))) == NULL)
{
OPENSSL_free(ami);
ret=0;
}
if (mh == NULL)
{
- if ((mh=lh_new((LHASH_HASH_FN_TYPE)mem_hash,
- (LHASH_COMP_FN_TYPE)mem_cmp)) == NULL)
+ if ((mh=lh_new(LHASH_HASH_FN(mem_hash),
+ LHASH_COMP_FN(mem_cmp))) == NULL)
{
OPENSSL_free(addr);
OPENSSL_free(m);
static unsigned long obj_name_hash(OBJ_NAME *a);
static int obj_name_cmp(OBJ_NAME *a,OBJ_NAME *b);
+static IMPLEMENT_LHASH_HASH_FN(obj_name_hash, OBJ_NAME *)
+static IMPLEMENT_LHASH_COMP_FN(obj_name_cmp, OBJ_NAME *)
+
int OBJ_NAME_init(void)
{
if (names_lh != NULL) return(1);
MemCheck_off();
- names_lh=lh_new((LHASH_HASH_FN_TYPE)obj_name_hash,
- (LHASH_COMP_FN_TYPE)obj_name_cmp);
+ names_lh=lh_new(LHASH_HASH_FN(obj_name_hash),
+ LHASH_COMP_FN(obj_name_cmp));
MemCheck_on();
return(names_lh != NULL);
}
return(1); /* should not get here */
}
+static IMPLEMENT_LHASH_HASH_FN(add_hash, ADDED_OBJ *)
+static IMPLEMENT_LHASH_COMP_FN(add_cmp, ADDED_OBJ *)
+
static int init_added(void)
{
if (added != NULL) return(1);
- added=lh_new((LHASH_HASH_FN_TYPE)add_hash,(LHASH_COMP_FN_TYPE)add_cmp);
+ added=lh_new(LHASH_HASH_FN(add_hash),LHASH_COMP_FN(add_cmp));
return(added != NULL);
}
return(memcmp(a->session_id,b->session_id,a->session_id_length));
}
+static IMPLEMENT_LHASH_HASH_FN(SSL_SESSION_hash, SSL_SESSION *)
+static IMPLEMENT_LHASH_COMP_FN(SSL_SESSION_cmp, SSL_SESSION *)
+
SSL_CTX *SSL_CTX_new(SSL_METHOD *meth)
{
SSL_CTX *ret=NULL;
ret->default_passwd_callback_userdata=NULL;
ret->client_cert_cb=NULL;
- ret->sessions=lh_new((LHASH_HASH_FN_TYPE)SSL_SESSION_hash,
- (LHASH_COMP_FN_TYPE)SSL_SESSION_cmp);
+ ret->sessions=lh_new(LHASH_HASH_FN(SSL_SESSION_hash),
+ LHASH_COMP_FN(SSL_SESSION_cmp));
if (ret->sessions == NULL) goto err;
ret->cert_store=X509_STORE_new();
if (ret->cert_store == NULL) goto err;