X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=ccl%2Fccltoken.c;h=81af66236c6c6c2a9e30a862890a30556e17365f;hb=c126b2a625462f95475f00efdfdf9ce41a0e9c79;hp=42922cffcf50f6e8685cb1e4e1a997a0d6a9d27a;hpb=044d170f0a963555486df54653cd2fdc5815928b;p=yaz-moved-to-github.git diff --git a/ccl/ccltoken.c b/ccl/ccltoken.c index 42922cf..81af662 100644 --- a/ccl/ccltoken.c +++ b/ccl/ccltoken.c @@ -45,7 +45,18 @@ * Europagate, 1995 * * $Log: ccltoken.c,v $ - * Revision 1.9 1998-02-11 11:53:33 adam + * Revision 1.12 2000-01-31 13:15:21 adam + * Removed uses of assert(3). Cleanup of ODR. CCL parser update so + * that some characters are not surrounded by spaces in resulting term. + * ILL-code updates. + * + * Revision 1.11 1999/11/30 13:47:11 adam + * Improved installation. Moved header files to include/yaz. + * + * Revision 1.10 1998/07/07 15:49:41 adam + * Added braces to avoid warning. + * + * Revision 1.9 1998/02/11 11:53:33 adam * Changed code so that it compiles as C++. * * Revision 1.8 1997/09/29 08:56:38 adam @@ -101,9 +112,8 @@ #include #include #include -#include -#include +#include /* * token_cmp: Compare token with keyword(s) @@ -121,6 +131,7 @@ static int token_cmp (CCL_parser cclp, const char *kw, struct ccl_token *token) while ((cp2 = strchr (cp1, ' '))) { if (token->len == (size_t) (cp2-cp1)) + { if (cclp->ccl_case_sensitive) { if (!memcmp (cp1, token->name, token->len)) @@ -131,6 +142,7 @@ static int token_cmp (CCL_parser cclp, const char *kw, struct ccl_token *token) if (!ccl_memicmp (cp1, token->name, token->len)) return 1; } + } cp1 = cp2+1; } if (cclp->ccl_case_sensitive) @@ -159,13 +171,13 @@ struct ccl_token *ccl_token_simple (const char *command) if (!first) { first = last = (struct ccl_token *)malloc (sizeof (*first)); - assert (first); + ccl_assert (first); last->prev = NULL; } else { last->next = (struct ccl_token *)malloc (sizeof(*first)); - assert (last->next); + ccl_assert (last->next); last->next->prev = last; last = last->next; } @@ -222,13 +234,13 @@ struct ccl_token *ccl_parser_tokenize (CCL_parser cclp, const char *command) if (!first) { first = last = (struct ccl_token *)malloc (sizeof (*first)); - assert (first); + ccl_assert (first); last->prev = NULL; } else { last->next = (struct ccl_token *)malloc (sizeof(*first)); - assert (last->next); + ccl_assert (last->next); last->next->prev = last; last = last->next; }