Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: third_party/libxml/src/xmlreader.c

Issue 1977213002: Roll libxml to 8effcb578e0590cc01bbcab0f9dccefc6bdbcdbd (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update README.chromium. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * xmlreader.c: implements the xmlTextReader streaming node API 2 * xmlreader.c: implements the xmlTextReader streaming node API
3 * 3 *
4 * NOTE: 4 * NOTE:
5 * XmlTextReader.Normalization Property won't be supported, since 5 * XmlTextReader.Normalization Property won't be supported, since
6 * it makes the parser non compliant to the XML recommendation 6 * it makes the parser non compliant to the XML recommendation
7 * 7 *
8 * See Copyright for the status of this software. 8 * See Copyright for the status of this software.
9 * 9 *
10 * daniel@veillard.com 10 * daniel@veillard.com
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 charactersSAXFunc characters; 135 charactersSAXFunc characters;
136 cdataBlockSAXFunc cdataBlock; 136 cdataBlockSAXFunc cdataBlock;
137 unsigned int base; /* base of the segment in the input */ 137 unsigned int base; /* base of the segment in the input */
138 unsigned int cur; /* current position in the input */ 138 unsigned int cur; /* current position in the input */
139 xmlNodePtr node; /* current node */ 139 xmlNodePtr node; /* current node */
140 xmlNodePtr curnode;/* current attribute node */ 140 xmlNodePtr curnode;/* current attribute node */
141 int depth; /* depth of the current node */ 141 int depth; /* depth of the current node */
142 xmlNodePtr faketext;/* fake xmlNs chld */ 142 xmlNodePtr faketext;/* fake xmlNs chld */
143 int preserve;/* preserve the resulting document */ 143 int preserve;/* preserve the resulting document */
144 xmlBufPtr buffer; /* used to return const xmlChar * */ 144 xmlBufPtr buffer; /* used to return const xmlChar * */
145 xmlDictPtr» » » dict;» /* the context dictionnary */ 145 xmlDictPtr» » » dict;» /* the context dictionary */
146 146
147 /* entity stack when traversing entities content */ 147 /* entity stack when traversing entities content */
148 xmlNodePtr ent; /* Current Entity Ref Node */ 148 xmlNodePtr ent; /* Current Entity Ref Node */
149 int entNr; /* Depth of the entities stack */ 149 int entNr; /* Depth of the entities stack */
150 int entMax; /* Max depth of the entities stack */ 150 int entMax; /* Max depth of the entities stack */
151 xmlNodePtr *entTab; /* array of entities */ 151 xmlNodePtr *entTab; /* array of entities */
152 152
153 /* error handling */ 153 /* error handling */
154 xmlTextReaderErrorFunc errorFunc; /* callback function */ 154 xmlTextReaderErrorFunc errorFunc; /* callback function */
155 void *errorFuncArg; /* callback function user argument */ 155 void *errorFuncArg; /* callback function user argument */
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 203
204 /************************************************************************ 204 /************************************************************************
205 * * 205 * *
206 * Our own version of the freeing routines as we recycle nodes * 206 * Our own version of the freeing routines as we recycle nodes *
207 * * 207 * *
208 ************************************************************************/ 208 ************************************************************************/
209 /** 209 /**
210 * DICT_FREE: 210 * DICT_FREE:
211 * @str: a string 211 * @str: a string
212 * 212 *
213 * Free a string if it is not owned by the "dict" dictionnary in the 213 * Free a string if it is not owned by the "dict" dictionary in the
214 * current scope 214 * current scope
215 */ 215 */
216 #define DICT_FREE(str) \ 216 #define DICT_FREE(str) \
217 if ((str) && ((!dict) || \ 217 if ((str) && ((!dict) || \
218 (xmlDictOwns(dict, (const xmlChar *)(str)) == 0))) \ 218 (xmlDictOwns(dict, (const xmlChar *)(str)) == 0))) \
219 xmlFree((char *)(str)); 219 xmlFree((char *)(str));
220 220
221 static void xmlTextReaderFreeNode(xmlTextReaderPtr reader, xmlNodePtr cur); 221 static void xmlTextReaderFreeNode(xmlTextReaderPtr reader, xmlNodePtr cur);
222 static void xmlTextReaderFreeNodeList(xmlTextReaderPtr reader, xmlNodePtr cur); 222 static void xmlTextReaderFreeNodeList(xmlTextReaderPtr reader, xmlNodePtr cur);
223 223
(...skipping 1927 matching lines...) Expand 10 before | Expand all | Expand 10 after
2151 xmlFree(ret->sax); 2151 xmlFree(ret->sax);
2152 xmlFree(ret); 2152 xmlFree(ret);
2153 return(NULL); 2153 return(NULL);
2154 } 2154 }
2155 ret->ctxt->parseMode = XML_PARSE_READER; 2155 ret->ctxt->parseMode = XML_PARSE_READER;
2156 ret->ctxt->_private = ret; 2156 ret->ctxt->_private = ret;
2157 ret->ctxt->linenumbers = 1; 2157 ret->ctxt->linenumbers = 1;
2158 ret->ctxt->dictNames = 1; 2158 ret->ctxt->dictNames = 1;
2159 ret->allocs = XML_TEXTREADER_CTXT; 2159 ret->allocs = XML_TEXTREADER_CTXT;
2160 /* 2160 /*
2161 * use the parser dictionnary to allocate all elements and attributes names 2161 * use the parser dictionary to allocate all elements and attributes names
2162 */ 2162 */
2163 ret->ctxt->docdict = 1; 2163 ret->ctxt->docdict = 1;
2164 ret->dict = ret->ctxt->dict; 2164 ret->dict = ret->ctxt->dict;
2165 #ifdef LIBXML_XINCLUDE_ENABLED 2165 #ifdef LIBXML_XINCLUDE_ENABLED
2166 ret->xinclude = 0; 2166 ret->xinclude = 0;
2167 #endif 2167 #endif
2168 #ifdef LIBXML_PATTERN_ENABLED 2168 #ifdef LIBXML_PATTERN_ENABLED
2169 ret->patternMax = 0; 2169 ret->patternMax = 0;
2170 ret->patternTab = NULL; 2170 ret->patternTab = NULL;
2171 #endif 2171 #endif
(...skipping 3070 matching lines...) Expand 10 before | Expand all | Expand 10 after
5242 } 5242 }
5243 } else { 5243 } else {
5244 if (reader->ctxt->dict == NULL) 5244 if (reader->ctxt->dict == NULL)
5245 reader->ctxt->dict = xmlDictCreate(); 5245 reader->ctxt->dict = xmlDictCreate();
5246 reader->dict = reader->ctxt->dict; 5246 reader->dict = reader->ctxt->dict;
5247 } 5247 }
5248 reader->ctxt->_private = reader; 5248 reader->ctxt->_private = reader;
5249 reader->ctxt->linenumbers = 1; 5249 reader->ctxt->linenumbers = 1;
5250 reader->ctxt->dictNames = 1; 5250 reader->ctxt->dictNames = 1;
5251 /* 5251 /*
5252 * use the parser dictionnary to allocate all elements and attributes names 5252 * use the parser dictionary to allocate all elements and attributes names
5253 */ 5253 */
5254 reader->ctxt->docdict = 1; 5254 reader->ctxt->docdict = 1;
5255 reader->ctxt->parseMode = XML_PARSE_READER; 5255 reader->ctxt->parseMode = XML_PARSE_READER;
5256 5256
5257 #ifdef LIBXML_XINCLUDE_ENABLED 5257 #ifdef LIBXML_XINCLUDE_ENABLED
5258 if (reader->xincctxt != NULL) { 5258 if (reader->xincctxt != NULL) {
5259 xmlXIncludeFreeContext(reader->xincctxt); 5259 xmlXIncludeFreeContext(reader->xincctxt);
5260 reader->xincctxt = NULL; 5260 reader->xincctxt = NULL;
5261 } 5261 }
5262 if (options & XML_PARSE_XINCLUDE) { 5262 if (options & XML_PARSE_XINCLUDE) {
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
5941 printf("ret: %d, cons: %ld , prod: %ld, output: '%s'\n", ret, cons, 5941 printf("ret: %d, cons: %ld , prod: %ld, output: '%s'\n", ret, cons,
5942 prod, output3); 5942 prod, output3);
5943 return (0); 5943 return (0);
5944 5944
5945 } 5945 }
5946 #endif 5946 #endif
5947 #endif /* NOT_USED_YET */ 5947 #endif /* NOT_USED_YET */
5948 #define bottom_xmlreader 5948 #define bottom_xmlreader
5949 #include "elfgcchack.h" 5949 #include "elfgcchack.h"
5950 #endif /* LIBXML_READER_ENABLED */ 5950 #endif /* LIBXML_READER_ENABLED */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698