From e150e51a7e20a902e9fd2f11f00811f94f67d529 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 30 Nov 1999 13:48:03 +0000 Subject: [PATCH] Improved installation. Updated for inclusion of YAZ header files. --- Makefile.in | 33 +++- bfile/Makefile.in | 6 +- configure | 423 +++++++++++++++------------------------------------ configure.in | 58 ++++--- dfa/Makefile.in | 6 +- dict/Makefile.in | 6 +- dict/dcompact.c | 7 +- include/charmap.h | 7 +- include/dict.h | 7 +- include/recctrl.h | 13 +- include/zebramap.h | 7 +- include/zebrautl.h | 8 +- include/zebraver.h | 12 +- index/Makefile.in | 51 ++++--- index/apitest.c | 4 +- index/attribute.c | 7 +- index/index.h | 20 ++- index/invstat.c | 145 +++++++----------- index/kcompare.c | 35 ++--- index/kinput.c | 186 ++++++++-------------- index/main.c | 7 +- index/sortidx.c | 7 +- index/trunc.c | 70 +++++---- index/zebraapi.c | 45 +++--- index/zebraapi.h | 11 +- index/zinfo.h | 7 +- index/zrpn.c | 17 ++- index/zserver.c | 7 +- index/zserver.h | 13 +- isam/Makefile.in | 6 +- isam/physical.c | 7 +- isamc/Makefile.in | 10 +- isamc/isamc.c | 7 +- isamc/isamd.c | 11 +- isamc/merge-d.c | 9 +- isamc/merge.c | 312 +------------------------------------ recctrl/Makefile.in | 8 +- recctrl/grsread.h | 7 +- recctrl/marcread.c | 11 +- recctrl/recgrs.c | 9 +- recctrl/regxread.c | 7 +- recctrl/sgmlread.c | 7 +- rset/Makefile.in | 8 +- rset/rsisam.c | 10 +- rset/rsisamc.c | 10 +- rset/rsm_or.c | 10 +- test/gils/test.sh | 4 +- test/gils/zebra.cfg | 4 +- util/Makefile.in | 6 +- util/charmap.c | 7 +- util/passwddb.c | 9 +- util/res.c | 9 +- util/zebramap.c | 7 +- 53 files changed, 659 insertions(+), 1061 deletions(-) diff --git a/Makefile.in b/Makefile.in index 9f7fdc7..acc4abc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ # Copyright (C) 1994-1999, Index Data # All rights reserved. # Sebastian Hammer, Adam Dickmeiss -# $Id: Makefile.in,v 1.6 1999-06-09 11:58:48 adam Exp $ +# $Id: Makefile.in,v 1.7 1999-11-30 13:48:03 adam Exp $ SHELL=/bin/sh MAKE=make @@ -11,9 +11,9 @@ CPP=@CPP@ CDEFS=@DEFS@ @ODEFS@ # Where are Yaz libraries located? -YAZLIB=../../yaz/lib/libyaz.a +YAZLIB=@YAZLIB@ # Where are Yaz header files located? -YAZINC=-I../../yaz/include +YAZINC=@YAZINC@ # If Yaz is compiled with mosi support uncomment and specify. #OSILIB=../../xtimosi/src/libmosi.a ../../yaz/lib/librfc.a @@ -25,8 +25,22 @@ TCL_LIB=@TCL_LIB@ LIBS=@LIBS@ prefix=@prefix@ +exec_prefix=@exec_prefix@ -SUBDIR=util bfile dfa dict isamc isam rset recctrl index +INSTALL=@INSTALL@ +INSTALL_PROGRAM=@INSTALL_PROGRAM@ +INSTALL_DATA=@INSTALL_DATA@ + +BUILD=@build_root@ +BINDIR=$(exec_prefix)/bin +# Public libraries and header files +LIBDIR=$(exec_prefix)/lib +INCDIR=$(prefix)/include +# Misc tables, etc. +ZEBRADIR=$(prefix)/lib/zebra +ZEBRATAB=$(prefix)/lib/zebra/tab + +SUBDIR=util bfile dfa dict isams isamc isam rset recctrl index all: for i in $(SUBDIR); do cd $$i; if $(MAKE) OSILIB="$(OSILIB)" YAZLIB="$(YAZLIB)" YAZINC="$(YAZINC)" RANLIB="$(RANLIB)" CDEFS="$(CDEFS)" LIBS="$(LIBS)" CFLAGS="$(CFLAGS)" CC="$(CC)"; then cd ..; else exit 1; fi; done @@ -49,6 +63,17 @@ cleandepend: if sed '/^#Depend/q' Makefile.tmp; then \ mv -f Makefile.tmp Makefile; fi; rm -f .depend); done +install: + $(INSTALL) -d $(BUILD)$(BINDIR) + $(INSTALL_PROGRAM) bin/zebraidx $(BUILD)$(BINDIR) + $(INSTALL_PROGRAM) bin/zebrasrv $(BUILD)$(BINDIR) + $(INSTALL) -d $(BUILD)$(ZEBRATAB) + @cd tab; for f in *; do \ + if [ -f $$f ]; then \ + $(INSTALL_DATA) $$f $(BUILD)$(ZEBRATAB); \ + fi; \ + done + wc: wc `find . -name '*.[ch]'` diff --git a/bfile/Makefile.in b/bfile/Makefile.in index 549de89..80bfe1c 100644 --- a/bfile/Makefile.in +++ b/bfile/Makefile.in @@ -1,7 +1,7 @@ # Copyright (C) 1994-1998, Index Data ApS # All rights reserved. # Sebastian Hammer, Adam Dickmeiss -# $Id: Makefile.in,v 1.3 1999-06-09 11:58:48 adam Exp $ +# $Id: Makefile.in,v 1.4 1999-11-30 13:48:03 adam Exp $ SHELL=/bin/sh @@ -11,8 +11,8 @@ RANLIB=@RANLIB@ CDEFS=@DEFS@ @ODEFS@ LIBS=@LIBS@ -YAZLIB=-lyaz -YAZINC=-I../../yaz/include +YAZLIB=@YAZLIB@ +YAZINC=@YAZINC@ INCLUDE=-I../include $(YAZINC) TPROG=btest diff --git a/configure b/configure index b83c502..c7752db 100755 --- a/configure +++ b/configure @@ -12,6 +12,10 @@ ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help + --with-buildroot RPM Build root" +ac_help="$ac_help + --with-yazconfig Path for yaz-config" +ac_help="$ac_help --with-tclconfig Path for tclConfig.sh" # Initialize some variables set by options. @@ -527,10 +531,12 @@ fi + + # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:534: checking for $ac_word" >&5 +echo "configure:540: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -560,7 +566,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:564: checking for $ac_word" >&5 +echo "configure:570: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -611,7 +617,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:615: checking for $ac_word" >&5 +echo "configure:621: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -643,7 +649,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:647: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:653: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -654,12 +660,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 658 "configure" +#line 664 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -685,12 +691,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:689: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:695: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:694: checking whether we are using GNU C" >&5 +echo "configure:700: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -699,7 +705,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:703: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:709: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -718,7 +724,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:722: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:728: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -750,7 +756,7 @@ else fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:754: checking how to run the C preprocessor" >&5 +echo "configure:760: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -765,13 +771,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:775: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -782,13 +788,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:792: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:798: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -799,13 +805,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:809: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:815: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -860,7 +866,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:864: checking for a BSD compatible install" >&5 +echo "configure:870: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -915,7 +921,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:919: checking for $ac_word" >&5 +echo "configure:925: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -942,6 +948,80 @@ else echo "$ac_t""no" 1>&6 fi + +# Check whether --with-build-root or --without-build-root was given. +if test "${with_build_root+set}" = set; then + withval="$with_build_root" + build_root=$withval +else + build_root="" +fi + +yazconfig=NONE +yazpath=NONE +# Check whether --with-yazconfig or --without-yazconfig was given. +if test "${with_yazconfig+set}" = set; then + withval="$with_yazconfig" + yazpath=$withval +fi + +if test "x$yazpath" != "xNONE"; then + yazconfig=$yazpath/yaz-config +else + for i in ../yaz* ../yaz; do + if test -d $i; then + if test -r $i/include/yaz/yaz-version.h; then + yazconfig=$i/yaz-config + fi + fi + done + if test "x$yazconfig" = "xNONE"; then + # Extract the first word of "yaz-config", so it can be a program name with args. +set dummy yaz-config; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:983: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_yazconfig'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$yazconfig" in + /*) + ac_cv_path_yazconfig="$yazconfig" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_yazconfig="$yazconfig" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_yazconfig="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_yazconfig" && ac_cv_path_yazconfig="NONE" + ;; +esac +fi +yazconfig="$ac_cv_path_yazconfig" +if test -n "$yazconfig"; then + echo "$ac_t""$yazconfig" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + fi +fi +echo $ac_n "checking for YAZ""... $ac_c" 1>&6 +echo "configure:1019: checking for YAZ" >&5 +if test -r $yazconfig; then + . $yazconfig + echo "$ac_t""$yazconfig" 1>&6 +else + echo "$ac_t""Not found" 1>&6 +fi TCL_LIB="" TCL_INCLUDE="" tclconfig=NONE @@ -958,7 +1038,7 @@ echo $ac_n "checking for prefix by $ac_c" 1>&6 # Extract the first word of "tclsh", so it can be a program name with args. set dummy tclsh; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:962: checking for $ac_word" >&5 +echo "configure:1042: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_TCLSH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1000,7 +1080,7 @@ fi fi if test -r ${tclconfig}/tclConfig.sh; then echo $ac_n "checking for Tcl""... $ac_c" 1>&6 -echo "configure:1004: checking for Tcl" >&5 +echo "configure:1084: checking for Tcl" >&5 . ${tclconfig}/tclConfig.sh if test -r ${tclconfig}/../generic/tcl.h; then TCL_INCLUDE=-I${tclconfig}/../generic @@ -1018,246 +1098,21 @@ echo "configure:1004: checking for Tcl" >&5 else ODEFS="-DHAVE_TCL_H=0" fi -checkBoth=0 -echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:1024: checking for connect" >&5 -if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char connect(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_connect) || defined (__stub___connect) -choke me -#else -connect(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_connect=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_connect=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -fi - -if test "$ac_cv_func_connect" = "no"; then - echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6 -echo "configure:1073: checking for main in -lsocket" >&5 -ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lsocket $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -lsocket" -else - echo "$ac_t""no" 1>&6 -checkBoth=1 -fi - -fi -if test "$checkBoth" = "1"; then - oldLibs=$LIBS - LIBS="$LIBS -lsocket -lnsl" - echo $ac_n "checking for accept""... $ac_c" 1>&6 -echo "configure:1114: checking for accept" >&5 -if eval "test \"`echo '$''{'ac_cv_func_accept'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char accept(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_accept) || defined (__stub___accept) -choke me -#else -accept(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_accept=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_accept=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'accept`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -LIBS=$oldLibs -fi - -fi -echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:1164: checking for gethostbyname" >&5 -if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostbyname(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) -choke me -#else -gethostbyname(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_gethostbyname=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_gethostbyname=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6 -echo "configure:1210: checking for main in -lnsl" >&5 -ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lnsl $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -lnsl" -else - echo "$ac_t""no" 1>&6 -fi - -fi - for ac_hdr in sys/times.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1251: checking for $ac_hdr" >&5 +echo "configure:1106: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1261: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1116: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1283,44 +1138,8 @@ else fi done -echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6 -echo "configure:1288: checking for main in -lwrap" >&5 -ac_lib_var=`echo wrap'_'main | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lwrap $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -lwrap" -else - echo "$ac_t""no" 1>&6 -fi - echo $ac_n "checking for bzCompressInit in -lbz2""... $ac_c" 1>&6 -echo "configure:1324: checking for bzCompressInit in -lbz2" >&5 +echo "configure:1143: checking for bzCompressInit in -lbz2" >&5 ac_lib_var=`echo bz2'_'bzCompressInit | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1328,7 +1147,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lbz2 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1371,17 +1190,17 @@ if test "$ac_cv_lib_bz2_bzCompressInit" = "yes"; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1375: checking for $ac_hdr" >&5 +echo "configure:1194: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1385: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1204: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1409,12 +1228,12 @@ done fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1413: checking for ANSI C header files" >&5 +echo "configure:1232: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1422,7 +1241,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1426: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1245: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1439,7 +1258,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1457,7 +1276,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1478,7 +1297,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1489,7 +1308,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1628,7 +1447,7 @@ done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" -trap 'rm -fr `echo "Makefile util/Makefile bfile/Makefile dfa/Makefile dict/Makefile isam/Makefile isamc/Makefile recctrl/Makefile rset/Makefile index/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +trap 'rm -fr `echo "Makefile util/Makefile bfile/Makefile dfa/Makefile dict/Makefile isams/Makefile isam/Makefile isamc/Makefile recctrl/Makefile rset/Makefile index/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then diff --git a/configure.in b/configure.in index cdb3f48..dbf056e 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl Zebra, Index Data Aps, 1994-1999 -dnl $Id: configure.in,v 1.10 1999-07-14 10:59:26 adam Exp $ +dnl $Id: configure.in,v 1.11 1999-11-30 13:48:03 adam Exp $ dnl See the file LICENSE.2 for details. dnl AC_INIT(include/zebraver.h) @@ -8,6 +8,8 @@ AC_SUBST(ODEFS) AC_SUBST(DEFS) AC_SUBST(TCL_INCLUDE) AC_SUBST(TCL_LIB) +AC_SUBST(YAZLIB) +AC_SUBST(YAZINC) dnl dnl ------ Checking programs AC_PROG_CC @@ -15,7 +17,43 @@ AC_PROG_CPP AC_PROG_INSTALL AC_PROG_RANLIB dnl +dnl ------ Build root +AC_SUBST(build_root) +AC_ARG_WITH(build-root, [ --with-buildroot RPM Build root],[build_root=$withval],[build_root=""]) +dnl +dnl ------ Look for Yaz +dnl See if user specified location of yaz-config; otherwise +dnl use ../yaz if is a directory (internal development); otherwise +dnl use yaz-config found in PATH. +yazconfig=NONE +yazpath=NONE +AC_ARG_WITH(yazconfig, [ --with-yazconfig Path for yaz-config], [yazpath=$withval]) +if test "x$yazpath" != "xNONE"; then + yazconfig=$yazpath/yaz-config +else + for i in ../yaz* ../yaz; do + if test -d $i; then + if test -r $i/include/yaz/yaz-version.h; then + yazconfig=$i/yaz-config + fi + fi + done + if test "x$yazconfig" = "xNONE"; then + AC_PATH_PROG(yazconfig, yaz-config, NONE) + fi +fi +AC_MSG_CHECKING(for YAZ) +if test -r $yazconfig; then + . $yazconfig + AC_MSG_RESULT($yazconfig) +else + AC_MSG_RESULT(Not found) +fi +dnl dnl ------ Look for Tcl +dnl See if user has specified location of tclConfig.sh; otherwise +dnl see if tclConfig.sh exists in same prefix lcoation as tclsh; otherwise +dnl disable Tcl. TCL_LIB="" TCL_INCLUDE="" tclconfig=NONE @@ -46,25 +84,9 @@ else ODEFS="-DHAVE_TCL_H=0" fi dnl -dnl ------ Socket libraries -checkBoth=0 -AC_CHECK_FUNC(connect) -if test "$ac_cv_func_connect" = "no"; then - AC_CHECK_LIB(socket, main, LIBS="$LIBS -lsocket", checkBoth=1) -fi -if test "$checkBoth" = "1"; then - oldLibs=$LIBS - LIBS="$LIBS -lsocket -lnsl" - AC_CHECK_FUNC(accept, , [LIBS=$oldLibs]) -fi -AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"])) -dnl dnl ------ times AC_CHECK_HEADERS(sys/times.h) dnl -dnl ------ TCP wrapper (for Linux) -AC_CHECK_LIB(wrap, main, [LIBS="$LIBS -lwrap"]) -dnl dnl ------- BZIP2 AC_CHECK_LIB(bz2,bzCompressInit) if test "$ac_cv_lib_bz2_bzCompressInit" = "yes"; then @@ -78,4 +100,4 @@ if test "$ac_cv_header_stdc" = "no"; then fi dnl dnl ------ Create Makefiles -AC_OUTPUT(Makefile util/Makefile bfile/Makefile dfa/Makefile dict/Makefile isam/Makefile isamc/Makefile recctrl/Makefile rset/Makefile index/Makefile) +AC_OUTPUT(Makefile util/Makefile bfile/Makefile dfa/Makefile dict/Makefile isams/Makefile isam/Makefile isamc/Makefile recctrl/Makefile rset/Makefile index/Makefile) diff --git a/dfa/Makefile.in b/dfa/Makefile.in index 0661af2..90be746 100644 --- a/dfa/Makefile.in +++ b/dfa/Makefile.in @@ -1,7 +1,7 @@ # Copyright (C) 1994-1999, Index Data ApS # All rights reserved. # Sebastian Hammer, Adam Dickmeiss -# $Id: Makefile.in,v 1.4 1999-06-09 11:58:48 adam Exp $ +# $Id: Makefile.in,v 1.5 1999-11-30 13:48:03 adam Exp $ SHELL=/bin/sh @@ -11,8 +11,8 @@ RANLIB=@RANLIB@ CDEFS=@DEFS@ @ODEFS@ LIBS=@LIBS@ -YAZLIB=../../yaz/lib/libyaz.a -YAZINC=-I../../yaz/include +YAZLIB=@YAZLIB@ +YAZINC=@YAZINC@ INCLUDE=-I../include $(YAZINC) TPROG1=agrep diff --git a/dict/Makefile.in b/dict/Makefile.in index 643436c..3ee321b 100644 --- a/dict/Makefile.in +++ b/dict/Makefile.in @@ -1,7 +1,7 @@ # Copyright (C) 1994-1998, Index Data # All rights reserved. # Sebastian Hammer, Adam Dickmeiss -# $Id: Makefile.in,v 1.4 1999-06-09 11:58:48 adam Exp $ +# $Id: Makefile.in,v 1.5 1999-11-30 13:48:03 adam Exp $ SHELL=/bin/sh @@ -11,8 +11,8 @@ RANLIB=@RANLIB@ CDEFS=@DEFS@ @ODEFS@ LIBS=@LIBS@ -YAZLIB=../../yaz/lib/libyaz.a -YAZINC=-I../../yaz/include +YAZLIB=@YAZLIB@ +YAZINC=@YAZINC@ INCLUDE=-I../include $(YAZINC) TPROG1=dicttest diff --git a/dict/dcompact.c b/dict/dcompact.c index 5ae4402..70a167b 100644 --- a/dict/dcompact.c +++ b/dict/dcompact.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: dcompact.c,v $ - * Revision 1.6 1999-09-07 08:13:08 adam + * Revision 1.7 1999-11-30 13:48:03 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.6 1999/09/07 08:13:08 adam * Removed log messages. * * Revision 1.5 1999/05/26 07:49:12 adam @@ -29,7 +32,7 @@ #include #include -#include +#include #include static void dict_copy_page(Dict dict, char *to_p, char *from_p, int *map) diff --git a/include/charmap.h b/include/charmap.h index 6b3f6dd..23661a5 100644 --- a/include/charmap.h +++ b/include/charmap.h @@ -36,7 +36,10 @@ * OF THIS SOFTWARE. * * $Log: charmap.h,v $ - * Revision 1.5 1999-09-07 07:19:21 adam + * Revision 1.6 1999-11-30 13:48:03 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.5 1999/09/07 07:19:21 adam * Work on character mapping. Implemented replace rules. * * Revision 1.4 1997/10/27 14:33:04 adam @@ -54,7 +57,7 @@ #ifndef CHARMAP_H #define CHARMAP_H -#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/dict.h b/include/dict.h index b7c10c0..ca82337 100644 --- a/include/dict.h +++ b/include/dict.h @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: dict.h,v $ - * Revision 1.29 1999-05-15 14:36:37 adam + * Revision 1.30 1999-11-30 13:48:03 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.29 1999/05/15 14:36:37 adam * Updated dictionary. Implemented "compression" of dictionary. * * Revision 1.28 1999/03/09 13:07:06 adam @@ -107,7 +110,7 @@ #define DICT_H #include -#include +#include #ifdef __cplusplus extern "C" { diff --git a/include/recctrl.h b/include/recctrl.h index a6812ec..c1f4392 100644 --- a/include/recctrl.h +++ b/include/recctrl.h @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: recctrl.h,v $ - * Revision 1.31 1999-09-07 07:19:21 adam + * Revision 1.32 1999-11-30 13:48:03 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.31 1999/09/07 07:19:21 adam * Work on character mapping. Implemented replace rules. * * Revision 1.30 1999/05/21 12:00:17 adam @@ -115,10 +118,10 @@ #ifndef RECCTRL_H #define RECCTRL_H -#include -#include -#include -#include +#include +#include +#include +#include #include #ifdef __cplusplus diff --git a/include/zebramap.h b/include/zebramap.h index 73710eb..490373b 100644 --- a/include/zebramap.h +++ b/include/zebramap.h @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: zebramap.h,v $ - * Revision 1.9 1999-09-07 07:19:21 adam + * Revision 1.10 1999-11-30 13:48:03 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.9 1999/09/07 07:19:21 adam * Work on character mapping. Implemented replace rules. * * Revision 1.8 1999/02/12 13:29:21 adam @@ -42,7 +45,7 @@ #ifndef ZEBRAMAP_H #define ZEBRAMAP_H -#include +#include #include #ifdef __cplusplus diff --git a/include/zebrautl.h b/include/zebrautl.h index fa1997f..e33b8ec 100644 --- a/include/zebrautl.h +++ b/include/zebrautl.h @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: zebrautl.h,v $ - * Revision 1.5 1999-02-02 14:50:47 adam + * Revision 1.6 1999-11-30 13:48:03 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.5 1999/02/02 14:50:47 adam * Updated WIN32 code specific sections. Changed header. * * Revision 1.4 1997/10/27 14:33:04 adam @@ -30,7 +33,8 @@ #ifndef ZEBRA_UTIL_H #define ZEBRA_UTIL_H -#include +#include #include +#include #endif diff --git a/include/zebraver.h b/include/zebraver.h index c7da788..dc7749f 100644 --- a/include/zebraver.h +++ b/include/zebraver.h @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: zebraver.h,v $ - * Revision 1.13 1999-02-02 14:50:48 adam + * Revision 1.14 1999-11-30 13:48:03 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.13 1999/02/02 14:50:48 adam * Updated WIN32 code specific sections. Changed header. * * Revision 1.12 1998/02/10 12:03:05 adam @@ -46,10 +49,13 @@ */ #ifndef ZEBRAVER -#define ZEBRAVER "1.0b2" +#define ZEBRAVER "1.0" #endif #ifndef ZEBRADATE -#define ZEBRADATE "$Date: 1999-02-02 14:50:48 $" +#define ZEBRADATE "$Date: 1999-11-30 13:48:03 $" #endif +#ifndef ZMBOL +#define ZMBOL 1 +#endif diff --git a/index/Makefile.in b/index/Makefile.in index b8a7176..3d8c876 100644 --- a/index/Makefile.in +++ b/index/Makefile.in @@ -1,7 +1,7 @@ -# Copyright (C) 1995-1998, Index Data +# Copyright (C) 1995-1999, Index Data # All rights reserved. # Sebastian Hammer, Adam Dickmeiss -# $Id: Makefile.in,v 1.8 1999-06-09 11:58:48 adam Exp $ +# $Id: Makefile.in,v 1.9 1999-11-30 13:48:03 adam Exp $ SHELL=/bin/sh @@ -12,16 +12,14 @@ CDEFS=@DEFS@ @ODEFS@ LIBS=@LIBS@ TCL_LIB=@TCL_LIB@ -YAZLIB=../../yaz/lib/libyaz.a -YAZINC=-I../../yaz/include -#OSILIB=../../xtimosi/src/libmosi.a ../../yaz/lib/librfc.a -#OSILIB=../../xtimosi/src/libmosi.a -lrfc +YAZLIB=@YAZLIB@ +YAZINC=@YAZINC@ INCLUDE=-I../include $(YAZINC) TCL_INCLUDE=@TCL_INCLUDE@ -TPROG1=zebraidx +TPROG1=../bin/zebraidx TPROG2=kdump -TPROG3=zebrasrv +TPROG3=../bin/zebrasrv TPROG4=hlvltest TPROG5=apitest DEFS=$(CDEFS) $(INCLUDE) $(TCL_INCLUDE) @@ -39,11 +37,11 @@ O5 = apitest.o kcompare.o zrpn.o zsets.o attribute.o recindex.o \ all: $(TPROG1) $(TPROG2) $(TPROG3) -$(TPROG1): $(O1) ../lib/dict.a ../lib/isam.a ../lib/isamc.a ../lib/recctrl.a \ - ../lib/bfile.a ../lib/dfa.a ../lib/zebrautl.a $(YAZLIB) +$(TPROG1): $(O1) ../lib/dict.a ../lib/isams.a ../lib/isam.a ../lib/isamc.a \ + ../lib/recctrl.a ../lib/bfile.a ../lib/dfa.a ../lib/zebrautl.a $(CC) $(CFLAGS) -o $(TPROG1) $(O1) \ - ../lib/dict.a ../lib/isam.a ../lib/isamc.a ../lib/recctrl.a \ - ../lib/bfile.a ../lib/dfa.a ../lib/zebrautl.a \ + ../lib/dict.a ../lib/isams.a ../lib/isam.a ../lib/isamc.a \ + ../lib/recctrl.a ../lib/bfile.a ../lib/dfa.a ../lib/zebrautl.a \ $(YAZLIB) $(TCL_LIB) $(LIBS) $(TPROG2): $(O2) @@ -51,29 +49,32 @@ $(TPROG2): $(O2) $(YAZLIB) $(LIBS) $(TPROG3): $(O3) \ - ../lib/rset.a ../lib/dict.a ../lib/isam.a ../lib/recctrl.a \ - ../lib/isamc.a ../lib/bfile.a ../lib/dfa.a ../lib/zebrautl.a \ - $(YAZLIB) + ../lib/rset.a ../lib/dict.a ../lib/isams.a ../lib/isam.a \ + ../lib/recctrl.a ../lib/isamc.a ../lib/bfile.a ../lib/dfa.a \ + ../lib/zebrautl.a $(CC) $(CFLAGS) -o $(TPROG3) $(O3) \ - ../lib/rset.a ../lib/dict.a ../lib/isam.a ../lib/recctrl.a \ - ../lib/isamc.a ../lib/bfile.a ../lib/dfa.a ../lib/zebrautl.a \ + ../lib/rset.a ../lib/dict.a ../lib/isams.a ../lib/isam.a \ + ../lib/recctrl.a ../lib/isamc.a ../lib/bfile.a ../lib/dfa.a \ + ../lib/zebrautl.a \ $(YAZLIB) $(OSILIB) $(TCL_LIB) $(LIBS) -lm $(TPROG4): $(O4) \ - ../lib/rset.a ../lib/dict.a ../lib/isam.a ../lib/recctrl.a \ - ../lib/isamc.a ../lib/bfile.a ../lib/dfa.a ../lib/zebrautl.a \ - $(YAZLIB) + ../lib/rset.a ../lib/dict.a ../lib/isams.a ../lib/isam.a \ + ../lib/recctrl.a \ + ../lib/isamc.a ../lib/bfile.a ../lib/dfa.a ../lib/zebrautl.a $(CC) $(CFLAGS) -o $(TPROG4) $(O4) \ - ../lib/rset.a ../lib/dict.a ../lib/isam.a ../lib/recctrl.a \ + ../lib/rset.a ../lib/dict.a ../lib/isams.a ../lib/isam.a \ + ../lib/recctrl.a \ ../lib/isamc.a ../lib/bfile.a ../lib/dfa.a ../lib/zebrautl.a \ $(YAZLIB) $(OSILIB) $(TCL_LIB) $(LIBS) -lm $(TPROG5): $(O5) \ - ../lib/rset.a ../lib/dict.a ../lib/isam.a ../lib/recctrl.a \ - ../lib/isamc.a ../lib/bfile.a ../lib/dfa.a ../lib/zebrautl.a \ - $(YAZLIB) + ../lib/rset.a ../lib/dict.a ../lib/isams.a ../lib/isam.a \ + ../lib/recctrl.a \ + ../lib/isamc.a ../lib/bfile.a ../lib/dfa.a ../lib/zebrautl.a $(CC) $(CFLAGS) -o $(TPROG5) $(O5) \ - ../lib/rset.a ../lib/dict.a ../lib/isam.a ../lib/recctrl.a \ + ../lib/rset.a ../lib/dict.a ../lib/isams.a ../lib/isam.a \ + ../lib/recctrl.a \ ../lib/isamc.a ../lib/bfile.a ../lib/dfa.a ../lib/zebrautl.a \ $(YAZLIB) $(OSILIB) $(TCL_LIB) $(LIBS) -lm diff --git a/index/apitest.c b/index/apitest.c index 9ed3508..88c9e6b 100644 --- a/index/apitest.c +++ b/index/apitest.c @@ -1,8 +1,8 @@ #include -#include -#include +#include +#include #include "zebraapi.h" /* Small routine to display GRS-1 record variants ... */ diff --git a/index/attribute.c b/index/attribute.c index bc60c86..d01230e 100644 --- a/index/attribute.c +++ b/index/attribute.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: attribute.c,v $ - * Revision 1.10 1999-02-02 14:50:49 adam + * Revision 1.11 1999-11-30 13:48:03 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.10 1999/02/02 14:50:49 adam * Updated WIN32 code specific sections. Changed header. * * Revision 1.9 1998/05/20 10:12:14 adam @@ -42,7 +45,7 @@ #include -#include +#include #include #include #include "zserver.h" diff --git a/index/index.h b/index/index.h index e7c61de..50904d3 100644 --- a/index/index.h +++ b/index/index.h @@ -10,12 +10,16 @@ #include #include +#include +#if ZMBOL #include #include -#include -#include #include -#include +#define ISAM_DEFAULT "c" +#else +#define ISAM_DEFAULT "s" +#endif +#include #include #ifdef __cplusplus @@ -100,10 +104,11 @@ void key_logdump (int mask, const void *p); void inv_prstat (BFiles bfs); void inv_compact (BFiles bfs); void key_input (BFiles bfs, int nkeys, int cache); -ISAMC_M key_isamc_m (Res res, ISAMC_M me); ISAMS_M key_isams_m (Res res, ISAMS_M me); -ISAMH_M key_isamh_m (Res res); +#if ZMBOL +ISAMC_M key_isamc_m (Res res, ISAMC_M me); ISAMD_M key_isamd_m (Res res, ISAMD_M me); +#endif int merge_sort (char **buf, int from, int to); int key_SU_code (int ch, char *out); @@ -161,7 +166,10 @@ extern Res common_resource; /* * $Log: index.h,v $ - * Revision 1.66 1999-07-14 13:21:34 heikki + * Revision 1.67 1999-11-30 13:48:03 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.66 1999/07/14 13:21:34 heikki * Added isam-d files. Compiles (almost) clean. Doesn't work at all * * Revision 1.65 1999/07/14 10:59:26 adam diff --git a/index/invstat.c b/index/invstat.c index 7f7cca3..2cdf9b1 100644 --- a/index/invstat.c +++ b/index/invstat.c @@ -11,15 +11,15 @@ #include "index.h" #include "recindex.h" -#include "../isamc/isamh-p.h" #include "../isamc/isamd-p.h" struct inv_stat_info { + ISAMS isams; +#if ZMBOL ISAM isam; ISAMC isamc; - ISAMS isams; - ISAMH isamh; ISAMD isamd; +#endif int no_isam_entries[9]; int no_dict_entries; int no_dict_bytes; @@ -37,15 +37,32 @@ static int inv_stat_handle (char *name, const char *info, int pos, int occur = 0; int i = 0; struct inv_stat_info *stat_info = (struct inv_stat_info*) client; - ISAM_P isam_p; + ISAMS_P isam_p; stat_info->no_dict_entries++; stat_info->no_dict_bytes += strlen(name); - assert (*info == sizeof(ISAM_P)); - memcpy (&isam_p, info+1, sizeof(ISAM_P)); + assert (*info == sizeof(ISAMS_P)); + memcpy (&isam_p, info+1, sizeof(ISAMS_P)); + + if (stat_info->isams) + { + ISAMS_PP pp; + int occurx = 0; + struct it_key key; - //printf ("---\n"); + pp = isams_pp_open (stat_info->isams, isam_p); + occur = isams_pp_num (pp); + while (isams_pp_read(pp, &key)) + { + //printf ("sysno=%d seqno=%d\n", key.sysno, key.seqno); + occurx++; + } + assert (occurx == occur); + stat_info->no_isam_entries[0] += occur; + isams_pp_close (pp); + } +#if ZMBOL if (stat_info->isam) { ISPT ispt; @@ -71,30 +88,6 @@ static int inv_stat_handle (char *name, const char *info, int pos, stat_info->no_isam_entries[isc_type(isam_p)] += occur; isc_pp_close (pp); } - if (stat_info->isamh) - { - ISAMH_PP pp; - int occurx = 0; - struct it_key key; - - pp = isamh_pp_open (stat_info->isamh, isam_p); - - occur = isamh_pp_num (pp); - while (isamh_pp_read(pp, &key)) - { - occurx++; - //logf (LOG_LOG,"sysno=%d seqno=%d (%x/%x) oc=%d/%d ofs=%d ", - // key.sysno, key.seqno, - // key.sysno, key.seqno, - // occur,occurx, pp->offset); - } - if (occurx != occur) { - logf(LOG_LOG,"Count error!!! read %d, counted %d", occur, occurx); - //isamh_pp_dump(stat_info->isamh, isam_p); - } - stat_info->no_isam_entries[isamh_type(isam_p)] += occur; - isamh_pp_close (pp); - } if (stat_info->isamd) { ISAMD_PP pp; @@ -126,24 +119,7 @@ static int inv_stat_handle (char *name, const char *info, int pos, stat_info->no_isam_entries[isamd_type(isam_p)] += occur; isamd_pp_close (pp); } - if (stat_info->isams) - { - ISAMS_PP pp; - int occurx = 0; - struct it_key key; - - pp = isams_pp_open (stat_info->isams, isam_p); - occur = isams_pp_num (pp); - while (isams_pp_read(pp, &key)) - { - //printf ("sysno=%d seqno=%d\n", key.sysno, key.seqno); - occurx++; - } - assert (occurx == occur); - stat_info->no_isam_entries[isc_type(isam_p)] += occur; - isams_pp_close (pp); - } - +#endif while (occur > stat_info->isam_bounds[i] && stat_info->isam_bounds[i]) i++; ++(stat_info->isam_occurrences[i]); @@ -153,11 +129,12 @@ static int inv_stat_handle (char *name, const char *info, int pos, void inv_prstat (BFiles bfs) { Dict dict; + ISAMS isams = NULL; +#if ZMBOL ISAM isam = NULL; ISAMC isamc = NULL; - ISAMS isams = NULL; - ISAMH isamh = NULL; ISAMD isamd = NULL; +#endif Records records; int i, prev; int before = 0; @@ -177,17 +154,7 @@ void inv_prstat (BFiles bfs) logf (LOG_FATAL, "dict_open fail"); exit (1); } - if (res_get_match (common_resource, "isam", "i", NULL)) - { - isam = is_open (bfs, FNAME_ISAM, key_compare, 0, - sizeof(struct it_key), common_resource); - if (!isam) - { - logf (LOG_FATAL, "is_open fail"); - exit (1); - } - } - else if (res_get_match (common_resource, "isam", "s", NULL)) + if (res_get_match (common_resource, "isam", "s", ISAM_DEFAULT)) { struct ISAMS_M_s isams_m; isams = isams_open (bfs, FNAME_ISAMS, 0, @@ -198,16 +165,18 @@ void inv_prstat (BFiles bfs) exit (1); } } - else if (res_get_match (common_resource, "isam", "h", NULL)) +#if ZMBOL + else if (res_get_match (common_resource, "isam", "i", ISAM_DEFAULT)) { - isamh = isamh_open (bfs, FNAME_ISAMH, 0, key_isamh_m(common_resource)); - if (!isamh) + isam = is_open (bfs, FNAME_ISAM, key_compare, 0, + sizeof(struct it_key), common_resource); + if (!isam) { - logf (LOG_FATAL, "isamh_open fail"); + logf (LOG_FATAL, "is_open fail"); exit (1); } } - else if (res_get_match (common_resource, "isam", "d", NULL)) + else if (res_get_match (common_resource, "isam", "d", ISAM_DEFAULT)) { struct ISAMD_M_s isamd_m; isamd = isamd_open (bfs, FNAME_ISAMD, 0, @@ -218,7 +187,7 @@ void inv_prstat (BFiles bfs) exit (1); } } - else + else if (res_get_match (common_resource, "isam", "c", ISAM_DEFAULT)) { struct ISAMC_M_s isamc_m; isamc = isc_open (bfs, FNAME_ISAMC, 0, @@ -229,17 +198,19 @@ void inv_prstat (BFiles bfs) exit (1); } } +#endif records = rec_open (bfs, 0, 0); for (i = 0; i<=SINGLETON_TYPE; i++) stat_info.no_isam_entries[i] = 0; stat_info.no_dict_entries = 0; stat_info.no_dict_bytes = 0; + stat_info.isams = isams; +#if ZMBOL stat_info.isam = isam; stat_info.isamc = isamc; - stat_info.isams = isams; - stat_info.isamh = isamh; stat_info.isamd = isamd; +#endif stat_info.isam_bounds[0] = 1; stat_info.isam_bounds[1] = 2; stat_info.isam_bounds[2] = 3; @@ -265,6 +236,7 @@ void inv_prstat (BFiles bfs) dict_scan (dict, term_dict, &before, &after, &stat_info, inv_stat_handle); +#if ZMBOL if (isamc) { fprintf (stderr, " Blocks Occur Size KB Bytes/Entry\n"); @@ -314,49 +286,33 @@ void inv_prstat (BFiles bfs) } /* for */ } /* isamd */ if ( (isamd) && (isamd->method->debug>0)) - fprintf (stderr, "\n%d words using %d bytes\n", + fprintf (stderr, "\n%d words using %d bytes\n", stat_info.no_dict_entries, stat_info.no_dict_bytes); +#endif fprintf (stderr, " Occurrences Words\n"); - if ( (isamd) && (isamd->method->debug>0) ) - { - logf(LOG_LOG, "%d words using %d bytes", - stat_info.no_dict_entries, stat_info.no_dict_bytes); - logf(LOG_LOG, " Occurrences Words"); - } prev = 1; for (i = 0; stat_info.isam_bounds[i]; i++) { int here = stat_info.isam_bounds[i]; fprintf (stderr, "%7d-%-7d %7d\n", prev, here, stat_info.isam_occurrences[i]); - if ( (isamd) && (isamd->method->debug>0) && - stat_info.isam_occurrences[i] ) - { - logf(LOG_LOG,"%7d-%-7d %7d", - prev, here, stat_info.isam_occurrences[i]); - } prev = here+1; } fprintf (stderr, "%7d- %7d\n", prev, stat_info.isam_occurrences[i]); - if ( (isamd) && (isamd->method->debug>0) && - ( stat_info.isam_occurrences[i] || - stat_info.isam_occurrences[i+1]) ) - logf(LOG_LOG,"%7d- %7d", - prev, stat_info.isam_occurrences[i]); rec_close (&records); dict_close (dict); + if (isams) + isams_close (isams); +#if ZMBOL if (isam) is_close (isam); if (isamc) isc_close (isamc); - if (isams) - isams_close (isams); - if (isamh) - isamh_close (isamh); if (isamd) isamd_close (isamd); +#endif xmalloc_trav("unfreed"); /*! while hunting memory leaks */ } @@ -365,7 +321,10 @@ void inv_prstat (BFiles bfs) /* * * $Log: invstat.c,v $ - * Revision 1.18 1999-10-06 11:46:36 heikki + * Revision 1.19 1999-11-30 13:48:03 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.18 1999/10/06 11:46:36 heikki * mproved statistics on isam-d * * Revision 1.17 1999/08/20 08:28:37 heikki diff --git a/index/kcompare.c b/index/kcompare.c index 39ee853..647349a 100644 --- a/index/kcompare.c +++ b/index/kcompare.c @@ -201,22 +201,6 @@ static void iscz1_code_item (int mode, void *vp, char **dst, char **src) } } -ISAMC_M key_isamc_m (Res res, ISAMC_M me) -{ - isc_getmethod (me); - - me->compare_item = key_compare; - - me->code_start = iscz1_code_start; - me->code_item = iscz1_code_item; - me->code_stop = iscz1_code_stop; - me->code_reset = iscz1_code_reset; - - me->debug = atoi(res_get_def (res, "isamcDebug", "0")); - - return me; -} - ISAMS_M key_isams_m (Res res, ISAMS_M me) { isams_getmethod (me); @@ -232,14 +216,11 @@ ISAMS_M key_isams_m (Res res, ISAMS_M me) return me; } -ISAMH_M key_isamh_m (Res res) -{ - static ISAMH_M me = NULL; - - if (me) - return me; +#if ZMBOL - me = isamh_getmethod (); +ISAMC_M key_isamc_m (Res res, ISAMC_M me) +{ + isc_getmethod (me); me->compare_item = key_compare; @@ -248,7 +229,7 @@ ISAMH_M key_isamh_m (Res res) me->code_stop = iscz1_code_stop; me->code_reset = iscz1_code_reset; - me->debug = atoi(res_get_def (res, "isamhDebug", "9")); + me->debug = atoi(res_get_def (res, "isamcDebug", "0")); return me; } @@ -270,6 +251,7 @@ ISAMD_M key_isamd_m (Res res,ISAMD_M me) return me; } +#endif int key_SU_code (int ch, char *out) { @@ -288,7 +270,10 @@ int key_SU_code (int ch, char *out) /* * $Log: kcompare.c,v $ - * Revision 1.34 1999-07-14 13:21:34 heikki + * Revision 1.35 1999-11-30 13:48:03 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.34 1999/07/14 13:21:34 heikki * Added isam-d files. Compiles (almost) clean. Doesn't work at all * * Revision 1.33 1999/07/14 10:59:26 adam diff --git a/index/kinput.c b/index/kinput.c index f0649d6..fd3099b 100644 --- a/index/kinput.c +++ b/index/kinput.c @@ -208,11 +208,12 @@ struct heap_info { int *ptr; int (*cmp)(const void *p1, const void *p2); Dict dict; + ISAMS isams; +#if ZMBOL ISAM isam; ISAMC isamc; - ISAMS isams; - ISAMH isamh; ISAMD isamd; +#endif }; struct heap_info *key_heap_init (int nkeys, @@ -346,6 +347,7 @@ int heap_cread_item (void *vp, char **dst, int *insertMode) return 1; } +#if ZMBOL int heap_inpc (struct heap_info *hi) { struct heap_cread_info hci; @@ -397,92 +399,6 @@ int heap_inpc (struct heap_info *hi) return 0; } -int heap_inps (struct heap_info *hi) -{ - struct heap_cread_info hci; - ISAMS_I isams_i = (ISAMS_I) xmalloc (sizeof(*isams_i)); - - hci.key = (char *) xmalloc (KEY_SIZE); - hci.mode = 1; - hci.hi = hi; - hci.more = heap_read_one (hi, hci.cur_name, hci.key); - - isams_i->clientData = &hci; - isams_i->read_item = heap_cread_item; - - while (hci.more) - { - char this_name[INP_NAME_MAX]; - ISAMS_P isams_p; - char *dict_info; - - strcpy (this_name, hci.cur_name); - assert (hci.cur_name[1]); - no_diffs++; - if (!(dict_info = dict_lookup (hi->dict, hci.cur_name))) - { - isams_p = isams_merge (hi->isams, isams_i); - no_insertions++; - dict_insert (hi->dict, this_name, sizeof(ISAMS_P), &isams_p); - } - else - abort(); - } - xfree (isams_i); - return 0; -} - -int heap_inph (struct heap_info *hi) -{ - struct heap_cread_info hci; - ISAMH_I isamh_i = (ISAMH_I) xmalloc (sizeof(*isamh_i)); - - hci.key = (char *) xmalloc (KEY_SIZE); - hci.mode = 1; - hci.hi = hi; - hci.more = heap_read_one (hi, hci.cur_name, hci.key); - - isamh_i->clientData = &hci; - isamh_i->read_item = heap_cread_item; - - while (hci.more) - { - char this_name[INP_NAME_MAX]; - ISAMH_P isamh_p, isamh_p2; - char *dict_info; - - strcpy (this_name, hci.cur_name); - assert (hci.cur_name[1]); - no_diffs++; - if ((dict_info = dict_lookup (hi->dict, hci.cur_name))) - { - memcpy (&isamh_p, dict_info+1, sizeof(ISAMH_P)); - isamh_p2 = isamh_append (hi->isamh, isamh_p, isamh_i); - if (!isamh_p2) - { - no_deletions++; - if (!dict_delete (hi->dict, this_name)) - abort(); - } - else - { - no_updates++; - if (isamh_p2 != isamh_p) - dict_insert (hi->dict, this_name, - sizeof(ISAMH_P), &isamh_p2); - } - } - else - { - isamh_p = isamh_append (hi->isamh, 0, isamh_i); - no_insertions++; - dict_insert (hi->dict, this_name, sizeof(ISAMH_P), &isamh_p); - } - } - xfree (isamh_i); - return 0; -} - int heap_inpd (struct heap_info *hi) { struct heap_cread_info hci; @@ -534,9 +450,6 @@ int heap_inpd (struct heap_info *hi) return 0; } - - - int heap_inp (struct heap_info *hi) { char *info; @@ -607,6 +520,43 @@ int heap_inp (struct heap_info *hi) return 0; } +#endif + +int heap_inps (struct heap_info *hi) +{ + struct heap_cread_info hci; + ISAMS_I isams_i = (ISAMS_I) xmalloc (sizeof(*isams_i)); + + hci.key = (char *) xmalloc (KEY_SIZE); + hci.mode = 1; + hci.hi = hi; + hci.more = heap_read_one (hi, hci.cur_name, hci.key); + + isams_i->clientData = &hci; + isams_i->read_item = heap_cread_item; + + while (hci.more) + { + char this_name[INP_NAME_MAX]; + ISAMS_P isams_p; + char *dict_info; + + strcpy (this_name, hci.cur_name); + assert (hci.cur_name[1]); + no_diffs++; + if (!(dict_info = dict_lookup (hi->dict, hci.cur_name))) + { + isams_p = isams_merge (hi->isams, isams_i); + no_insertions++; + dict_insert (hi->dict, this_name, sizeof(ISAMS_P), &isams_p); + } + else + abort(); + } + xfree (isams_i); + return 0; +} + struct progressInfo { time_t startTime; time_t lastTime; @@ -646,11 +596,12 @@ void key_input (BFiles bfs, int nkeys, int cache) { Dict dict; + ISAMS isams = NULL; +#if ZMBOL ISAM isam = NULL; ISAMC isamc = NULL; - ISAMS isams = NULL; - ISAMH isamh = NULL; ISAMD isamd = NULL; +#endif struct key_file **kf; char rbuf[1024]; int i, r; @@ -677,7 +628,7 @@ void key_input (BFiles bfs, int nkeys, int cache) logf (LOG_FATAL, "dict_open fail"); exit (1); } - if (res_get_match (common_resource, "isam", "s", NULL)) + if (res_get_match (common_resource, "isam", "s", ISAM_DEFAULT)) { struct ISAMS_M_s isams_m; isams = isams_open (bfs, FNAME_ISAMS, 1, @@ -687,8 +638,10 @@ void key_input (BFiles bfs, int nkeys, int cache) logf (LOG_FATAL, "isams_open fail"); exit (1); } + logf (LOG_LOG, "isams opened"); } - else if (res_get_match (common_resource, "isam", "i", NULL)) +#if ZMBOL + else if (res_get_match (common_resource, "isam", "i", ISAM_DEFAULT)) { isam = is_open (bfs, FNAME_ISAM, key_compare, 1, sizeof(struct it_key), common_resource); @@ -698,17 +651,7 @@ void key_input (BFiles bfs, int nkeys, int cache) exit (1); } } - else if (res_get_match (common_resource, "isam", "h", NULL)) - { - isamh = isamh_open (bfs, FNAME_ISAMH, 1, - key_isamh_m (common_resource)); - if (!isamh) - { - logf (LOG_FATAL, "isamh_open fail"); - exit (1); - } - } - else if (res_get_match (common_resource, "isam", "d", NULL)) + else if (res_get_match (common_resource, "isam", "d", ISAM_DEFAULT)) { struct ISAMD_M_s isamd_m; isamd = isamd_open (bfs, FNAME_ISAMD, 1, @@ -719,7 +662,7 @@ void key_input (BFiles bfs, int nkeys, int cache) exit (1); } } - else + else if (res_get_match (common_resource, "isam", "c", ISAM_DEFAULT)) { struct ISAMC_M_s isamc_m; isamc = isc_open (bfs, FNAME_ISAMC, 1, @@ -730,6 +673,7 @@ void key_input (BFiles bfs, int nkeys, int cache) exit (1); } } +#endif kf = (struct key_file **) xmalloc ((1+nkeys) * sizeof(*kf)); progressInfo.totalBytes = 0; progressInfo.totalOffset = 0; @@ -745,37 +689,38 @@ void key_input (BFiles bfs, int nkeys, int cache) } hi = key_heap_init (nkeys, key_qsort_compare); hi->dict = dict; + hi->isams = isams; +#if ZMBOL hi->isam = isam; hi->isamc = isamc; - hi->isams = isams; - hi->isamh = isamh; hi->isamd = isamd; +#endif for (i = 1; i<=nkeys; i++) if ((r = key_file_read (kf[i], rbuf))) key_heap_insert (hi, rbuf, r, kf[i]); - if (isamc) - heap_inpc (hi); - else if (isams) + if (isams) heap_inps (hi); +#if ZMBOL + else if (isamc) + heap_inpc (hi); else if (isam) heap_inp (hi); - else if (isamh) - heap_inph (hi); else if (isamd) heap_inpd (hi); +#endif dict_close (dict); + if (isams) + isams_close (isams); +#if ZMBOL if (isam) is_close (isam); if (isamc) isc_close (isamc); - if (isams) - isams_close (isams); - if (isamh) - isamh_close (isamh); if (isamd) isamd_close (isamd); +#endif for (i = 1; i<=nkeys; i++) { @@ -795,7 +740,10 @@ void key_input (BFiles bfs, int nkeys, int cache) /* * $Log: kinput.c,v $ - * Revision 1.40 1999-09-08 12:12:39 adam + * Revision 1.41 1999-11-30 13:48:03 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.40 1999/09/08 12:12:39 adam * Removed log message. * * Revision 1.39 1999/08/18 10:39:20 heikki diff --git a/index/main.c b/index/main.c index 4ab1ebf..d10fbcc 100644 --- a/index/main.c +++ b/index/main.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: main.c,v $ - * Revision 1.72 1999-10-14 14:33:50 adam + * Revision 1.73 1999-11-30 13:48:03 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.72 1999/10/14 14:33:50 adam * Added truncation 5=106. * * Revision 1.71 1999/09/08 12:12:06 adam @@ -270,7 +273,7 @@ #include #endif -#include +#include #include "index.h" #include "recindex.h" diff --git a/index/sortidx.c b/index/sortidx.c index c9366f1..5c9d5a3 100644 --- a/index/sortidx.c +++ b/index/sortidx.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: sortidx.c,v $ - * Revision 1.3 1999-05-26 07:49:13 adam + * Revision 1.4 1999-11-30 13:48:03 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.3 1999/05/26 07:49:13 adam * C++ compilation. * * Revision 1.2 1998/06/25 09:55:50 adam @@ -14,7 +17,7 @@ #include -#include +#include #include #include diff --git a/index/trunc.c b/index/trunc.c index 887110b..3063cd2 100644 --- a/index/trunc.c +++ b/index/trunc.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: trunc.c,v $ - * Revision 1.15 1999-07-20 13:59:18 adam + * Revision 1.16 1999-11-30 13:48:03 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.15 1999/07/20 13:59:18 adam * Fixed bug that occurred when phrases had 0 hits. * * Revision 1.14 1999/05/26 07:49:13 adam @@ -59,18 +62,19 @@ #include #include +#define NEW_TRUNC 1 + #include "zserver.h" #include +#include +#include +#if ZMBOL #include #include -#include -#include - -#define NEW_TRUNC 1 - #if NEW_TRUNC #include #endif +#endif struct trunc_info { int *ptr; @@ -169,7 +173,7 @@ static void heap_close (struct trunc_info *ti) } static RSET rset_trunc_r (ZebraHandle zi, const char *term, int length, - const char *flags, ISAM_P *isam_p, int from, int to, + const char *flags, ISAMS_P *isam_p, int from, int to, int merge_chunk) { RSET result; @@ -244,6 +248,7 @@ static RSET rset_trunc_r (ZebraHandle zi, const char *term, int length, xfree (rsfd); heap_close (ti); } +#if ZMBOL else if (zi->isam) { ISPT *ispt; @@ -348,6 +353,7 @@ static RSET rset_trunc_r (ZebraHandle zi, const char *term, int length, heap_close (ti); xfree (ispt); } +#endif else if (zi->isams) { ISAMS_PP *ispt; @@ -394,6 +400,15 @@ static RSET rset_trunc_r (ZebraHandle zi, const char *term, int length, return result; } +static int isams_trunc_cmp (const void *p1, const void *p2) +{ + ISAMS_P i1 = *(ISAMS_P*) p1; + ISAMS_P i2 = *(ISAMS_P*) p2; + + return i1 - i2; +} + +#if ZMBOL static int isam_trunc_cmp (const void *p1, const void *p2) { ISAM_P i1 = *(ISAM_P*) p1; @@ -417,16 +432,9 @@ static int isamc_trunc_cmp (const void *p1, const void *p2) return d; return isc_block (i1) - isc_block (i2); } +#endif -static int isams_trunc_cmp (const void *p1, const void *p2) -{ - ISAMS_P i1 = *(ISAMS_P*) p1; - ISAMS_P i2 = *(ISAMS_P*) p2; - - return i1 - i2; -} - -RSET rset_trunc (ZebraHandle zi, ISAM_P *isam_p, int no, +RSET rset_trunc (ZebraHandle zi, ISAMS_P *isam_p, int no, const char *term, int length, const char *flags) { logf (LOG_DEBUG, "rset_trunc no=%d", no); @@ -436,7 +444,21 @@ RSET rset_trunc (ZebraHandle zi, ISAM_P *isam_p, int no, parms.rset_term = rset_term_create (term, length, flags); return rset_create (rset_kind_null, &parms); } - if (zi->isam) + if (zi->isams) + { + if (no == 1) + { + rset_isams_parms parms; + + parms.pos = *isam_p; + parms.is = zi->isams; + parms.rset_term = rset_term_create (term, length, flags); + return rset_create (rset_kind_isams, &parms); + } + qsort (isam_p, no, sizeof(*isam_p), isams_trunc_cmp); + } +#if ZMBOL + else if (zi->isam) { if (no == 1) { @@ -477,19 +499,7 @@ RSET rset_trunc (ZebraHandle zi, ISAM_P *isam_p, int no, #endif qsort (isam_p, no, sizeof(*isam_p), isamc_trunc_cmp); } - else if (zi->isams) - { - if (no == 1) - { - rset_isams_parms parms; - - parms.pos = *isam_p; - parms.is = zi->isams; - parms.rset_term = rset_term_create (term, length, flags); - return rset_create (rset_kind_isams, &parms); - } - qsort (isam_p, no, sizeof(*isam_p), isams_trunc_cmp); - } +#endif else { logf (LOG_WARN, "Neither isam / isamc / isams set in rset_trunc"); diff --git a/index/zebraapi.c b/index/zebraapi.c index 50b9988..a740d57 100644 --- a/index/zebraapi.c +++ b/index/zebraapi.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: zebraapi.c,v $ - * Revision 1.25 1999-11-04 15:00:45 adam + * Revision 1.26 1999-11-30 13:48:03 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.25 1999/11/04 15:00:45 adam * Implemented delete result set(s). * * Revision 1.24 1999/10/14 14:33:50 adam @@ -99,7 +102,7 @@ #include #endif -#include +#include #include "zserver.h" static void zebra_chdir (ZebraHandle zh) @@ -161,20 +164,24 @@ static int zebra_register_lock (ZebraHandle zh) dict_close (zh->dict); if (zh->sortIdx) sortIdx_close (zh->sortIdx); + if (zh->isams) + isams_close (zh->isams); +#if ZMBOL if (zh->isam) is_close (zh->isam); if (zh->isamc) isc_close (zh->isamc); - if (zh->isams) - isams_close (zh->isams); +#endif rec_close (&zh->records); } bf_cache (zh->bfs, state ? res_get (zh->res, "shadow") : NULL); zh->registerState = state; + zh->isams = NULL; +#if ZMBOL zh->isam = NULL; zh->isamc = NULL; - zh->isams = NULL; +#endif zh->dict = NULL; zh->sortIdx = NULL; zh->zei = NULL; @@ -196,26 +203,27 @@ static int zebra_register_lock (ZebraHandle zh) logf (LOG_WARN, "sortIdx_open"); zh->errCode = 2; } - if (res_get_match (zh->res, "isam", "i", NULL)) + if (res_get_match (zh->res, "isam", "s", ISAM_DEFAULT)) { - if (!(zh->isam = is_open (zh->bfs, FNAME_ISAM, key_compare, 0, - sizeof (struct it_key), zh->res))) + struct ISAMS_M_s isams_m; + if (!(zh->isams = isams_open (zh->bfs, FNAME_ISAMS, 0, + key_isams_m(zh->res, &isams_m)))) { - logf (LOG_WARN, "is_open"); + logf (LOG_WARN, "isams_open"); zh->errCode = 2; } } - else if (res_get_match (zh->res, "isam", "s", NULL)) +#if ZMBOL + else if (res_get_match (zh->res, "isam", "i", ISAM_DEFAULT)) { - struct ISAMS_M_s isams_m; - if (!(zh->isams = isams_open (zh->bfs, FNAME_ISAMS, 0, - key_isams_m(zh->res, &isams_m)))) + if (!(zh->isam = is_open (zh->bfs, FNAME_ISAM, key_compare, 0, + sizeof (struct it_key), zh->res))) { - logf (LOG_WARN, "isams_open"); + logf (LOG_WARN, "is_open"); zh->errCode = 2; } } - else + else if (res_get_match (zh->res, "isam", "c", ISAM_DEFAULT)) { struct ISAMC_M_s isamc_m; if (!(zh->isamc = isc_open (zh->bfs, FNAME_ISAMC, @@ -225,6 +233,7 @@ static int zebra_register_lock (ZebraHandle zh) zh->errCode = 2; } } +#endif zh->zei = zebraExplain_open (zh->records, zh->dh, zh->res, 0, 0, 0); if (!zh->zei) { @@ -335,12 +344,14 @@ void zebra_close (ZebraHandle zh) zebraExplain_close (zh->zei, 0, 0); dict_close (zh->dict); sortIdx_close (zh->sortIdx); + if (zh->isams) + isams_close (zh->isams); +#if ZMBOL if (zh->isam) is_close (zh->isam); if (zh->isamc) isc_close (zh->isamc); - if (zh->isams) - isams_close (zh->isams); +#endif rec_close (&zh->records); zebra_register_unlock (zh); } diff --git a/index/zebraapi.h b/index/zebraapi.h index f092167..0aae163 100644 --- a/index/zebraapi.h +++ b/index/zebraapi.h @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: zebraapi.h,v $ - * Revision 1.7 1999-11-04 15:00:45 adam + * Revision 1.8 1999-11-30 13:48:03 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.7 1999/11/04 15:00:45 adam * Implemented delete result set(s). * * Revision 1.6 1999/02/17 11:29:57 adam @@ -28,9 +31,9 @@ * */ -#include -#include -#include +#include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/index/zinfo.h b/index/zinfo.h index fea0349..30a764a 100644 --- a/index/zinfo.h +++ b/index/zinfo.h @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: zinfo.h,v $ - * Revision 1.7 1999-05-26 07:49:13 adam + * Revision 1.8 1999-11-30 13:48:03 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.7 1999/05/26 07:49:13 adam * C++ compilation. * * Revision 1.6 1999/02/02 14:51:12 adam @@ -33,7 +36,7 @@ #ifndef ZINFO_H #define ZINFO_H -#include +#include #include "recindex.h" #ifdef __cplusplus diff --git a/index/zrpn.c b/index/zrpn.c index 30b7b30..e87cf46 100644 --- a/index/zrpn.c +++ b/index/zrpn.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: zrpn.c,v $ - * Revision 1.97 1999-10-14 14:33:50 adam + * Revision 1.98 1999-11-30 13:48:04 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.97 1999/10/14 14:33:50 adam * Added truncation 5=106. * * Revision 1.96 1999/09/23 10:05:05 adam @@ -448,7 +451,7 @@ struct grep_info { #ifdef TERM_COUNT int *term_no; #endif - ISAM_P *isam_p_buf; + ISAMS_P *isam_p_buf; int isam_p_size; int isam_p_indx; ZebraHandle zh; @@ -475,12 +478,12 @@ static void add_isam_p (const char *name, const char *info, { if (p->isam_p_indx == p->isam_p_size) { - ISAM_P *new_isam_p_buf; + ISAMS_P *new_isam_p_buf; #ifdef TERM_COUNT int *new_term_no; #endif p->isam_p_size = 2*p->isam_p_size + 100; - new_isam_p_buf = (ISAM_P *) xmalloc (sizeof(*new_isam_p_buf) * + new_isam_p_buf = (ISAMS_P *) xmalloc (sizeof(*new_isam_p_buf) * p->isam_p_size); if (p->isam_p_buf) { @@ -2354,7 +2357,7 @@ RSET rpn_search (ZebraHandle zh, NMEM nmem, struct scan_info_entry { char *term; - ISAM_P isam_p; + ISAMS_P isam_p; }; struct scan_info { @@ -2378,8 +2381,8 @@ static int scan_handle (char *name, const char *info, int pos, void *client) scan_info->list[idx].term = (char *) odr_malloc (scan_info->odr, strlen(name + len_prefix)+1); strcpy (scan_info->list[idx].term, name + len_prefix); - assert (*info == sizeof(ISAM_P)); - memcpy (&scan_info->list[idx].isam_p, info+1, sizeof(ISAM_P)); + assert (*info == sizeof(ISAMS_P)); + memcpy (&scan_info->list[idx].isam_p, info+1, sizeof(ISAMS_P)); return 0; } diff --git a/index/zserver.c b/index/zserver.c index 696676a..3b060d5 100644 --- a/index/zserver.c +++ b/index/zserver.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: zserver.c,v $ - * Revision 1.74 1999-11-29 15:13:26 adam + * Revision 1.75 1999-11-30 13:48:04 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.74 1999/11/29 15:13:26 adam * Server sets implementationName - and Version. * * Revision 1.73 1999/11/04 15:00:45 adam @@ -272,7 +275,7 @@ #include #endif -#include +#include #include "zserver.h" diff --git a/index/zserver.h b/index/zserver.h index a4c2f24..0b49c28 100644 --- a/index/zserver.h +++ b/index/zserver.h @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: zserver.h,v $ - * Revision 1.44 1999-11-04 15:00:45 adam + * Revision 1.45 1999-11-30 13:48:04 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.44 1999/11/04 15:00:45 adam * Implemented delete result set(s). * * Revision 1.43 1999/07/14 10:59:27 adam @@ -160,7 +163,7 @@ #include #endif -#include +#include #include #include @@ -193,9 +196,11 @@ struct zebra_info { ZebraSet sets; Dict dict; SortIdx sortIdx; + ISAMS isams; +#if ZMBOL ISAM isam; ISAMC isamc; - ISAMS isams; +#endif Records records; int errCode; int hits; @@ -239,7 +244,7 @@ void rpn_scan (ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt, int *position, int *num_entries, ZebraScanEntry **list, int *is_partial); -RSET rset_trunc (ZebraHandle zh, ISAM_P *isam_p, int no, +RSET rset_trunc (ZebraHandle zh, ISAMS_P *isam_p, int no, const char *term, int length_term, const char *flags); ZebraSet resultSetAdd (ZebraHandle zh, const char *name, int ov); diff --git a/isam/Makefile.in b/isam/Makefile.in index 2d412c6..0c0ce41 100644 --- a/isam/Makefile.in +++ b/isam/Makefile.in @@ -1,7 +1,7 @@ # Copyright (C) 1994-1998, Index Data # All rights reserved. # Sebastian Hammer, Adam Dickmeiss -# $Id: Makefile.in,v 1.3 1999-06-09 11:58:48 adam Exp $ +# $Id: Makefile.in,v 1.4 1999-11-30 13:48:04 adam Exp $ SHELL=/bin/sh @@ -11,8 +11,8 @@ RANLIB=@RANLIB@ CDEFS=@DEFS@ @ODEFS@ LIBS=@LIBS@ -YAZLIB=../../yaz/lib/libyaz.a -YAZINC=-I../../yaz/include +YAZLIB=@YAZLIB@ +YAZINC=@YAZINC@ INCLUDE=-I../include $(YAZINC) DEFS=$(CDEFS) $(INCLUDE) diff --git a/isam/physical.c b/isam/physical.c index 09de594..65bfe19 100644 --- a/isam/physical.c +++ b/isam/physical.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: physical.c,v $ - * Revision 1.16 1999-05-26 07:49:14 adam + * Revision 1.17 1999-11-30 13:48:04 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.16 1999/05/26 07:49:14 adam * C++ compilation. * * Revision 1.15 1999/02/02 14:51:22 adam @@ -63,7 +66,7 @@ #include #include -#include +#include #include static int is_freestore_alloc(ISAM is, int type) diff --git a/isamc/Makefile.in b/isamc/Makefile.in index 316c008..efc95cd 100644 --- a/isamc/Makefile.in +++ b/isamc/Makefile.in @@ -1,7 +1,7 @@ -# Copyright (C) 1996-1998, Index Data +# Copyright (C) 1996-1999, Index Data # All rights reserved. # Sebastian Hammer, Adam Dickmeiss -# $Id: Makefile.in,v 1.6 1999-07-14 13:21:34 heikki Exp $ +# $Id: Makefile.in,v 1.7 1999-11-30 13:48:04 adam Exp $ SHELL=/bin/sh @@ -11,14 +11,14 @@ RANLIB=@RANLIB@ CDEFS=@DEFS@ @ODEFS@ LIBS=@LIBS@ -YAZLIB=../../yaz/lib/libyaz.a -YAZINC=-I../../yaz/include +YAZLIB=@YAZLIB@ +YAZINC=@YAZINC@ INCLUDE=-I../include $(YAZINC) TPROG1=isamctst DEFS=$(CDEFS) $(INCLUDE) LIB=../lib/isamc.a -PO = isamc.o isamh.o isamd.o merge.o merge-d.o isams.o +PO = isamc.o isamd.o merge.o merge-d.o all: $(LIB) diff --git a/isamc/isamc.c b/isamc/isamc.c index d5a1bd1..28b71ce 100644 --- a/isamc/isamc.c +++ b/isamc/isamc.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: isamc.c,v $ - * Revision 1.19 1999-07-14 10:59:27 adam + * Revision 1.20 1999-11-30 13:48:04 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.19 1999/07/14 10:59:27 adam * Changed functions isc_getmethod, isams_getmethod. * Improved fatal error handling (such as missing EXPLAIN schema). * @@ -84,7 +87,7 @@ #include #include -#include +#include #include "isamc-p.h" static void flush_block (ISAMC is, int cat); diff --git a/isamc/isamd.c b/isamc/isamd.c index 1da8fda..7333d31 100644 --- a/isamc/isamd.c +++ b/isamc/isamd.c @@ -1,7 +1,7 @@ /* * Copyright (c) 1995-1998, Index Data. * See the file LICENSE for details. - * $Id: isamd.c,v 1.18 1999-10-06 15:18:13 heikki Exp $ + * $Id: isamd.c,v 1.19 1999-11-30 13:48:04 adam Exp $ * * Isamd - isam with diffs * Programmed by: Heikki Levanto @@ -17,7 +17,7 @@ #include #include -#include +#include #include "../index/index.h" /* isamd uses the internal structure of it_key */ #include "isamd-p.h" @@ -850,7 +850,10 @@ void isamd_pp_dump (ISAMD is, ISAMD_P ipos) /* * $Log: isamd.c,v $ - * Revision 1.18 1999-10-06 15:18:13 heikki + * Revision 1.19 1999-11-30 13:48:04 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.18 1999/10/06 15:18:13 heikki * * Improving block sizes again * @@ -898,4 +901,4 @@ void isamd_pp_dump (ISAMD is, ISAMD_P ipos) * Copied from isamh, starting to change things... * * - */ \ No newline at end of file + */ diff --git a/isamc/merge-d.c b/isamc/merge-d.c index ed553df..29fc630 100644 --- a/isamc/merge-d.c +++ b/isamc/merge-d.c @@ -3,7 +3,7 @@ * See the file LICENSE for details. * Heikki Levanto * - * $Id: merge-d.c,v 1.24 1999-10-05 09:57:40 heikki Exp $ + * $Id: merge-d.c,v 1.25 1999-11-30 13:48:04 adam Exp $ * * bugs * sinleton-bit has to be in the high end, not low, so as not to confuse @@ -100,7 +100,7 @@ #include #include #include -#include +#include #include "../index/index.h" #include "isamd-p.h" @@ -1122,7 +1122,10 @@ ISAMD_P isamd_append (ISAMD is, ISAMD_P ipos, ISAMD_I data) /* * $Log: merge-d.c,v $ - * Revision 1.24 1999-10-05 09:57:40 heikki + * Revision 1.25 1999-11-30 13:48:04 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.24 1999/10/05 09:57:40 heikki * Tuning the isam-d (and fixed a small "detail") * * Revision 1.23 1999/09/27 14:36:36 heikki diff --git a/isamc/merge.c b/isamc/merge.c index aa7be55..3092129 100644 --- a/isamc/merge.c +++ b/isamc/merge.c @@ -9,9 +9,8 @@ #include #include #include -#include +#include #include "isamc-p.h" -#include "isamh-p.h" struct isc_merge_block { int offset; /* offset in r_buf */ @@ -462,313 +461,12 @@ ISAMC_P isc_merge (ISAMC is, ISAMC_P ipos, ISAMC_I data) return cat + firstpos * 8; } -static char *hexdump(unsigned char *p, int len, char *buff) { - static char localbuff[128]; - char bytebuff[8]; - if (!buff) buff=localbuff; - *buff='\0'; - while (len--) { - sprintf(bytebuff,"%02x",*p); - p++; - strcat(buff,bytebuff); - if (len) strcat(buff,","); - } - return buff; -} - - -/* isamh - heikki's append-only isam - * Idea: When allocating a new block, allocate memory for a very large block - * (maximal blocksize). When done, see if you can shrink it to some - * smaller size. First-time indexing will go in optimal blocks, and - * following small additions will go to the end of the last of the - * maximal ones. Only later, when new blocks need to be allocated, it - * may make sense to reserve some extra space... -*/ - - -static void isamh_reduceblock(ISAMH is, ISAMH_PP pp, int numKeys) -{ - if (pp->is->method->debug > 2) - logf(LOG_LOG,"isamh_reduce: block p=%d c=%d o=%d nk=%d ", - pp->pos, pp->cat, pp->offset, numKeys); - if (pp->pos != 0) - return; /* already allocated in some size */ - while ( ( pp->cat > 0 ) && - ( pp->offset < is->method->filecat[pp->cat-1].bsize) && - ( numKeys < is->method->filecat[pp->cat-1].mblocks) ) - pp->cat--; - pp->pos = isamh_alloc_block(is,pp->cat) ; - if (pp->is->method->debug > 2) - logf(LOG_LOG,"isamh_reduced block p=%d to c=%d o=%d nk=%d bs=%d", - pp->pos, pp->cat, pp->offset, numKeys, - is->method->filecat[pp->cat].bsize); -} /* reduceblock */ - - -ISAMC_P isamh_append (ISAMH is, ISAMH_P ipos, ISAMH_I data) -{ - - ISAMH_PP pp; /* always the last pp in the chain */ - ISAMH_PP firstpp; /* always the first one in the chain, may ==pp */ - ISAMH_PP prevpp; /* the one that points to pp, may be null or ==firstpp */ - /* needed to postpone the writing of its next field until */ - /* pp itself has been categorized */ - char i_item[128]; - char *i_item_ptr; - int i_more=1, i_mode; - - char codebuffer[128]; - char *codeptr; - char *bufptr; - int codelen; - - void *r_clientData; /* encode client data */ - int newblock; - int newcat; - int maxkeys; - int maxsize; - int retval; - int maxcat; - - pp = firstpp = isamh_pp_open (is, ipos); - prevpp =0; /* only used when new blocks allocated */ - - assert (*is->method->code_reset); - - maxcat=0; /* find the largest block size for default allocation */ - for ( newcat=0; is->method->filecat[newcat].mblocks > 0; newcat++) - if ( is->method->filecat[newcat].bsize > - is->method->filecat[maxcat].bsize) - maxcat = newcat; - - if ( 0==ipos) - { /* new block */ - pp->cat=maxcat; /* start large... */ - pp->pos = 0; /* not allocated yet */ - pp->size= pp->offset = ISAMH_BLOCK_OFFSET_1 ; - pp->buf=xrealloc(pp->buf,is->method->filecat[maxcat].bsize); - r_clientData = (*is->method->code_start)(ISAMH_ENCODE); - if (pp->is->method->debug > 2) - logf(LOG_LOG,"isamh_append: starting with new block"); - } - else - { /* existing block */ - if (isamh_block(firstpp->lastblock) == firstpp->pos) - /*!!! TODO: BUG: Compare whole addresses !!! (later) */ - { /* only one block, we have it already */ - pp->offset=ISAMH_BLOCK_OFFSET_1; - if (pp->is->method->debug > 2) - logf(LOG_LOG,"isamh_append: starting with one block %d",pp->pos); - } - else - { - if (pp->is->method->debug > 2) - logf(LOG_LOG,"isamh_append: starting with multiple blocks %d>%d>%d", - firstpp->pos,isamh_block(firstpp->next),isamh_block(firstpp->lastblock)); - pp=isamh_pp_open(is,firstpp->lastblock); - /* dirty, but this can also read a N-block. Just clear extra values*/ - pp->lastblock=0; - pp->offset=ISAMH_BLOCK_OFFSET_N; - } /* get last */ - r_clientData = (*is->method->code_start)(ISAMH_ENCODE); - if (pp->is->method->debug > 3) - logf(LOG_LOG,"isamh_append: scanning to end of block %d %d->%d", - pp->pos, pp->offset, pp->size); - codeptr=codebuffer; - while (pp->offsetsize) { - codeptr=codebuffer; - bufptr=pp->buf + pp->offset; - (*is->method->code_item)(ISAMH_DECODE, r_clientData, &codeptr, &bufptr); - codelen = bufptr - (pp->buf+pp->offset) ; - if (pp->is->method->debug > 3) - logf(LOG_LOG,"isamh_append: dec at %d %d/%d:%s", - pp->offset, codelen, codeptr-codebuffer, - hexdump(codebuffer,codeptr-codebuffer,0) ); - pp->offset += codelen; - } - } /* existing block */ - - - i_item_ptr = i_item; - i_more = (*data->read_item)(data->clientData,&i_item_ptr,&i_mode); - if (pp->is->method->debug > 3) - logf(LOG_LOG,"isamh_append 1: m=%d l=%d %s", - i_mode, i_item_ptr-i_item, hexdump(i_item,i_item_ptr-i_item,0)); - - maxsize = is->method->filecat[pp->cat].bsize; - - while(i_more) { - if (i_mode) - { /* insert key, ignore all delete keys time being... */ - codeptr = codebuffer; - i_item_ptr=i_item; - (*is->method->code_item)(ISAMH_ENCODE, r_clientData, &codeptr, &i_item_ptr); - codelen = codeptr-codebuffer; - - assert( (codelen < 128) && (codelen>0)); - - if (pp->is->method->debug > 3) - logf(LOG_LOG,"isamh_append: coded into %d:%s (nk=%d)", - codelen,hexdump(codebuffer,codelen,0),firstpp->numKeys); - - if ( pp->offset + codelen > maxsize ) - { /* oops, block full, do something */ - newcat = maxcat; /* start with a large block again */ - maxkeys = is->method->filecat[pp->cat].mblocks; /* max keys */ - if (pp->is->method->debug > 2) - logf(LOG_LOG,"isamh_append: need new block: %d > %d (k:%d/%d)", - pp->offset + codelen, maxsize, firstpp->numKeys,maxkeys ); - - newblock = 0; - pp->next = 0; - - /* Four possibilities: */ - if (prevpp!=0) - { /* 1: we have a prevpp that can go on the disk */ - /* reduce pp, set next ptr, and store block */ - /* set pp up as new last block, and remember the just */ - /* filled as (pp) the new prev */ - assert(pp!=firstpp); - isamh_reduceblock(is,pp,firstpp->numKeys); - prevpp->next=isamh_addr(pp->pos,pp->cat); - isamh_buildlaterblock(prevpp); - isamh_write_block(is,prevpp->cat,prevpp->pos,prevpp->buf); - if (pp->is->method->debug > 2) - logf(LOG_LOG,"isamh_append N1: Wrote prevpp (%d:%d) -> %d:%d", - prevpp->pos, prevpp->cat, pp->pos, pp->cat); - isamh_pp_close(prevpp); /* it's done its job */ - prevpp = pp; - pp=isamh_pp_open(is,isamh_addr(0,maxcat)); /* start a large one */ - pp->size=pp->offset=ISAMH_BLOCK_OFFSET_N ; - pp->next=0; - pp->lastblock=0; - } - else if ( (firstpp!=pp) && (firstpp->next != 0)) - { /* 2: we are working at end of list, but have no prevpp */ - /* some block (already on disk) points to pp */ - /* set the newly filled block as prev, don't save yet */ - /* allocate new pp */ - if (pp->is->method->debug > 2) - logf(LOG_LOG,"isamh_append N2: set up a new prevpp (%d:%d)", - pp->pos, pp->cat); - prevpp = pp; - pp=isamh_pp_open(is,isamh_addr(0,maxcat)); /* start a large one */ - pp->size=pp->offset=ISAMH_BLOCK_OFFSET_N ; - pp->next=0; - pp->lastblock=0; - } - else if ( (firstpp!=pp) && (firstpp->next==0)) - { /* 3: we have earlier allocated pp as the second block */ - /* reduce it to get its address. Set first->next to it */ - /* move it to prevpp, and create a new pp */ - isamh_reduceblock(is,pp,firstpp->numKeys); - firstpp->next=isamh_addr(pp->pos,pp->cat); - if (pp->is->method->debug > 2) - logf(LOG_LOG,"isamh_append N3: set up a new firstpp->next (%d:%d)", - pp->pos, pp->cat); - prevpp=pp; - pp=isamh_pp_open(is,isamh_addr(0,maxcat)); /* start a large one */ - pp->size=pp->offset=ISAMH_BLOCK_OFFSET_N ; - pp->next=0; - pp->lastblock=0; - } - else - { /* 4: firstpp itself has got full. */ - /* allocate a new pp for it, store nothing */ - assert(firstpp==pp); - assert(firstpp->next==0); - if (pp->is->method->debug > 2) - logf(LOG_LOG,"isamh_append N4: allocated new pp for full first (%d:%d)", - firstpp->pos, firstpp->cat); - pp=isamh_pp_open(is,isamh_addr(0,maxcat)); /* start a large one */ - pp->size=pp->offset=ISAMH_BLOCK_OFFSET_N ; - pp->next=0; - pp->lastblock=0; - } - - maxsize = is->method->filecat[pp->cat].bsize; - pp->size=pp->offset=ISAMH_BLOCK_OFFSET_N ; - pp->next=0; - pp->lastblock=0; - if (pp->is->method->debug > 2) - logf(LOG_LOG,"isamh_append: got a new block c=%d p=%d",pp->cat,pp->pos); - - - /* reset the encoding, and code again */ - (*is->method->code_reset)(r_clientData); - codeptr = codebuffer; - i_item_ptr=i_item; - (*is->method->code_item)(ISAMH_ENCODE, r_clientData, &codeptr, &i_item_ptr); - codelen = codeptr-codebuffer; - if (pp->is->method->debug > 3) - logf(LOG_LOG,"isamh_append: coded again %d:%s (nk=%d)", - codelen,hexdump(codebuffer,codelen,0),firstpp->numKeys); - - } /* block full */ - - /* ok, now we can write it */ - memcpy(&(pp->buf[pp->offset]), codebuffer, codelen); - pp->offset += codelen; - pp->size += codelen; - firstpp->numKeys++; - } /* not a delete */ - - /* try to read the next element */ - i_item_ptr = i_item; - i_more = (*data->read_item)(data->clientData,&i_item_ptr,&i_mode); - if (pp->is->method->debug > 3) - logf(LOG_LOG,"isamh_append 2: m=%d l=%d %s", - i_mode, i_item_ptr-i_item, hexdump(i_item,i_item_ptr-i_item,0)); - - } /* while */ - - isamh_reduceblock(is,pp,firstpp->numKeys); - /* may be the same as firstpp! */ - - if (prevpp) - { /* Write the prev block we have been holding off */ - assert(prevpp->pos); - prevpp->next = isamh_addr(pp->pos, pp->cat); - isamh_buildlaterblock(prevpp); - isamh_write_block(is,prevpp->cat,prevpp->pos,prevpp->buf); - if (firstpp->next==0) /* can happen if extending many blocks */ - firstpp->next=isamh_addr(prevpp->pos,prevpp->cat); - isamh_pp_close(prevpp); - } - /* Write the last (partial) block, if needed. */ - if (pp!=firstpp) - { - pp->next=0; /* just to be sure */ - if (firstpp->next==0) - firstpp->next=isamh_addr(pp->pos,pp->cat); - isamh_buildlaterblock(pp); - isamh_write_block(is,pp->cat,pp->pos,pp->buf); - } - - /* update first block and write it */ - firstpp->lastblock = isamh_addr(pp->pos,pp->cat); - isamh_reduceblock(is,firstpp,firstpp->numKeys); - isamh_buildfirstblock(firstpp); - isamh_write_block(is,firstpp->cat,firstpp->pos,firstpp->buf); - - /* release the second block, if we allocated one */ - if ( firstpp != pp ) - isamh_pp_close(pp); - - /* get return value (before it disappears at close! */ - retval = isamh_addr(firstpp->pos,firstpp->cat); - - isamh_pp_close(firstpp); - - return retval; - -} /* isamh_append */ - - /* * $Log: merge.c,v $ - * Revision 1.19 1999-07-14 12:12:07 heikki + * Revision 1.20 1999-11-30 13:48:04 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.19 1999/07/14 12:12:07 heikki * Large-block isam-h (may not work too well... Abandoning for isam-d) * * Revision 1.17 1999/07/13 14:22:17 heikki diff --git a/recctrl/Makefile.in b/recctrl/Makefile.in index 54deebf..ffa7712 100644 --- a/recctrl/Makefile.in +++ b/recctrl/Makefile.in @@ -1,7 +1,7 @@ -# Copyright (C) 1995-1998, Index Data +# Copyright (C) 1995-1999, Index Data # All rights reserved. # Sebastian Hammer, Adam Dickmeiss -# $Id: Makefile.in,v 1.4 1999-06-09 11:58:48 adam Exp $ +# $Id: Makefile.in,v 1.5 1999-11-30 13:48:04 adam Exp $ SHELL=/bin/sh @@ -11,8 +11,8 @@ RANLIB=@RANLIB@ CDEFS=@DEFS@ @ODEFS@ LIBS=@LIBS@ -YAZLIB=../../yaz/lib/libyaz.a -YAZINC=-I../../yaz/include +YAZLIB=@YAZLIB@ +YAZINC=@YAZINC@ INCLUDE=-I../include $(YAZINC) TCL_INCLUDE=@TCL_INCLUDE@ diff --git a/recctrl/grsread.h b/recctrl/grsread.h index af8219a..0f9d05d 100644 --- a/recctrl/grsread.h +++ b/recctrl/grsread.h @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: grsread.h,v $ - * Revision 1.7 1999-05-26 07:49:14 adam + * Revision 1.8 1999-11-30 13:48:04 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.7 1999/05/26 07:49:14 adam * C++ compilation. * * Revision 1.6 1999/05/20 12:57:18 adam @@ -32,7 +35,7 @@ #ifndef GRSREAD_H #define GRSREAD_H -#include +#include #ifdef __cplusplus extern "C" { diff --git a/recctrl/marcread.c b/recctrl/marcread.c index fe3e9d3..c76e22d 100644 --- a/recctrl/marcread.c +++ b/recctrl/marcread.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: marcread.c,v $ - * Revision 1.9 1999-06-25 13:47:25 adam + * Revision 1.10 1999-11-30 13:48:04 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.9 1999/06/25 13:47:25 adam * Minor change that prevents MSVC warning. * * Revision 1.8 1999/05/26 07:49:14 adam @@ -38,9 +41,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "grsread.h" data1_node *data1_mk_node_wp (data1_handle dh, NMEM mem, data1_node *parent) diff --git a/recctrl/recgrs.c b/recctrl/recgrs.c index dc31d46..00a7acd 100644 --- a/recctrl/recgrs.c +++ b/recctrl/recgrs.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: recgrs.c,v $ - * Revision 1.32 1999-09-07 07:19:21 adam + * Revision 1.33 1999-11-30 13:48:04 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.32 1999/09/07 07:19:21 adam * Work on character mapping. Implemented replace rules. * * Revision 1.31 1999/07/14 10:56:43 adam @@ -197,8 +200,8 @@ #include #endif -#include -#include +#include +#include #include #include "grsread.h" diff --git a/recctrl/regxread.c b/recctrl/regxread.c index d24be82..32ffdda 100644 --- a/recctrl/regxread.c +++ b/recctrl/regxread.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: regxread.c,v $ - * Revision 1.32 1999-09-07 07:19:21 adam + * Revision 1.33 1999-11-30 13:48:04 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.32 1999/09/07 07:19:21 adam * Work on character mapping. Implemented replace rules. * * Revision 1.31 1999/07/14 13:05:29 adam @@ -192,7 +195,7 @@ #include #include -#include +#include #include #include #include "grsread.h" diff --git a/recctrl/sgmlread.c b/recctrl/sgmlread.c index 7179f35..1bcce37 100644 --- a/recctrl/sgmlread.c +++ b/recctrl/sgmlread.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: sgmlread.c,v $ - * Revision 1.9 1999-07-14 10:56:16 adam + * Revision 1.10 1999-11-30 13:48:04 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.9 1999/07/14 10:56:16 adam * Filter handles multiple records in one file. * * Revision 1.8 1999/06/25 13:47:25 adam @@ -35,7 +38,7 @@ * */ #include -#include +#include #include "grsread.h" diff --git a/rset/Makefile.in b/rset/Makefile.in index 761a2a4..e21a1a6 100644 --- a/rset/Makefile.in +++ b/rset/Makefile.in @@ -1,7 +1,7 @@ -# Copyright (C) 1994-1998, Index Data +# Copyright (C) 1994-1999, Index Data # All rights reserved. # Sebastian Hammer, Adam Dickmeiss -# $Id: Makefile.in,v 1.4 1999-06-09 11:58:48 adam Exp $ +# $Id: Makefile.in,v 1.5 1999-11-30 13:48:04 adam Exp $ SHELL=/bin/sh @@ -11,8 +11,8 @@ RANLIB=@RANLIB@ CDEFS=@DEFS@ @ODEFS@ LIBS=@LIBS@ -YAZLIB=../../yaz/lib/libyaz.a -YAZINC=-I../../yaz/include +YAZLIB=@YAZLIB@ +YAZINC=@YAZINC@ INCLUDE=-I../include $(YAZINC) DEFS=$(CDEFS) $(INCLUDE) diff --git a/rset/rsisam.c b/rset/rsisam.c index e816376..92e6f4c 100644 --- a/rset/rsisam.c +++ b/rset/rsisam.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: rsisam.c,v $ - * Revision 1.20 1999-05-26 07:49:14 adam + * Revision 1.21 1999-11-30 13:48:04 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.20 1999/05/26 07:49:14 adam * C++ compilation. * * Revision 1.19 1999/02/02 14:51:34 adam @@ -72,11 +75,11 @@ * Work * */ - #include #include -#include #include +#if ZMBOL +#include static void *r_create(RSET ct, const struct rset_control *sel, void *parms); static RSFD r_open (RSET ct, int flag); @@ -203,3 +206,4 @@ static int r_write (RSFD rfd, const void *buf) logf (LOG_FATAL, "ISAM set type is read-only"); return -1; } +#endif diff --git a/rset/rsisamc.c b/rset/rsisamc.c index cd8d9dd..76c9702 100644 --- a/rset/rsisamc.c +++ b/rset/rsisamc.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: rsisamc.c,v $ - * Revision 1.7 1999-05-26 07:49:14 adam + * Revision 1.8 1999-11-30 13:48:04 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.7 1999/05/26 07:49:14 adam * C++ compilation. * * Revision 1.6 1999/02/02 14:51:35 adam @@ -29,10 +32,12 @@ * */ + #include #include -#include #include +#if ZMBOL +#include static void *r_create(RSET ct, const struct rset_control *sel, void *parms); static RSFD r_open (RSET ct, int flag); @@ -157,3 +162,4 @@ static int r_write (RSFD rfd, const void *buf) logf (LOG_FATAL, "ISAMC set type is read-only"); return -1; } +#endif diff --git a/rset/rsm_or.c b/rset/rsm_or.c index 324118b..382e5dd 100644 --- a/rset/rsm_or.c +++ b/rset/rsm_or.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: rsm_or.c,v $ - * Revision 1.9 1999-07-13 14:45:42 adam + * Revision 1.10 1999-11-30 13:48:04 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.9 1999/07/13 14:45:42 adam * Fixed memory leak. * * Revision 1.8 1999/05/26 07:49:14 adam @@ -37,15 +40,17 @@ * */ + #include #include #include #include +#include +#if ZMBOL #include #include #include -#include static void *r_create(RSET ct, const struct rset_control *sel, void *parms); static RSFD r_open (RSET ct, int flag); @@ -349,3 +354,4 @@ static int r_write (RSFD rfd, const void *buf) logf (LOG_FATAL, "mor set type is read-only"); return -1; } +#endif diff --git a/test/gils/test.sh b/test/gils/test.sh index 7abd7cb..1fab726 100755 --- a/test/gils/test.sh +++ b/test/gils/test.sh @@ -1,5 +1,5 @@ : echo Loading Records -../../index/zebraidx -t grs.sgml update records +../../bin/zebraidx -t grs.sgml update records echo Starting Server -../../index/zebrasrv +../../bin/zebrasrv diff --git a/test/gils/zebra.cfg b/test/gils/zebra.cfg index d552d73..9e42c87 100644 --- a/test/gils/zebra.cfg +++ b/test/gils/zebra.cfg @@ -1,8 +1,8 @@ # Simple Zebra configuration file -# $Id: zebra.cfg,v 1.7 1999-08-24 13:22:19 heikki Exp $ +# $Id: zebra.cfg,v 1.8 1999-11-30 13:48:04 adam Exp $ # # Where are the YAZ / Zebra tables located? -profilePath: .:../../tab:../../../yaz/tab +profilePath: .:../../tab:../../../yaz-1.5/tab # Files that describe the attribute sets supported. attset: bib1.att diff --git a/util/Makefile.in b/util/Makefile.in index 9726eac..6adcf8b 100644 --- a/util/Makefile.in +++ b/util/Makefile.in @@ -1,7 +1,7 @@ # Copyright (C) 1994-1998, Index Data ApS # All rights reserved. # Sebastian Hammer, Adam Dickmeiss -# $Id: Makefile.in,v 1.3 1999-06-09 11:58:48 adam Exp $ +# $Id: Makefile.in,v 1.4 1999-11-30 13:48:04 adam Exp $ SHELL=/bin/sh @@ -11,8 +11,8 @@ RANLIB=@RANLIB@ CDEFS=@DEFS@ @ODEFS@ LIBS=@LIBS@ -YAZLIB=../../yaz/lib/libyaz.a -YAZINC=-I../../yaz/include +YAZLIB=@YAZLIB@ +YAZINC=@YAZINC@ INCLUDE=-I../include $(YAZINC) TPROG=opt-test diff --git a/util/charmap.c b/util/charmap.c index 2ce85e5..fc9df50 100644 --- a/util/charmap.c +++ b/util/charmap.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: charmap.c,v $ - * Revision 1.17 1999-09-08 12:13:21 adam + * Revision 1.18 1999-11-30 13:48:04 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.17 1999/09/08 12:13:21 adam * Fixed minor bug "replace"-mappings. Removed some logging messages. * * Revision 1.16 1999/09/07 07:19:21 adam @@ -71,7 +74,7 @@ #include #include -#include +#include #include #define CHR_MAXSTR 1024 diff --git a/util/passwddb.c b/util/passwddb.c index 7e76d7c..b3d6936 100644 --- a/util/passwddb.c +++ b/util/passwddb.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: passwddb.c,v $ - * Revision 1.5 1999-05-26 07:49:14 adam + * Revision 1.6 1999-11-30 13:48:04 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.5 1999/05/26 07:49:14 adam * C++ compilation. * * Revision 1.4 1999/02/02 14:51:39 adam @@ -32,8 +35,8 @@ #include #endif -#include -#include +#include +#include #include diff --git a/util/res.c b/util/res.c index 11946c3..779db2d 100644 --- a/util/res.c +++ b/util/res.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: res.c,v $ - * Revision 1.26 1999-10-07 09:48:36 adam + * Revision 1.27 1999-11-30 13:48:04 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.26 1999/10/07 09:48:36 adam * Allow res_get / res_get_def with NULL res. * * Revision 1.25 1999/05/26 07:49:14 adam @@ -95,7 +98,7 @@ #endif #include -#include +#include static struct res_entry *add_entry (Res r) { @@ -292,6 +295,8 @@ int res_get_match (Res r, const char *name, const char *value, const char *s) { const char *cn = res_get (r, name); + if (!cn) + cn = s; if (cn && !yaz_matchstr (cn, value)) return 1; return 0; diff --git a/util/zebramap.c b/util/zebramap.c index 0dc705e..9538f8e 100644 --- a/util/zebramap.c +++ b/util/zebramap.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: zebramap.c,v $ - * Revision 1.18 1999-10-15 08:27:46 adam + * Revision 1.19 1999-11-30 13:48:04 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.18 1999/10/15 08:27:46 adam * Fixed replace handler. 8-bit fix. * * Revision 1.17 1999/09/08 12:13:21 adam @@ -69,7 +72,7 @@ #include #include -#include +#include #include #include -- 1.7.10.4