Lines Matching refs:cur

73 static void     xmlC14NVisibleNsStackDestroy	(xmlC14NVisibleNsStackPtr cur);
74 static void xmlC14NVisibleNsStackAdd (xmlC14NVisibleNsStackPtr cur,
77 static void xmlC14NVisibleNsStackSave (xmlC14NVisibleNsStackPtr cur,
79 static void xmlC14NVisibleNsStackRestore (xmlC14NVisibleNsStackPtr cur,
81 static void xmlC14NVisibleNsStackShift (xmlC14NVisibleNsStackPtr cur);
82 static int xmlC14NVisibleNsStackFind (xmlC14NVisibleNsStackPtr cur,
84 static int xmlExcC14NVisibleNsStackFind (xmlC14NVisibleNsStackPtr cur,
94 static int xmlC14NProcessNode(xmlC14NCtxPtr ctx, xmlNodePtr cur);
95 static int xmlC14NProcessNodeList(xmlC14NCtxPtr ctx, xmlNodePtr cur);
288 xmlC14NVisibleNsStackDestroy(xmlC14NVisibleNsStackPtr cur) {
289 if(cur == NULL) {
293 if(cur->nsTab != NULL) {
294 memset(cur->nsTab, 0, cur->nsMax * sizeof(xmlNsPtr));
295 xmlFree(cur->nsTab);
297 if(cur->nodeTab != NULL) {
298 memset(cur->nodeTab, 0, cur->nsMax * sizeof(xmlNodePtr));
299 xmlFree(cur->nodeTab);
301 memset(cur, 0, sizeof(xmlC14NVisibleNsStack));
302 xmlFree(cur);
307 xmlC14NVisibleNsStackAdd(xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns, xmlNodePtr node) {
308 if((cur == NULL) ||
309 ((cur->nsTab == NULL) && (cur->nodeTab != NULL)) ||
310 ((cur->nsTab != NULL) && (cur->nodeTab == NULL))) {
315 if ((cur->nsTab == NULL) && (cur->nodeTab == NULL)) {
316 cur->nsTab = (xmlNsPtr*) xmlMalloc(XML_NAMESPACES_DEFAULT * sizeof(xmlNsPtr));
317 cur->nodeTab = (xmlNodePtr*) xmlMalloc(XML_NAMESPACES_DEFAULT * sizeof(xmlNodePtr));
318 if ((cur->nsTab == NULL) || (cur->nodeTab == NULL)) {
322 memset(cur->nsTab, 0 , XML_NAMESPACES_DEFAULT * sizeof(xmlNsPtr));
323 memset(cur->nodeTab, 0 , XML_NAMESPACES_DEFAULT * sizeof(xmlNodePtr));
324 cur->nsMax = XML_NAMESPACES_DEFAULT;
325 } else if(cur->nsMax == cur->nsCurEnd) {
329 tmpSize = 2 * cur->nsMax;
330 tmp = xmlRealloc(cur->nsTab, tmpSize * sizeof(xmlNsPtr));
335 cur->nsTab = (xmlNsPtr*)tmp;
337 tmp = xmlRealloc(cur->nodeTab, tmpSize * sizeof(xmlNodePtr));
342 cur->nodeTab = (xmlNodePtr*)tmp;
344 cur->nsMax = tmpSize;
346 cur->nsTab[cur->nsCurEnd] = ns;
347 cur->nodeTab[cur->nsCurEnd] = node;
349 ++cur->nsCurEnd;
353 xmlC14NVisibleNsStackSave(xmlC14NVisibleNsStackPtr cur, xmlC14NVisibleNsStackPtr state) {
354 if((cur == NULL) || (state == NULL)) {
359 state->nsCurEnd = cur->nsCurEnd;
360 state->nsPrevStart = cur->nsPrevStart;
361 state->nsPrevEnd = cur->nsPrevEnd;
365 xmlC14NVisibleNsStackRestore(xmlC14NVisibleNsStackPtr cur, xmlC14NVisibleNsStackPtr state) {
366 if((cur == NULL) || (state == NULL)) {
370 cur->nsCurEnd = state->nsCurEnd;
371 cur->nsPrevStart = state->nsPrevStart;
372 cur->nsPrevEnd = state->nsPrevEnd;
376 xmlC14NVisibleNsStackShift(xmlC14NVisibleNsStackPtr cur) {
377 if(cur == NULL) {
381 cur->nsPrevStart = cur->nsPrevEnd;
382 cur->nsPrevEnd = cur->nsCurEnd;
406 xmlC14NVisibleNsStackFind(xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns)
413 if(cur == NULL) {
426 if (cur->nsTab != NULL) {
427 int start = (has_empty_ns) ? 0 : cur->nsPrevStart;
428 for (i = cur->nsCurEnd - 1; i >= start; --i) {
429 xmlNsPtr ns1 = cur->nsTab[i];
440 xmlExcC14NVisibleNsStackFind(xmlC14NVisibleNsStackPtr cur, xmlNsPtr ns, xmlC14NCtxPtr ctx) {
446 if(cur == NULL) {
459 if (cur->nsTab != NULL) {
461 for (i = cur->nsCurEnd - 1; i >= start; --i) {
462 xmlNsPtr ns1 = cur->nsTab[i];
466 return(xmlC14NIsVisible(ctx, ns1, cur->nodeTab[i]));
596 xmlC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible)
604 if ((ctx == NULL) || (cur == NULL) || (cur->type != XML_ELEMENT_NODE)) {
619 for(n = cur; n != NULL; n = n->parent) {
621 tmp = xmlSearchNs(cur->doc, cur, ns->prefix);
623 if((tmp == ns) && !xmlC14NIsXmlNs(ns) && xmlC14NIsVisible(ctx, ns, cur)) {
626 xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur);
701 xmlExcC14NProcessNamespacesAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible)
711 if ((ctx == NULL) || (cur == NULL) || (cur->type != XML_ELEMENT_NODE)) {
751 ns = xmlSearchNs(cur->doc, cur, prefix);
752 if((ns != NULL) && !xmlC14NIsXmlNs(ns) && xmlC14NIsVisible(ctx, ns, cur)) {
755 xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur);
768 if(cur->ns != NULL) {
769 ns = cur->ns;
771 ns = xmlSearchNs(cur->doc, cur, NULL);
775 if(visible && xmlC14NIsVisible(ctx, ns, cur)) {
781 xmlC14NVisibleNsStackAdd(ctx->ns_rendered, ns, cur);
790 for(attr = cur->properties; attr != NULL; attr = attr->next) {
796 if((attr->ns != NULL) && !xmlC14NIsXmlNs(attr->ns) && xmlC14NIsVisible(ctx, attr, cur)) {
798 xmlC14NVisibleNsStackAdd(ctx->ns_rendered, attr->ns, cur);
948 * @cur: the current node
978 xmlC14NProcessAttrsAxis(xmlC14NCtxPtr ctx, xmlNodePtr cur, int parent_visible)
983 if ((ctx == NULL) || (cur == NULL) || (cur->type != XML_ELEMENT_NODE)) {
1000 attr = cur->properties;
1003 if (xmlC14NIsVisible(ctx, attr, cur)) {
1013 if (parent_visible && (!ctx->exclusive) && (cur->parent != NULL)
1014 && (!xmlC14NIsVisible(ctx, cur->parent, cur->parent->parent))) {
1019 cur = cur->parent;
1020 while (cur != NULL) {
1021 attr = cur->properties;
1031 cur = cur->parent;
1050 * @cur: the current element node
1057 xmlC14NCheckForRelativeNamespaces(xmlC14NCtxPtr ctx, xmlNodePtr cur)
1061 if ((ctx == NULL) || (cur == NULL) || (cur->type != XML_ELEMENT_NODE)) {
1066 ns = cur->nsDef;
1098 * @cur: the node to process
1117 xmlC14NProcessElementNode(xmlC14NCtxPtr ctx, xmlNodePtr cur, int visible)
1123 if ((ctx == NULL) || (cur == NULL) || (cur->type != XML_ELEMENT_NODE)) {
1133 if (xmlC14NCheckForRelativeNamespaces(ctx, cur) < 0) {
1154 if ((cur->ns != NULL) && (xmlStrlen(cur->ns->prefix) > 0)) {
1156 (const char *) cur->ns->prefix);
1159 xmlOutputBufferWriteString(ctx->buf, (const char *) cur->name);
1163 ret = xmlC14NProcessNamespacesAxis(ctx, cur, visible);
1165 ret = xmlExcC14NProcessNamespacesAxis(ctx, cur, visible);
1176 ret = xmlC14NProcessAttrsAxis(ctx, cur, visible);
1185 if (cur->children != NULL) {
1186 ret = xmlC14NProcessNodeList(ctx, cur->children);
1194 if ((cur->ns != NULL) && (xmlStrlen(cur->ns->prefix) > 0)) {
1196 (const char *) cur->ns->prefix);
1199 xmlOutputBufferWriteString(ctx->buf, (const char *) cur->name);
1218 * @cur: the node to process
1225 xmlC14NProcessNode(xmlC14NCtxPtr ctx, xmlNodePtr cur)
1230 if ((ctx == NULL) || (cur == NULL)) {
1235 visible = xmlC14NIsVisible(ctx, cur, cur->parent);
1236 switch (cur->type) {
1238 ret = xmlC14NProcessElementNode(ctx, cur, visible);
1251 if ((visible) && (cur->content != NULL)) {
1254 buffer = xmlC11NNormalizeText(cur->content);
1286 (const char *) cur->name);
1287 if ((cur->content != NULL) && (*(cur->content) != '\0')) {
1293 buffer = xmlC11NNormalizePI(cur->content);
1334 if (cur->content != NULL) {
1338 buffer = xmlC11NNormalizeComment(cur->content);
1364 if (cur->children != NULL) {
1367 ret = xmlC14NProcessNodeList(ctx, cur->children);
1399 xmlC14NErrUnknownNode(cur->type, "processing node");
1409 * @cur: the node to start from
1411 * Processes all nodes in the row starting from cur.
1416 xmlC14NProcessNodeList(xmlC14NCtxPtr ctx, xmlNodePtr cur)
1425 for (ret = 0; cur != NULL && ret >= 0; cur = cur->next) {
1426 ret = xmlC14NProcessNode(ctx, cur);
1840 const xmlChar *cur = input;
1859 while (*cur != '\0') {
1867 if ((*cur == '<') && ((mode == XMLC14N_NORMALIZE_ATTR) ||
1873 } else if ((*cur == '>') && (mode == XMLC14N_NORMALIZE_TEXT)) {
1878 } else if ((*cur == '&') && ((mode == XMLC14N_NORMALIZE_ATTR) ||
1885 } else if ((*cur == '"') && (mode == XMLC14N_NORMALIZE_ATTR)) {
1892 } else if ((*cur == '\x09') && (mode == XMLC14N_NORMALIZE_ATTR)) {
1898 } else if ((*cur == '\x0A') && (mode == XMLC14N_NORMALIZE_ATTR)) {
1904 } else if ((*cur == '\x0D') && ((mode == XMLC14N_NORMALIZE_ATTR) ||
1918 *out++ = *cur;
1920 cur++;