#include <stdlib.h>
#include <assert.h>
#include <time.h>
-#include <ctype.h>
#ifndef WIN32
#include <signal.h>
#endif
*start = start_position;
if (*end_ptr == '\0')
return 1;
- while (isspace(*(unsigned char *)end_ptr))
+ while (yaz_isspace(*end_ptr))
end_ptr++;
if (*end_ptr != '+')
{
}
if (*end_ptr == '\0')
return 1;
- while (isspace(*(unsigned char *)end_ptr))
+ while (yaz_isspace(*end_ptr))
end_ptr++;
if (*end_ptr != '+')
{
for (; *p; ++p)
{
- if (!isspace(*(unsigned char *) p))
+ if (!yaz_isspace(*p))
lastnonspace = p;
}
if (lastnonspace)
#include <stdlib.h>
#include <assert.h>
#include <time.h>
-#include <ctype.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
char **outbuf, size_t *outbytesleft,
int *error);
+/* ctype.h macros ASCII based. That do not depend on LANG, nor require
+ unsigned int as argument */
+#define yaz_isdigit(x) ((x) >= '0' && (x) <= '9')
+#define yaz_isspace(x) strchr(" \f\r\n\t\v", x)
+#define yaz_toupper(x) ((x) + ('A' - 'a'))
+#define yaz_isupper(x) ((x) >= 'A' && (x) <= 'Z')
+#define yaz_tolower(x) ((x) + ('a' - 'A'))
+#define yaz_islower(x) ((x) >= 'a' && (x) <= 'z')
+
YAZ_END_CDECL
#endif
#include <assert.h>
#include <errno.h>
#include <string.h>
-#include <ctype.h>
#include "iconv-p.h"
#endif
#include <string.h>
-#include <ctype.h>
#include <yaz/marcdisp.h>
+#include <yaz/yaz-iconv.h>
int atoi_n(const char *buf, int len)
{
while (--len >= 0)
{
- if (isdigit(*(const unsigned char *) buf))
+ if (yaz_isdigit(*buf))
val = val*10 + (*buf - '0');
buf++;
}
{
int i;
for (i = 0; i < size; i++)
- if (!isdigit(i[(const unsigned char *) buf]))
+ if (!yaz_isdigit(*buf))
return 0;
*val = atoi_n(buf, size);
return 1;
#include <stdio.h>
#include <string.h>
-#include <ctype.h>
#include <yaz/ccl.h>
#include <yaz/nmem.h>
#include <stdio.h>
#include <string.h>
-#include <ctype.h>
#include <yaz/querytowrbuf.h>
+#include <yaz/yaz-iconv.h>
#include <yaz/ccl.h>
static void ccl_pquery_indent(WRBUF w, struct ccl_rpn_node *p, int indent);
if (*cp == '!')
{
/* word order specified */
- if (isdigit(((const unsigned char *) cp)[1]))
+ if (yaz_isdigit(cp[1]))
wrbuf_printf(w, "@prox 0 %s 1 2 k 2", cp+1);
else
wrbuf_printf(w, "@prox 0 1 1 2 k 2");
else if (*cp == '%')
{
/* word order not specified */
- if (isdigit(((const unsigned char *) cp)[1]))
+ if (yaz_isdigit(cp[1]))
wrbuf_printf(w, "@prox 0 %s 0 2 k 2", cp+1);
else
wrbuf_printf(w, "@prox 0 1 0 2 k 2");
#if HAVE_CONFIG_H
#include <config.h>
#endif
-#include <ctype.h>
+#include <yaz/yaz-iconv.h>
#include <stdio.h>
#include <stdlib.h>
static int ccli_toupper (int c)
{
- return toupper (c);
+ if (yaz_islower(c))
+ return yaz_toupper(c);
+ else
+ return c;
}
int (*ccl_toupper)(int c) = NULL;
#include <string.h>
#include <stdlib.h>
-#include <ctype.h>
-
+#include <yaz/yaz-iconv.h>
#include "cclp.h"
/*
case '%':
case '!':
last->kind = CCL_TOK_PROX;
- while (isdigit(*cp))
+ while (yaz_isdigit(*cp))
{
++ last->len;
cp++;
#endif
#include <string.h>
-#include <ctype.h>
#include <errno.h>
+#include <yaz/yaz-iconv.h>
#include <yaz/log.h>
#include <yaz/comstack.h>
#include <yaz/tcpip.h>
printf ("i=%d len=%d\n", i, len);
#endif
return 0;
- } else if (isdigit(buf[i]))
+ } else if (yaz_isdigit(buf[i]))
chunk_len = chunk_len * 16 +
(buf[i++] - '0');
- else if (isupper(buf[i]))
+ else if (yaz_isupper(buf[i]))
chunk_len = chunk_len * 16 +
(buf[i++] - ('A'-10));
- else if (islower(buf[i]))
+ else if (yaz_islower(buf[i]))
chunk_len = chunk_len * 16 +
(buf[i++] - ('a'-10));
else
while (buf[i] == ' ')
i++;
content_len = 0;
- while (i <= len-4 && isdigit(buf[i]))
+ while (i <= len-4 && yaz_isdigit(buf[i]))
content_len = content_len*10 + (buf[i++] - '0');
if (content_len < 0) /* prevent negative offsets */
content_len = 0;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
+#include <yaz/yaz-iconv.h>
#include <yaz/xmalloc.h>
#include <yaz/nmem.h>
#include <yaz/cql.h>
return 0;
if (c == '\n')
return 0;
- } while (isspace(c));
+ } while (yaz_isspace(c));
if (strchr("()=></", c))
{
int c1;
#include <assert.h>
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#include <yaz/rpn2cql.h>
#include <yaz/xmalloc.h>
#include <yaz/diagsrw.h>
break;
}
value_str = yaz_tok_parse_string(tp);
- if (isdigit(*value_str))
+ if (yaz_isdigit(*value_str))
{
elem->which = Z_AttributeValue_numeric;
elem->value.numeric =
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <ctype.h>
#include <yaz/proto.h>
#include <yaz/oid_db.h>
#include <config.h>
#endif
-#include <ctype.h>
#include <yaz/odr.h>
#include <yaz/yaz-version.h>
#include <yaz/yaz-iconv.h>
/* chunk length .. */
int chunk_len = 0;
for (; i < o->size-2; i++)
- if (isdigit(o->buf[i]))
+ if (yaz_isdigit(o->buf[i]))
chunk_len = chunk_len * 16 +
(o->buf[i] - '0');
- else if (isupper(o->buf[i]))
+ else if (yaz_isupper(o->buf[i]))
chunk_len = chunk_len * 16 +
(o->buf[i] - ('A'-10));
- else if (islower(o->buf[i]))
+ else if (yaz_islower(o->buf[i]))
chunk_len = chunk_len * 16 +
(o->buf[i] - ('a'-10));
else
#include <assert.h>
#include <errno.h>
#include <string.h>
-#include <ctype.h>
#include <stdio.h>
#include <yaz/log.h>
#include <yaz/xmalloc.h>
#include <assert.h>
#include <errno.h>
#include <string.h>
-#include <ctype.h>
#include <yaz/xmalloc.h>
#include "iconv-p.h"
#include <assert.h>
#include <errno.h>
#include <string.h>
-#include <ctype.h>
#include <yaz/xmalloc.h>
#include "iconv-p.h"
#include <assert.h>
#include <errno.h>
#include <string.h>
-#include <ctype.h>
#include <yaz/xmalloc.h>
#include "iconv-p.h"
#include <assert.h>
#include <errno.h>
#include <string.h>
-#include <ctype.h>
#include <yaz/xmalloc.h>
#include <yaz/snprintf.h>
#include <assert.h>
#include <errno.h>
#include <string.h>
-#include <ctype.h>
#if HAVE_WCHAR_H
#include <wchar.h>
#endif
#include <assert.h>
#include <errno.h>
#include <string.h>
-#include <ctype.h>
#include "iconv-p.h"
#endif
#include <stdio.h>
#include <stdlib.h>
-#include <ctype.h>
#include <string.h>
#include <stdarg.h>
#include <errno.h>
#include <time.h>
+#include <yaz/yaz-iconv.h>
#include <yaz/errno.h>
#include <yaz/thread_id.h>
#include <yaz/log.h>
negated = 1;
str++;
}
- if (isdigit(*(unsigned char *) str))
+ if (yaz_isdigit(*str))
{
level = atoi(str);
}
#include <stdio.h>
#include <string.h>
-#include <ctype.h>
#include <yaz/marcdisp.h>
#include <yaz/wrbuf.h>
#include <yaz/yaz-util.h>
}
/* Check for digits in length+starting info */
while (--l >= 3)
- if (!isdigit(*(const unsigned char *) (buf + entry_p+l)))
+ if (!yaz_isdigit(buf[entry_p + l]))
break;
if (l >= 3)
{
#include <assert.h>
#include <stdio.h>
#include <string.h>
-#include <ctype.h>
#include <yaz/marcdisp.h>
#include <yaz/wrbuf.h>
#include <stdio.h>
#include <string.h>
-#include <ctype.h>
#include <yaz/marcdisp.h>
#include <yaz/wrbuf.h>
#include <yaz/yaz-util.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#include <yaz/marcdisp.h>
#include <yaz/wrbuf.h>
#include <yaz/yaz-util.h>
#include <assert.h>
#include <stdlib.h>
-#include <ctype.h>
#include <string.h>
#include <yaz/xmalloc.h>
#include <stdio.h>
#include <assert.h>
-#include <ctype.h>
#include <string.h>
+#include <yaz/yaz-iconv.h>
#include <yaz/matchstr.h>
int yaz_matchstr(const char *s1, const char *s2)
break;
if (c2 != '.')
{
- if (isupper(c1))
- c1 = tolower(c1);
- if (isupper(c2))
- c2 = tolower(c2);
+ if (yaz_isupper(c1))
+ c1 = yaz_tolower(c1);
+ if (yaz_isupper(c2))
+ c2 = yaz_tolower(c2);
if (c1 != c2)
break;
}
#include <stdio.h>
#include <string.h>
-#include <ctype.h>
#include <yaz/xmalloc.h>
#include "mime.h"
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#include "odr-priv.h"
#include <yaz/oid_util.h>
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#include <yaz/yaz-util.h>
#include <yaz/odr.h>
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
+#include <yaz/yaz-iconv.h>
#include <yaz/snprintf.h>
#include <yaz/oid_util.h>
{
int i = 0;
int val = 0;
- while (isdigit (*(unsigned char *) name))
+ while (yaz_isdigit (*name))
{
val = val*10 + (*name - '0');
name++;
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <ctype.h>
#include <yaz/proto.h>
#include <yaz/marcdisp.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <ctype.h>
#include <yaz/proto.h>
#include <yaz/oid_db.h>
}
li->lex_buf = *qptr;
- if (**qptr == li->escape_char && isdigit(((const unsigned char *) *qptr)[1]))
+ if (**qptr == li->escape_char && yaz_isdigit((*qptr)[1]))
{
++(li->lex_len);
++(*qptr);
#endif
#include <stdio.h>
-#include <ctype.h>
#include <yaz/log.h>
#include <yaz/readconf.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
-#include <ctype.h>
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
int t;
const char *alive = z_HTTP_header_lookup(hreq->headers, "Keep-Alive");
- if (alive && isdigit(*(const unsigned char *) alive))
+ if (alive && yaz_isdigit(*(const unsigned char *) alive))
t = atoi(alive);
else
t = 15;
#include <assert.h>
#include <errno.h>
#include <string.h>
-#include <ctype.h>
#if HAVE_ICONV_H
#include <iconv.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#include <yaz/rpn2solr.h>
#include <yaz/xmalloc.h>
#include <yaz/diagsrw.h>
break;
}
value_str = yaz_tok_parse_string(tp);
- if (isdigit(*value_str))
+ if (yaz_isdigit(*value_str))
{
elem->which = Z_AttributeValue_numeric;
elem->value.numeric =
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#ifdef WIN32
#include <process.h>
#include "session.h"
#include <yaz/statserv.h>
#include <yaz/daemon.h>
+#include <yaz/yaz-iconv.h>
static IOCHAN pListener = NULL;
cp = p->content;
if (first)
{
- while(*cp && isspace(*cp))
+ while(*cp && yaz_isspace(*cp))
cp++;
if (*cp)
first = 0; /* reset if we got non-whitespace out */
}
/* remove trailing whitespace */
cp = strlen((const char *)str) + str;
- while (cp != str && isspace(cp[-1]))
+ while (cp != str && yaz_isspace(cp[-1]))
cp--;
*cp = '\0';
/* return resulting string */
#include <assert.h>
#include <stdio.h>
#include <string.h>
-#include <ctype.h>
#include <yaz/log.h>
#include <yaz/wrbuf.h>
#include <yaz/tokenizer.h>
#include <stdio.h>
#include <string.h>
-#include <ctype.h>
#include <yaz/tpath.h>
#include <yaz/log.h>
#if HAVE_SYS_TYPES_H
#include <assert.h>
#include <errno.h>
#include <string.h>
-#include <ctype.h>
#include "iconv-p.h"
#include <assert.h>
#include <errno.h>
#include <string.h>
-#include <ctype.h>
#include "iconv-p.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#include <yaz/yaz-ccl.h>
#include <yaz/pquery.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
-#include <ctype.h>
#include <yaz/file_glob.h>
#include <yaz/test.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
-#include <ctype.h>
#include <yaz/tpath.h>
#include <yaz/test.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
-#include <ctype.h>
#include <yaz/yaz-util.h>
#include <yaz/test.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
-#include <ctype.h>
#include <yaz/nmem.h>
#include <yaz/test.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
-#include <ctype.h>
#include <yaz/yaz-util.h>
* Copyright (C) 1995-2011 Index Data
* See the file LICENSE for details.
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#include <sys/time.h>
#include <yaz/xmalloc.h>
#include <yaz/options.h>
#include <yaz/zoom.h>
-
/* naming events */
static char* zoom_events[ZOOM_EVENT_MAX+1];
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#include <yaz/wrbuf.h>
#include <yaz/log.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
+#include <yaz/yaz-iconv.h>
#include <yaz/xmalloc.h>
"%s number target query\n", *argv, *argv);
exit (1);
}
- if (argc == 4 && isdigit(argv[1][0]) && !strchr(argv[1],'.'))
+ if (argc == 4 && yaz_isdigit(argv[1][0]) && !strchr(argv[1],'.'))
{
no = atoi(argv[1]);
same_target = 1;
#include <config.h>
#endif
-#include <ctype.h>
#include <yaz/wrbuf.h>
#include <yaz/marcdisp.h>
#include <yaz/odr.h>
#include <stdio.h>
#include <stdlib.h>
-#include <ctype.h>
#include <yaz/log.h>
#include <yaz/backend.h>
#endif
#include <stdio.h>
-#include <ctype.h>
#include <stdlib.h>
#include <yaz/proto.h>
while (fgets(buf = line, 512, f))
{
- while (*buf && isspace(*(unsigned char *) buf))
+ while (*buf && yaz_isspace(*buf))
buf++;
if (!*buf || *buf == '#')
continue;
if (!(buf = strchr(buf, ')')))
return 0;
buf++;
- while (*buf && isspace(*(unsigned char *) buf))
+ while (*buf && yaz_isspace(*buf))
buf++;
if (!*buf)
return 0;
#include <config.h>
#endif
-#include <ctype.h>
#include <yaz/wrbuf.h>
#include <yaz/marcdisp.h>
#include <yaz/odr.h>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
-#include <ctype.h>
#if HAVE_SYS_TIME_H
#include <sys/time.h>
strcpy(term, "0");
for (p = term; *p; p++)
- if (islower(*(unsigned char *) p))
- *p = toupper(*p);
+ if (yaz_islower(*p))
+ *p = yaz_toupper(*p);
fseek(f, 0, SEEK_SET);
q->num_entries = 0;