Retrieval module no longer uses ctype.h - functions.
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 21 Oct 1999 12:06:28 +0000 (12:06 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 21 Oct 1999 12:06:28 +0000 (12:06 +0000)
include/data1.h
retrieval/d1_absyn.c
retrieval/d1_attset.c
retrieval/d1_espec.c
retrieval/d1_map.c
retrieval/d1_marc.c
retrieval/d1_read.c
retrieval/d1_sutrs.c
retrieval/d1_tagset.c
retrieval/d1_write.c

index d09d5b0..9ea9cfc 100644 (file)
  * OF THIS SOFTWARE.
  *
  * $Log: data1.h,v $
- * Revision 1.41  1999-07-13 13:23:47  adam
+ * Revision 1.42  1999-10-21 12:06:28  adam
+ * Retrieval module no longer uses ctype.h - functions.
+ *
+ * Revision 1.41  1999/07/13 13:23:47  adam
  * Non-recursive version of data1_read_node. data1_read_nodex reads
  * stream of bytes (instead of buffer in memory).
  *
 #include <yaz-util.h>
 #include <wrbuf.h>
 
+#define d1_isspace(c) strchr(" \r\n\t\f", c)
+#define d1_isdigit(c) ((c) <= '9' && (c) >= '0')
 #ifdef __cplusplus
 extern "C" {
 #endif
index 6ff747b..a89eb91 100644 (file)
@@ -4,7 +4,10 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: d1_absyn.c,v $
- * Revision 1.24  1999-08-27 09:40:32  adam
+ * 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,7 +99,6 @@
  *
  */
 
-#include <ctype.h>
 #include <stdio.h>
 #include <assert.h>
 #include <stdlib.h>
index 30d84ec..81d7682 100644 (file)
@@ -4,7 +4,10 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: d1_attset.c,v $
- * Revision 1.12  1999-08-27 09:40:32  adam
+ * Revision 1.13  1999-10-21 12:06:29  adam
+ * Retrieval module no longer uses ctype.h - functions.
+ *
+ * Revision 1.12  1999/08/27 09:40:32  adam
  * Renamed logf function to yaz_log. Removed VC++ project files.
  *
  * Revision 1.11  1998/10/14 13:31:56  adam
@@ -51,7 +54,6 @@
  *
  */
 
-#include <ctype.h>
 #include <stdio.h>
 #include <assert.h>
 #include <stdlib.h>
index 0b6b638..48d54f3 100644 (file)
@@ -4,7 +4,10 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: d1_espec.c,v $
- * Revision 1.16  1999-08-27 09:40:32  adam
+ * 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
@@ -69,7 +72,6 @@
 #include <stdlib.h>
 #include <assert.h>
 #include <string.h>
-#include <ctype.h>
 #include <odr.h>
 #include <proto.h>
 #include <log.h>
@@ -120,7 +122,7 @@ static Z_Variant *read_variant(int argc, char **argv, NMEM nmem,
            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 *)
@@ -167,7 +169,7 @@ static Z_Occurrences *read_occurrences(char *occ, NMEM nmem,
     {
        Z_OccurValues *ov = (Z_OccurValues *)nmem_malloc(nmem, sizeof(*ov));
     
-       if (!isdigit(*occ))
+       if (!d1_isdigit(*occ))
        {
            yaz_log(LOG_WARN, "%s:%d: Bad occurrences-spec %s",
                    file, lineno, occ);
index 84367af..c7faa42 100644 (file)
@@ -4,7 +4,10 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: d1_map.c,v $
- * Revision 1.15  1999-08-27 09:40:32  adam
+ * Revision 1.16  1999-10-21 12:06:29  adam
+ * Retrieval module no longer uses ctype.h - functions.
+ *
+ * Revision 1.15  1999/08/27 09:40:32  adam
  * Renamed logf function to yaz_log. Removed VC++ project files.
  *
  * Revision 1.14  1998/10/13 16:09:50  adam
@@ -63,7 +66,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <ctype.h>
 
 #include <oid.h>
 #include <log.h>
@@ -183,7 +185,7 @@ data1_maptab *data1_read_maptab (data1_handle dh, const char *file)
                    (*mtp)->new_field = 1;
                else
                    (*mtp)->new_field = 0;
-               if ((type != 3 || local_numeric) && isdigit(*valstr))
+               if ((type != 3 || local_numeric) && d1_isdigit(*valstr))
                 {
                    (*mtp)->which = D1_MAPTAG_numeric;
                    (*mtp)->value.numeric = atoi(valstr);
index 84c6569..4ddf45e 100644 (file)
@@ -4,7 +4,10 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: d1_marc.c,v $
- * Revision 1.14  1999-08-27 09:40:32  adam
+ * Revision 1.15  1999-10-21 12:06:29  adam
+ * Retrieval module no longer uses ctype.h - functions.
+ *
+ * Revision 1.14  1999/08/27 09:40:32  adam
  * Renamed logf function to yaz_log. Removed VC++ project files.
  *
  * Revision 1.13  1998/10/13 16:09:52  adam
@@ -59,7 +62,6 @@
 #include <assert.h>
 #include <stdlib.h>
 #include <string.h>
-#include <ctype.h>
 
 #include <oid.h>
 #include <log.h>
@@ -213,7 +215,7 @@ static char *get_data(data1_node *n, int *len)
     }
 
     *len = n->u.data.len;
-    while (*len && isspace(n->u.data.data[*len - 1]))
+    while (*len && d1_isspace(n->u.data.data[*len - 1]))
        (*len)--;
     return n->u.data.data;
 }
index dfa0f89..92b1b59 100644 (file)
@@ -4,7 +4,10 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: d1_read.c,v $
- * Revision 1.28  1999-10-21 09:50:33  adam
+ * 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
 #include <log.h>
 #include <data1.h>
 
-#define d1_isspace(c) strchr(" \r\n\t\f", c)
 /*
  * get the tag which is the immediate parent of this node (this may mean
  * traversing intermediate things like variants and stuff.
index 504007f..fea2d02 100644 (file)
@@ -4,7 +4,10 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: d1_sutrs.c,v $
- * Revision 1.4  1997-09-17 12:10:38  adam
+ * Revision 1.5  1999-10-21 12:06:29  adam
+ * Retrieval module no longer uses ctype.h - functions.
+ *
+ * Revision 1.4  1997/09/17 12:10:38  adam
  * YAZ version 1.4.
  *
  * Revision 1.3  1995/12/15 16:57:11  quinn
@@ -19,8 +22,6 @@
  *
  */
 
-#include <ctype.h>
-
 #include <data1.h>
 
 #define NTOBUF_INDENT   2
@@ -30,7 +31,7 @@ static int wordlen(char *b)
 {
     int l = 0;
 
-    while (*b && !isspace(*b))
+    while (*b && !d1_isspace(*b))
        l++, b++;
     return l;
 }
@@ -83,7 +84,7 @@ static int nodetobuf(data1_node *n, int select, WRBUF b, int indent, int col)
                {
                    int wlen;
 
-                   while (l && isspace(*p))
+                   while (l && d1_isspace(*p))
                        p++, l--;
                    if (!l)
                        break;
@@ -101,7 +102,7 @@ static int nodetobuf(data1_node *n, int select, WRBUF b, int indent, int col)
                        wrbuf_putc(b, ' ');
                        col++;
                    }
-                   while (l && !isspace(*p))
+                   while (l && !d1_isspace(*p))
                    {
                        if (col > NTOBUF_MARGIN)
                        {
index 65b9daa..f02ed58 100644 (file)
@@ -4,7 +4,10 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: d1_tagset.c,v $
- * Revision 1.12  1999-08-27 09:40:32  adam
+ * Revision 1.13  1999-10-21 12:06:29  adam
+ * Retrieval module no longer uses ctype.h - functions.
+ *
+ * Revision 1.12  1999/08/27 09:40:32  adam
  * Renamed logf function to yaz_log. Removed VC++ project files.
  *
  * Revision 1.11  1998/10/19 14:16:36  adam
@@ -54,7 +57,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <ctype.h>
 #include <string.h>
 
 #include <log.h>
index 3cff061..3990c14 100644 (file)
@@ -4,7 +4,10 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: d1_write.c,v $
- * Revision 1.6  1999-07-06 12:16:00  adam
+ * Revision 1.7  1999-10-21 12:06:29  adam
+ * Retrieval module no longer uses ctype.h - functions.
+ *
+ * Revision 1.6  1999/07/06 12:16:00  adam
  * Improved layout generated record in SGML/XML format.
  *
  * Revision 1.5  1998/06/05 08:57:43  adam
@@ -28,7 +31,6 @@
  */
 
 #include <string.h>
-#include <ctype.h>
 
 #include <data1.h>
 #include <wrbuf.h>
@@ -39,7 +41,7 @@ static int wordlen(char *b, int max)
 {
     int l = 0;
 
-    while (l < max && !isspace(*b))
+    while (l < max && !d1_isspace(*b))
        l++, b++;
     return l;
 }
@@ -92,7 +94,7 @@ static int nodetoidsgml(data1_node *n, int select, WRBUF b, int col)
                {
                    int wlen;
                    
-                   while (l && isspace(*p))
+                   while (l && d1_isspace(*p))
                        p++, l--;
                    if (!l)
                        break;
@@ -110,7 +112,7 @@ static int nodetoidsgml(data1_node *n, int select, WRBUF b, int col)
                        wrbuf_putc(b, ' ');
                        lcol++;
                    }
-                   while (l && !isspace(*p))
+                   while (l && !d1_isspace(*p))
                    {
                        wrbuf_putc(b, *p);
                        p++;