X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=ccl%2Fccltoken.c;fp=ccl%2Fccltoken.c;h=51cdf0e2831a4ee39b55b3f21d12f95f0b760159;hb=ddccceb2d9e85c93eca315233f73adf6743bc2bf;hp=26a45f6048c8ac581d8be9482177fbc63178a48b;hpb=f933e3fe27e52c53ff9e453ab81f8d5d891a4512;p=egate.git diff --git a/ccl/ccltoken.c b/ccl/ccltoken.c index 26a45f6..51cdf0e 100644 --- a/ccl/ccltoken.c +++ b/ccl/ccltoken.c @@ -2,7 +2,12 @@ * Europagate, 1995 * * $Log: ccltoken.c,v $ - * Revision 1.7 1995/04/19 12:11:24 adam + * Revision 1.8 1995/05/11 14:03:57 adam + * Changes in the reading of qualifier(s). New function: ccl_qual_fitem. + * New variable ccl_case_sensitive, which controls whether reserved + * words and field names are case sensitive or not. + * + * Revision 1.7 1995/04/19 12:11:24 adam * Minor change. * * Revision 1.6 1995/04/17 09:31:48 adam @@ -36,6 +41,7 @@ const char *ccl_token_and = "and"; const char *ccl_token_or = "or"; const char *ccl_token_not = "not andnot"; const char *ccl_token_set = "set"; +int ccl_case_sensitive = 1; /* * token_cmp: Compare token with keyword(s) @@ -52,13 +58,24 @@ static int token_cmp (const char *kw, struct ccl_token *token) return 0; while ((cp2 = strchr (cp1, ' '))) { - if (token->len == cp2-cp1 && - !memcmp (cp1, token->name, token->len)) - return 1; + if (token->len == cp2-cp1) + if (ccl_case_sensitive) + { + if (!memcmp (cp1, token->name, token->len)) + return 1; + } + else + { + if (!ccl_memicmp (cp1, token->name, token->len)) + return 1; + } cp1 = cp2+1; } - return token->len == strlen(cp1) - && !memcmp (cp1, token->name, token->len); + if (ccl_case_sensitive) + return token->len == strlen(cp1) + && !memcmp (cp1, token->name, token->len); + return token->len == strlen(cp1) && + !ccl_memicmp (cp1, token->name, token->len); } /*