#include <openssl/objects.h>
#include <openssl/safestack.h>
#include <openssl/e_os2.h>
+#include "obj_lcl.h"
/*
* Later versions of DEC C has started to add lnkage information to certain
* I use the ex_data stuff to manage the identifiers for the obj_name_types
* that applications may define. I only really use the free function field.
*/
-DECLARE_LHASH_OF(OBJ_NAME);
static LHASH_OF(OBJ_NAME) *names_lh = NULL;
static int names_type_num = OBJ_NAME_TYPE_NUM;
-typedef struct name_funcs_st {
+struct name_funcs_st {
unsigned long (*hash_func) (const char *name);
int (*cmp_func) (const char *a, const char *b);
void (*free_func) (const char *, int, const char *);
-} NAME_FUNCS;
-
-DECLARE_STACK_OF(NAME_FUNCS)
+};
static STACK_OF(NAME_FUNCS) *name_funcs_stack;
{
if (names_lh != NULL)
return (1);
- MemCheck_off();
+ CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
names_lh = lh_OBJ_NAME_new();
- MemCheck_on();
+ CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
return (names_lh != NULL);
}
NAME_FUNCS *name_funcs;
if (name_funcs_stack == NULL) {
- MemCheck_off();
+ CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
name_funcs_stack = sk_NAME_FUNCS_new_null();
- MemCheck_on();
+ CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
}
if (name_funcs_stack == NULL) {
/* ERROR */
ret = names_type_num;
names_type_num++;
for (i = sk_NAME_FUNCS_num(name_funcs_stack); i < names_type_num; i++) {
- MemCheck_off();
+ CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
name_funcs = OPENSSL_zalloc(sizeof(*name_funcs));
- MemCheck_on();
+ CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
if (name_funcs == NULL) {
OBJerr(OBJ_F_OBJ_NAME_NEW_INDEX, ERR_R_MALLOC_FAILURE);
return (0);
}
name_funcs->hash_func = lh_strhash;
name_funcs->cmp_func = OPENSSL_strcmp;
- MemCheck_off();
+ CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
sk_NAME_FUNCS_push(name_funcs_stack, name_funcs);
- MemCheck_on();
+ CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
}
name_funcs = sk_NAME_FUNCS_value(name_funcs_stack, ret);
if (hash_func != NULL)
return;
free_type = type;
- down_load = lh_OBJ_NAME_down_load(names_lh);
- lh_OBJ_NAME_down_load(names_lh) = 0;
+ down_load = lh_OBJ_NAME_get_down_load(names_lh);
+ lh_OBJ_NAME_set_down_load(names_lh, 0);
lh_OBJ_NAME_doall(names_lh, LHASH_DOALL_FN(names_lh_free));
if (type < 0) {
names_lh = NULL;
name_funcs_stack = NULL;
} else
- lh_OBJ_NAME_down_load(names_lh) = down_load;
+ lh_OBJ_NAME_set_down_load(names_lh, down_load);
}