Lines Matching defs:cur

49     htmlNodePtr cur;
55 cur = doc->children;
60 while (cur != NULL) {
61 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) {
62 if (xmlStrEqual(cur->name, BAD_CAST"html"))
64 if (xmlStrEqual(cur->name, BAD_CAST"head"))
66 if (xmlStrEqual(cur->name, BAD_CAST"meta"))
69 cur = cur->next;
71 if (cur == NULL)
73 cur = cur->children;
78 while (cur != NULL) {
79 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) {
80 if (xmlStrEqual(cur->name, BAD_CAST"head"))
82 if (xmlStrEqual(cur->name, BAD_CAST"meta"))
85 cur = cur->next;
87 if (cur == NULL)
90 cur = cur->children;
96 while (cur != NULL) {
97 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) {
98 if (xmlStrEqual(cur->name, BAD_CAST"meta")) {
99 xmlAttrPtr attr = cur->properties;
123 cur = cur->next;
163 htmlNodePtr cur, meta;
177 cur = doc->children;
182 while (cur != NULL) {
183 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) {
184 if (xmlStrcasecmp(cur->name, BAD_CAST"html") == 0)
186 if (xmlStrcasecmp(cur->name, BAD_CAST"head") == 0)
188 if (xmlStrcasecmp(cur->name, BAD_CAST"meta") == 0)
191 cur = cur->next;
193 if (cur == NULL)
195 cur = cur->children;
200 while (cur != NULL) {
201 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) {
202 if (xmlStrcasecmp(cur->name, BAD_CAST"head") == 0)
204 if (xmlStrcasecmp(cur->name, BAD_CAST"meta") == 0)
207 cur = cur->next;
209 if (cur == NULL)
212 if (cur->children == NULL) {
216 xmlAddChild(cur, meta);
221 cur = cur->children;
230 xmlAddPrevSibling(cur, meta);
239 while (cur != NULL) {
240 if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) {
241 if (xmlStrcasecmp(cur->name, BAD_CAST"meta") == 0) {
242 xmlAttrPtr attr = cur->properties;
268 meta = cur;
269 cur = cur->next;
277 cur = cur->next;
375 htmlNodeDumpFormat(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur,
382 * @cur: the current node
390 htmlNodeDumpFormat(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur,
396 if (cur == NULL) {
416 htmlNodeDumpFormatOutput(outbuf, doc, cur, NULL, format);
426 * @cur: the current node
434 htmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur) {
437 return(htmlNodeDumpFormat(buf, doc, cur, 1));
444 * @cur: the current node
456 xmlNodePtr cur, const char *encoding, int format) {
488 htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format);
498 * @cur: the current node
504 htmlNodeDumpFile(FILE *out, xmlDocPtr doc, xmlNodePtr cur) {
505 htmlNodeDumpFileFormat(out, doc, cur, NULL, 1);
510 * @cur: the document
519 htmlDocDumpMemoryFormat(xmlDocPtr cur, xmlChar**mem, int *size, int format) {
528 if (cur == NULL) {
534 encoding = (const char *) htmlGetMetaEncoding(cur);
540 if (enc != cur->charset) {
541 if (cur->charset != XML_CHAR_ENCODING_UTF8) {
576 htmlDocContentDumpFormatOutput(buf, cur, NULL, format);
591 * @cur: the document
599 htmlDocDumpMemory(xmlDocPtr cur, xmlChar**mem, int *size) {
600 htmlDocDumpMemoryFormat(cur, mem, size, 1);
610 void xmlNsListDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur);
625 xmlDtdPtr cur = doc->intSubset;
627 if (cur == NULL) {
632 xmlOutputBufferWriteString(buf, (const char *)cur->name);
633 if (cur->ExternalID != NULL) {
635 xmlBufferWriteQuotedString(buf->buffer, cur->ExternalID);
636 if (cur->SystemID != NULL) {
638 xmlBufferWriteQuotedString(buf->buffer, cur->SystemID);
640 } else if (cur->SystemID != NULL) {
642 xmlBufferWriteQuotedString(buf->buffer, cur->SystemID);
651 * @cur: the attribute pointer
657 htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur,
667 if (cur == NULL) {
671 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
672 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
675 xmlOutputBufferWriteString(buf, (const char *)cur->name);
676 if ((cur->children != NULL) && (!htmlIsBooleanAttr(cur->name))) {
677 value = xmlNodeListGetString(doc, cur->children, 0);
680 if ((cur->ns == NULL) && (cur->parent != NULL) &&
681 (cur->parent->ns == NULL) &&
682 ((!xmlStrcasecmp(cur->name, BAD_CAST "href")) ||
683 (!xmlStrcasecmp(cur->name, BAD_CAST "action")) ||
684 (!xmlStrcasecmp(cur->name, BAD_CAST "src")) ||
685 ((!xmlStrcasecmp(cur->name, BAD_CAST "name")) &&
686 (!xmlStrcasecmp(cur->parent->name, BAD_CAST "a"))))) {
713 * @cur: the first attribute pointer
719 htmlAttrListDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur, const char *encoding) {
720 if (cur == NULL) {
723 while (cur != NULL) {
724 htmlAttrDumpOutput(buf, doc, cur, encoding);
725 cur = cur->next;
735 * @cur: the first node
743 xmlNodePtr cur, const char *encoding, int format) {
744 if (cur == NULL) {
747 while (cur != NULL) {
748 htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format);
749 cur = cur->next;
757 * @cur: the current node
765 xmlNodePtr cur, const char *encoding, int format) {
770 if ((cur == NULL) || (buf == NULL)) {
776 if (cur->type == XML_DTD_NODE)
778 if ((cur->type == XML_HTML_DOCUMENT_NODE) ||
779 (cur->type == XML_DOCUMENT_NODE)){
780 htmlDocContentDumpOutput(buf, (xmlDocPtr) cur, encoding);
783 if (cur->type == XML_ATTRIBUTE_NODE) {
784 htmlAttrDumpOutput(buf, doc, (xmlAttrPtr) cur, encoding);
787 if (cur->type == HTML_TEXT_NODE) {
788 if (cur->content != NULL) {
789 if (((cur->name == (const xmlChar *)xmlStringText) ||
790 (cur->name != (const xmlChar *)xmlStringTextNoenc)) &&
791 ((cur->parent == NULL) ||
792 ((xmlStrcasecmp(cur->parent->name, BAD_CAST "script")) &&
793 (xmlStrcasecmp(cur->parent->name, BAD_CAST "style"))))) {
796 buffer = xmlEncodeEntitiesReentrant(doc, cur->content);
802 xmlOutputBufferWriteString(buf, (const char *)cur->content);
807 if (cur->type == HTML_COMMENT_NODE) {
808 if (cur->content != NULL) {
810 xmlOutputBufferWriteString(buf, (const char *)cur->content);
815 if (cur->type == HTML_PI_NODE) {
816 if (cur->name == NULL)
819 xmlOutputBufferWriteString(buf, (const char *)cur->name);
820 if (cur->content != NULL) {
822 xmlOutputBufferWriteString(buf, (const char *)cur->content);
827 if (cur->type == HTML_ENTITY_REF_NODE) {
829 xmlOutputBufferWriteString(buf, (const char *)cur->name);
833 if (cur->type == HTML_PRESERVE_NODE) {
834 if (cur->content != NULL) {
835 xmlOutputBufferWriteString(buf, (const char *)cur->content);
843 if (cur->ns == NULL)
844 info = htmlTagLookup(cur->name);
849 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
850 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
853 xmlOutputBufferWriteString(buf, (const char *)cur->name);
854 if (cur->nsDef)
855 xmlNsListDumpOutput(buf, cur->nsDef);
856 if (cur->properties != NULL)
857 htmlAttrListDumpOutput(buf, doc, cur->properties, encoding);
861 if ((format) && (!info->isinline) && (cur->next != NULL)) {
862 if ((cur->next->type != HTML_TEXT_NODE) &&
863 (cur->next->type != HTML_ENTITY_REF_NODE) &&
864 (cur->parent != NULL) &&
865 (cur->parent->name != NULL) &&
866 (cur->parent->name[0] != 'p')) /* p, pre, param */
871 if (((cur->type == XML_ELEMENT_NODE) || (cur->content == NULL)) &&
872 (cur->children == NULL)) {
879 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
880 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
883 xmlOutputBufferWriteString(buf, (const char *)cur->name);
886 if ((format) && (cur->next != NULL) &&
888 if ((cur->next->type != HTML_TEXT_NODE) &&
889 (cur->next->type != HTML_ENTITY_REF_NODE) &&
890 (cur->parent != NULL) &&
891 (cur->parent->name != NULL) &&
892 (cur->parent->name[0] != 'p')) /* p, pre, param */
898 if ((cur->type != XML_ELEMENT_NODE) &&
899 (cur->content != NULL)) {
905 xmlOutputBufferWriteString(buf, (const char *) cur->content);
907 if (cur->children != NULL) {
909 (cur->children->type != HTML_TEXT_NODE) &&
910 (cur->children->type != HTML_ENTITY_REF_NODE) &&
911 (cur->children != cur->last) &&
912 (cur->name != NULL) &&
913 (cur->name[0] != 'p')) /* p, pre, param */
915 htmlNodeListDumpOutput(buf, doc, cur->children, encoding, format);
917 (cur->last->type != HTML_TEXT_NODE) &&
918 (cur->last->type != HTML_ENTITY_REF_NODE) &&
919 (cur->children != cur->last) &&
920 (cur->name != NULL) &&
921 (cur->name[0] != 'p')) /* p, pre, param */
925 if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
926 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
929 xmlOutputBufferWriteString(buf, (const char *)cur->name);
932 (cur->next != NULL)) {
933 if ((cur->next->type != HTML_TEXT_NODE) &&
934 (cur->next->type != HTML_ENTITY_REF_NODE) &&
935 (cur->parent != NULL) &&
936 (cur->parent->name != NULL) &&
937 (cur->parent->name[0] != 'p')) /* p, pre, param */
946 * @cur: the current node
954 xmlNodePtr cur, const char *encoding) {
955 htmlNodeDumpFormatOutput(buf, doc, cur, encoding, 1);
961 * @cur: the document
968 htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr cur,
974 if ((buf == NULL) || (cur == NULL))
980 type = cur->type;
981 cur->type = XML_HTML_DOCUMENT_NODE;
982 if (cur->intSubset != NULL) {
983 htmlDtdDumpOutput(buf, cur, NULL);
985 if (cur->children != NULL) {
986 htmlNodeListDumpOutput(buf, cur, cur->children, encoding, format);
989 cur->type = (xmlElementType) type;
995 * @cur: the document
1001 htmlDocContentDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr cur,
1003 htmlDocContentDumpFormatOutput(buf, cur, encoding, 1);
1015 * @cur: the document
1022 htmlDocDump(FILE *f, xmlDocPtr cur) {
1030 if ((cur == NULL) || (f == NULL)) {
1034 encoding = (const char *) htmlGetMetaEncoding(cur);
1040 if (enc != cur->charset) {
1041 if (cur->charset != XML_CHAR_ENCODING_UTF8) {
1066 htmlDocContentDumpOutput(buf, cur, NULL);
1075 * @cur: the document
1082 htmlSaveFile(const char *filename, xmlDocPtr cur) {
1088 if ((cur == NULL) || (filename == NULL))
1093 encoding = (const char *) htmlGetMetaEncoding(cur);
1099 if (enc != cur->charset) {
1100 if (cur->charset != XML_CHAR_ENCODING_UTF8) {
1124 buf = xmlOutputBufferCreateFilename(filename, handler, cur->compression);
1127 htmlDocContentDumpOutput(buf, cur, NULL);
1136 * @cur: the document
1145 htmlSaveFileFormat(const char *filename, xmlDocPtr cur,
1151 if ((cur == NULL) || (filename == NULL))
1160 if (enc != cur->charset) {
1161 if (cur->charset != XML_CHAR_ENCODING_UTF8) {
1171 htmlSetMetaEncoding(cur, (const xmlChar *) encoding);
1174 htmlSetMetaEncoding(cur, (const xmlChar *) "UTF-8");
1191 htmlDocContentDumpFormatOutput(buf, cur, encoding, format);
1200 * @cur: the document
1209 htmlSaveFileEnc(const char *filename, xmlDocPtr cur, const char *encoding) {
1210 return(htmlSaveFileFormat(filename, cur, encoding, 1));