synchronize with engine branch (some changes were done only
[oweals/openssl.git] / crypto / objects / o_names.c
index d654eb220ea8560dccccac09e5db0f43ba1d0611..dca988230e8c69ac4a382d8c2331ee23895bc5f2 100644 (file)
@@ -22,7 +22,7 @@ typedef struct name_funcs_st
 DECLARE_STACK_OF(NAME_FUNCS)
 IMPLEMENT_STACK_OF(NAME_FUNCS)
 
-STACK_OF(NAME_FUNCS) *name_funcs_stack;
+static STACK_OF(NAME_FUNCS) *name_funcs_stack;
 
 static unsigned long obj_name_hash(OBJ_NAME *a);
 static int obj_name_cmp(OBJ_NAME *a,OBJ_NAME *b);
@@ -36,8 +36,9 @@ int OBJ_NAME_init(void)
        return(names_lh != NULL);
        }
 
-int OBJ_NAME_new_index(unsigned long (*hash_func)(), int (*cmp_func)(),
-            void (*free_func)())
+int OBJ_NAME_new_index(unsigned long (*hash_func)(const char *),
+       int (*cmp_func)(const void *, const void *),
+       void (*free_func)(const char *, int, const char *))
        {
        int ret;
        int i;
@@ -59,7 +60,7 @@ int OBJ_NAME_new_index(unsigned long (*hash_func)(), int (*cmp_func)(),
        for (i=sk_NAME_FUNCS_num(name_funcs_stack); i<names_type_num; i++)
                {
                MemCheck_off();
-               name_funcs = Malloc(sizeof(NAME_FUNCS));
+               name_funcs = OPENSSL_malloc(sizeof(NAME_FUNCS));
                name_funcs->hash_func = lh_strhash;
                name_funcs->cmp_func = (int (*)())strcmp;
                name_funcs->free_func = 0; /* NULL is often declared to
@@ -156,7 +157,7 @@ int OBJ_NAME_add(const char *name, int type, const char *data)
        alias=type&OBJ_NAME_ALIAS;
        type&= ~OBJ_NAME_ALIAS;
 
-       onp=(OBJ_NAME *)Malloc(sizeof(OBJ_NAME));
+       onp=(OBJ_NAME *)OPENSSL_malloc(sizeof(OBJ_NAME));
        if (onp == NULL)
                {
                /* ERROR */
@@ -181,7 +182,7 @@ int OBJ_NAME_add(const char *name, int type, const char *data)
                        sk_NAME_FUNCS_value(name_funcs_stack,ret->type)
                                ->free_func(ret->name,ret->type,ret->data);
                        }
-               Free(ret);
+               OPENSSL_free(ret);
                }
        else
                {
@@ -216,7 +217,7 @@ int OBJ_NAME_remove(const char *name, int type)
                        sk_NAME_FUNCS_value(name_funcs_stack,ret->type)
                                ->free_func(ret->name,ret->type,ret->data);
                        }
-               Free(ret);
+               OPENSSL_free(ret);
                return(1);
                }
        else
@@ -238,7 +239,7 @@ static void names_lh_free(OBJ_NAME *onp, int type)
 
 static void name_funcs_free(NAME_FUNCS *ptr)
        {
-       Free(ptr);
+       OPENSSL_free(ptr);
        }
 
 void OBJ_NAME_cleanup(int type)