Updated information about YAZ.
[yaz-moved-to-github.git] / retrieval / d1_read.c
index a6e21cd..e73f946 100644 (file)
@@ -4,7 +4,19 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: d1_read.c,v $
- * Revision 1.26  1999-07-13 13:23:48  adam
+ * Revision 1.30  1999-11-30 13:47:12  adam
+ * Improved installation. Moved header files to include/yaz.
+ *
+ * Revision 1.29  1999/10/21 12:06:29  adam
+ * Retrieval module no longer uses ctype.h - functions.
+ *
+ * Revision 1.28  1999/10/21 09:50:33  adam
+ * SGML reader uses own isspace - it doesn't do 8-bit on WIN32!
+ *
+ * Revision 1.27  1999/08/27 09:40:32  adam
+ * Renamed logf function to yaz_log. Removed VC++ project files.
+ *
+ * Revision 1.26  1999/07/13 13:23:48  adam
  * Non-recursive version of data1_read_node. data1_read_nodex reads
  * stream of bytes (instead of buffer in memory).
  *
  */
 
 #include <assert.h>
-#include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <xmalloc.h>
-#include <log.h>
-#include <data1.h>
+#include <yaz/xmalloc.h>
+#include <yaz/log.h>
+#include <yaz/data1.h>
 
 /*
  * get the tag which is the immediate parent of this node (this may mean
@@ -292,7 +303,7 @@ data1_node *data1_read_nodex (data1_handle dh, NMEM m,
     while (1)
     {
        data1_node *parent = level ? d1_stack[level-1] : 0;
-       while (c != '\0' && isspace(c))
+       while (c != '\0' && d1_isspace(c))
        {
            if (c == '\n')
                line++;
@@ -307,11 +318,11 @@ data1_node *data1_read_nodex (data1_handle dh, NMEM m,
            char args[256];
            size_t i;
            
-           for (i = 0; (c=(*get_byte)(fh)) && c != '>' && !isspace(c);)
+           for (i = 0; (c=(*get_byte)(fh)) && c != '>' && !d1_isspace(c);)
                if (i < (sizeof(tag)-1))
                    tag[i++] = c;
            tag[i] = '\0';
-           while (isspace(c))
+           while (d1_isspace(c))
                c = (*get_byte)(fh);
            for (i = 0; c && c != '>'; c = (*get_byte)(fh))
                if (i < (sizeof(args)-1))
@@ -319,7 +330,7 @@ data1_node *data1_read_nodex (data1_handle dh, NMEM m,
            args[i] = '\0';
            if (c != '>')
            {
-               logf(LOG_WARN, "d1: %d: Malformed tag", line);
+               yaz_log(LOG_WARN, "d1: %d: Malformed tag", line);
                return 0;
            }
            else
@@ -347,8 +358,8 @@ data1_node *data1_read_nodex (data1_handle dh, NMEM m,
                    }
                    if (i != level)
                    {
-                       logf (LOG_WARN, "%d: no begin tag for %s",
-                             line, tag);
+                       yaz_log (LOG_WARN, "%d: no begin tag for %s",
+                                line, tag);
                        break;
                    }
                }
@@ -360,8 +371,8 @@ data1_node *data1_read_nodex (data1_handle dh, NMEM m,
            {
                if (!(absyn = data1_get_absyn (dh, tag)))
                {
-                   logf(LOG_WARN, "Unable to acquire abstract syntax "
-                        "for '%s'", tag);
+                   yaz_log(LOG_WARN, "Unable to acquire abstract syntax "
+                           "for '%s'", tag);
                    return 0;
                }
                res = data1_mk_node (dh, m);
@@ -378,7 +389,7 @@ data1_node *data1_read_nodex (data1_handle dh, NMEM m,
                
                if (sscanf(args, "%s %s %n", tclass, type, &val_offset) != 2)
                {
-                   logf(LOG_WARN, "Malformed variant triple at '%s'", tag);
+                   yaz_log(LOG_WARN, "Malformed variant triple at '%s'", tag);
                    continue;
                }
                if (!(tp =
@@ -497,7 +508,7 @@ data1_node *data1_read_nodex (data1_handle dh, NMEM m,
            {
                if (*src == '\n')
                    line++;
-               if (isspace (*src))
+               if (d1_isspace (*src))
                    prev_char = ' ';
                else
                {