summaryrefslogtreecommitdiff
path: root/lib/libcrypto/txt_db
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>1999-09-29 04:37:45 +0000
committerBob Beck <beck@cvs.openbsd.org>1999-09-29 04:37:45 +0000
commitca679cff5e2a72ad205119c981e695c8cc640970 (patch)
tree691368331190f762b9f484d059ec119620396521 /lib/libcrypto/txt_db
parent30902ef04e4a800063b5f4afdbf1732ad34aa6b3 (diff)
OpenSSL 0.9.4 merge
Diffstat (limited to 'lib/libcrypto/txt_db')
-rw-r--r--lib/libcrypto/txt_db/Makefile.ssl36
-rw-r--r--lib/libcrypto/txt_db/txt_db.c39
-rw-r--r--lib/libcrypto/txt_db/txt_db.h16
3 files changed, 37 insertions, 54 deletions
diff --git a/lib/libcrypto/txt_db/Makefile.ssl b/lib/libcrypto/txt_db/Makefile.ssl
index 76e511534f1..552ea5580f1 100644
--- a/lib/libcrypto/txt_db/Makefile.ssl
+++ b/lib/libcrypto/txt_db/Makefile.ssl
@@ -7,9 +7,11 @@ TOP= ../..
CC= cc
INCLUDES=
CFLAG=-g
+INSTALL_PREFIX=
+OPENSSLDIR= /usr/local/ssl
INSTALLTOP=/usr/local/ssl
MAKE= make -f Makefile.ssl
-MAKEDEPEND= makedepend -f Makefile.ssl
+MAKEDEPEND= $(TOP)/util/domd $(TOP)
MAKEFILE= Makefile.ssl
AR= ar r
@@ -37,24 +39,23 @@ all: lib
lib: $(LIBOBJ)
$(AR) $(LIB) $(LIBOBJ)
- sh $(TOP)/util/ranlib.sh $(LIB)
+ $(RANLIB) $(LIB)
@touch lib
files:
- perl $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
+ $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
links:
- /bin/rm -f Makefile
- $(TOP)/util/point.sh Makefile.ssl Makefile ;
- $(TOP)/util/mklink.sh ../../include $(EXHEADER)
- $(TOP)/util/mklink.sh ../../test $(TEST)
- $(TOP)/util/mklink.sh ../../apps $(APPS)
+ @$(TOP)/util/point.sh Makefile.ssl Makefile
+ @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
+ @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
+ @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
install:
@for i in $(EXHEADER) ; \
do \
- (cp $$i $(INSTALLTOP)/include/$$i; \
- chmod 644 $(INSTALLTOP)/include/$$i ); \
+ (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
+ chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
done;
tags:
@@ -66,15 +67,20 @@ lint:
lint -DLINT $(INCLUDES) $(SRC)>fluff
depend:
- $(MAKEDEPEND) $(INCLUDES) $(PROGS) $(LIBSRC)
+ $(MAKEDEPEND) $(INCLUDES) $(DEPFLAG) $(PROGS) $(LIBSRC)
dclean:
- perl -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
+ $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
mv -f Makefile.new $(MAKEFILE)
clean:
- /bin/rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
-
-errors:
+ rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+txt_db.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
+txt_db.o: ../../include/openssl/crypto.h ../../include/openssl/e_os.h
+txt_db.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
+txt_db.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
+txt_db.o: ../../include/openssl/opensslv.h ../../include/openssl/stack.h
+txt_db.o: ../../include/openssl/txt_db.h ../cryptlib.h
diff --git a/lib/libcrypto/txt_db/txt_db.c b/lib/libcrypto/txt_db/txt_db.c
index e34ce4efa9d..9a9fa5ce557 100644
--- a/lib/libcrypto/txt_db/txt_db.c
+++ b/lib/libcrypto/txt_db/txt_db.c
@@ -60,17 +60,15 @@
#include <stdlib.h>
#include <string.h>
#include "cryptlib.h"
-#include "buffer.h"
-#include "txt_db.h"
+#include <openssl/buffer.h>
+#include <openssl/txt_db.h>
#undef BUFSIZE
#define BUFSIZE 512
-char *TXT_DB_version="TXT_DB part of SSLeay 0.9.0b 29-Jun-1998";
+const char *TXT_DB_version="TXT_DB" OPENSSL_VERSION_PTEXT;
-TXT_DB *TXT_DB_read(in,num)
-BIO *in;
-int num;
+TXT_DB *TXT_DB_read(BIO *in, int num)
{
TXT_DB *ret=NULL;
int er=1;
@@ -158,7 +156,7 @@ int num;
if ((n != num) || (*f != '\0'))
{
#if !defined(NO_STDIO) && !defined(WIN16) /* temporaty fix :-( */
- fprintf(stderr,"wrong number of fields on line %ld\n",ln);
+ fprintf(stderr,"wrong number of fields on line %ld (looking for field %d, got %d, '%s' left)\n",ln,num,n,f);
#endif
er=2;
goto err;
@@ -191,10 +189,7 @@ err:
return(ret);
}
-char **TXT_DB_get_by_index(db,idx,value)
-TXT_DB *db;
-int idx;
-char **value;
+char **TXT_DB_get_by_index(TXT_DB *db, int idx, char **value)
{
char **ret;
LHASH *lh;
@@ -215,12 +210,8 @@ char **value;
return(ret);
}
-int TXT_DB_create_index(db,field,qual,hash,cmp)
-TXT_DB *db;
-int field;
-int (*qual)();
-unsigned long (*hash)();
-int (*cmp)();
+int TXT_DB_create_index(TXT_DB *db, int field, int (*qual)(),
+ unsigned long (*hash)(), int (*cmp)())
{
LHASH *idx;
char *r;
@@ -256,9 +247,7 @@ int (*cmp)();
return(1);
}
-long TXT_DB_write(out,db)
-BIO *out;
-TXT_DB *db;
+long TXT_DB_write(BIO *out, TXT_DB *db)
{
long i,j,n,nn,l,tot=0;
char *p,**pp,*f;
@@ -306,9 +295,7 @@ err:
return(ret);
}
-int TXT_DB_insert(db,row)
-TXT_DB *db;
-char **row;
+int TXT_DB_insert(TXT_DB *db, char **row)
{
int i;
char **r;
@@ -350,12 +337,14 @@ err:
return(0);
}
-void TXT_DB_free(db)
-TXT_DB *db;
+void TXT_DB_free(TXT_DB *db)
{
int i,n;
char **p,*max;
+ if(db == NULL)
+ return;
+
if (db->index != NULL)
{
for (i=db->num_fields-1; i>=0; i--)
diff --git a/lib/libcrypto/txt_db/txt_db.h b/lib/libcrypto/txt_db/txt_db.h
index aca6dae393d..58b9de13532 100644
--- a/lib/libcrypto/txt_db/txt_db.h
+++ b/lib/libcrypto/txt_db/txt_db.h
@@ -63,8 +63,8 @@
extern "C" {
#endif
-#include "stack.h"
-#include "lhash.h"
+#include <openssl/stack.h>
+#include <openssl/lhash.h>
#define DB_ERROR_OK 0
#define DB_ERROR_MALLOC 1
@@ -85,7 +85,6 @@ typedef struct txt_db_st
char **arg_row;
} TXT_DB;
-#ifndef NOPROTO
#ifdef HEADER_BIO_H
TXT_DB *TXT_DB_read(BIO *in, int num);
long TXT_DB_write(BIO *out, TXT_DB *db);
@@ -99,17 +98,6 @@ void TXT_DB_free(TXT_DB *db);
char **TXT_DB_get_by_index(TXT_DB *db, int idx, char **value);
int TXT_DB_insert(TXT_DB *db,char **value);
-#else
-
-TXT_DB *TXT_DB_read();
-long TXT_DB_write();
-int TXT_DB_create_index();
-void TXT_DB_free();
-char **TXT_DB_get_by_index();
-int TXT_DB_insert();
-
-#endif
-
#ifdef __cplusplus
}
#endif