#include <stdlib.h>
#include <string.h>
-#include "lhash.h"
-#include "objects.h"
+#include <openssl/lhash.h>
+#include <openssl/objects.h>
/* 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.
static unsigned long obj_name_hash(OBJ_NAME *a);
static int obj_name_cmp(OBJ_NAME *a,OBJ_NAME *b);
-int OBJ_NAME_init()
+int OBJ_NAME_init(void)
{
if (names_lh != NULL) return(1);
MemCheck_off();
return(names_lh != NULL);
}
-int OBJ_NAME_new_index(hash_func,cmp_func,free_func)
-unsigned long (*hash_func)();
-int (*cmp_func)();
-void (*free_func)();
+int OBJ_NAME_new_index(unsigned long (*hash_func)(), int (*cmp_func)(),
+ void (*free_func)())
{
int ret;
int i;
return(ret);
}
-static int obj_name_cmp(a,b)
-OBJ_NAME *a;
-OBJ_NAME *b;
+static int obj_name_cmp(OBJ_NAME *a, OBJ_NAME *b)
{
int ret;
int (*cmp)();
return(ret);
}
-static unsigned long obj_name_hash(a)
-OBJ_NAME *a;
+static unsigned long obj_name_hash(OBJ_NAME *a)
{
unsigned long ret;
unsigned long (*hash)();
return(ret);
}
-char *OBJ_NAME_get(name,type)
-char *name;
-int type;
+const char *OBJ_NAME_get(const char *name, int type)
{
OBJ_NAME on,*ret;
int num=0,alias;
}
}
-int OBJ_NAME_add(name,type,data)
-char *name;
-int type;
-char *data;
+int OBJ_NAME_add(const char *name, int type, const char *data)
{
void (*f)();
OBJ_NAME *onp,*ret;
return(1);
}
-int OBJ_NAME_remove(name,type)
-char *name;
-int type;
+int OBJ_NAME_remove(const char *name, int type)
{
OBJ_NAME on,*ret;
void (*f)();
static int free_type;
-static void names_lh_free(onp,type)
-OBJ_NAME *onp;
- {
+static void names_lh_free(OBJ_NAME *onp, int type)
+{
+ if(onp == NULL)
+ return;
+
if ((free_type < 0) || (free_type == onp->type))
{
OBJ_NAME_remove(onp->name,onp->type);
}
}
-void OBJ_NAME_cleanup(type)
-int type;
+void OBJ_NAME_cleanup(int type)
{
unsigned long down_load;