#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifndef OPENSSL_SYSNAME_WIN32
+#include <strings.h>
+#endif
#include <sys/types.h>
#include <ctype.h>
#include <errno.h>
int load_config(BIO *err, CONF *cnf)
{
+ static int load_config_called = 0;
+ if (load_config_called)
+ return 1;
+ load_config_called = 1;
if (!cnf)
cnf = config;
if (!cnf)
return p;
}
-static unsigned long index_serial_hash(const char **a)
+static unsigned long index_serial_hash(const CSTRING *a)
{
const char *n;
return(lh_strhash(n));
}
-static int index_serial_cmp(const char **a, const char **b)
+static int index_serial_cmp(const CSTRING *a, const CSTRING *b)
{
const char *aa,*bb;
static int index_name_qual(char **a)
{ return(a[0][0] == 'V'); }
-static unsigned long index_name_hash(const char **a)
+static unsigned long index_name_hash(const CSTRING *a)
{ return(lh_strhash(a[DB_name])); }
-int index_name_cmp(const char **a, const char **b)
- { return(strcmp(a[DB_name],
- b[DB_name])); }
+int index_name_cmp(const CSTRING *a, const CSTRING *b)
+ { return(strcmp(a[DB_name], b[DB_name])); }
-static IMPLEMENT_LHASH_HASH_FN(index_serial_hash,const char **)
-static IMPLEMENT_LHASH_COMP_FN(index_serial_cmp,const char **)
-static IMPLEMENT_LHASH_HASH_FN(index_name_hash,const char **)
-static IMPLEMENT_LHASH_COMP_FN(index_name_cmp,const char **)
+static IMPLEMENT_LHASH_HASH_FN(index_serial, CSTRING)
+static IMPLEMENT_LHASH_COMP_FN(index_serial, CSTRING)
+static IMPLEMENT_LHASH_HASH_FN(index_name, CSTRING)
+static IMPLEMENT_LHASH_COMP_FN(index_name, CSTRING)
#undef BSIZE
#define BSIZE 256
int index_index(CA_DB *db)
{
if (!TXT_DB_create_index(db->db, DB_serial, NULL,
- LHASH_HASH_FN(index_serial_hash),
- LHASH_COMP_FN(index_serial_cmp)))
+ LHASH_HASH_FN(index_serial),
+ LHASH_COMP_FN(index_serial)))
{
BIO_printf(bio_err,
"error creating serial number index:(%ld,%ld,%ld)\n",
if (db->attributes.unique_subject
&& !TXT_DB_create_index(db->db, DB_name, index_name_qual,
- LHASH_HASH_FN(index_name_hash),
- LHASH_COMP_FN(index_name_cmp)))
+ LHASH_HASH_FN(index_name),
+ LHASH_COMP_FN(index_name)))
{
BIO_printf(bio_err,"error creating name index:(%ld,%ld,%ld)\n",
db->db->error,db->db->arg1,db->db->arg2);
case 'y': /* yes */
case 'Y': /* YES */
case '1': /* 1 */
- ret = 0;
+ ret = 1;
break;
default:
ret = def;
return (ret);
}
-#elif defined(OPENSSL_SYSTEM_NETWARE)
+#elif defined(OPENSSL_SYS_NETWARE)
#include <time.h>
double app_tminterval(int stop,int usertime)
if (usertime) now = rus.tms_utime;
if (stop==TM_START) tmstart = now;
- else ret = (now - tmstart)/(double)sysconf(_SC_CLK_TCK);
+ else
+ {
+ long int tck = sysconf(_SC_CLK_TCK);
+ ret = (now - tmstart)/(double)tck;
+ }
return (ret);
}
struct timeval now;
static struct timeval tmstart;
- if (usertime) getrusage(RUSAGE_SELF,&rus), now = rus.ru_time;
+ if (usertime) getrusage(RUSAGE_SELF,&rus), now = rus.ru_utime;
else gettimeofday(&now,NULL);
if (stop==TM_START) tmstart = now;