directive in .abs-files and "include" directive in .tag-files.
Possible compatibility problems with earlier versions marked with '*'.
-Backend interface change. Individual Scan terms returned from
-bend_scan may also be tagged as Surrogate Diagnostics. Refer
-to struct scan_entry in include/backend.h.
-
-Retrieval module enhancements. Multiple tag sets and attribute sets
-may be specified in abstract syntax specs. Revised the error/warning
+Retrieval module enhancements. Tag sets may be typed in the reference
+to it. From the .abs-file the "tagset" directive takes a third optional
+integer type for the tag set referenced. From a .tag-file the "include"
+directive takes a third optional type as well. The old "type" directive
+in the tag set itself is still recognized but acts as the default type
+for the tag set.
+
+Backend interface change. Individual Scan terms returned from bend_scan
+may also be tagged as Surrogate Diagnostics. Refer to struct scan_entry
+in include/backend.h.
+
+Retrieval module enhancements. Multiple tag sets and attribute sets may
+be specified in abstract syntax specs. Revised the error/warning for
logging messages reported by the retrieval module when reading the
various spec files.
Object Identifier system (oid_..) changed. The API is backwards
-compatible but the oid-routines now allocates new OID's
-when needed. Raw OID's may be specified in oid_getvalbyname.
+compatible but the oid-routines now allocates new OID's when needed.
+Raw OID's may be specified in oid_getvalbyname.
YAZ now uses GNU configure to generate Makefile(s).
* OF THIS SOFTWARE.
*
* $Log: data1.h,v $
- * Revision 1.37 1998-10-13 16:09:46 adam
+ * Revision 1.38 1998-10-15 08:29:15 adam
+ * Tag set type may be specified in reference to it using "tagset"
+ * directive in .abs-files and "include" directive in .tag-files.
+ *
+ * Revision 1.37 1998/10/13 16:09:46 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.
typedef enum data1_datatype
{
- DATA1K_structured = 1,
+ DATA1K_unknown,
+ DATA1K_structured,
DATA1K_string,
DATA1K_numeric,
DATA1K_bool,
struct data1_tag *next;
} data1_tag;
-typedef struct data1_tagset
+typedef struct data1_tagset data1_tagset;
+
+struct data1_tagset
{
+ int type; /* type of tagset in current context */
char *name; /* symbolic name */
oid_value reference;
- int type; /* type of tagset in current context */
data1_tag *tags; /* tags defined by this set */
- struct data1_tagset *children; /* included tagsets */
- struct data1_tagset *next; /* sibling */
-} data1_tagset;
+ data1_tagset *children; /* children */
+ data1_tagset *next; /* sibling */
+};
typedef struct data1_termlist
{
int (*rf)(void *, char *, size_t),
void *fh, NMEM m);
YAZ_EXPORT data1_absyn *data1_read_absyn(data1_handle dh, const char *file);
-YAZ_EXPORT data1_tag *data1_gettagbynum(data1_handle dh, data1_tagset *s,
+YAZ_EXPORT data1_tag *data1_gettagbynum(data1_handle dh,
+ data1_tagset *s,
int type, int value);
YAZ_EXPORT data1_tagset *data1_empty_tagset (data1_handle dh);
-YAZ_EXPORT data1_tagset *data1_read_tagset(data1_handle dh, char *file);
+YAZ_EXPORT data1_tagset *data1_read_tagset(data1_handle dh,
+ const char *file,
+ int type);
YAZ_EXPORT data1_element *data1_getelementbytagname(data1_handle dh,
data1_absyn *abs,
data1_element *parent,
int select, ODR o,
int *len);
YAZ_EXPORT data1_tag *data1_gettagbyname(data1_handle dh, data1_tagset *s,
- char *name);
+ const char *name);
YAZ_EXPORT void data1_free_tree(data1_handle dh, data1_node *t);
YAZ_EXPORT char *data1_nodetobuf(data1_handle dh, data1_node *n,
int select, int *len);
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: d1_absyn.c,v $
- * Revision 1.22 1998-10-13 16:09:47 adam
+ * Revision 1.23 1998-10-15 08:29:16 adam
+ * Tag set type may be specified in reference to it using "tagset"
+ * directive in .abs-files and "include" directive in .tag-files.
+ *
+ * Revision 1.22 1998/10/13 16:09:47 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.
else if (!strcmp(cmd, "tagset"))
{
char *name;
- if (argc != 2)
+ int type = 0;
+ if (argc < 2)
{
logf(LOG_WARN, "%s:%d: Bad # of args to tagset",
file, lineno);
continue;
}
name = argv[1];
- if (!(*tagset_childp = data1_read_tagset (dh, name)))
+ if (argc == 3)
+ type = atoi(argv[2]);
+ *tagset_childp = data1_read_tagset (dh, name, type);
+ if (!(*tagset_childp))
{
logf(LOG_WARN, "%s:%d: Couldn't load tagset %s",
file, lineno, name);
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: d1_tagset.c,v $
- * Revision 1.9 1998-10-13 16:09:53 adam
+ * Revision 1.10 1998-10-15 08:29:17 adam
+ * Tag set type may be specified in reference to it using "tagset"
+ * directive in .abs-files and "include" directive in .tag-files.
+ *
+ * Revision 1.9 1998/10/13 16:09:53 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.
for (i = 0; types[i].tname; i++)
if (!data1_matchstr(types[i].tname, t))
return types[i].type;
- return 0;
+ return DATA1K_unknown;
}
data1_tag *data1_gettagbynum (data1_handle dh, data1_tagset *s,
int type, int value)
{
data1_tag *r;
-
+
for (; s; s = s->next)
{
/* scan local set */
if (r->which == DATA1T_numeric && r->value.numeric == value)
return r;
/* scan included sets */
- if (s->children && (r = data1_gettagbynum (dh, s->children,
- type, value)))
+ if (s->children &&
+ (r = data1_gettagbynum (dh, s->children, type, value)))
return r;
}
return 0;
}
-data1_tag *data1_gettagbyname (data1_handle dh, data1_tagset *s, char *name)
+data1_tag *data1_gettagbyname (data1_handle dh, data1_tagset *s,
+ const char *name)
{
data1_tag *r;
for (; s; s = s->next)
{
/* scan local set */
- for (r = s->tags; r; r = r->next)
+ for (r = s->children->tags; r; r = r->next)
{
data1_name *np;
(data1_tagset *) nmem_malloc(data1_nmem_get (dh), sizeof(*res));
res->name = 0;
res->reference = VAL_NONE;
- res->type = 0;
res->tags = 0;
+ res->type = 0;
res->children = 0;
res->next = 0;
return res;
}
-data1_tagset *data1_read_tagset (data1_handle dh, char *file)
+data1_tagset *data1_read_tagset (data1_handle dh, const char *file, int type)
{
NMEM mem = data1_nmem_get (dh);
- data1_tagset *res = 0, **childp;
+ data1_tagset *res = 0;
+ data1_tagset **childp;
data1_tag **tagp;
FILE *f;
int lineno = 0;
return 0;
}
res = data1_empty_tagset (dh);
+ res->type = type;
childp = &res->children;
tagp = &res->tags;
{
if (argc != 2)
{
- logf(LOG_WARN, "%s:%d: Bad # args to type", file, lineno);
+ logf (LOG_WARN, "%s:%d: Bad # args to type", file, lineno);
continue;
}
- res->type = atoi(argv[1]);
+ if (!res->type)
+ res->type = atoi(argv[1]);
}
else if (!strcmp(cmd, "include"))
{
char *name;
+ int type = 0;
- if (argc != 2)
+ if (argc < 2)
{
logf(LOG_WARN, "%s:%d: Bad # args to include",
file, lineno);
continue;
}
name = argv[1];
- if (!(*childp = data1_read_tagset (dh, name)))
+ if (argc == 3)
+ type = atoi(argv[2]);
+ *childp = data1_read_tagset (dh, name, type);
+ if (!(*childp))
{
logf(LOG_WARN, "%s:%d: Inclusion failed for tagset %s",
file, lineno, name);