/*
- * Copyright (c) 1995-1998, Index Data.
+ * Copyright (c) 1995-1999, Index Data.
* See the file LICENSE for details.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: d1_espec.c,v $
- * Revision 1.15 1998-10-13 16:09:49 adam
+ * Revision 1.18 1999-11-30 13:47:12 adam
+ * Improved installation. Moved header files to include/yaz.
+ *
+ * Revision 1.17 1999/10/21 12:06:29 adam
+ * Retrieval module no longer uses ctype.h - functions.
+ *
+ * Revision 1.16 1999/08/27 09:40:32 adam
+ * Renamed logf function to yaz_log. Removed VC++ project files.
+ *
+ * Revision 1.15 1998/10/13 16:09:49 adam
* Added support for arbitrary OID's for tagsets, schemas and attribute sets.
* Added support for multiple attribute set references and tagset references
* from an abstract syntax file.
#include <stdlib.h>
#include <assert.h>
#include <string.h>
-#include <ctype.h>
-#include <odr.h>
-#include <proto.h>
-#include <log.h>
-#include <data1.h>
+
+#include <yaz/odr.h>
+#include <yaz/proto.h>
+#include <yaz/log.h>
+#include <yaz/data1.h>
static Z_Variant *read_variant(int argc, char **argv, NMEM nmem,
const char *file, int lineno)
if (sscanf(argv[i], "(%d,%d,%[^)])", &zclass, &type, value) < 3)
{
- logf(LOG_WARN, "%s:%d: Syntax error in variant component '%s'",
- file, lineno, argv[i]);
+ yaz_log(LOG_WARN, "%s:%d: Syntax error in variant component '%s'",
+ file, lineno, argv[i]);
return 0;
}
t = r->triples[i] = (Z_Triple *)nmem_malloc(nmem, sizeof(Z_Triple));
t->which = Z_Triple_null;
t->value.null = odr_nullval();
}
- else if (isdigit(*value))
+ else if (d1_isdigit(*value))
{
t->which = Z_Triple_integer;
t->value.integer = (int *)
{
Z_OccurValues *ov = (Z_OccurValues *)nmem_malloc(nmem, sizeof(*ov));
- if (!isdigit(*occ))
+ if (!d1_isdigit(*occ))
{
- logf(LOG_WARN, "%s:%d: Bad occurrences-spec %s",
- file, lineno, occ);
+ yaz_log(LOG_WARN, "%s:%d: Bad occurrences-spec %s",
+ file, lineno, occ);
return 0;
}
op->which = Z_Occurrences_values;
if (!(f = yaz_path_fopen(data1_get_tabpath(dh), file, "r")))
{
- logf(LOG_WARN|LOG_ERRNO, "%s", file);
+ yaz_log(LOG_WARN|LOG_ERRNO, "%s", file);
return 0;
}
if (!nnames)
{
- logf(LOG_WARN, "%s:%d: Empty elementsetnames directive",
- file, lineno);
+ yaz_log(LOG_WARN, "%s:%d: Empty elementsetnames directive",
+ file, lineno);
continue;
}
{
if (argc != 2)
{
- logf(LOG_WARN, "%s:%d: Bad # of args for %s",
- file, lineno, argv[0]);
+ yaz_log(LOG_WARN, "%s:%d: Bad # of args for %s",
+ file, lineno, argv[0]);
continue;
}
if (!(res->defaultVariantSetId =
odr_getoidbystr_nmem(nmem, argv[1])))
{
- logf(LOG_WARN, "%s:%d: Bad defaultvariantsetid",
- file, lineno);
+ yaz_log(LOG_WARN, "%s:%d: Bad defaultvariantsetid",
+ file, lineno);
continue;
}
}
{
if (argc != 2)
{
- logf(LOG_WARN, "%s:%d: Bad # of args for %s",
- file, lineno, argv[0]);
+ yaz_log(LOG_WARN, "%s:%d: Bad # of args for %s",
+ file, lineno, argv[0]);
continue;
}
res->defaultTagType = (int *)nmem_malloc(nmem, sizeof(int));
if (!(res->defaultVariantRequest =
read_variant(argc-1, argv+1, nmem, file, lineno)))
{
- logf(LOG_WARN, "%s:%d: Bad defaultvariantrequest",
- file, lineno);
+ yaz_log(LOG_WARN, "%s:%d: Bad defaultvariantrequest",
+ file, lineno);
continue;
}
}
}
if (argc < 2)
{
- logf(LOG_WARN, "%s:%d: Bad # of args for %s",
- file, lineno, argv[0]);
+ yaz_log(LOG_WARN, "%s:%d: Bad # of args for %s",
+ file, lineno, argv[0]);
continue;
}
read_variant(argc-3, argv+3, nmem, file, lineno);
}
else
- logf(LOG_WARN, "%s:%d: Unknown directive '%s'",
- file, lineno, argv[0]);
+ yaz_log(LOG_WARN, "%s:%d: Unknown directive '%s'",
+ file, lineno, argv[0]);
fclose (f);
return res;
}