Use util/mklink.pl instead of util/mklink.sh.
[openssl.git] / crypto / objects / o_names.c
index 8995869587b485dcdb0caa66dad675179388c7c0..22edb0e6800b2732821d5e3111296bf978dc4a01 100644 (file)
@@ -2,8 +2,8 @@
 #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.
@@ -17,7 +17,7 @@ static STACK *names_free=NULL;
 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();
@@ -26,10 +26,8 @@ int OBJ_NAME_init()
        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;
@@ -66,9 +64,7 @@ void (*free_func)();
        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)();
@@ -87,8 +83,7 @@ OBJ_NAME *b;
        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)();
@@ -106,9 +101,7 @@ OBJ_NAME *a;
        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;
@@ -138,10 +131,7 @@ int type;
                }
        }
 
-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;
@@ -186,9 +176,7 @@ char *data;
        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)();
@@ -216,17 +204,18 @@ int type;
 
 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;