X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=util%2Fyaz-ccl.c;h=93832c0ef23fcf147ceee092c42e07ad0e8d246a;hb=de62d4d97943ed7033f48bdbcaf06f67952f86fe;hp=095bf4bdaba7a734c1bb1f70ab3d22b86aa78c09;hpb=657fb99115b87a5244e9a33bbe4ca3d9d18849c4;p=yaz-moved-to-github.git diff --git a/util/yaz-ccl.c b/util/yaz-ccl.c index 095bf4b..93832c0 100644 --- a/util/yaz-ccl.c +++ b/util/yaz-ccl.c @@ -1,3 +1,14 @@ +/* + * Copyright (c) 1996, Index Data. + * See the file LICENSE for details. + * Sebastian Hammer, Adam Dickmeiss + * + * $Log: yaz-ccl.c,v $ + * Revision 1.8 1996-10-29 13:36:27 adam + * Added header. + * + */ + #include #include #include @@ -15,13 +26,13 @@ static Z_AttributesPlusTerm *ccl_rpn_term (struct ccl_rpn_node *p) Odr_oct *term_octet; Z_Term *term; - zapt = malloc (sizeof(*zapt)); + zapt = xmalloc (sizeof(*zapt)); assert (zapt); - term_octet = malloc (sizeof(*term_octet)); + term_octet = xmalloc (sizeof(*term_octet)); assert (term_octet); - term = malloc(sizeof(*term)); + term = xmalloc(sizeof(*term)); assert(term); for (attr = p->u.t.attr_list; attr; attr = attr->next) @@ -30,11 +41,11 @@ static Z_AttributesPlusTerm *ccl_rpn_term (struct ccl_rpn_node *p) if (num) { int i = 0; - zapt->attributeList = malloc (num*sizeof(*zapt->attributeList)); + zapt->attributeList = xmalloc (num*sizeof(*zapt->attributeList)); assert (zapt->attributeList); for (attr = p->u.t.attr_list; attr; attr = attr->next, i++) { - zapt->attributeList[i] = malloc (sizeof(**zapt->attributeList)); + zapt->attributeList[i] = xmalloc (sizeof(**zapt->attributeList)); assert (zapt->attributeList[i]); zapt->attributeList[i]->attributeType = &attr->type; @@ -63,7 +74,7 @@ static Z_Operand *ccl_rpn_simple (struct ccl_rpn_node *p) { Z_Operand *zo; - zo = malloc (sizeof(*zo)); + zo = xmalloc (sizeof(*zo)); assert (zo); switch (p->kind) @@ -87,12 +98,12 @@ static Z_Complex *ccl_rpn_complex (struct ccl_rpn_node *p) Z_Complex *zc; Z_Operator *zo; - zc = malloc (sizeof(*zc)); + zc = xmalloc (sizeof(*zc)); assert (zc); - zo = malloc (sizeof(*zo)); + zo = xmalloc (sizeof(*zo)); assert (zo); - zc->operator = zo; + zc->roperator = zo; switch (p->kind) { case CCL_RPN_AND: @@ -119,7 +130,7 @@ static Z_RPNStructure *ccl_rpn_structure (struct ccl_rpn_node *p) { Z_RPNStructure *zs; - zs = malloc (sizeof(*zs)); + zs = xmalloc (sizeof(*zs)); assert (zs); switch (p->kind) { @@ -141,18 +152,18 @@ static Z_RPNStructure *ccl_rpn_structure (struct ccl_rpn_node *p) return zs; } -Z_RPNQuery MDF *ccl_rpn_query (struct ccl_rpn_node *p) +Z_RPNQuery *ccl_rpn_query (struct ccl_rpn_node *p) { Z_RPNQuery *zq; - zq = malloc (sizeof(*zq)); + zq = xmalloc (sizeof(*zq)); assert (zq); zq->attributeSetId = NULL; zq->RPNStructure = ccl_rpn_structure (p); return zq; } -Z_AttributesPlusTerm MDF *ccl_scan_query (struct ccl_rpn_node *p) +Z_AttributesPlusTerm *ccl_scan_query (struct ccl_rpn_node *p) { if (p->kind != CCL_RPN_TERM) return NULL;