X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=retrieval%2Fd1_absyn.c;h=94886263cb4308d92fd7be9d19fc6d5ffceda9fc;hb=37b3d8433b89248def810d7cfa9b110893519f65;hp=6ff747b09f6864feba08f88a96c2f6ec895e83e9;hpb=b440dce0831a72bebe4f4821ab7771cc05e8facb;p=yaz-moved-to-github.git diff --git a/retrieval/d1_absyn.c b/retrieval/d1_absyn.c index 6ff747b..9488626 100644 --- a/retrieval/d1_absyn.c +++ b/retrieval/d1_absyn.c @@ -4,7 +4,18 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_absyn.c,v $ - * Revision 1.24 1999-08-27 09:40:32 adam + * Revision 1.27 1999-12-21 14:16:19 ian + * Changed retrieval module to allow data1 trees with no associated absyn. + * Also added a simple interface for extracting values from data1 trees using + * a string based tagpath. + * + * Revision 1.26 1999/11/30 13:47:12 adam + * Improved installation. Moved header files to include/yaz. + * + * Revision 1.25 1999/10/21 12:06:29 adam + * Retrieval module no longer uses ctype.h - functions. + * + * Revision 1.24 1999/08/27 09:40:32 adam * Renamed logf function to yaz_log. Removed VC++ project files. * * Revision 1.23 1998/10/15 08:29:16 adam @@ -96,15 +107,14 @@ * */ -#include #include #include #include #include -#include -#include -#include +#include +#include +#include #define D1_MAX_NESTING 128 @@ -256,6 +266,10 @@ data1_element *data1_getelementbytagname (data1_handle dh, data1_absyn *abs, { data1_element *r; + /* It's now possible to have a data1 tree with no abstract syntax */ + if ( !abs ) + return 0; + if (!parent) r = abs->main_elements; else @@ -276,6 +290,11 @@ data1_element *data1_getelementbyname (data1_handle dh, data1_absyn *absyn, const char *name) { data1_element *r; + + /* It's now possible to have a data1 tree with no abstract syntax */ + if ( !absyn ) + return 0; + assert (absyn->main_elements); for (r = absyn->main_elements; r; r = r->next) if (!data1_matchstr(r->name, name)) @@ -286,6 +305,10 @@ data1_element *data1_getelementbyname (data1_handle dh, data1_absyn *absyn, void fix_element_ref (data1_handle dh, data1_absyn *absyn, data1_element *e) { + /* It's now possible to have a data1 tree with no abstract syntax */ + if ( !absyn ) + return; + for (; e; e = e->next) { if (!e->sub_name)