Lines Matching refs:cur

77 static void     xmlC14NVisibleNsStackDestroy	(xmlC14NVisibleNsStackPtr cur);
78 static void xmlC14NVisibleNsStackAdd (xmlC14NVisibleNsStackPtr cur,
81 static void xmlC14NVisibleNsStackSave (xmlC14NVisibleNsStackPtr cur,
83 static void xmlC14NVisibleNsStackRestore (xmlC14NVisibleNsStackPtr cur,
85 static void xmlC14NVisibleNsStackShift (xmlC14NVisibleNsStackPtr cur);
86 static int xmlC14NVisibleNsStackFind (xmlC14NVisibleNsStackPtr cur,
88 static int xmlExcC14NVisibleNsStackFind (xmlC14NVisibleNsStackPtr cur,
98 static int xmlC14NProcessNode(xmlC14NCtxPtr ctx, xmlNodePtr cur);
99 static int xmlC14NProcessNodeList(xmlC14NCtxPtr ctx, xmlNodePtr cur);
295 xmlC14NVisibleNsStackDestroy(xmlC14NVisibleNsStackPtr cur) { in xmlC14NVisibleNsStackDestroy() argument
296 if(cur == NULL) { in xmlC14NVisibleNsStackDestroy()
300 if(cur->nsTab != NULL) { in xmlC14NVisibleNsStackDestroy()
301 memset(cur->nsTab, 0, cur->nsMax * sizeof(xmlNsPtr)); in xmlC14NVisibleNsStackDestroy()
302 xmlFree(cur->nsTab); in xmlC14NVisibleNsStackDestroy()
304 if(cur->nodeTab != NULL) { in xmlC14NVisibleNsStackDestroy()
305 memset(cur->nodeTab, 0, cur->nsMax * sizeof(xmlNodePtr)); in xmlC14NVisibleNsStackDestroy()
306 xmlFree(cur->nodeTab); in xmlC14NVisibleNsStackDestroy()
308 memset(cur, 0, sizeof(xmlC14NVisibleNsStack)); in xmlC14NVisibleNsStackDestroy()
309 xmlFree(cur); in xmlC14NVisibleNsStackDestroy()
314 xmlC14NVisibleNsStackAdd(xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns, xmlNodePtr node) { in xmlC14NVisibleNsStackAdd() argument
315 if((cur == NULL) || in xmlC14NVisibleNsStackAdd()
316 ((cur->nsTab == NULL) && (cur->nodeTab != NULL)) || in xmlC14NVisibleNsStackAdd()
317 ((cur->nsTab != NULL) && (cur->nodeTab == NULL))) { in xmlC14NVisibleNsStackAdd()
322 if ((cur->nsTab == NULL) && (cur->nodeTab == NULL)) { in xmlC14NVisibleNsStackAdd()
323 cur->nsTab = (xmlNsPtr*) xmlMalloc(XML_NAMESPACES_DEFAULT * sizeof(xmlNsPtr)); in xmlC14NVisibleNsStackAdd()
324 cur->nodeTab = (xmlNodePtr*) xmlMalloc(XML_NAMESPACES_DEFAULT * sizeof(xmlNodePtr)); in xmlC14NVisibleNsStackAdd()
325 if ((cur->nsTab == NULL) || (cur->nodeTab == NULL)) { in xmlC14NVisibleNsStackAdd()
329 memset(cur->nsTab, 0 , XML_NAMESPACES_DEFAULT * sizeof(xmlNsPtr)); in xmlC14NVisibleNsStackAdd()
330 memset(cur->nodeTab, 0 , XML_NAMESPACES_DEFAULT * sizeof(xmlNodePtr)); in xmlC14NVisibleNsStackAdd()
331 cur->nsMax = XML_NAMESPACES_DEFAULT; in xmlC14NVisibleNsStackAdd()
332 } else if(cur->nsMax == cur->nsCurEnd) { in xmlC14NVisibleNsStackAdd()
336 tmpSize = 2 * cur->nsMax; in xmlC14NVisibleNsStackAdd()
337 tmp = xmlRealloc(cur->nsTab, tmpSize * sizeof(xmlNsPtr)); in xmlC14NVisibleNsStackAdd()
342 cur->nsTab = (xmlNsPtr*)tmp; in xmlC14NVisibleNsStackAdd()
344 tmp = xmlRealloc(cur->nodeTab, tmpSize * sizeof(xmlNodePtr)); in xmlC14NVisibleNsStackAdd()
349 cur->nodeTab = (xmlNodePtr*)tmp; in xmlC14NVisibleNsStackAdd()
351 cur->nsMax = tmpSize; in xmlC14NVisibleNsStackAdd()
353 cur->nsTab[cur->nsCurEnd] = ns; in xmlC14NVisibleNsStackAdd()
354 cur->nodeTab[cur->nsCurEnd] = node; in xmlC14NVisibleNsStackAdd()
356 ++cur->nsCurEnd; in xmlC14NVisibleNsStackAdd()
360 xmlC14NVisibleNsStackSave(xmlC14NVisibleNsStackPtr cur, xmlC14NVisibleNsStackPtr state) { in xmlC14NVisibleNsStackSave() argument
361 if((cur == NULL) || (state == NULL)) { in xmlC14NVisibleNsStackSave()
366 state->nsCurEnd = cur->nsCurEnd; in xmlC14NVisibleNsStackSave()
367 state->nsPrevStart = cur->nsPrevStart; in xmlC14NVisibleNsStackSave()
368 state->nsPrevEnd = cur->nsPrevEnd; in xmlC14NVisibleNsStackSave()
372 xmlC14NVisibleNsStackRestore(xmlC14NVisibleNsStackPtr cur, xmlC14NVisibleNsStackPtr state) { in xmlC14NVisibleNsStackRestore() argument
373 if((cur == NULL) || (state == NULL)) { in xmlC14NVisibleNsStackRestore()
377 cur->nsCurEnd = state->nsCurEnd; in xmlC14NVisibleNsStackRestore()
378 cur->nsPrevStart = state->nsPrevStart; in xmlC14NVisibleNsStackRestore()
379 cur->nsPrevEnd = state->nsPrevEnd; in xmlC14NVisibleNsStackRestore()
383 xmlC14NVisibleNsStackShift(xmlC14NVisibleNsStackPtr cur) { in xmlC14NVisibleNsStackShift() argument
384 if(cur == NULL) { in xmlC14NVisibleNsStackShift()
388 cur->nsPrevStart = cur->nsPrevEnd; in xmlC14NVisibleNsStackShift()
389 cur->nsPrevEnd = cur->nsCurEnd; in xmlC14NVisibleNsStackShift()
413 xmlC14NVisibleNsStackFind(xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns) in xmlC14NVisibleNsStackFind() argument
420 if(cur == NULL) { in xmlC14NVisibleNsStackFind()
433 if (cur->nsTab != NULL) { in xmlC14NVisibleNsStackFind()
434 int start = (has_empty_ns) ? 0 : cur->nsPrevStart; in xmlC14NVisibleNsStackFind()
435 for (i = cur->nsCurEnd - 1; i >= start; --i) { in xmlC14NVisibleNsStackFind()
436 xmlNsPtr ns1 = cur->nsTab[i]; in xmlC14NVisibleNsStackFind()
447 xmlExcC14NVisibleNsStackFind(xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns, xmlC14NCtxPtr ctx) { in xmlExcC14NVisibleNsStackFind() argument
453 if(cur == NULL) { in xmlExcC14NVisibleNsStackFind()
466 if (cur->nsTab != NULL) { in xmlExcC14NVisibleNsStackFind()
468 for (i = cur->nsCurEnd - 1; i >= start; --i) { in xmlExcC14NVisibleNsStackFind()
469 xmlNsPtr ns1 = cur->nsTab[i]; in xmlExcC14NVisibleNsStackFind()
473 return(xmlC14NIsVisible(ctx, ns1, cur->nodeTab[i])); in xmlExcC14NVisibleNsStackFind()
602 xmlC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible) in xmlC14NProcessNamespacesAxis() argument
610 if ((ctx == NULL) || (cur == NULL) || (cur->type != XML_ELEMENT_NODE)) { in xmlC14NProcessNamespacesAxis()
625 for(n = cur; n != NULL; n = n->parent) { in xmlC14NProcessNamespacesAxis()
627 tmp = xmlSearchNs(cur->doc, cur, ns->prefix); in xmlC14NProcessNamespacesAxis()
629 if((tmp == ns) && !xmlC14NIsXmlNs(ns) && xmlC14NIsVisible(ctx, ns, cur)) { in xmlC14NProcessNamespacesAxis()
632 xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur); in xmlC14NProcessNamespacesAxis()
707 xmlExcC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible) in xmlExcC14NProcessNamespacesAxis() argument
717 if ((ctx == NULL) || (cur == NULL) || (cur->type != XML_ELEMENT_NODE)) { in xmlExcC14NProcessNamespacesAxis()
757 ns = xmlSearchNs(cur->doc, cur, prefix); in xmlExcC14NProcessNamespacesAxis()
758 if((ns != NULL) && !xmlC14NIsXmlNs(ns) && xmlC14NIsVisible(ctx, ns, cur)) { in xmlExcC14NProcessNamespacesAxis()
761 xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur); in xmlExcC14NProcessNamespacesAxis()
774 if(cur->ns != NULL) { in xmlExcC14NProcessNamespacesAxis()
775 ns = cur->ns; in xmlExcC14NProcessNamespacesAxis()
777 ns = xmlSearchNs(cur->doc, cur, NULL); in xmlExcC14NProcessNamespacesAxis()
781 if(visible && xmlC14NIsVisible(ctx, ns, cur)) { in xmlExcC14NProcessNamespacesAxis()
787 xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur); in xmlExcC14NProcessNamespacesAxis()
796 for(attr = cur->properties; attr != NULL; attr = attr->next) { in xmlExcC14NProcessNamespacesAxis()
802 if((attr->ns != NULL) && !xmlC14NIsXmlNs(attr->ns) && xmlC14NIsVisible(ctx, attr, cur)) { in xmlExcC14NProcessNamespacesAxis()
804 xmlC14NVisibleNsStackAdd(ctx->ns_rendered, attr->ns, cur); in xmlExcC14NProcessNamespacesAxis()
978 xmlC14NFindHiddenParentAttr(xmlC14NCtxPtr ctx, xmlNodePtr cur, const xmlChar * name, const xmlChar … in xmlC14NFindHiddenParentAttr() argument
981 while((cur != NULL) && (!xmlC14NIsVisible(ctx, cur, cur->parent))) { in xmlC14NFindHiddenParentAttr()
982 res = xmlHasNsProp(cur, name, ns); in xmlC14NFindHiddenParentAttr()
987 cur = cur->parent; in xmlC14NFindHiddenParentAttr()
1004 xmlNodePtr cur; in xmlC14NFixupBaseAttr() local
1023 cur = xml_base_attr->parent->parent; in xmlC14NFixupBaseAttr()
1024 while((cur != NULL) && (!xmlC14NIsVisible(ctx, cur, cur->parent))) { in xmlC14NFixupBaseAttr()
1025 attr = xmlHasNsProp(cur, BAD_CAST "base", XML_XML_NAMESPACE); in xmlC14NFixupBaseAttr()
1069 cur = cur->parent; in xmlC14NFixupBaseAttr()
1126 xmlC14NProcessAttrsAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int parent_visible) in xmlC14NProcessAttrsAxis() argument
1137 if ((ctx == NULL) || (cur == NULL) || (cur->type != XML_ELEMENT_NODE)) { in xmlC14NProcessAttrsAxis()
1167 attr = cur->properties; in xmlC14NProcessAttrsAxis()
1170 if (xmlC14NIsVisible(ctx, attr, cur)) { in xmlC14NProcessAttrsAxis()
1179 if (parent_visible && (cur->parent != NULL) && in xmlC14NProcessAttrsAxis()
1180 (!xmlC14NIsVisible(ctx, cur->parent, cur->parent->parent))) in xmlC14NProcessAttrsAxis()
1188 tmp = cur->parent; in xmlC14NProcessAttrsAxis()
1213 attr = cur->properties; in xmlC14NProcessAttrsAxis()
1216 if (xmlC14NIsVisible(ctx, attr, cur)) { in xmlC14NProcessAttrsAxis()
1256 attr = cur->properties; in xmlC14NProcessAttrsAxis()
1261 if (xmlC14NIsVisible(ctx, attr, cur)) { in xmlC14NProcessAttrsAxis()
1284 if((!matched) && xmlC14NIsVisible(ctx, attr, cur)) { in xmlC14NProcessAttrsAxis()
1298 … xml_lang_attr = xmlC14NFindHiddenParentAttr(ctx, cur->parent, BAD_CAST "lang", XML_XML_NAMESPACE); in xmlC14NProcessAttrsAxis()
1304 …xml_space_attr = xmlC14NFindHiddenParentAttr(ctx, cur->parent, BAD_CAST "space", XML_XML_NAMESPACE… in xmlC14NProcessAttrsAxis()
1313 … xml_base_attr = xmlC14NFindHiddenParentAttr(ctx, cur->parent, BAD_CAST "base", XML_XML_NAMESPACE); in xmlC14NProcessAttrsAxis()
1354 xmlC14NCheckForRelativeNamespaces(xmlC14NCtxPtr ctx, xmlNodePtr cur) in xmlC14NCheckForRelativeNamespaces() argument
1358 if ((ctx == NULL) || (cur == NULL) || (cur->type != XML_ELEMENT_NODE)) { in xmlC14NCheckForRelativeNamespaces()
1363 ns = cur->nsDef; in xmlC14NCheckForRelativeNamespaces()
1416 xmlC14NProcessElementNode(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible) in xmlC14NProcessElementNode() argument
1422 if ((ctx == NULL) || (cur == NULL) || (cur->type != XML_ELEMENT_NODE)) { in xmlC14NProcessElementNode()
1432 if (xmlC14NCheckForRelativeNamespaces(ctx, cur) < 0) { in xmlC14NProcessElementNode()
1453 if ((cur->ns != NULL) && (xmlStrlen(cur->ns->prefix) > 0)) { in xmlC14NProcessElementNode()
1455 (const char *) cur->ns->prefix); in xmlC14NProcessElementNode()
1458 xmlOutputBufferWriteString(ctx->buf, (const char *) cur->name); in xmlC14NProcessElementNode()
1462 ret = xmlC14NProcessNamespacesAxis(ctx, cur, visible); in xmlC14NProcessElementNode()
1464 ret = xmlExcC14NProcessNamespacesAxis(ctx, cur, visible); in xmlC14NProcessElementNode()
1475 ret = xmlC14NProcessAttrsAxis(ctx, cur, visible); in xmlC14NProcessElementNode()
1484 if (cur->children != NULL) { in xmlC14NProcessElementNode()
1485 ret = xmlC14NProcessNodeList(ctx, cur->children); in xmlC14NProcessElementNode()
1493 if ((cur->ns != NULL) && (xmlStrlen(cur->ns->prefix) > 0)) { in xmlC14NProcessElementNode()
1495 (const char *) cur->ns->prefix); in xmlC14NProcessElementNode()
1498 xmlOutputBufferWriteString(ctx->buf, (const char *) cur->name); in xmlC14NProcessElementNode()
1524 xmlC14NProcessNode(xmlC14NCtxPtr ctx, xmlNodePtr cur) in xmlC14NProcessNode() argument
1529 if ((ctx == NULL) || (cur == NULL)) { in xmlC14NProcessNode()
1534 visible = xmlC14NIsVisible(ctx, cur, cur->parent); in xmlC14NProcessNode()
1535 switch (cur->type) { in xmlC14NProcessNode()
1537 ret = xmlC14NProcessElementNode(ctx, cur, visible); in xmlC14NProcessNode()
1550 if ((visible) && (cur->content != NULL)) { in xmlC14NProcessNode()
1553 buffer = xmlC11NNormalizeText(cur->content); in xmlC14NProcessNode()
1585 (const char *) cur->name); in xmlC14NProcessNode()
1586 if ((cur->content != NULL) && (*(cur->content) != '\0')) { in xmlC14NProcessNode()
1592 buffer = xmlC11NNormalizePI(cur->content); in xmlC14NProcessNode()
1633 if (cur->content != NULL) { in xmlC14NProcessNode()
1637 buffer = xmlC11NNormalizeComment(cur->content); in xmlC14NProcessNode()
1663 if (cur->children != NULL) { in xmlC14NProcessNode()
1666 ret = xmlC14NProcessNodeList(ctx, cur->children); in xmlC14NProcessNode()
1698 xmlC14NErrUnknownNode(cur->type, "processing node"); in xmlC14NProcessNode()
1715 xmlC14NProcessNodeList(xmlC14NCtxPtr ctx, xmlNodePtr cur) in xmlC14NProcessNodeList() argument
1724 for (ret = 0; cur != NULL && ret >= 0; cur = cur->next) { in xmlC14NProcessNodeList()
1725 ret = xmlC14NProcessNode(ctx, cur); in xmlC14NProcessNodeList()
2150 const xmlChar *cur = input; in xmlC11NNormalizeString() local
2169 while (*cur != '\0') { in xmlC11NNormalizeString()
2177 if ((*cur == '<') && ((mode == XMLC14N_NORMALIZE_ATTR) || in xmlC11NNormalizeString()
2183 } else if ((*cur == '>') && (mode == XMLC14N_NORMALIZE_TEXT)) { in xmlC11NNormalizeString()
2188 } else if ((*cur == '&') && ((mode == XMLC14N_NORMALIZE_ATTR) || in xmlC11NNormalizeString()
2195 } else if ((*cur == '"') && (mode == XMLC14N_NORMALIZE_ATTR)) { in xmlC11NNormalizeString()
2202 } else if ((*cur == '\x09') && (mode == XMLC14N_NORMALIZE_ATTR)) { in xmlC11NNormalizeString()
2208 } else if ((*cur == '\x0A') && (mode == XMLC14N_NORMALIZE_ATTR)) { in xmlC11NNormalizeString()
2214 } else if ((*cur == '\x0D') && ((mode == XMLC14N_NORMALIZE_ATTR) || in xmlC11NNormalizeString()
2228 *out++ = *cur; in xmlC11NNormalizeString()
2230 cur++; in xmlC11NNormalizeString()