# 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
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
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
if sed '/^#Depend/q' <Makefile >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]'`
# 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
CDEFS=@DEFS@ @ODEFS@
LIBS=@LIBS@
-YAZLIB=-lyaz
-YAZINC=-I../../yaz/include
+YAZLIB=@YAZLIB@
+YAZINC=@YAZINC@
INCLUDE=-I../include $(YAZINC)
TPROG=btest
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.
+
+
# 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
# 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
# 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
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.
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
{ 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
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
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
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=
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 769 "configure"
+#line 775 "configure"
#include "confdefs.h"
#include <assert.h>
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
:
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 786 "configure"
+#line 792 "configure"
#include "confdefs.h"
#include <assert.h>
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
:
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 803 "configure"
+#line 809 "configure"
#include "confdefs.h"
#include <assert.h>
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
:
# 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
# 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
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
# 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
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
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 <<EOF
-#line 1029 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char connect(); below. */
-#include <assert.h>
-/* 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 <<EOF
-#line 1081 "configure"
-#include "confdefs.h"
-
-int main() {
-main()
-; return 0; }
-EOF
-if { (eval echo configure:1088: \"$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
- 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 <<EOF
-#line 1119 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char accept(); below. */
-#include <assert.h>
-/* 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 <<EOF
-#line 1169 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char gethostbyname(); below. */
-#include <assert.h>
-/* 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 <<EOF
-#line 1218 "configure"
-#include "confdefs.h"
-
-int main() {
-main()
-; return 0; }
-EOF
-if { (eval echo configure:1225: \"$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
- 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
-#line 1256 "configure"
+#line 1111 "configure"
#include "confdefs.h"
#include <$ac_hdr>
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*
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 <<EOF
-#line 1296 "configure"
-#include "confdefs.h"
-
-int main() {
-main()
-; return 0; }
-EOF
-if { (eval echo configure:1303: \"$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
- 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
ac_save_LIBS="$LIBS"
LIBS="-lbz2 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1332 "configure"
+#line 1151 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
bzCompressInit()
; return 0; }
EOF
-if { (eval echo configure:1343: \"$ac_link\") 1>&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
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
-#line 1380 "configure"
+#line 1199 "configure"
#include "confdefs.h"
#include <$ac_hdr>
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*
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 <<EOF
-#line 1418 "configure"
+#line 1237 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
#include <float.h>
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*
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
-#line 1443 "configure"
+#line 1262 "configure"
#include "confdefs.h"
#include <string.h>
EOF
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
-#line 1461 "configure"
+#line 1280 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
:
else
cat > conftest.$ac_ext <<EOF
-#line 1482 "configure"
+#line 1301 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
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
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 <<EOF
s%@ODEFS@%$ODEFS%g
s%@TCL_INCLUDE@%$TCL_INCLUDE%g
s%@TCL_LIB@%$TCL_LIB%g
+s%@YAZLIB@%$YAZLIB%g
+s%@YAZINC@%$YAZINC%g
s%@CC@%$CC%g
s%@CPP@%$CPP%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
s%@RANLIB@%$RANLIB%g
+s%@build_root@%$build_root%g
+s%@yazconfig@%$yazconfig%g
s%@TCLSH@%$TCLSH%g
CEOF
cat >> $CONFIG_STATUS <<EOF
-CONFIG_FILES=\${CONFIG_FILES-"Makefile util/Makefile bfile/Makefile dfa/Makefile dict/Makefile isam/Makefile isamc/Makefile recctrl/Makefile rset/Makefile index/Makefile"}
+CONFIG_FILES=\${CONFIG_FILES-"Makefile util/Makefile bfile/Makefile dfa/Makefile dict/Makefile isams/Makefile isam/Makefile isamc/Makefile recctrl/Makefile rset/Makefile index/Makefile"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
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)
AC_SUBST(DEFS)
AC_SUBST(TCL_INCLUDE)
AC_SUBST(TCL_LIB)
+AC_SUBST(YAZLIB)
+AC_SUBST(YAZINC)
dnl
dnl ------ Checking programs
AC_PROG_CC
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
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
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)
# 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
CDEFS=@DEFS@ @ODEFS@
LIBS=@LIBS@
-YAZLIB=../../yaz/lib/libyaz.a
-YAZINC=-I../../yaz/include
+YAZLIB=@YAZLIB@
+YAZINC=@YAZINC@
INCLUDE=-I../include $(YAZINC)
TPROG1=agrep
# 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
CDEFS=@DEFS@ @ODEFS@
LIBS=@LIBS@
-YAZLIB=../../yaz/lib/libyaz.a
-YAZINC=-I../../yaz/include
+YAZLIB=@YAZLIB@
+YAZINC=@YAZINC@
INCLUDE=-I../include $(YAZINC)
TPROG1=dicttest
* 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
#include <string.h>
#include <stdio.h>
-#include <log.h>
+#include <yaz/log.h>
#include <dict.h>
static void dict_copy_page(Dict dict, char *to_p, char *from_p, int *map)
* 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
#ifndef CHARMAP_H
#define CHARMAP_H
-#include <yconfig.h>
+#include <yaz/yconfig.h>
#ifdef __cplusplus
extern "C" {
* 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
#define DICT_H
#include <bfile.h>
-#include <log.h>
+#include <yaz/log.h>
#ifdef __cplusplus
extern "C" {
* 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
#ifndef RECCTRL_H
#define RECCTRL_H
-#include <proto.h>
-#include <oid.h>
-#include <odr.h>
-#include <data1.h>
+#include <yaz/proto.h>
+#include <yaz/oid.h>
+#include <yaz/odr.h>
+#include <yaz/data1.h>
#include <zebramap.h>
#ifdef __cplusplus
* 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
#ifndef ZEBRAMAP_H
#define ZEBRAMAP_H
-#include <proto.h>
+#include <yaz/proto.h>
#include <res.h>
#ifdef __cplusplus
* 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
#ifndef ZEBRA_UTIL_H
#define ZEBRA_UTIL_H
-#include <yaz-util.h>
+#include <yaz/yaz-util.h>
#include <res.h>
+#include <zebraver.h>
#endif
* 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
*/
#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
-# 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
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)
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)
$(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
#include <stdio.h>
-#include <log.h>
-#include <pquery.h>
+#include <yaz/log.h>
+#include <yaz/pquery.h>
#include "zebraapi.h"
/* Small routine to display GRS-1 record variants ... */
* 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
#include <stdio.h>
-#include <log.h>
+#include <yaz/log.h>
#include <res.h>
#include <zebrautl.h>
#include "zserver.h"
#include <zebramap.h>
#include <dict.h>
+#include <isams.h>
+#if ZMBOL
#include <isam.h>
#include <isamc.h>
-#include <isams.h>
-#include <isamh.h>
#include <isamd.h>
-#include <data1.h>
+#define ISAM_DEFAULT "c"
+#else
+#define ISAM_DEFAULT "s"
+#endif
+#include <yaz/data1.h>
#include <recctrl.h>
#ifdef __cplusplus
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);
/*
* $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
#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;
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;
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;
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]);
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;
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,
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,
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,
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;
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");
} /* 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 */
}
/*
*
* $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
}
}
-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);
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;
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;
}
return me;
}
+#endif
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
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,
return 1;
}
+#if ZMBOL
int heap_inpc (struct heap_info *hi)
{
struct heap_cread_info hci;
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;
return 0;
}
-
-
-
int heap_inp (struct heap_info *hi)
{
char *info;
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;
{
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;
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,
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);
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,
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,
exit (1);
}
}
+#endif
kf = (struct key_file **) xmalloc ((1+nkeys) * sizeof(*kf));
progressInfo.totalBytes = 0;
progressInfo.totalOffset = 0;
}
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++)
{
/*
* $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
* 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
#include <unistd.h>
#endif
-#include <data1.h>
+#include <yaz/data1.h>
#include "index.h"
#include "recindex.h"
* 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
#include <string.h>
-#include <log.h>
+#include <yaz/log.h>
#include <bfile.h>
#include <sortidx.h>
* 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
#include <stdio.h>
#include <assert.h>
+#define NEW_TRUNC 1
+
#include "zserver.h"
#include <rstemp.h>
+#include <rsnull.h>
+#include <rsisams.h>
+#if ZMBOL
#include <rsisam.h>
#include <rsisamc.h>
-#include <rsisams.h>
-#include <rsnull.h>
-
-#define NEW_TRUNC 1
-
#if NEW_TRUNC
#include <rsm_or.h>
#endif
+#endif
struct trunc_info {
int *ptr;
}
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;
xfree (rsfd);
heap_close (ti);
}
+#if ZMBOL
else if (zi->isam)
{
ISPT *ispt;
heap_close (ti);
xfree (ispt);
}
+#endif
else if (zi->isams)
{
ISAMS_PP *ispt;
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;
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);
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)
{
#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");
* 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
#include <unistd.h>
#endif
-#include <diagbib1.h>
+#include <yaz/diagbib1.h>
#include "zserver.h"
static void zebra_chdir (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;
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,
zh->errCode = 2;
}
}
+#endif
zh->zei = zebraExplain_open (zh->records, zh->dh, zh->res, 0, 0, 0);
if (!zh->zei)
{
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);
}
* 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
*
*/
-#include <odr.h>
-#include <oid.h>
-#include <proto.h>
+#include <yaz/odr.h>
+#include <yaz/oid.h>
+#include <yaz/proto.h>
#ifdef __cplusplus
extern "C" {
* 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
#ifndef ZINFO_H
#define ZINFO_H
-#include <data1.h>
+#include <yaz/data1.h>
#include "recindex.h"
#ifdef __cplusplus
* 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
#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;
{
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)
{
struct scan_info_entry {
char *term;
- ISAM_P isam_p;
+ ISAMS_P isam_p;
};
struct scan_info {
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;
}
* 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
#include <unistd.h>
#endif
-#include <data1.h>
+#include <yaz/data1.h>
#include "zserver.h"
* 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
#include <sys/times.h>
#endif
-#include <backend.h>
+#include <yaz/backend.h>
#include <rset.h>
#include <sortidx.h>
ZebraSet sets;
Dict dict;
SortIdx sortIdx;
+ ISAMS isams;
+#if ZMBOL
ISAM isam;
ISAMC isamc;
- ISAMS isams;
+#endif
Records records;
int errCode;
int hits;
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);
# 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
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)
* 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
#include <stdio.h>
#include <string.h>
-#include <log.h>
+#include <yaz/log.h>
#include <isam.h>
static int is_freestore_alloc(ISAM is, int type)
-# 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
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)
* 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).
*
#include <string.h>
#include <stdio.h>
-#include <log.h>
+#include <yaz/log.h>
#include "isamc-p.h"
static void flush_block (ISAMC is, int cat);
/*
* 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
#include <string.h>
#include <stdio.h>
-#include <log.h>
+#include <yaz/log.h>
#include "../index/index.h" /* isamd uses the internal structure of it_key */
#include "isamd-p.h"
/*
* $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
*
* Copied from isamh, starting to change things...
*
*
- */
\ No newline at end of file
+ */
* 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
#include <assert.h>
#include <string.h>
#include <stdio.h>
-#include <log.h>
+#include <yaz/log.h>
#include "../index/index.h"
#include "isamd-p.h"
/*
* $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
#include <assert.h>
#include <string.h>
#include <stdio.h>
-#include <log.h>
+#include <yaz/log.h>
#include "isamc-p.h"
-#include "isamh-p.h"
struct isc_merge_block {
int offset; /* offset in r_buf */
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->offset<pp->size) {
- 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
-# 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
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@
* 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
#ifndef GRSREAD_H
#define GRSREAD_H
-#include <data1.h>
+#include <yaz/data1.h>
#ifdef __cplusplus
extern "C" {
* 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
#include <ctype.h>
#include <assert.h>
-#include <log.h>
-#include <yaz-util.h>
-#include <marcdisp.h>
+#include <yaz/log.h>
+#include <yaz/yaz-util.h>
+#include <yaz/marcdisp.h>
#include "grsread.h"
data1_node *data1_mk_node_wp (data1_handle dh, NMEM mem, data1_node *parent)
* 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
#include <unistd.h>
#endif
-#include <log.h>
-#include <oid.h>
+#include <yaz/log.h>
+#include <yaz/oid.h>
#include <recctrl.h>
#include "grsread.h"
* 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
#include <string.h>
#include <ctype.h>
-#include <tpath.h>
+#include <yaz/tpath.h>
#include <zebrautl.h>
#include <dfa.h>
#include "grsread.h"
* 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
*
*/
#include <assert.h>
-#include <log.h>
+#include <yaz/log.h>
#include "grsread.h"
-# 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
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)
* 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
* Work
*
*/
-
#include <stdio.h>
#include <assert.h>
-#include <rsisam.h>
#include <zebrautl.h>
+#if ZMBOL
+#include <rsisam.h>
static void *r_create(RSET ct, const struct rset_control *sel, void *parms);
static RSFD r_open (RSET ct, int flag);
logf (LOG_FATAL, "ISAM set type is read-only");
return -1;
}
+#endif
* 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
*
*/
+
#include <stdio.h>
#include <assert.h>
-#include <rsisamc.h>
#include <zebrautl.h>
+#if ZMBOL
+#include <rsisamc.h>
static void *r_create(RSET ct, const struct rset_control *sel, void *parms);
static RSFD r_open (RSET ct, int flag);
logf (LOG_FATAL, "ISAMC set type is read-only");
return -1;
}
+#endif
* 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
*
*/
+
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <zebrautl.h>
+#if ZMBOL
#include <isam.h>
#include <isamc.h>
#include <rsm_or.h>
-#include <zebrautl.h>
static void *r_create(RSET ct, const struct rset_control *sel, void *parms);
static RSFD r_open (RSET ct, int flag);
logf (LOG_FATAL, "mor set type is read-only");
return -1;
}
+#endif
:
echo Loading Records
-../../index/zebraidx -t grs.sgml update records
+../../bin/zebraidx -t grs.sgml update records
echo Starting Server
-../../index/zebrasrv
+../../bin/zebrasrv
# 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
# 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
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
* 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
#include <string.h>
#include <assert.h>
-#include <yaz-util.h>
+#include <yaz/yaz-util.h>
#include <charmap.h>
#define CHR_MAXSTR 1024
* 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
#include <crypt.h>
#endif
-#include <log.h>
-#include <xmalloc.h>
+#include <yaz/log.h>
+#include <yaz/xmalloc.h>
#include <passwddb.h>
* 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
#endif
#include <zebrautl.h>
-#include <yaz-util.h>
+#include <yaz/yaz-util.h>
static struct res_entry *add_entry (Res r)
{
{
const char *cn = res_get (r, name);
+ if (!cn)
+ cn = s;
if (cn && !yaz_matchstr (cn, value))
return 1;
return 0;
* 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
#include <assert.h>
#include <ctype.h>
-#include <yaz-util.h>
+#include <yaz/yaz-util.h>
#include <charmap.h>
#include <zebramap.h>