/*
- * Copyright (C) 1994-1998, Index Data I/S
+ * Copyright (C) 1994-1999, Index Data
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: zebramap.c,v $
- * Revision 1.10 1998-06-23 15:33:37 adam
+ * Revision 1.12 1999-02-12 13:29:25 adam
+ * Implemented position-flag for registers.
+ *
+ * Revision 1.11 1998/10/13 20:09:19 adam
+ * Changed call to readconf_line.
+ *
+ * Revision 1.10 1998/06/23 15:33:37 adam
* Added feature to specify sort criteria in query (type 7 specifies
* sort flags).
*
struct zebra_map {
unsigned reg_id;
int completeness;
+ int positioned;
int type;
union {
struct {
char line[512];
char *argv[10];
int argc;
+ int lineno = 0;
struct zebra_map **zm = 0, *zp;
if (!(f = yaz_path_fopen(zms->tabpath, name, "r")))
logf(LOG_WARN|LOG_ERRNO, "%s", name);
return ;
}
- while ((argc = readconf_line(f, line, 512, argv, 10)))
+ while ((argc = readconf_line(f, &lineno, line, 512, argv, 10)))
{
if (!yaz_matchstr (argv[0], "index") && argc == 2)
{
(*zm)->maptab = NULL;
(*zm)->type = ZEBRA_MAP_TYPE_INDEX;
(*zm)->completeness = 0;
+ (*zm)->positioned = 1;
}
else if (!yaz_matchstr (argv[0], "sort") && argc == 2)
{
(*zm)->u.sort.entry_size = 80;
(*zm)->maptab = NULL;
(*zm)->completeness = 0;
+ (*zm)->positioned = 0;
}
else if (zm && !yaz_matchstr (argv[0], "charmap") && argc == 2)
{
{
(*zm)->completeness = atoi (argv[1]);
}
+ else if (zm && !yaz_matchstr (argv[0], "position") && argc == 2)
+ {
+ (*zm)->positioned = atoi (argv[1]);
+ }
else if (zm && !yaz_matchstr (argv[0], "entrysize") && argc == 2)
{
if ((*zm)->type == ZEBRA_MAP_TYPE_SORT)
return 0;
}
+int zebra_maps_is_positioned (ZebraMaps zms, unsigned reg_id)
+{
+ struct zebra_map *zm = zebra_map_get (zms, reg_id);
+ if (zm)
+ return zm->positioned;
+ return 0;
+}
+
int zebra_maps_is_sort (ZebraMaps zms, unsigned reg_id)
{
struct zebra_map *zm = zebra_map_get (zms, reg_id);