16 #ifdef OPENSSL_SYS_VMS_DECC
17 # define OPENSSL_strcmp (int (*)(const char *,const char *))strcmp
19 # define OPENSSL_strcmp strcmp
29 typedef struct name_funcs_st
31 unsigned long (*hash_func)(
const char *name);
32 int (*cmp_func)(
const char *
a,
const char *
b);
46 static
unsigned long obj_name_hash(const
void *a_void);
48 static
int obj_name_cmp(const
void *a_void,const
void *b_void);
55 if (names_lh != NULL)
return(1);
59 return(names_lh != NULL);
63 int (*cmp_func)(
const char *,
const char *),
64 void (*
free_func)(
const char *,
int,
const char *))
70 if (name_funcs_stack == NULL)
76 if ((name_funcs_stack == NULL))
95 name_funcs->free_func = 0;
105 if (hash_func != NULL)
106 name_funcs->hash_func = hash_func;
107 if (cmp_func != NULL)
108 name_funcs->cmp_func = cmp_func;
115 static int obj_name_cmp(
const void *a_void,
const void *b_void)
124 if ((name_funcs_stack != NULL)
137 static unsigned long obj_name_hash(
const void *a_void)
160 if (name == NULL)
return(NULL);
164 type&= ~OBJ_NAME_ALIAS;
172 if (ret == NULL)
return(NULL);
173 if ((ret->
alias) && !alias)
175 if (++num > 10)
return(NULL);
193 type&= ~OBJ_NAME_ALIAS;
237 if (names_lh == NULL)
return(0);
269 static void do_all_fn_doall_arg(
const OBJ_NAME *name,
struct doall *d)
296 static void do_all_sorted_fn(
const OBJ_NAME *name,
void *d_)
306 static int do_all_sorted_cmp(
const void *n1_,
const void *n2_)
308 const OBJ_NAME *
const *n1=n1_;
309 const OBJ_NAME *
const *n2=n2_;
311 return strcmp((*n1)->name,(*n2)->name);
325 qsort((
void *)d.
names,d.
n,
sizeof *d.
names,do_all_sorted_cmp);
327 for(n=0 ; n < d.
n ; ++
n)
333 static int free_type;
335 static void names_lh_free_doall(OBJ_NAME *onp)
340 if (free_type < 0 || free_type == onp->type)
353 unsigned long down_load;
355 if (names_lh == NULL)
return;
367 name_funcs_stack = NULL;