Zebra TODO
-$Id: TODO,v 1.8 1999-12-01 14:29:50 adam Exp $
+$Id: TODO,v 1.9 2000-07-07 12:49:20 adam Exp $
+
+Browse set.
+
+Multiple register areas.
+
+Hit Vector for each term in query in search-response PDU.
+
+Prefix configuration for externally stored records.
Size of sort entries should be configurable.
done
fi
-echo $ac_n "checking for large files""... $ac_c" 1>&6
-echo "configure:1686: checking for large files" >&5
+echo $ac_n "checking for LFS""... $ac_c" 1>&6
+echo "configure:1686: checking for LFS" >&5
if test "$cross_compiling" = yes; then
bits=32
else
dnl Zebra, Index Data Aps, 1994-2000
-dnl $Id: configure.in,v 1.21 2000-05-15 15:32:50 adam Exp $
+dnl $Id: configure.in,v 1.22 2000-07-07 12:49:20 adam Exp $
dnl
AC_INIT(include/zebraver.h)
AC_MSG_CHECKING(for package)
AC_CHECK_HEADERS(bzlib.h)
fi
dnl ------- 64 bit files
-AC_MSG_CHECKING(for large files)
+AC_MSG_CHECKING(for LFS)
AC_TRY_RUN([#define _FILE_OFFSET_BITS 64
#include <unistd.h>
#include <string.h>
-## $Id: Makefile.am,v 1.1 2000-04-05 09:49:35 adam Exp $
+## $Id: Makefile.am,v 1.2 2000-07-07 12:49:20 adam Exp $
noinst_LIBRARIES = libdict.a
-## noinst_PROGRAMS = dicttest dictext
+noinst_PROGRAMS = dicttest dictext
INCLUDES = -I$(srcdir)/../include @YAZINC@
-LDADD = ../bfile/libbfile.a ../dfa/libdfa.a ../util/libutil.a @YAZLIB@ @LIBS@
+LDADD = libdict.a ../bfile/libbfile.a ../dfa/libdfa.a ../util/libutil.a @YAZLIB@ @LIBS@
libdict_a_SOURCES = scan.c dopen.c dclose.c drdwr.c open.c close.c insert.c \
lookup.c lookupec.c lookgrep.c delete.c dcompact.c
-## dicttest_SOURCES = dicttest.c
+dicttest_SOURCES = dicttest.c
-## dictext_SOURCES = dictext.c
+dictext_SOURCES = dictext.c
yazconfig = @yazconfig@
noinst_LIBRARIES = libdict.a
+noinst_PROGRAMS = dicttest dictext
INCLUDES = -I$(srcdir)/../include @YAZINC@
-LDADD = ../bfile/libbfile.a ../dfa/libdfa.a ../util/libutil.a @YAZLIB@ @LIBS@
+LDADD = libdict.a ../bfile/libbfile.a ../dfa/libdfa.a ../util/libutil.a @YAZLIB@ @LIBS@
libdict_a_SOURCES = scan.c dopen.c dclose.c drdwr.c open.c close.c insert.c lookup.c lookupec.c lookgrep.c delete.c dcompact.c
+
+dicttest_SOURCES = dicttest.c
+
+dictext_SOURCES = dictext.c
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
LIBRARIES = $(noinst_LIBRARIES)
libdict_a_OBJECTS = scan.o dopen.o dclose.o drdwr.o open.o close.o \
insert.o lookup.o lookupec.o lookgrep.o delete.o dcompact.o
AR = ar
+PROGRAMS = $(noinst_PROGRAMS)
+
+dicttest_OBJECTS = dicttest.o
+dicttest_LDADD = $(LDADD)
+dicttest_DEPENDENCIES = libdict.a ../bfile/libbfile.a ../dfa/libdfa.a \
+../util/libutil.a
+dicttest_LDFLAGS =
+dictext_OBJECTS = dictext.o
+dictext_LDADD = $(LDADD)
+dictext_DEPENDENCIES = libdict.a ../bfile/libbfile.a ../dfa/libdfa.a \
+../util/libutil.a
+dictext_LDFLAGS =
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
TAR = gtar
GZIP_ENV = --best
DEP_FILES = .deps/close.P .deps/dclose.P .deps/dcompact.P \
-.deps/delete.P .deps/dopen.P .deps/drdwr.P .deps/insert.P \
-.deps/lookgrep.P .deps/lookup.P .deps/lookupec.P .deps/open.P \
-.deps/scan.P
-SOURCES = $(libdict_a_SOURCES)
-OBJECTS = $(libdict_a_OBJECTS)
+.deps/delete.P .deps/dictext.P .deps/dicttest.P .deps/dopen.P \
+.deps/drdwr.P .deps/insert.P .deps/lookgrep.P .deps/lookup.P \
+.deps/lookupec.P .deps/open.P .deps/scan.P
+SOURCES = $(libdict_a_SOURCES) $(dicttest_SOURCES) $(dictext_SOURCES)
+OBJECTS = $(libdict_a_OBJECTS) $(dicttest_OBJECTS) $(dictext_OBJECTS)
all: all-redirect
.SUFFIXES:
$(AR) cru libdict.a $(libdict_a_OBJECTS) $(libdict_a_LIBADD)
$(RANLIB) libdict.a
+mostlyclean-noinstPROGRAMS:
+
+clean-noinstPROGRAMS:
+ -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
+
+distclean-noinstPROGRAMS:
+
+maintainer-clean-noinstPROGRAMS:
+
+dicttest: $(dicttest_OBJECTS) $(dicttest_DEPENDENCIES)
+ @rm -f dicttest
+ $(LINK) $(dicttest_LDFLAGS) $(dicttest_OBJECTS) $(dicttest_LDADD) $(LIBS)
+
+dictext: $(dictext_OBJECTS) $(dictext_DEPENDENCIES)
+ @rm -f dictext
+ $(LINK) $(dictext_LDFLAGS) $(dictext_OBJECTS) $(dictext_LDADD) $(LIBS)
+
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
install: install-am
uninstall-am:
uninstall: uninstall-am
-all-am: Makefile $(LIBRARIES)
+all-am: Makefile $(LIBRARIES) $(PROGRAMS)
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
maintainer-clean-generic:
mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
- mostlyclean-tags mostlyclean-depend mostlyclean-generic
+ mostlyclean-noinstPROGRAMS mostlyclean-tags \
+ mostlyclean-depend mostlyclean-generic
mostlyclean: mostlyclean-am
-clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \
- clean-generic mostlyclean-am
+clean-am: clean-noinstLIBRARIES clean-compile clean-noinstPROGRAMS \
+ clean-tags clean-depend clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-noinstLIBRARIES distclean-compile \
- distclean-tags distclean-depend distclean-generic \
- clean-am
+ distclean-noinstPROGRAMS distclean-tags \
+ distclean-depend distclean-generic clean-am
distclean: distclean-am
maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
- maintainer-clean-compile maintainer-clean-tags \
+ maintainer-clean-compile \
+ maintainer-clean-noinstPROGRAMS maintainer-clean-tags \
maintainer-clean-depend maintainer-clean-generic \
distclean-am
@echo "This command is intended for maintainers to use;"
.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \
clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \
mostlyclean-compile distclean-compile clean-compile \
-maintainer-clean-compile tags mostlyclean-tags distclean-tags \
+maintainer-clean-compile mostlyclean-noinstPROGRAMS \
+distclean-noinstPROGRAMS clean-noinstPROGRAMS \
+maintainer-clean-noinstPROGRAMS tags mostlyclean-tags distclean-tags \
clean-tags maintainer-clean-tags distdir mostlyclean-depend \
distclean-depend clean-depend maintainer-clean-depend info-am info \
dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: dicttest.c,v $
- * Revision 1.22 1999-02-02 14:50:19 adam
+ * Revision 1.23 2000-07-07 12:49:20 adam
+ * Optimized resultSetInsert{Rank,Sort}.
+ *
+ * Revision 1.22 1999/02/02 14:50:19 adam
* Updated WIN32 code specific sections. Changed header.
*
* Revision 1.21 1996/10/29 14:00:03 adam
int main (int argc, char **argv)
{
+ Res my_resource = 0;
+ BFiles bfs;
const char *name = NULL;
const char *inputfile = NULL;
- const char *base = NULL;
+ const char *config = NULL;
int do_delete = 0;
int range = -1;
int srange = 0;
{
fprintf (stderr, "usage:\n "
" %s [-d] [-r n] [-p n] [-u] [-g pat] [-s n] [-v n] [-i f]"
- " [-w] [-c n] base file\n\n",
+ " [-w] [-c n] config file\n\n",
prog);
fprintf (stderr, " -d delete instead of insert\n");
fprintf (stderr, " -r n set regular match range\n");
{
if (ret == 0)
{
- if (!base)
- base = arg;
+ if (!config)
+ config = arg;
else if (!name)
name = arg;
else
exit (1);
}
}
- if (!base || !name)
+ if (!config || !name)
+ {
+ logf (LOG_FATAL, "no config and/or dictionary specified");
+ exit (1);
+ }
+ my_resource = res_open (config);
+ if (!my_resource)
{
- logf (LOG_FATAL, "no base and/or dictionary specified");
+ logf (LOG_FATAL, "cannot open resource `%s'", config);
exit (1);
}
- common_resource = res_open (base);
- if (!common_resource)
+ bfs = bfs_create (res_get(my_resource, "register"));
+ if (!bfs)
{
- logf (LOG_FATAL, "cannot open resource `%s'", base);
+ logf (LOG_FATAL, "bfs_create fail");
exit (1);
}
- dict = dict_open (name, cache, rw);
+ dict = dict_open (bfs, name, cache, rw, 0);
if (!dict)
{
logf (LOG_FATAL, "dict_open fail of `%s'", name);
no_of_misses++;
}
++no_of_iterations;
+ if ((no_of_iterations % 10000) == 0)
+ {
+ printf ("."); fflush(stdout);
+ }
ipf_ptr += (i-1);
}
}
logf (LOG_LOG, "No of misses.. %d", no_of_misses);
}
dict_close (dict);
- res_close (common_resource);
+ bfs_destroy (bfs);
+ res_close (my_resource);
return 0;
}
* All rights reserved.
*
* $Log: zebraapi.c,v $
- * Revision 1.34 2000-06-09 13:56:38 ian
+ * Revision 1.35 2000-07-07 12:49:20 adam
+ * Optimized resultSetInsert{Rank,Sort}.
+ *
+ * Revision 1.34 2000/06/09 13:56:38 ian
* Added some logging on Authentication and searches.
*
* Revision 1.33 2000/05/18 12:01:36 adam
zebra_chdir (zh);
if (zh->records)
{
- zebraExplain_close (zh->zei, 1);
+ zebraExplain_close (zh->zei, 0);
dict_close (zh->dict);
sortIdx_close (zh->sortIdx);
if (zh->isams)
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: zinfo.c,v $
- * Revision 1.18 2000-03-20 19:08:36 adam
+ * Revision 1.19 2000-07-07 12:49:20 adam
+ * Optimized resultSetInsert{Rank,Sort}.
+ *
+ * Revision 1.18 2000/03/20 19:08:36 adam
* Added remote record import using Z39.50 extended services and Segment
* Requests.
*
zdip = &zei->databaseInfo;
trec = rec_get (records, 1); /* get "root" record */
+ zei->ordinalSU = 1;
+ zei->runNumber = 0;
+
zebraExplain_mergeAccessInfo (zei, 0, &zei->accessInfo);
if (trec) /* targetInfo already exists ... */
{
data1_node *node_tgtinfo, *node_zebra, *node_list, *np;
zei->data1_target = read_sgml_rec (zei->dh, zei->nmem, trec);
- if (!zei->data1_target)
+ if (!zei->data1_target || !zei->data1_target->u.root.absyn)
{
- rec_rm (&trec);
- nmem_destroy(zei->nmem);
+ logf (LOG_FATAL, "Explain schema missing. Check profilePath");
+ nmem_destroy (zei->nmem);
return 0;
}
#if ZINFO_DEBUG
node_zebra = data1_search_tag (zei->dh, node_tgtinfo->child,
"zebraInfo");
- node_list = data1_search_tag (zei->dh, node_zebra->child,
- "databaseList");
- for (np = node_list->child; np; np = np->next)
+ np = 0;
+ if (node_zebra)
+ {
+ node_list = data1_search_tag (zei->dh, node_zebra->child,
+ "databaseList");
+ if (node_list)
+ np = node_list->child;
+ }
+ for (; np; np = np->next)
{
data1_node *node_name = NULL;
data1_node *node_id = NULL;
zdip = &(*zdip)->next;
}
- np = data1_search_tag (zei->dh, node_zebra->child,
- "ordinalSU");
- np = np->child;
- assert (np && np->which == DATA1N_data);
- zei->ordinalSU = atoi_n (np->u.data.data, np->u.data.len);
-
- np = data1_search_tag (zei->dh, node_zebra->child,
- "runNumber");
- np = np->child;
- assert (np && np->which == DATA1N_data);
- zei->runNumber = atoi_n (np->u.data.data, np->u.data.len);
- *zdip = NULL;
+ if (node_zebra)
+ {
+ np = data1_search_tag (zei->dh, node_zebra->child,
+ "ordinalSU");
+ np = np->child;
+ assert (np && np->which == DATA1N_data);
+ zei->ordinalSU = atoi_n (np->u.data.data, np->u.data.len);
+
+ np = data1_search_tag (zei->dh, node_zebra->child,
+ "runNumber");
+ np = np->child;
+ assert (np && np->which == DATA1N_data);
+ zei->runNumber = atoi_n (np->u.data.data, np->u.data.len);
+ *zdip = NULL;
+ }
rec_rm (&trec);
}
else /* create initial targetInfo */
{
data1_node *node_tgtinfo;
- zei->ordinalSU = 1;
- zei->runNumber = 0;
*zdip = NULL;
if (writeFlag)
"<multipleDBSearch>1</>\n"
"<nicknames><name>Zebra</></>\n"
"</></>\n" );
-
- if (!zei->data1_target)
+ if (!zei->data1_target || !zei->data1_target->u.root.absyn)
{
+ logf (LOG_FATAL, "Explain schema missing. Check profilePath");
nmem_destroy (zei->nmem);
return 0;
}
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: zsets.c,v $
- * Revision 1.27 2000-04-05 09:49:36 adam
+ * Revision 1.28 2000-07-07 12:49:20 adam
+ * Optimized resultSetInsert{Rank,Sort}.
+ *
+ * Revision 1.27 2000/04/05 09:49:36 adam
* On Unix, zebra/z'mbol uses automake.
*
* Revision 1.26 2000/03/20 19:08:36 adam
break;
}
}
- j = sort_info->max_entries-1;
+ ++i;
+ j = sort_info->max_entries;
if (i == j)
return;
- ++i;
+
+ if (sort_info->num_entries == j)
+ --j;
+ else
+ j = (sort_info->num_entries)++;
new_entry = sort_info->entries[j];
while (j != i)
{
sort_info->entries[j] = sort_info->entries[j-1];
--j;
}
- sort_info->entries[j] = new_entry;
+ sort_info->entries[i] = new_entry;
assert (new_entry);
- if (sort_info->num_entries != sort_info->max_entries)
- (sort_info->num_entries)++;
for (i = 0; i<num_criteria; i++)
memcpy (new_entry->buf[i], this_entry.buf[i], SORT_IDX_ENTRYSIZE);
new_entry->sysno = sysno;
break;
}
}
- j = sort_info->max_entries-1;
+ ++i;
+ j = sort_info->max_entries;
if (i == j)
return;
- ++i;
+
+ if (sort_info->num_entries == j)
+ --j;
+ else
+ j = (sort_info->num_entries)++;
+
new_entry = sort_info->entries[j];
while (j != i)
{
sort_info->entries[j] = sort_info->entries[j-1];
--j;
}
- sort_info->entries[j] = new_entry;
+ sort_info->entries[i] = new_entry;
assert (new_entry);
- if (sort_info->num_entries != sort_info->max_entries)
- (sort_info->num_entries)++;
new_entry->sysno = sysno;
new_entry->score = score;
}
passwd_db_show (db);
passwd_db_auth (db, "adam", "xtx9Y=");
passwd_db_close (db);
+ return 0;
}