From 18ed9f15a489511014d4384a53b27e35824dd831 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 21 Oct 1999 12:06:28 +0000 Subject: [PATCH] Retrieval module no longer uses ctype.h - functions. --- include/data1.h | 7 ++++++- retrieval/d1_absyn.c | 6 ++++-- retrieval/d1_attset.c | 6 ++++-- retrieval/d1_espec.c | 10 ++++++---- retrieval/d1_map.c | 8 +++++--- retrieval/d1_marc.c | 8 +++++--- retrieval/d1_read.c | 6 ++++-- retrieval/d1_sutrs.c | 13 +++++++------ retrieval/d1_tagset.c | 6 ++++-- retrieval/d1_write.c | 12 +++++++----- 10 files changed, 52 insertions(+), 30 deletions(-) diff --git a/include/data1.h b/include/data1.h index d09d5b0..9ea9cfc 100644 --- a/include/data1.h +++ b/include/data1.h @@ -24,7 +24,10 @@ * 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). * @@ -224,6 +227,8 @@ #include #include +#define d1_isspace(c) strchr(" \r\n\t\f", c) +#define d1_isdigit(c) ((c) <= '9' && (c) >= '0') #ifdef __cplusplus extern "C" { #endif diff --git a/retrieval/d1_absyn.c b/retrieval/d1_absyn.c index 6ff747b..a89eb91 100644 --- a/retrieval/d1_absyn.c +++ b/retrieval/d1_absyn.c @@ -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 #include #include #include diff --git a/retrieval/d1_attset.c b/retrieval/d1_attset.c index 30d84ec..81d7682 100644 --- a/retrieval/d1_attset.c +++ b/retrieval/d1_attset.c @@ -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 #include #include #include diff --git a/retrieval/d1_espec.c b/retrieval/d1_espec.c index 0b6b638..48d54f3 100644 --- a/retrieval/d1_espec.c +++ b/retrieval/d1_espec.c @@ -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 #include #include -#include #include #include #include @@ -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); diff --git a/retrieval/d1_map.c b/retrieval/d1_map.c index 84367af..c7faa42 100644 --- a/retrieval/d1_map.c +++ b/retrieval/d1_map.c @@ -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 #include #include -#include #include #include @@ -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); diff --git a/retrieval/d1_marc.c b/retrieval/d1_marc.c index 84c6569..4ddf45e 100644 --- a/retrieval/d1_marc.c +++ b/retrieval/d1_marc.c @@ -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 #include #include -#include #include #include @@ -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; } diff --git a/retrieval/d1_read.c b/retrieval/d1_read.c index dfa0f89..92b1b59 100644 --- a/retrieval/d1_read.c +++ b/retrieval/d1_read.c @@ -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 @@ -156,7 +159,6 @@ #include #include -#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. diff --git a/retrieval/d1_sutrs.c b/retrieval/d1_sutrs.c index 504007f..fea2d02 100644 --- a/retrieval/d1_sutrs.c +++ b/retrieval/d1_sutrs.c @@ -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 - #include #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) { diff --git a/retrieval/d1_tagset.c b/retrieval/d1_tagset.c index 65b9daa..f02ed58 100644 --- a/retrieval/d1_tagset.c +++ b/retrieval/d1_tagset.c @@ -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 #include -#include #include #include diff --git a/retrieval/d1_write.c b/retrieval/d1_write.c index 3cff061..3990c14 100644 --- a/retrieval/d1_write.c +++ b/retrieval/d1_write.c @@ -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 -#include #include #include @@ -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++; -- 1.7.10.4