From: oleg Date: Wed, 15 Jan 2003 07:26:40 +0000 (+0000) Subject: Add macros for case insesitive string compare. X-Git-Tag: ZEBRA.1.3.5~20 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=55f7753517be121c50701a923dc638b5a8f3be5e;p=idzebra-moved-to-github.git Add macros for case insesitive string compare. The Z39.50-1995 required case insensitive Database name. It fixed. --- diff --git a/index/zebraapi.c b/index/zebraapi.c index 79a90b7..4529294 100644 --- a/index/zebraapi.c +++ b/index/zebraapi.c @@ -1,4 +1,4 @@ -/* $Id: zebraapi.c,v 1.80 2003-01-13 10:56:09 oleg Exp $ +/* $Id: zebraapi.c,v 1.81 2003-01-15 07:26:40 oleg Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Index Data Aps @@ -571,7 +571,7 @@ void map_basenames_func (void *vp, const char *name, const char *value) return ; no--; for (i = 0; inum_bases; i++) - if (p->basenames[i] && !strcmp (p->basenames[i], fromdb)) + if (p->basenames[i] && !STRCASECMP (p->basenames[i], fromdb)) { p->basenames[i] = 0; for (i = 0; i < no; i++) diff --git a/index/zebraapi.h b/index/zebraapi.h index 2e00a2d..f34c52a 100644 --- a/index/zebraapi.h +++ b/index/zebraapi.h @@ -1,4 +1,4 @@ -/* $Id: zebraapi.h,v 1.22 2002-10-22 09:37:56 heikki Exp $ +/* $Id: zebraapi.h,v 1.23 2003-01-15 07:26:40 oleg Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Index Data Aps @@ -30,6 +30,13 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #include +/* Fixme! Compare string (ignore case) */ +#ifdef WIN32 +#define STRCASECMP stricmp +#else +#define STRCASECMP strcasecmp +#endif + YAZ_BEGIN_CDECL struct recordGroup { diff --git a/index/zinfo.c b/index/zinfo.c index b4ec43c..de9be50 100644 --- a/index/zinfo.c +++ b/index/zinfo.c @@ -1,4 +1,4 @@ -/* $Id: zinfo.c,v 1.35 2002-09-06 10:28:02 adam Exp $ +/* $Id: zinfo.c,v 1.36 2003-01-15 07:26:40 oleg Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Index Data Aps @@ -610,11 +610,11 @@ int zebraExplain_curDatabase (ZebraExplainInfo zei, const char *database) assert (zei); if (zei->curDatabaseInfo && - !strcmp (zei->curDatabaseInfo->databaseName, database)) + !STRCASECMP (zei->curDatabaseInfo->databaseName, database)) return 0; for (zdi = zei->databaseInfo; zdi; zdi=zdi->next) { - if (!strcmp (zdi->databaseName, database_n)) + if (!STRCASECMP (zdi->databaseName, database_n)) break; } if (!zdi) @@ -709,7 +709,7 @@ int zebraExplain_newDatabase (ZebraExplainInfo zei, const char *database, assert (zei); for (zdi = zei->databaseInfo; zdi; zdi=zdi->next) { - if (!strcmp (zdi->databaseName, database_n)) + if (!STRCASECMP (zdi->databaseName, database_n)) break; } if (zdi)