X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=ccl%2Fccltoken.c;h=afbac9c2e29081b4ed848d8979e27e3c6709e078;hb=f0c29efc372c97a94a32118de624b31c996d7ff5;hp=12111b1726b2ecc9e214ec60b7fca951e1c0e9a9;hpb=cb9bad819f13e44d7af6753bfa1bc8274ca37b9b;p=yaz-moved-to-github.git diff --git a/ccl/ccltoken.c b/ccl/ccltoken.c index 12111b1..afbac9c 100644 --- a/ccl/ccltoken.c +++ b/ccl/ccltoken.c @@ -44,7 +44,7 @@ /* CCL - lexical analysis * Europagate, 1995 * - * $Id: ccltoken.c,v 1.18 2001-11-27 22:38:50 adam Exp $ + * $Id: ccltoken.c,v 1.19 2002-06-06 12:54:24 adam Exp $ * * Old Europagate Log: * @@ -149,13 +149,13 @@ struct ccl_token *ccl_token_simple (const char *command) } if (!first) { - first = last = (struct ccl_token *)malloc (sizeof (*first)); + first = last = (struct ccl_token *)xmalloc (sizeof (*first)); ccl_assert (first); last->prev = NULL; } else { - last->next = (struct ccl_token *)malloc (sizeof(*first)); + last->next = (struct ccl_token *)xmalloc (sizeof(*first)); ccl_assert (last->next); last->next->prev = last; last = last->next; @@ -213,13 +213,13 @@ struct ccl_token *ccl_parser_tokenize (CCL_parser cclp, const char *command) } if (!first) { - first = last = (struct ccl_token *)malloc (sizeof (*first)); + first = last = (struct ccl_token *)xmalloc (sizeof (*first)); ccl_assert (first); last->prev = NULL; } else { - last->next = (struct ccl_token *)malloc (sizeof(*first)); + last->next = (struct ccl_token *)xmalloc (sizeof(*first)); ccl_assert (last->next); last->next->prev = last; last = last->next; @@ -337,7 +337,7 @@ void ccl_token_del (struct ccl_token *list) while (list) { list1 = list->next; - free (list); + xfree (list); list = list1; } } @@ -345,14 +345,14 @@ void ccl_token_del (struct ccl_token *list) char *ccl_strdup (const char *str) { int len = strlen(str); - char *p = (char*) malloc (len+1); + char *p = (char*) xmalloc (len+1); strcpy (p, str); return p; } CCL_parser ccl_parser_create (void) { - CCL_parser p = (CCL_parser)malloc (sizeof(*p)); + CCL_parser p = (CCL_parser)xmalloc (sizeof(*p)); if (!p) return p; p->look_token = NULL; @@ -373,11 +373,11 @@ void ccl_parser_destroy (CCL_parser p) { if (!p) return; - free (p->ccl_token_and); - free (p->ccl_token_or); - free (p->ccl_token_not); - free (p->ccl_token_set); - free (p); + xfree (p->ccl_token_and); + xfree (p->ccl_token_or); + xfree (p->ccl_token_not); + xfree (p->ccl_token_set); + xfree (p); } void ccl_parser_set_op_and (CCL_parser p, const char *op) @@ -385,7 +385,7 @@ void ccl_parser_set_op_and (CCL_parser p, const char *op) if (p && op) { if (p->ccl_token_and) - free (p->ccl_token_and); + xfree (p->ccl_token_and); p->ccl_token_and = ccl_strdup (op); } } @@ -395,7 +395,7 @@ void ccl_parser_set_op_or (CCL_parser p, const char *op) if (p && op) { if (p->ccl_token_or) - free (p->ccl_token_or); + xfree (p->ccl_token_or); p->ccl_token_or = ccl_strdup (op); } } @@ -404,7 +404,7 @@ void ccl_parser_set_op_not (CCL_parser p, const char *op) if (p && op) { if (p->ccl_token_not) - free (p->ccl_token_not); + xfree (p->ccl_token_not); p->ccl_token_not = ccl_strdup (op); } } @@ -413,7 +413,7 @@ void ccl_parser_set_op_set (CCL_parser p, const char *op) if (p && op) { if (p->ccl_token_set) - free (p->ccl_token_set); + xfree (p->ccl_token_set); p->ccl_token_set = ccl_strdup (op); } }