• Home
  • Raw
  • Download

Lines Matching refs:parser

198 copy_salt_to_sipkey(XML_Parser parser, struct sipkey * key);
383 typedef enum XML_Error PTRCALL Processor(XML_Parser parser,
408 handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName);
410 processXmlDecl(XML_Parser parser, int isGeneralTextEntity,
413 initializeEncoding(XML_Parser parser);
415 doProlog(XML_Parser parser, const ENCODING *enc, const char *s,
419 processInternalEntity(XML_Parser parser, ENTITY *entity,
422 doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
426 doCdataSection(XML_Parser parser, const ENCODING *, const char **startPtr,
430 doIgnoreSection(XML_Parser parser, const ENCODING *, const char **startPtr,
435 freeBindings(XML_Parser parser, BINDING *bindings);
437 storeAtts(XML_Parser parser, const ENCODING *, const char *s,
440 addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
444 XML_Bool isId, const XML_Char *dfltValue, XML_Parser parser);
446 storeAttributeValue(XML_Parser parser, const ENCODING *, XML_Bool isCdata,
449 appendAttributeValue(XML_Parser parser, const ENCODING *, XML_Bool isCdata,
452 getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start,
455 setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *);
457 storeEntityValue(XML_Parser parser, const ENCODING *enc, const char *start,
460 reportProcessingInstruction(XML_Parser parser, const ENCODING *enc,
463 reportComment(XML_Parser parser, const ENCODING *enc, const char *start,
466 reportDefault(XML_Parser parser, const ENCODING *enc, const char *start,
469 static const XML_Char * getContext(XML_Parser parser);
471 setContext(XML_Parser parser, const XML_Char *context);
487 lookup(XML_Parser parser, HASH_TABLE *table, KEY name, size_t createSize);
514 static int FASTCALL nextScaffoldPart(XML_Parser parser);
515 static XML_Content * build_model(XML_Parser parser);
517 getElementType(XML_Parser parser, const ENCODING *enc,
523 static unsigned long generate_hash_secret_salt(XML_Parser parser);
524 static XML_Bool startParsing(XML_Parser parser);
533 parserInit(XML_Parser parser, const XML_Char *encodingName);
650 #define MALLOC(parser, s) (parser->m_mem.malloc_fcn((s))) argument
651 #define REALLOC(parser, p, s) (parser->m_mem.realloc_fcn((p),(s))) argument
652 #define FREE(parser, p) (parser->m_mem.free_fcn((p))) argument
846 generate_hash_secret_salt(XML_Parser parser) in generate_hash_secret_salt() argument
849 (void)parser; in generate_hash_secret_salt()
890 get_hash_secret_salt(XML_Parser parser) { in get_hash_secret_salt() argument
891 if (parser->m_parentParser != NULL) in get_hash_secret_salt()
892 return get_hash_secret_salt(parser->m_parentParser); in get_hash_secret_salt()
893 return parser->m_hash_secret_salt; in get_hash_secret_salt()
897 startParsing(XML_Parser parser) in startParsing() argument
900 if (parser->m_hash_secret_salt == 0) in startParsing()
901 parser->m_hash_secret_salt = generate_hash_secret_salt(parser); in startParsing()
902 if (parser->m_ns) { in startParsing()
906 return setContext(parser, implicitContext); in startParsing()
925 XML_Parser parser; in parserCreate() local
929 parser = (XML_Parser) in parserCreate()
931 if (parser != NULL) { in parserCreate()
932 mtemp = (XML_Memory_Handling_Suite *)&(parser->m_mem); in parserCreate()
940 parser = (XML_Parser)malloc(sizeof(struct XML_ParserStruct)); in parserCreate()
941 if (parser != NULL) { in parserCreate()
942 mtemp = (XML_Memory_Handling_Suite *)&(parser->m_mem); in parserCreate()
949 if (!parser) in parserCreate()
950 return parser; in parserCreate()
952 parser->m_buffer = NULL; in parserCreate()
953 parser->m_bufferLim = NULL; in parserCreate()
955 parser->m_attsSize = INIT_ATTS_SIZE; in parserCreate()
956 parser->m_atts = (ATTRIBUTE *)MALLOC(parser, parser->m_attsSize * sizeof(ATTRIBUTE)); in parserCreate()
957 if (parser->m_atts == NULL) { in parserCreate()
958 FREE(parser, parser); in parserCreate()
962 parser->m_attInfo = (XML_AttrInfo*)MALLOC(parser, parser->m_attsSize * sizeof(XML_AttrInfo)); in parserCreate()
963 if (parser->m_attInfo == NULL) { in parserCreate()
964 FREE(parser, parser->m_atts); in parserCreate()
965 FREE(parser, parser); in parserCreate()
969 parser->m_dataBuf = (XML_Char *)MALLOC(parser, INIT_DATA_BUF_SIZE * sizeof(XML_Char)); in parserCreate()
970 if (parser->m_dataBuf == NULL) { in parserCreate()
971 FREE(parser, parser->m_atts); in parserCreate()
973 FREE(parser, parser->m_attInfo); in parserCreate()
975 FREE(parser, parser); in parserCreate()
978 parser->m_dataBufEnd = parser->m_dataBuf + INIT_DATA_BUF_SIZE; in parserCreate()
981 parser->m_dtd = dtd; in parserCreate()
983 parser->m_dtd = dtdCreate(&parser->m_mem); in parserCreate()
984 if (parser->m_dtd == NULL) { in parserCreate()
985 FREE(parser, parser->m_dataBuf); in parserCreate()
986 FREE(parser, parser->m_atts); in parserCreate()
988 FREE(parser, parser->m_attInfo); in parserCreate()
990 FREE(parser, parser); in parserCreate()
995 parser->m_freeBindingList = NULL; in parserCreate()
996 parser->m_freeTagList = NULL; in parserCreate()
997 parser->m_freeInternalEntities = NULL; in parserCreate()
999 parser->m_groupSize = 0; in parserCreate()
1000 parser->m_groupConnector = NULL; in parserCreate()
1002 parser->m_unknownEncodingHandler = NULL; in parserCreate()
1003 parser->m_unknownEncodingHandlerData = NULL; in parserCreate()
1005 parser->m_namespaceSeparator = ASCII_EXCL; in parserCreate()
1006 parser->m_ns = XML_FALSE; in parserCreate()
1007 parser->m_ns_triplets = XML_FALSE; in parserCreate()
1009 parser->m_nsAtts = NULL; in parserCreate()
1010 parser->m_nsAttsVersion = 0; in parserCreate()
1011 parser->m_nsAttsPower = 0; in parserCreate()
1013 parser->m_protocolEncodingName = NULL; in parserCreate()
1015 poolInit(&parser->m_tempPool, &(parser->m_mem)); in parserCreate()
1016 poolInit(&parser->m_temp2Pool, &(parser->m_mem)); in parserCreate()
1017 parserInit(parser, encodingName); in parserCreate()
1019 if (encodingName && !parser->m_protocolEncodingName) { in parserCreate()
1020 XML_ParserFree(parser); in parserCreate()
1025 parser->m_ns = XML_TRUE; in parserCreate()
1026 parser->m_internalEncoding = XmlGetInternalEncodingNS(); in parserCreate()
1027 parser->m_namespaceSeparator = *nameSep; in parserCreate()
1030 parser->m_internalEncoding = XmlGetInternalEncoding(); in parserCreate()
1033 return parser; in parserCreate()
1037 parserInit(XML_Parser parser, const XML_Char *encodingName) in parserInit() argument
1039 parser->m_processor = prologInitProcessor; in parserInit()
1040 XmlPrologStateInit(&parser->m_prologState); in parserInit()
1042 parser->m_protocolEncodingName = copyString(encodingName, &(parser->m_mem)); in parserInit()
1044 parser->m_curBase = NULL; in parserInit()
1045 XmlInitEncoding(&parser->m_initEncoding, &parser->m_encoding, 0); in parserInit()
1046 parser->m_userData = NULL; in parserInit()
1047 parser->m_handlerArg = NULL; in parserInit()
1048 parser->m_startElementHandler = NULL; in parserInit()
1049 parser->m_endElementHandler = NULL; in parserInit()
1050 parser->m_characterDataHandler = NULL; in parserInit()
1051 parser->m_processingInstructionHandler = NULL; in parserInit()
1052 parser->m_commentHandler = NULL; in parserInit()
1053 parser->m_startCdataSectionHandler = NULL; in parserInit()
1054 parser->m_endCdataSectionHandler = NULL; in parserInit()
1055 parser->m_defaultHandler = NULL; in parserInit()
1056 parser->m_startDoctypeDeclHandler = NULL; in parserInit()
1057 parser->m_endDoctypeDeclHandler = NULL; in parserInit()
1058 parser->m_unparsedEntityDeclHandler = NULL; in parserInit()
1059 parser->m_notationDeclHandler = NULL; in parserInit()
1060 parser->m_startNamespaceDeclHandler = NULL; in parserInit()
1061 parser->m_endNamespaceDeclHandler = NULL; in parserInit()
1062 parser->m_notStandaloneHandler = NULL; in parserInit()
1063 parser->m_externalEntityRefHandler = NULL; in parserInit()
1064 parser->m_externalEntityRefHandlerArg = parser; in parserInit()
1065 parser->m_skippedEntityHandler = NULL; in parserInit()
1066 parser->m_elementDeclHandler = NULL; in parserInit()
1067 parser->m_attlistDeclHandler = NULL; in parserInit()
1068 parser->m_entityDeclHandler = NULL; in parserInit()
1069 parser->m_xmlDeclHandler = NULL; in parserInit()
1070 parser->m_bufferPtr = parser->m_buffer; in parserInit()
1071 parser->m_bufferEnd = parser->m_buffer; in parserInit()
1072 parser->m_parseEndByteIndex = 0; in parserInit()
1073 parser->m_parseEndPtr = NULL; in parserInit()
1074 parser->m_declElementType = NULL; in parserInit()
1075 parser->m_declAttributeId = NULL; in parserInit()
1076 parser->m_declEntity = NULL; in parserInit()
1077 parser->m_doctypeName = NULL; in parserInit()
1078 parser->m_doctypeSysid = NULL; in parserInit()
1079 parser->m_doctypePubid = NULL; in parserInit()
1080 parser->m_declAttributeType = NULL; in parserInit()
1081 parser->m_declNotationName = NULL; in parserInit()
1082 parser->m_declNotationPublicId = NULL; in parserInit()
1083 parser->m_declAttributeIsCdata = XML_FALSE; in parserInit()
1084 parser->m_declAttributeIsId = XML_FALSE; in parserInit()
1085 memset(&parser->m_position, 0, sizeof(POSITION)); in parserInit()
1086 parser->m_errorCode = XML_ERROR_NONE; in parserInit()
1087 parser->m_eventPtr = NULL; in parserInit()
1088 parser->m_eventEndPtr = NULL; in parserInit()
1089 parser->m_positionPtr = NULL; in parserInit()
1090 parser->m_openInternalEntities = NULL; in parserInit()
1091 parser->m_defaultExpandInternalEntities = XML_TRUE; in parserInit()
1092 parser->m_tagLevel = 0; in parserInit()
1093 parser->m_tagStack = NULL; in parserInit()
1094 parser->m_inheritedBindings = NULL; in parserInit()
1095 parser->m_nSpecifiedAtts = 0; in parserInit()
1096 parser->m_unknownEncodingMem = NULL; in parserInit()
1097 parser->m_unknownEncodingRelease = NULL; in parserInit()
1098 parser->m_unknownEncodingData = NULL; in parserInit()
1099 parser->m_parentParser = NULL; in parserInit()
1100 parser->m_parsingStatus.parsing = XML_INITIALIZED; in parserInit()
1102 parser->m_isParamEntity = XML_FALSE; in parserInit()
1103 parser->m_useForeignDTD = XML_FALSE; in parserInit()
1104 parser->m_paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER; in parserInit()
1106 parser->m_hash_secret_salt = 0; in parserInit()
1111 moveToFreeBindingList(XML_Parser parser, BINDING *bindings) in moveToFreeBindingList() argument
1116 b->nextTagBinding = parser->m_freeBindingList; in moveToFreeBindingList()
1117 parser->m_freeBindingList = b; in moveToFreeBindingList()
1122 XML_ParserReset(XML_Parser parser, const XML_Char *encodingName) in XML_ParserReset() argument
1127 if (parser == NULL) in XML_ParserReset()
1130 if (parser->m_parentParser) in XML_ParserReset()
1133 tStk = parser->m_tagStack; in XML_ParserReset()
1137 tag->parent = parser->m_freeTagList; in XML_ParserReset()
1138 moveToFreeBindingList(parser, tag->bindings); in XML_ParserReset()
1140 parser->m_freeTagList = tag; in XML_ParserReset()
1143 openEntityList = parser->m_openInternalEntities; in XML_ParserReset()
1147 openEntity->next = parser->m_freeInternalEntities; in XML_ParserReset()
1148 parser->m_freeInternalEntities = openEntity; in XML_ParserReset()
1150 moveToFreeBindingList(parser, parser->m_inheritedBindings); in XML_ParserReset()
1151 FREE(parser, parser->m_unknownEncodingMem); in XML_ParserReset()
1152 if (parser->m_unknownEncodingRelease) in XML_ParserReset()
1153 parser->m_unknownEncodingRelease(parser->m_unknownEncodingData); in XML_ParserReset()
1154 poolClear(&parser->m_tempPool); in XML_ParserReset()
1155 poolClear(&parser->m_temp2Pool); in XML_ParserReset()
1156 FREE(parser, (void *)parser->m_protocolEncodingName); in XML_ParserReset()
1157 parser->m_protocolEncodingName = NULL; in XML_ParserReset()
1158 parserInit(parser, encodingName); in XML_ParserReset()
1159 dtdReset(parser->m_dtd, &parser->m_mem); in XML_ParserReset()
1164 XML_SetEncoding(XML_Parser parser, const XML_Char *encodingName) in XML_SetEncoding() argument
1166 if (parser == NULL) in XML_SetEncoding()
1172 …if (parser->m_parsingStatus.parsing == XML_PARSING || parser->m_parsingStatus.parsing == XML_SUSPE… in XML_SetEncoding()
1176 FREE(parser, (void *)parser->m_protocolEncodingName); in XML_SetEncoding()
1180 parser->m_protocolEncodingName = NULL; in XML_SetEncoding()
1183 parser->m_protocolEncodingName = copyString(encodingName, &(parser->m_mem)); in XML_SetEncoding()
1184 if (!parser->m_protocolEncodingName) in XML_SetEncoding()
1195 XML_Parser parser = oldParser; in XML_ExternalEntityParserCreate() local
1241 oldDtd = parser->m_dtd; in XML_ExternalEntityParserCreate()
1242 oldStartElementHandler = parser->m_startElementHandler; in XML_ExternalEntityParserCreate()
1243 oldEndElementHandler = parser->m_endElementHandler; in XML_ExternalEntityParserCreate()
1244 oldCharacterDataHandler = parser->m_characterDataHandler; in XML_ExternalEntityParserCreate()
1245 oldProcessingInstructionHandler = parser->m_processingInstructionHandler; in XML_ExternalEntityParserCreate()
1246 oldCommentHandler = parser->m_commentHandler; in XML_ExternalEntityParserCreate()
1247 oldStartCdataSectionHandler = parser->m_startCdataSectionHandler; in XML_ExternalEntityParserCreate()
1248 oldEndCdataSectionHandler = parser->m_endCdataSectionHandler; in XML_ExternalEntityParserCreate()
1249 oldDefaultHandler = parser->m_defaultHandler; in XML_ExternalEntityParserCreate()
1250 oldUnparsedEntityDeclHandler = parser->m_unparsedEntityDeclHandler; in XML_ExternalEntityParserCreate()
1251 oldNotationDeclHandler = parser->m_notationDeclHandler; in XML_ExternalEntityParserCreate()
1252 oldStartNamespaceDeclHandler = parser->m_startNamespaceDeclHandler; in XML_ExternalEntityParserCreate()
1253 oldEndNamespaceDeclHandler = parser->m_endNamespaceDeclHandler; in XML_ExternalEntityParserCreate()
1254 oldNotStandaloneHandler = parser->m_notStandaloneHandler; in XML_ExternalEntityParserCreate()
1255 oldExternalEntityRefHandler = parser->m_externalEntityRefHandler; in XML_ExternalEntityParserCreate()
1256 oldSkippedEntityHandler = parser->m_skippedEntityHandler; in XML_ExternalEntityParserCreate()
1257 oldUnknownEncodingHandler = parser->m_unknownEncodingHandler; in XML_ExternalEntityParserCreate()
1258 oldElementDeclHandler = parser->m_elementDeclHandler; in XML_ExternalEntityParserCreate()
1259 oldAttlistDeclHandler = parser->m_attlistDeclHandler; in XML_ExternalEntityParserCreate()
1260 oldEntityDeclHandler = parser->m_entityDeclHandler; in XML_ExternalEntityParserCreate()
1261 oldXmlDeclHandler = parser->m_xmlDeclHandler; in XML_ExternalEntityParserCreate()
1262 oldDeclElementType = parser->m_declElementType; in XML_ExternalEntityParserCreate()
1264 oldUserData = parser->m_userData; in XML_ExternalEntityParserCreate()
1265 oldHandlerArg = parser->m_handlerArg; in XML_ExternalEntityParserCreate()
1266 oldDefaultExpandInternalEntities = parser->m_defaultExpandInternalEntities; in XML_ExternalEntityParserCreate()
1267 oldExternalEntityRefHandlerArg = parser->m_externalEntityRefHandlerArg; in XML_ExternalEntityParserCreate()
1269 oldParamEntityParsing = parser->m_paramEntityParsing; in XML_ExternalEntityParserCreate()
1270 oldInEntityValue = parser->m_prologState.inEntityValue; in XML_ExternalEntityParserCreate()
1272 oldns_triplets = parser->m_ns_triplets; in XML_ExternalEntityParserCreate()
1278 oldhash_secret_salt = parser->m_hash_secret_salt; in XML_ExternalEntityParserCreate()
1290 if (parser->m_ns) { in XML_ExternalEntityParserCreate()
1292 *tmp = parser->m_namespaceSeparator; in XML_ExternalEntityParserCreate()
1293 parser = parserCreate(encodingName, &parser->m_mem, tmp, newDtd); in XML_ExternalEntityParserCreate()
1296 parser = parserCreate(encodingName, &parser->m_mem, NULL, newDtd); in XML_ExternalEntityParserCreate()
1299 if (!parser) in XML_ExternalEntityParserCreate()
1302 parser->m_startElementHandler = oldStartElementHandler; in XML_ExternalEntityParserCreate()
1303 parser->m_endElementHandler = oldEndElementHandler; in XML_ExternalEntityParserCreate()
1304 parser->m_characterDataHandler = oldCharacterDataHandler; in XML_ExternalEntityParserCreate()
1305 parser->m_processingInstructionHandler = oldProcessingInstructionHandler; in XML_ExternalEntityParserCreate()
1306 parser->m_commentHandler = oldCommentHandler; in XML_ExternalEntityParserCreate()
1307 parser->m_startCdataSectionHandler = oldStartCdataSectionHandler; in XML_ExternalEntityParserCreate()
1308 parser->m_endCdataSectionHandler = oldEndCdataSectionHandler; in XML_ExternalEntityParserCreate()
1309 parser->m_defaultHandler = oldDefaultHandler; in XML_ExternalEntityParserCreate()
1310 parser->m_unparsedEntityDeclHandler = oldUnparsedEntityDeclHandler; in XML_ExternalEntityParserCreate()
1311 parser->m_notationDeclHandler = oldNotationDeclHandler; in XML_ExternalEntityParserCreate()
1312 parser->m_startNamespaceDeclHandler = oldStartNamespaceDeclHandler; in XML_ExternalEntityParserCreate()
1313 parser->m_endNamespaceDeclHandler = oldEndNamespaceDeclHandler; in XML_ExternalEntityParserCreate()
1314 parser->m_notStandaloneHandler = oldNotStandaloneHandler; in XML_ExternalEntityParserCreate()
1315 parser->m_externalEntityRefHandler = oldExternalEntityRefHandler; in XML_ExternalEntityParserCreate()
1316 parser->m_skippedEntityHandler = oldSkippedEntityHandler; in XML_ExternalEntityParserCreate()
1317 parser->m_unknownEncodingHandler = oldUnknownEncodingHandler; in XML_ExternalEntityParserCreate()
1318 parser->m_elementDeclHandler = oldElementDeclHandler; in XML_ExternalEntityParserCreate()
1319 parser->m_attlistDeclHandler = oldAttlistDeclHandler; in XML_ExternalEntityParserCreate()
1320 parser->m_entityDeclHandler = oldEntityDeclHandler; in XML_ExternalEntityParserCreate()
1321 parser->m_xmlDeclHandler = oldXmlDeclHandler; in XML_ExternalEntityParserCreate()
1322 parser->m_declElementType = oldDeclElementType; in XML_ExternalEntityParserCreate()
1323 parser->m_userData = oldUserData; in XML_ExternalEntityParserCreate()
1325 parser->m_handlerArg = parser->m_userData; in XML_ExternalEntityParserCreate()
1327 parser->m_handlerArg = parser; in XML_ExternalEntityParserCreate()
1329 parser->m_externalEntityRefHandlerArg = oldExternalEntityRefHandlerArg; in XML_ExternalEntityParserCreate()
1330 parser->m_defaultExpandInternalEntities = oldDefaultExpandInternalEntities; in XML_ExternalEntityParserCreate()
1331 parser->m_ns_triplets = oldns_triplets; in XML_ExternalEntityParserCreate()
1332 parser->m_hash_secret_salt = oldhash_secret_salt; in XML_ExternalEntityParserCreate()
1333 parser->m_parentParser = oldParser; in XML_ExternalEntityParserCreate()
1335 parser->m_paramEntityParsing = oldParamEntityParsing; in XML_ExternalEntityParserCreate()
1336 parser->m_prologState.inEntityValue = oldInEntityValue; in XML_ExternalEntityParserCreate()
1339 if (!dtdCopy(oldParser, parser->m_dtd, oldDtd, &parser->m_mem) in XML_ExternalEntityParserCreate()
1340 || !setContext(parser, context)) { in XML_ExternalEntityParserCreate()
1341 XML_ParserFree(parser); in XML_ExternalEntityParserCreate()
1344 parser->m_processor = externalEntityInitProcessor; in XML_ExternalEntityParserCreate()
1355 parser->m_isParamEntity = XML_TRUE; in XML_ExternalEntityParserCreate()
1356 XmlPrologStateInitExternalEntity(&parser->m_prologState); in XML_ExternalEntityParserCreate()
1357 parser->m_processor = externalParEntInitProcessor; in XML_ExternalEntityParserCreate()
1360 return parser; in XML_ExternalEntityParserCreate()
1364 destroyBindings(BINDING *bindings, XML_Parser parser) in destroyBindings() argument
1371 FREE(parser, b->uri); in destroyBindings()
1372 FREE(parser, b); in destroyBindings()
1377 XML_ParserFree(XML_Parser parser) in XML_ParserFree() argument
1381 if (parser == NULL) in XML_ParserFree()
1384 tagList = parser->m_tagStack; in XML_ParserFree()
1388 if (parser->m_freeTagList == NULL) in XML_ParserFree()
1390 tagList = parser->m_freeTagList; in XML_ParserFree()
1391 parser->m_freeTagList = NULL; in XML_ParserFree()
1395 FREE(parser, p->buf); in XML_ParserFree()
1396 destroyBindings(p->bindings, parser); in XML_ParserFree()
1397 FREE(parser, p); in XML_ParserFree()
1400 entityList = parser->m_openInternalEntities; in XML_ParserFree()
1404 if (parser->m_freeInternalEntities == NULL) in XML_ParserFree()
1406 entityList = parser->m_freeInternalEntities; in XML_ParserFree()
1407 parser->m_freeInternalEntities = NULL; in XML_ParserFree()
1411 FREE(parser, openEntity); in XML_ParserFree()
1414 destroyBindings(parser->m_freeBindingList, parser); in XML_ParserFree()
1415 destroyBindings(parser->m_inheritedBindings, parser); in XML_ParserFree()
1416 poolDestroy(&parser->m_tempPool); in XML_ParserFree()
1417 poolDestroy(&parser->m_temp2Pool); in XML_ParserFree()
1418 FREE(parser, (void *)parser->m_protocolEncodingName); in XML_ParserFree()
1423 if (!parser->m_isParamEntity && parser->m_dtd) in XML_ParserFree()
1425 if (parser->m_dtd) in XML_ParserFree()
1427 dtdDestroy(parser->m_dtd, (XML_Bool)!parser->m_parentParser, &parser->m_mem); in XML_ParserFree()
1428 FREE(parser, (void *)parser->m_atts); in XML_ParserFree()
1430 FREE(parser, (void *)parser->m_attInfo); in XML_ParserFree()
1432 FREE(parser, parser->m_groupConnector); in XML_ParserFree()
1433 FREE(parser, parser->m_buffer); in XML_ParserFree()
1434 FREE(parser, parser->m_dataBuf); in XML_ParserFree()
1435 FREE(parser, parser->m_nsAtts); in XML_ParserFree()
1436 FREE(parser, parser->m_unknownEncodingMem); in XML_ParserFree()
1437 if (parser->m_unknownEncodingRelease) in XML_ParserFree()
1438 parser->m_unknownEncodingRelease(parser->m_unknownEncodingData); in XML_ParserFree()
1439 FREE(parser, parser); in XML_ParserFree()
1443 XML_UseParserAsHandlerArg(XML_Parser parser) in XML_UseParserAsHandlerArg() argument
1445 if (parser != NULL) in XML_UseParserAsHandlerArg()
1446 parser->m_handlerArg = parser; in XML_UseParserAsHandlerArg()
1450 XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD) in XML_UseForeignDTD() argument
1452 if (parser == NULL) in XML_UseForeignDTD()
1456 …if (parser->m_parsingStatus.parsing == XML_PARSING || parser->m_parsingStatus.parsing == XML_SUSPE… in XML_UseForeignDTD()
1458 parser->m_useForeignDTD = useDTD; in XML_UseForeignDTD()
1466 XML_SetReturnNSTriplet(XML_Parser parser, int do_nst) in XML_SetReturnNSTriplet() argument
1468 if (parser == NULL) in XML_SetReturnNSTriplet()
1471 …if (parser->m_parsingStatus.parsing == XML_PARSING || parser->m_parsingStatus.parsing == XML_SUSPE… in XML_SetReturnNSTriplet()
1473 parser->m_ns_triplets = do_nst ? XML_TRUE : XML_FALSE; in XML_SetReturnNSTriplet()
1477 XML_SetUserData(XML_Parser parser, void *p) in XML_SetUserData() argument
1479 if (parser == NULL) in XML_SetUserData()
1481 if (parser->m_handlerArg == parser->m_userData) in XML_SetUserData()
1482 parser->m_handlerArg = parser->m_userData = p; in XML_SetUserData()
1484 parser->m_userData = p; in XML_SetUserData()
1488 XML_SetBase(XML_Parser parser, const XML_Char *p) in XML_SetBase() argument
1490 if (parser == NULL) in XML_SetBase()
1493 p = poolCopyString(&parser->m_dtd->pool, p); in XML_SetBase()
1496 parser->m_curBase = p; in XML_SetBase()
1499 parser->m_curBase = NULL; in XML_SetBase()
1504 XML_GetBase(XML_Parser parser) in XML_GetBase() argument
1506 if (parser == NULL) in XML_GetBase()
1508 return parser->m_curBase; in XML_GetBase()
1512 XML_GetSpecifiedAttributeCount(XML_Parser parser) in XML_GetSpecifiedAttributeCount() argument
1514 if (parser == NULL) in XML_GetSpecifiedAttributeCount()
1516 return parser->m_nSpecifiedAtts; in XML_GetSpecifiedAttributeCount()
1520 XML_GetIdAttributeIndex(XML_Parser parser) in XML_GetIdAttributeIndex() argument
1522 if (parser == NULL) in XML_GetIdAttributeIndex()
1524 return parser->m_idAttIndex; in XML_GetIdAttributeIndex()
1529 XML_GetAttributeInfo(XML_Parser parser) in XML_GetAttributeInfo() argument
1531 if (parser == NULL) in XML_GetAttributeInfo()
1533 return parser->m_attInfo; in XML_GetAttributeInfo()
1538 XML_SetElementHandler(XML_Parser parser, in XML_SetElementHandler() argument
1542 if (parser == NULL) in XML_SetElementHandler()
1544 parser->m_startElementHandler = start; in XML_SetElementHandler()
1545 parser->m_endElementHandler = end; in XML_SetElementHandler()
1549 XML_SetStartElementHandler(XML_Parser parser, in XML_SetStartElementHandler() argument
1551 if (parser != NULL) in XML_SetStartElementHandler()
1552 parser->m_startElementHandler = start; in XML_SetStartElementHandler()
1556 XML_SetEndElementHandler(XML_Parser parser, in XML_SetEndElementHandler() argument
1558 if (parser != NULL) in XML_SetEndElementHandler()
1559 parser->m_endElementHandler = end; in XML_SetEndElementHandler()
1563 XML_SetCharacterDataHandler(XML_Parser parser, in XML_SetCharacterDataHandler() argument
1566 if (parser != NULL) in XML_SetCharacterDataHandler()
1567 parser->m_characterDataHandler = handler; in XML_SetCharacterDataHandler()
1571 XML_SetProcessingInstructionHandler(XML_Parser parser, in XML_SetProcessingInstructionHandler() argument
1574 if (parser != NULL) in XML_SetProcessingInstructionHandler()
1575 parser->m_processingInstructionHandler = handler; in XML_SetProcessingInstructionHandler()
1579 XML_SetCommentHandler(XML_Parser parser, in XML_SetCommentHandler() argument
1582 if (parser != NULL) in XML_SetCommentHandler()
1583 parser->m_commentHandler = handler; in XML_SetCommentHandler()
1587 XML_SetCdataSectionHandler(XML_Parser parser, in XML_SetCdataSectionHandler() argument
1591 if (parser == NULL) in XML_SetCdataSectionHandler()
1593 parser->m_startCdataSectionHandler = start; in XML_SetCdataSectionHandler()
1594 parser->m_endCdataSectionHandler = end; in XML_SetCdataSectionHandler()
1598 XML_SetStartCdataSectionHandler(XML_Parser parser, in XML_SetStartCdataSectionHandler() argument
1600 if (parser != NULL) in XML_SetStartCdataSectionHandler()
1601 parser->m_startCdataSectionHandler = start; in XML_SetStartCdataSectionHandler()
1605 XML_SetEndCdataSectionHandler(XML_Parser parser, in XML_SetEndCdataSectionHandler() argument
1607 if (parser != NULL) in XML_SetEndCdataSectionHandler()
1608 parser->m_endCdataSectionHandler = end; in XML_SetEndCdataSectionHandler()
1612 XML_SetDefaultHandler(XML_Parser parser, in XML_SetDefaultHandler() argument
1615 if (parser == NULL) in XML_SetDefaultHandler()
1617 parser->m_defaultHandler = handler; in XML_SetDefaultHandler()
1618 parser->m_defaultExpandInternalEntities = XML_FALSE; in XML_SetDefaultHandler()
1622 XML_SetDefaultHandlerExpand(XML_Parser parser, in XML_SetDefaultHandlerExpand() argument
1625 if (parser == NULL) in XML_SetDefaultHandlerExpand()
1627 parser->m_defaultHandler = handler; in XML_SetDefaultHandlerExpand()
1628 parser->m_defaultExpandInternalEntities = XML_TRUE; in XML_SetDefaultHandlerExpand()
1632 XML_SetDoctypeDeclHandler(XML_Parser parser, in XML_SetDoctypeDeclHandler() argument
1636 if (parser == NULL) in XML_SetDoctypeDeclHandler()
1638 parser->m_startDoctypeDeclHandler = start; in XML_SetDoctypeDeclHandler()
1639 parser->m_endDoctypeDeclHandler = end; in XML_SetDoctypeDeclHandler()
1643 XML_SetStartDoctypeDeclHandler(XML_Parser parser, in XML_SetStartDoctypeDeclHandler() argument
1645 if (parser != NULL) in XML_SetStartDoctypeDeclHandler()
1646 parser->m_startDoctypeDeclHandler = start; in XML_SetStartDoctypeDeclHandler()
1650 XML_SetEndDoctypeDeclHandler(XML_Parser parser, in XML_SetEndDoctypeDeclHandler() argument
1652 if (parser != NULL) in XML_SetEndDoctypeDeclHandler()
1653 parser->m_endDoctypeDeclHandler = end; in XML_SetEndDoctypeDeclHandler()
1657 XML_SetUnparsedEntityDeclHandler(XML_Parser parser, in XML_SetUnparsedEntityDeclHandler() argument
1660 if (parser != NULL) in XML_SetUnparsedEntityDeclHandler()
1661 parser->m_unparsedEntityDeclHandler = handler; in XML_SetUnparsedEntityDeclHandler()
1665 XML_SetNotationDeclHandler(XML_Parser parser, in XML_SetNotationDeclHandler() argument
1668 if (parser != NULL) in XML_SetNotationDeclHandler()
1669 parser->m_notationDeclHandler = handler; in XML_SetNotationDeclHandler()
1673 XML_SetNamespaceDeclHandler(XML_Parser parser, in XML_SetNamespaceDeclHandler() argument
1677 if (parser == NULL) in XML_SetNamespaceDeclHandler()
1679 parser->m_startNamespaceDeclHandler = start; in XML_SetNamespaceDeclHandler()
1680 parser->m_endNamespaceDeclHandler = end; in XML_SetNamespaceDeclHandler()
1684 XML_SetStartNamespaceDeclHandler(XML_Parser parser, in XML_SetStartNamespaceDeclHandler() argument
1686 if (parser != NULL) in XML_SetStartNamespaceDeclHandler()
1687 parser->m_startNamespaceDeclHandler = start; in XML_SetStartNamespaceDeclHandler()
1691 XML_SetEndNamespaceDeclHandler(XML_Parser parser, in XML_SetEndNamespaceDeclHandler() argument
1693 if (parser != NULL) in XML_SetEndNamespaceDeclHandler()
1694 parser->m_endNamespaceDeclHandler = end; in XML_SetEndNamespaceDeclHandler()
1698 XML_SetNotStandaloneHandler(XML_Parser parser, in XML_SetNotStandaloneHandler() argument
1701 if (parser != NULL) in XML_SetNotStandaloneHandler()
1702 parser->m_notStandaloneHandler = handler; in XML_SetNotStandaloneHandler()
1706 XML_SetExternalEntityRefHandler(XML_Parser parser, in XML_SetExternalEntityRefHandler() argument
1709 if (parser != NULL) in XML_SetExternalEntityRefHandler()
1710 parser->m_externalEntityRefHandler = handler; in XML_SetExternalEntityRefHandler()
1714 XML_SetExternalEntityRefHandlerArg(XML_Parser parser, void *arg) in XML_SetExternalEntityRefHandlerArg() argument
1716 if (parser == NULL) in XML_SetExternalEntityRefHandlerArg()
1719 parser->m_externalEntityRefHandlerArg = (XML_Parser)arg; in XML_SetExternalEntityRefHandlerArg()
1721 parser->m_externalEntityRefHandlerArg = parser; in XML_SetExternalEntityRefHandlerArg()
1725 XML_SetSkippedEntityHandler(XML_Parser parser, in XML_SetSkippedEntityHandler() argument
1728 if (parser != NULL) in XML_SetSkippedEntityHandler()
1729 parser->m_skippedEntityHandler = handler; in XML_SetSkippedEntityHandler()
1733 XML_SetUnknownEncodingHandler(XML_Parser parser, in XML_SetUnknownEncodingHandler() argument
1737 if (parser == NULL) in XML_SetUnknownEncodingHandler()
1739 parser->m_unknownEncodingHandler = handler; in XML_SetUnknownEncodingHandler()
1740 parser->m_unknownEncodingHandlerData = data; in XML_SetUnknownEncodingHandler()
1744 XML_SetElementDeclHandler(XML_Parser parser, in XML_SetElementDeclHandler() argument
1747 if (parser != NULL) in XML_SetElementDeclHandler()
1748 parser->m_elementDeclHandler = eldecl; in XML_SetElementDeclHandler()
1752 XML_SetAttlistDeclHandler(XML_Parser parser, in XML_SetAttlistDeclHandler() argument
1755 if (parser != NULL) in XML_SetAttlistDeclHandler()
1756 parser->m_attlistDeclHandler = attdecl; in XML_SetAttlistDeclHandler()
1760 XML_SetEntityDeclHandler(XML_Parser parser, in XML_SetEntityDeclHandler() argument
1763 if (parser != NULL) in XML_SetEntityDeclHandler()
1764 parser->m_entityDeclHandler = handler; in XML_SetEntityDeclHandler()
1768 XML_SetXmlDeclHandler(XML_Parser parser, in XML_SetXmlDeclHandler() argument
1770 if (parser != NULL) in XML_SetXmlDeclHandler()
1771 parser->m_xmlDeclHandler = handler; in XML_SetXmlDeclHandler()
1775 XML_SetParamEntityParsing(XML_Parser parser, in XML_SetParamEntityParsing() argument
1778 if (parser == NULL) in XML_SetParamEntityParsing()
1781 …if (parser->m_parsingStatus.parsing == XML_PARSING || parser->m_parsingStatus.parsing == XML_SUSPE… in XML_SetParamEntityParsing()
1784 parser->m_paramEntityParsing = peParsing; in XML_SetParamEntityParsing()
1792 XML_SetHashSalt(XML_Parser parser, in XML_SetHashSalt() argument
1795 if (parser == NULL) in XML_SetHashSalt()
1797 if (parser->m_parentParser) in XML_SetHashSalt()
1798 return XML_SetHashSalt(parser->m_parentParser, hash_salt); in XML_SetHashSalt()
1800 …if (parser->m_parsingStatus.parsing == XML_PARSING || parser->m_parsingStatus.parsing == XML_SUSPE… in XML_SetHashSalt()
1802 parser->m_hash_secret_salt = hash_salt; in XML_SetHashSalt()
1807 XML_Parse(XML_Parser parser, const char *s, int len, int isFinal) in XML_Parse() argument
1809 if ((parser == NULL) || (len < 0) || ((s == NULL) && (len != 0))) { in XML_Parse()
1810 if (parser != NULL) in XML_Parse()
1811 parser->m_errorCode = XML_ERROR_INVALID_ARGUMENT; in XML_Parse()
1814 switch (parser->m_parsingStatus.parsing) { in XML_Parse()
1816 parser->m_errorCode = XML_ERROR_SUSPENDED; in XML_Parse()
1819 parser->m_errorCode = XML_ERROR_FINISHED; in XML_Parse()
1822 if (parser->m_parentParser == NULL && !startParsing(parser)) { in XML_Parse()
1823 parser->m_errorCode = XML_ERROR_NO_MEMORY; in XML_Parse()
1828 parser->m_parsingStatus.parsing = XML_PARSING; in XML_Parse()
1832 parser->m_parsingStatus.finalBuffer = (XML_Bool)isFinal; in XML_Parse()
1835 parser->m_positionPtr = parser->m_bufferPtr; in XML_Parse()
1836 parser->m_parseEndPtr = parser->m_bufferEnd; in XML_Parse()
1842parser->m_errorCode = parser->m_processor(parser, parser->m_bufferPtr, parser->m_parseEndPtr, &par… in XML_Parse()
1844 if (parser->m_errorCode == XML_ERROR_NONE) { in XML_Parse()
1845 switch (parser->m_parsingStatus.parsing) { in XML_Parse()
1859 …XmlUpdatePosition(parser->m_encoding, parser->m_positionPtr, parser->m_bufferPtr, &parser->m_posit… in XML_Parse()
1860 parser->m_positionPtr = parser->m_bufferPtr; in XML_Parse()
1865 parser->m_parsingStatus.parsing = XML_FINISHED; in XML_Parse()
1871 parser->m_eventEndPtr = parser->m_eventPtr; in XML_Parse()
1872 parser->m_processor = errorProcessor; in XML_Parse()
1876 else if (parser->m_bufferPtr == parser->m_bufferEnd) { in XML_Parse()
1881 if (len > ((XML_Size)-1) / 2 - parser->m_parseEndByteIndex) { in XML_Parse()
1882 parser->m_errorCode = XML_ERROR_NO_MEMORY; in XML_Parse()
1883 parser->m_eventPtr = parser->m_eventEndPtr = NULL; in XML_Parse()
1884 parser->m_processor = errorProcessor; in XML_Parse()
1887 parser->m_parseEndByteIndex += len; in XML_Parse()
1888 parser->m_positionPtr = s; in XML_Parse()
1889 parser->m_parsingStatus.finalBuffer = (XML_Bool)isFinal; in XML_Parse()
1891 parser->m_errorCode = parser->m_processor(parser, s, parser->m_parseEndPtr = s + len, &end); in XML_Parse()
1893 if (parser->m_errorCode != XML_ERROR_NONE) { in XML_Parse()
1894 parser->m_eventEndPtr = parser->m_eventPtr; in XML_Parse()
1895 parser->m_processor = errorProcessor; in XML_Parse()
1899 switch (parser->m_parsingStatus.parsing) { in XML_Parse()
1906 parser->m_parsingStatus.parsing = XML_FINISHED; in XML_Parse()
1915 XmlUpdatePosition(parser->m_encoding, parser->m_positionPtr, end, &parser->m_position); in XML_Parse()
1918 if (parser->m_buffer == NULL || nLeftOver > parser->m_bufferLim - parser->m_buffer) { in XML_Parse()
1923 temp = (char *)REALLOC(parser, parser->m_buffer, bytesToAllocate); in XML_Parse()
1926 parser->m_errorCode = XML_ERROR_NO_MEMORY; in XML_Parse()
1927 parser->m_eventPtr = parser->m_eventEndPtr = NULL; in XML_Parse()
1928 parser->m_processor = errorProcessor; in XML_Parse()
1931 parser->m_buffer = temp; in XML_Parse()
1932 parser->m_bufferLim = parser->m_buffer + bytesToAllocate; in XML_Parse()
1934 memcpy(parser->m_buffer, end, nLeftOver); in XML_Parse()
1936 parser->m_bufferPtr = parser->m_buffer; in XML_Parse()
1937 parser->m_bufferEnd = parser->m_buffer + nLeftOver; in XML_Parse()
1938 parser->m_positionPtr = parser->m_bufferPtr; in XML_Parse()
1939 parser->m_parseEndPtr = parser->m_bufferEnd; in XML_Parse()
1940 parser->m_eventPtr = parser->m_bufferPtr; in XML_Parse()
1941 parser->m_eventEndPtr = parser->m_bufferPtr; in XML_Parse()
1946 void *buff = XML_GetBuffer(parser, len); in XML_Parse()
1951 return XML_ParseBuffer(parser, len, isFinal); in XML_Parse()
1957 XML_ParseBuffer(XML_Parser parser, int len, int isFinal) in XML_ParseBuffer() argument
1962 if (parser == NULL) in XML_ParseBuffer()
1964 switch (parser->m_parsingStatus.parsing) { in XML_ParseBuffer()
1966 parser->m_errorCode = XML_ERROR_SUSPENDED; in XML_ParseBuffer()
1969 parser->m_errorCode = XML_ERROR_FINISHED; in XML_ParseBuffer()
1972 if (parser->m_parentParser == NULL && !startParsing(parser)) { in XML_ParseBuffer()
1973 parser->m_errorCode = XML_ERROR_NO_MEMORY; in XML_ParseBuffer()
1978 parser->m_parsingStatus.parsing = XML_PARSING; in XML_ParseBuffer()
1981 start = parser->m_bufferPtr; in XML_ParseBuffer()
1982 parser->m_positionPtr = start; in XML_ParseBuffer()
1983 parser->m_bufferEnd += len; in XML_ParseBuffer()
1984 parser->m_parseEndPtr = parser->m_bufferEnd; in XML_ParseBuffer()
1985 parser->m_parseEndByteIndex += len; in XML_ParseBuffer()
1986 parser->m_parsingStatus.finalBuffer = (XML_Bool)isFinal; in XML_ParseBuffer()
1988parser->m_errorCode = parser->m_processor(parser, start, parser->m_parseEndPtr, &parser->m_bufferP… in XML_ParseBuffer()
1990 if (parser->m_errorCode != XML_ERROR_NONE) { in XML_ParseBuffer()
1991 parser->m_eventEndPtr = parser->m_eventPtr; in XML_ParseBuffer()
1992 parser->m_processor = errorProcessor; in XML_ParseBuffer()
1996 switch (parser->m_parsingStatus.parsing) { in XML_ParseBuffer()
2003 parser->m_parsingStatus.parsing = XML_FINISHED; in XML_ParseBuffer()
2010 …XmlUpdatePosition(parser->m_encoding, parser->m_positionPtr, parser->m_bufferPtr, &parser->m_posit… in XML_ParseBuffer()
2011 parser->m_positionPtr = parser->m_bufferPtr; in XML_ParseBuffer()
2016 XML_GetBuffer(XML_Parser parser, int len) in XML_GetBuffer() argument
2018 if (parser == NULL) in XML_GetBuffer()
2021 parser->m_errorCode = XML_ERROR_NO_MEMORY; in XML_GetBuffer()
2024 switch (parser->m_parsingStatus.parsing) { in XML_GetBuffer()
2026 parser->m_errorCode = XML_ERROR_SUSPENDED; in XML_GetBuffer()
2029 parser->m_errorCode = XML_ERROR_FINISHED; in XML_GetBuffer()
2034 if (len > EXPAT_SAFE_PTR_DIFF(parser->m_bufferLim, parser->m_bufferEnd)) { in XML_GetBuffer()
2040 (unsigned)EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, in XML_GetBuffer()
2041 parser->m_bufferPtr)); in XML_GetBuffer()
2043 parser->m_errorCode = XML_ERROR_NO_MEMORY; in XML_GetBuffer()
2047 keep = (int)EXPAT_SAFE_PTR_DIFF(parser->m_bufferPtr, parser->m_buffer); in XML_GetBuffer()
2052 if (neededSize <= EXPAT_SAFE_PTR_DIFF(parser->m_bufferLim, parser->m_buffer)) { in XML_GetBuffer()
2054 if (keep < EXPAT_SAFE_PTR_DIFF(parser->m_bufferPtr, parser->m_buffer)) { in XML_GetBuffer()
2055 int offset = (int)EXPAT_SAFE_PTR_DIFF(parser->m_bufferPtr, parser->m_buffer) - keep; in XML_GetBuffer()
2057 …memmove(parser->m_buffer, &parser->m_buffer[offset], parser->m_bufferEnd - parser->m_bufferPtr + k… in XML_GetBuffer()
2058 parser->m_bufferEnd -= offset; in XML_GetBuffer()
2059 parser->m_bufferPtr -= offset; in XML_GetBuffer()
2062 if (parser->m_buffer && parser->m_bufferPtr) { in XML_GetBuffer()
2063 memmove(parser->m_buffer, parser->m_bufferPtr, in XML_GetBuffer()
2064 EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr)); in XML_GetBuffer()
2065 parser->m_bufferEnd = parser->m_buffer + in XML_GetBuffer()
2066 EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr); in XML_GetBuffer()
2067 parser->m_bufferPtr = parser->m_buffer; in XML_GetBuffer()
2073 int bufferSize = (int)EXPAT_SAFE_PTR_DIFF(parser->m_bufferLim, parser->m_bufferPtr); in XML_GetBuffer()
2081 parser->m_errorCode = XML_ERROR_NO_MEMORY; in XML_GetBuffer()
2084 newBuf = (char *)MALLOC(parser, bufferSize); in XML_GetBuffer()
2086 parser->m_errorCode = XML_ERROR_NO_MEMORY; in XML_GetBuffer()
2089 parser->m_bufferLim = newBuf + bufferSize; in XML_GetBuffer()
2091 if (parser->m_bufferPtr) { in XML_GetBuffer()
2092 int keep = (int)EXPAT_SAFE_PTR_DIFF(parser->m_bufferPtr, parser->m_buffer); in XML_GetBuffer()
2095 memcpy(newBuf, &parser->m_bufferPtr[-keep], in XML_GetBuffer()
2096 EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr) + keep); in XML_GetBuffer()
2097 FREE(parser, parser->m_buffer); in XML_GetBuffer()
2098 parser->m_buffer = newBuf; in XML_GetBuffer()
2099 parser->m_bufferEnd = parser->m_buffer + in XML_GetBuffer()
2100 EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr) + keep; in XML_GetBuffer()
2101 parser->m_bufferPtr = parser->m_buffer + keep; in XML_GetBuffer()
2105 parser->m_bufferEnd = newBuf; in XML_GetBuffer()
2106 parser->m_bufferPtr = parser->m_buffer = newBuf; in XML_GetBuffer()
2109 if (parser->m_bufferPtr) { in XML_GetBuffer()
2110 memcpy(newBuf, parser->m_bufferPtr, in XML_GetBuffer()
2111 EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr)); in XML_GetBuffer()
2112 FREE(parser, parser->m_buffer); in XML_GetBuffer()
2113 parser->m_bufferEnd = newBuf + in XML_GetBuffer()
2114 EXPAT_SAFE_PTR_DIFF(parser->m_bufferEnd, parser->m_bufferPtr); in XML_GetBuffer()
2118 parser->m_bufferEnd = newBuf; in XML_GetBuffer()
2120 parser->m_bufferPtr = parser->m_buffer = newBuf; in XML_GetBuffer()
2123 parser->m_eventPtr = parser->m_eventEndPtr = NULL; in XML_GetBuffer()
2124 parser->m_positionPtr = NULL; in XML_GetBuffer()
2126 return parser->m_bufferEnd; in XML_GetBuffer()
2130 XML_StopParser(XML_Parser parser, XML_Bool resumable) in XML_StopParser() argument
2132 if (parser == NULL) in XML_StopParser()
2134 switch (parser->m_parsingStatus.parsing) { in XML_StopParser()
2137 parser->m_errorCode = XML_ERROR_SUSPENDED; in XML_StopParser()
2140 parser->m_parsingStatus.parsing = XML_FINISHED; in XML_StopParser()
2143 parser->m_errorCode = XML_ERROR_FINISHED; in XML_StopParser()
2148 if (parser->m_isParamEntity) { in XML_StopParser()
2149 parser->m_errorCode = XML_ERROR_SUSPEND_PE; in XML_StopParser()
2153 parser->m_parsingStatus.parsing = XML_SUSPENDED; in XML_StopParser()
2156 parser->m_parsingStatus.parsing = XML_FINISHED; in XML_StopParser()
2162 XML_ResumeParser(XML_Parser parser) in XML_ResumeParser() argument
2166 if (parser == NULL) in XML_ResumeParser()
2168 if (parser->m_parsingStatus.parsing != XML_SUSPENDED) { in XML_ResumeParser()
2169 parser->m_errorCode = XML_ERROR_NOT_SUSPENDED; in XML_ResumeParser()
2172 parser->m_parsingStatus.parsing = XML_PARSING; in XML_ResumeParser()
2174parser->m_errorCode = parser->m_processor(parser, parser->m_bufferPtr, parser->m_parseEndPtr, &par… in XML_ResumeParser()
2176 if (parser->m_errorCode != XML_ERROR_NONE) { in XML_ResumeParser()
2177 parser->m_eventEndPtr = parser->m_eventPtr; in XML_ResumeParser()
2178 parser->m_processor = errorProcessor; in XML_ResumeParser()
2182 switch (parser->m_parsingStatus.parsing) { in XML_ResumeParser()
2188 if (parser->m_parsingStatus.finalBuffer) { in XML_ResumeParser()
2189 parser->m_parsingStatus.parsing = XML_FINISHED; in XML_ResumeParser()
2196 …XmlUpdatePosition(parser->m_encoding, parser->m_positionPtr, parser->m_bufferPtr, &parser->m_posit… in XML_ResumeParser()
2197 parser->m_positionPtr = parser->m_bufferPtr; in XML_ResumeParser()
2202 XML_GetParsingStatus(XML_Parser parser, XML_ParsingStatus *status) in XML_GetParsingStatus() argument
2204 if (parser == NULL) in XML_GetParsingStatus()
2207 *status = parser->m_parsingStatus; in XML_GetParsingStatus()
2211 XML_GetErrorCode(XML_Parser parser) in XML_GetErrorCode() argument
2213 if (parser == NULL) in XML_GetErrorCode()
2215 return parser->m_errorCode; in XML_GetErrorCode()
2219 XML_GetCurrentByteIndex(XML_Parser parser) in XML_GetCurrentByteIndex() argument
2221 if (parser == NULL) in XML_GetCurrentByteIndex()
2223 if (parser->m_eventPtr) in XML_GetCurrentByteIndex()
2224 return (XML_Index)(parser->m_parseEndByteIndex - (parser->m_parseEndPtr - parser->m_eventPtr)); in XML_GetCurrentByteIndex()
2229 XML_GetCurrentByteCount(XML_Parser parser) in XML_GetCurrentByteCount() argument
2231 if (parser == NULL) in XML_GetCurrentByteCount()
2233 if (parser->m_eventEndPtr && parser->m_eventPtr) in XML_GetCurrentByteCount()
2234 return (int)(parser->m_eventEndPtr - parser->m_eventPtr); in XML_GetCurrentByteCount()
2239 XML_GetInputContext(XML_Parser parser, int *offset, int *size) in XML_GetInputContext() argument
2242 if (parser == NULL) in XML_GetInputContext()
2244 if (parser->m_eventPtr && parser->m_buffer) { in XML_GetInputContext()
2246 *offset = (int)(parser->m_eventPtr - parser->m_buffer); in XML_GetInputContext()
2248 *size = (int)(parser->m_bufferEnd - parser->m_buffer); in XML_GetInputContext()
2249 return parser->m_buffer; in XML_GetInputContext()
2252 (void)parser; in XML_GetInputContext()
2260 XML_GetCurrentLineNumber(XML_Parser parser) in XML_GetCurrentLineNumber() argument
2262 if (parser == NULL) in XML_GetCurrentLineNumber()
2264 if (parser->m_eventPtr && parser->m_eventPtr >= parser->m_positionPtr) { in XML_GetCurrentLineNumber()
2265 …XmlUpdatePosition(parser->m_encoding, parser->m_positionPtr, parser->m_eventPtr, &parser->m_positi… in XML_GetCurrentLineNumber()
2266 parser->m_positionPtr = parser->m_eventPtr; in XML_GetCurrentLineNumber()
2268 return parser->m_position.lineNumber + 1; in XML_GetCurrentLineNumber()
2272 XML_GetCurrentColumnNumber(XML_Parser parser) in XML_GetCurrentColumnNumber() argument
2274 if (parser == NULL) in XML_GetCurrentColumnNumber()
2276 if (parser->m_eventPtr && parser->m_eventPtr >= parser->m_positionPtr) { in XML_GetCurrentColumnNumber()
2277 …XmlUpdatePosition(parser->m_encoding, parser->m_positionPtr, parser->m_eventPtr, &parser->m_positi… in XML_GetCurrentColumnNumber()
2278 parser->m_positionPtr = parser->m_eventPtr; in XML_GetCurrentColumnNumber()
2280 return parser->m_position.columnNumber; in XML_GetCurrentColumnNumber()
2284 XML_FreeContentModel(XML_Parser parser, XML_Content *model) in XML_FreeContentModel() argument
2286 if (parser != NULL) in XML_FreeContentModel()
2287 FREE(parser, model); in XML_FreeContentModel()
2291 XML_MemMalloc(XML_Parser parser, size_t size) in XML_MemMalloc() argument
2293 if (parser == NULL) in XML_MemMalloc()
2295 return MALLOC(parser, size); in XML_MemMalloc()
2299 XML_MemRealloc(XML_Parser parser, void *ptr, size_t size) in XML_MemRealloc() argument
2301 if (parser == NULL) in XML_MemRealloc()
2303 return REALLOC(parser, ptr, size); in XML_MemRealloc()
2307 XML_MemFree(XML_Parser parser, void *ptr) in XML_MemFree() argument
2309 if (parser != NULL) in XML_MemFree()
2310 FREE(parser, ptr); in XML_MemFree()
2314 XML_DefaultCurrent(XML_Parser parser) in XML_DefaultCurrent() argument
2316 if (parser == NULL) in XML_DefaultCurrent()
2318 if (parser->m_defaultHandler) { in XML_DefaultCurrent()
2319 if (parser->m_openInternalEntities) in XML_DefaultCurrent()
2320 reportDefault(parser, in XML_DefaultCurrent()
2321 parser->m_internalEncoding, in XML_DefaultCurrent()
2322 parser->m_openInternalEntities->internalEventPtr, in XML_DefaultCurrent()
2323 parser->m_openInternalEntities->internalEventEndPtr); in XML_DefaultCurrent()
2325 reportDefault(parser, parser->m_encoding, parser->m_eventPtr, parser->m_eventEndPtr); in XML_DefaultCurrent()
2502 storeRawNames(XML_Parser parser) in storeRawNames() argument
2504 TAG *tag = parser->m_tagStack; in storeRawNames()
2521 char *temp = (char *)REALLOC(parser, tag->buf, bufSize); in storeRawNames()
2547 contentProcessor(XML_Parser parser, in contentProcessor() argument
2552 enum XML_Error result = doContent(parser, 0, parser->m_encoding, start, end, in contentProcessor()
2553 endPtr, (XML_Bool)!parser->m_parsingStatus.finalBuffer); in contentProcessor()
2555 if (!storeRawNames(parser)) in contentProcessor()
2562 externalEntityInitProcessor(XML_Parser parser, in externalEntityInitProcessor() argument
2567 enum XML_Error result = initializeEncoding(parser); in externalEntityInitProcessor()
2570 parser->m_processor = externalEntityInitProcessor2; in externalEntityInitProcessor()
2571 return externalEntityInitProcessor2(parser, start, end, endPtr); in externalEntityInitProcessor()
2575 externalEntityInitProcessor2(XML_Parser parser, in externalEntityInitProcessor2() argument
2581 int tok = XmlContentTok(parser->m_encoding, start, end, &next); in externalEntityInitProcessor2()
2589 if (next == end && !parser->m_parsingStatus.finalBuffer) { in externalEntityInitProcessor2()
2596 if (!parser->m_parsingStatus.finalBuffer) { in externalEntityInitProcessor2()
2600 parser->m_eventPtr = start; in externalEntityInitProcessor2()
2603 if (!parser->m_parsingStatus.finalBuffer) { in externalEntityInitProcessor2()
2607 parser->m_eventPtr = start; in externalEntityInitProcessor2()
2610 parser->m_processor = externalEntityInitProcessor3; in externalEntityInitProcessor2()
2611 return externalEntityInitProcessor3(parser, start, end, endPtr); in externalEntityInitProcessor2()
2615 externalEntityInitProcessor3(XML_Parser parser, in externalEntityInitProcessor3() argument
2622 parser->m_eventPtr = start; in externalEntityInitProcessor3()
2623 tok = XmlContentTok(parser->m_encoding, start, end, &next); in externalEntityInitProcessor3()
2624 parser->m_eventEndPtr = next; in externalEntityInitProcessor3()
2630 result = processXmlDecl(parser, 1, start, next); in externalEntityInitProcessor3()
2633 switch (parser->m_parsingStatus.parsing) { in externalEntityInitProcessor3()
2645 if (!parser->m_parsingStatus.finalBuffer) { in externalEntityInitProcessor3()
2651 if (!parser->m_parsingStatus.finalBuffer) { in externalEntityInitProcessor3()
2657 parser->m_processor = externalEntityContentProcessor; in externalEntityInitProcessor3()
2658 parser->m_tagLevel = 1; in externalEntityInitProcessor3()
2659 return externalEntityContentProcessor(parser, start, end, endPtr); in externalEntityInitProcessor3()
2663 externalEntityContentProcessor(XML_Parser parser, in externalEntityContentProcessor() argument
2668 enum XML_Error result = doContent(parser, 1, parser->m_encoding, start, end, in externalEntityContentProcessor()
2669 endPtr, (XML_Bool)!parser->m_parsingStatus.finalBuffer); in externalEntityContentProcessor()
2671 if (!storeRawNames(parser)) in externalEntityContentProcessor()
2678 doContent(XML_Parser parser, in doContent() argument
2687 DTD * const dtd = parser->m_dtd; in doContent()
2691 if (enc == parser->m_encoding) { in doContent()
2692 eventPP = &parser->m_eventPtr; in doContent()
2693 eventEndPP = &parser->m_eventEndPtr; in doContent()
2696 eventPP = &(parser->m_openInternalEntities->internalEventPtr); in doContent()
2697 eventEndPP = &(parser->m_openInternalEntities->internalEventEndPtr); in doContent()
2712 if (parser->m_characterDataHandler) { in doContent()
2714 parser->m_characterDataHandler(parser->m_handlerArg, &c, 1); in doContent()
2716 else if (parser->m_defaultHandler) in doContent()
2717 reportDefault(parser, enc, s, end); in doContent()
2723 if (parser->m_tagLevel != startTagLevel) in doContent()
2733 if (parser->m_tagLevel != startTagLevel) in doContent()
2762 if (parser->m_characterDataHandler) in doContent()
2763 parser->m_characterDataHandler(parser->m_handlerArg, &ch, 1); in doContent()
2764 else if (parser->m_defaultHandler) in doContent()
2765 reportDefault(parser, enc, s, next); in doContent()
2773 entity = (ENTITY *)lookup(parser, &dtd->generalEntities, name, 0); in doContent()
2786 if (parser->m_skippedEntityHandler) in doContent()
2787 parser->m_skippedEntityHandler(parser->m_handlerArg, name, 0); in doContent()
2788 else if (parser->m_defaultHandler) in doContent()
2789 reportDefault(parser, enc, s, next); in doContent()
2798 if (!parser->m_defaultExpandInternalEntities) { in doContent()
2799 if (parser->m_skippedEntityHandler) in doContent()
2800 parser->m_skippedEntityHandler(parser->m_handlerArg, entity->name, 0); in doContent()
2801 else if (parser->m_defaultHandler) in doContent()
2802 reportDefault(parser, enc, s, next); in doContent()
2805 result = processInternalEntity(parser, entity, XML_FALSE); in doContent()
2809 else if (parser->m_externalEntityRefHandler) { in doContent()
2812 context = getContext(parser); in doContent()
2816 if (!parser->m_externalEntityRefHandler(parser->m_externalEntityRefHandlerArg, in doContent()
2822 poolDiscard(&parser->m_tempPool); in doContent()
2824 else if (parser->m_defaultHandler) in doContent()
2825 reportDefault(parser, enc, s, next); in doContent()
2835 if (parser->m_freeTagList) { in doContent()
2836 tag = parser->m_freeTagList; in doContent()
2837 parser->m_freeTagList = parser->m_freeTagList->parent; in doContent()
2840 tag = (TAG *)MALLOC(parser, sizeof(TAG)); in doContent()
2843 tag->buf = (char *)MALLOC(parser, INIT_TAG_BUF_SIZE); in doContent()
2845 FREE(parser, tag); in doContent()
2851 tag->parent = parser->m_tagStack; in doContent()
2852 parser->m_tagStack = tag; in doContent()
2857 ++parser->m_tagLevel; in doContent()
2875 char *temp = (char *)REALLOC(parser, tag->buf, bufSize); in doContent()
2886 result = storeAtts(parser, enc, s, &(tag->name), &(tag->bindings)); in doContent()
2889 if (parser->m_startElementHandler) in doContent()
2890 parser->m_startElementHandler(parser->m_handlerArg, tag->name.str, in doContent()
2891 (const XML_Char **)parser->m_atts); in doContent()
2892 else if (parser->m_defaultHandler) in doContent()
2893 reportDefault(parser, enc, s, next); in doContent()
2894 poolClear(&parser->m_tempPool); in doContent()
2906 name.str = poolStoreString(&parser->m_tempPool, enc, rawName, in doContent()
2910 poolFinish(&parser->m_tempPool); in doContent()
2911 result = storeAtts(parser, enc, s, &name, &bindings); in doContent()
2913 freeBindings(parser, bindings); in doContent()
2916 poolFinish(&parser->m_tempPool); in doContent()
2917 if (parser->m_startElementHandler) { in doContent()
2918parser->m_startElementHandler(parser->m_handlerArg, name.str, (const XML_Char **)parser->m_atts); in doContent()
2921 if (parser->m_endElementHandler) { in doContent()
2922 if (parser->m_startElementHandler) in doContent()
2924 parser->m_endElementHandler(parser->m_handlerArg, name.str); in doContent()
2927 if (noElmHandlers && parser->m_defaultHandler) in doContent()
2928 reportDefault(parser, enc, s, next); in doContent()
2929 poolClear(&parser->m_tempPool); in doContent()
2930 freeBindings(parser, bindings); in doContent()
2932 if ((parser->m_tagLevel == 0) && (parser->m_parsingStatus.parsing != XML_FINISHED)) { in doContent()
2933 if (parser->m_parsingStatus.parsing == XML_SUSPENDED) in doContent()
2934 parser->m_processor = epilogProcessor; in doContent()
2936 return epilogProcessor(parser, next, end, nextPtr); in doContent()
2940 if (parser->m_tagLevel == startTagLevel) in doContent()
2945 TAG *tag = parser->m_tagStack; in doContent()
2946 parser->m_tagStack = tag->parent; in doContent()
2947 tag->parent = parser->m_freeTagList; in doContent()
2948 parser->m_freeTagList = tag; in doContent()
2956 --parser->m_tagLevel; in doContent()
2957 if (parser->m_endElementHandler) { in doContent()
2962 if (parser->m_ns && localPart) { in doContent()
2971 if (parser->m_ns_triplets && prefix) { in doContent()
2972 *uri++ = parser->m_namespaceSeparator; in doContent()
2977 parser->m_endElementHandler(parser->m_handlerArg, tag->name.str); in doContent()
2979 else if (parser->m_defaultHandler) in doContent()
2980 reportDefault(parser, enc, s, next); in doContent()
2983 if (parser->m_endNamespaceDeclHandler) in doContent()
2984 parser->m_endNamespaceDeclHandler(parser->m_handlerArg, b->prefix->name); in doContent()
2986 b->nextTagBinding = parser->m_freeBindingList; in doContent()
2987 parser->m_freeBindingList = b; in doContent()
2990 if (parser->m_tagLevel == 0) in doContent()
2991 return epilogProcessor(parser, next, end, nextPtr); in doContent()
2999 if (parser->m_characterDataHandler) { in doContent()
3001 parser->m_characterDataHandler(parser->m_handlerArg, buf, XmlEncode(n, (ICHAR *)buf)); in doContent()
3003 else if (parser->m_defaultHandler) in doContent()
3004 reportDefault(parser, enc, s, next); in doContent()
3010 if (parser->m_characterDataHandler) { in doContent()
3012 parser->m_characterDataHandler(parser->m_handlerArg, &c, 1); in doContent()
3014 else if (parser->m_defaultHandler) in doContent()
3015 reportDefault(parser, enc, s, next); in doContent()
3020 if (parser->m_startCdataSectionHandler) in doContent()
3021 parser->m_startCdataSectionHandler(parser->m_handlerArg); in doContent()
3035 else if (parser->m_characterDataHandler) in doContent()
3036 parser->m_characterDataHandler(parser->m_handlerArg, parser->m_dataBuf, 0); in doContent()
3038 else if (parser->m_defaultHandler) in doContent()
3039 reportDefault(parser, enc, s, next); in doContent()
3040 result = doCdataSection(parser, enc, &next, end, nextPtr, haveMore); in doContent()
3044 parser->m_processor = cdataSectionProcessor; in doContent()
3054 if (parser->m_characterDataHandler) { in doContent()
3056 ICHAR *dataPtr = (ICHAR *)parser->m_dataBuf; in doContent()
3057 XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)parser->m_dataBufEnd); in doContent()
3058 parser->m_characterDataHandler(parser->m_handlerArg, parser->m_dataBuf, in doContent()
3059 (int)(dataPtr - (ICHAR *)parser->m_dataBuf)); in doContent()
3062 parser->m_characterDataHandler(parser->m_handlerArg, in doContent()
3066 else if (parser->m_defaultHandler) in doContent()
3067 reportDefault(parser, enc, s, end); in doContent()
3075 if (parser->m_tagLevel != startTagLevel) { in doContent()
3083 XML_CharacterDataHandler charDataHandler = parser->m_characterDataHandler; in doContent()
3087 ICHAR *dataPtr = (ICHAR *)parser->m_dataBuf; in doContent()
3088 …ML_Convert_Result convert_res = XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)parser->m_dataBufEnd); in doContent()
3090 charDataHandler(parser->m_handlerArg, parser->m_dataBuf, in doContent()
3091 (int)(dataPtr - (ICHAR *)parser->m_dataBuf)); in doContent()
3098 charDataHandler(parser->m_handlerArg, in doContent()
3102 else if (parser->m_defaultHandler) in doContent()
3103 reportDefault(parser, enc, s, next); in doContent()
3107 if (!reportProcessingInstruction(parser, enc, s, next)) in doContent()
3111 if (!reportComment(parser, enc, s, next)) in doContent()
3122 if (parser->m_defaultHandler) in doContent()
3123 reportDefault(parser, enc, s, next); in doContent()
3128 switch (parser->m_parsingStatus.parsing) { in doContent()
3145 freeBindings(XML_Parser parser, BINDING *bindings) in freeBindings() argument
3153 if (parser->m_endNamespaceDeclHandler) in freeBindings()
3154 parser->m_endNamespaceDeclHandler(parser->m_handlerArg, b->prefix->name); in freeBindings()
3157 b->nextTagBinding = parser->m_freeBindingList; in freeBindings()
3158 parser->m_freeBindingList = b; in freeBindings()
3174 storeAtts(XML_Parser parser, const ENCODING *enc, in storeAtts() argument
3178 DTD * const dtd = parser->m_dtd; /* save one level of indirection */ in storeAtts()
3192 elementType = (ELEMENT_TYPE *)lookup(parser, &dtd->elementTypes, tagNamePtr->str,0); in storeAtts()
3197 elementType = (ELEMENT_TYPE *)lookup(parser, &dtd->elementTypes, name, in storeAtts()
3201 if (parser->m_ns && !setElementTypePrefix(parser, elementType)) in storeAtts()
3207 n = XmlGetAttributes(enc, attStr, parser->m_attsSize, parser->m_atts); in storeAtts()
3208 if (n + nDefaultAtts > parser->m_attsSize) { in storeAtts()
3209 int oldAttsSize = parser->m_attsSize; in storeAtts()
3214 parser->m_attsSize = n + nDefaultAtts + INIT_ATTS_SIZE; in storeAtts()
3215 …temp = (ATTRIBUTE *)REALLOC(parser, (void *)parser->m_atts, parser->m_attsSize * sizeof(ATTRIBUTE)… in storeAtts()
3217 parser->m_attsSize = oldAttsSize; in storeAtts()
3220 parser->m_atts = temp; in storeAtts()
3222 …temp2 = (XML_AttrInfo *)REALLOC(parser, (void *)parser->m_attInfo, parser->m_attsSize * sizeof(XML… in storeAtts()
3224 parser->m_attsSize = oldAttsSize; in storeAtts()
3227 parser->m_attInfo = temp2; in storeAtts()
3230 XmlGetAttributes(enc, attStr, n, parser->m_atts); in storeAtts()
3233 appAtts = (const XML_Char **)parser->m_atts; in storeAtts()
3235 ATTRIBUTE *currAtt = &parser->m_atts[i]; in storeAtts()
3237 XML_AttrInfo *currAttInfo = &parser->m_attInfo[i]; in storeAtts()
3240 ATTRIBUTE_ID *attId = getAttributeId(parser, enc, currAtt->name, in storeAtts()
3246 currAttInfo->nameStart = parser->m_parseEndByteIndex - (parser->m_parseEndPtr - currAtt->name); in storeAtts()
3249 currAttInfo->valueStart = parser->m_parseEndByteIndex - in storeAtts()
3250 (parser->m_parseEndPtr - currAtt->valuePtr); in storeAtts()
3251 … currAttInfo->valueEnd = parser->m_parseEndByteIndex - (parser->m_parseEndPtr - currAtt->valueEnd); in storeAtts()
3258 if (enc == parser->m_encoding) in storeAtts()
3259 parser->m_eventPtr = parser->m_atts[i].name; in storeAtts()
3264 if (!parser->m_atts[i].normalized) { in storeAtts()
3280 result = storeAttributeValue(parser, enc, isCdata, in storeAtts()
3281 parser->m_atts[i].valuePtr, parser->m_atts[i].valueEnd, in storeAtts()
3282 &parser->m_tempPool); in storeAtts()
3285 appAtts[attIndex] = poolStart(&parser->m_tempPool); in storeAtts()
3286 poolFinish(&parser->m_tempPool); in storeAtts()
3290 appAtts[attIndex] = poolStoreString(&parser->m_tempPool, enc, parser->m_atts[i].valuePtr, in storeAtts()
3291 parser->m_atts[i].valueEnd); in storeAtts()
3294 poolFinish(&parser->m_tempPool); in storeAtts()
3300 enum XML_Error result = addBinding(parser, attId->prefix, attId, in storeAtts()
3318 parser->m_nSpecifiedAtts = attIndex; in storeAtts()
3322 parser->m_idAttIndex = i; in storeAtts()
3327 parser->m_idAttIndex = -1; in storeAtts()
3335 enum XML_Error result = addBinding(parser, da->id->prefix, da->id, in storeAtts()
3361 unsigned long version = parser->m_nsAttsVersion; in storeAtts()
3362 int nsAttsSize = (int)1 << parser->m_nsAttsPower; in storeAtts()
3363 unsigned char oldNsAttsPower = parser->m_nsAttsPower; in storeAtts()
3365 if ((nPrefixes << 1) >> parser->m_nsAttsPower) { /* true for m_nsAttsPower = 0 */ in storeAtts()
3368 while (nPrefixes >> parser->m_nsAttsPower++); in storeAtts()
3369 if (parser->m_nsAttsPower < 3) in storeAtts()
3370 parser->m_nsAttsPower = 3; in storeAtts()
3371 nsAttsSize = (int)1 << parser->m_nsAttsPower; in storeAtts()
3372 temp = (NS_ATT *)REALLOC(parser, parser->m_nsAtts, nsAttsSize * sizeof(NS_ATT)); in storeAtts()
3375 parser->m_nsAttsPower = oldNsAttsPower; in storeAtts()
3378 parser->m_nsAtts = temp; in storeAtts()
3385 parser->m_nsAtts[--j].version = version; in storeAtts()
3387 parser->m_nsAttsVersion = --version; in storeAtts()
3399 copy_salt_to_sipkey(parser, &sip_key); in storeAtts()
3403 id = (ATTRIBUTE_ID *)lookup(parser, &dtd->attributeIds, s, 0); in storeAtts()
3427 if (!poolAppendChar(&parser->m_tempPool, c)) in storeAtts()
3439 if (!poolAppendChar(&parser->m_tempPool, *s)) in storeAtts()
3451 while (parser->m_nsAtts[j].version == version) { in storeAtts()
3453 if (uriHash == parser->m_nsAtts[j].hash) { in storeAtts()
3454 const XML_Char *s1 = poolStart(&parser->m_tempPool); in storeAtts()
3455 const XML_Char *s2 = parser->m_nsAtts[j].uriName; in storeAtts()
3462 step = PROBE_STEP(uriHash, mask, parser->m_nsAttsPower); in storeAtts()
3467 if (parser->m_ns_triplets) { /* append namespace separator and prefix */ in storeAtts()
3468 parser->m_tempPool.ptr[-1] = parser->m_namespaceSeparator; in storeAtts()
3471 if (!poolAppendChar(&parser->m_tempPool, *s)) in storeAtts()
3477 s = poolStart(&parser->m_tempPool); in storeAtts()
3478 poolFinish(&parser->m_tempPool); in storeAtts()
3482 parser->m_nsAtts[j].version = version; in storeAtts()
3483 parser->m_nsAtts[j].hash = uriHash; in storeAtts()
3484 parser->m_nsAtts[j].uriName = s; in storeAtts()
3501 if (!parser->m_ns) in storeAtts()
3520 if (parser->m_ns_triplets && binding->prefix->name) { in storeAtts()
3533 uri = (XML_Char *)MALLOC(parser, (n + EXPAND_SPARE) * sizeof(XML_Char)); in storeAtts()
3538 for (p = parser->m_tagStack; p; p = p->parent) in storeAtts()
3541 FREE(parser, binding->uri); in storeAtts()
3550 *uri = parser->m_namespaceSeparator; /* replace null terminator */ in storeAtts()
3561 addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId, in addBinding() argument
3628 if (parser->m_namespaceSeparator) in addBinding()
3630 if (parser->m_freeBindingList) { in addBinding()
3631 b = parser->m_freeBindingList; in addBinding()
3633 XML_Char *temp = (XML_Char *)REALLOC(parser, b->uri, in addBinding()
3640 parser->m_freeBindingList = b->nextTagBinding; in addBinding()
3643 b = (BINDING *)MALLOC(parser, sizeof(BINDING)); in addBinding()
3646 b->uri = (XML_Char *)MALLOC(parser, sizeof(XML_Char) * (len + EXPAND_SPARE)); in addBinding()
3648 FREE(parser, b); in addBinding()
3655 if (parser->m_namespaceSeparator) in addBinding()
3656 b->uri[len - 1] = parser->m_namespaceSeparator; in addBinding()
3661 if (*uri == XML_T('\0') && prefix == &parser->m_dtd->defaultPrefix) in addBinding()
3668 if (attId && parser->m_startNamespaceDeclHandler) in addBinding()
3669 parser->m_startNamespaceDeclHandler(parser->m_handlerArg, prefix->name, in addBinding()
3678 cdataSectionProcessor(XML_Parser parser, in cdataSectionProcessor() argument
3683 enum XML_Error result = doCdataSection(parser, parser->m_encoding, &start, end, in cdataSectionProcessor()
3684 endPtr, (XML_Bool)!parser->m_parsingStatus.finalBuffer); in cdataSectionProcessor()
3688 if (parser->m_parentParser) { /* we are parsing an external entity */ in cdataSectionProcessor()
3689 parser->m_processor = externalEntityContentProcessor; in cdataSectionProcessor()
3690 return externalEntityContentProcessor(parser, start, end, endPtr); in cdataSectionProcessor()
3693 parser->m_processor = contentProcessor; in cdataSectionProcessor()
3694 return contentProcessor(parser, start, end, endPtr); in cdataSectionProcessor()
3704 doCdataSection(XML_Parser parser, in doCdataSection() argument
3714 if (enc == parser->m_encoding) { in doCdataSection()
3715 eventPP = &parser->m_eventPtr; in doCdataSection()
3717 eventEndPP = &parser->m_eventEndPtr; in doCdataSection()
3720 eventPP = &(parser->m_openInternalEntities->internalEventPtr); in doCdataSection()
3721 eventEndPP = &(parser->m_openInternalEntities->internalEventEndPtr); in doCdataSection()
3732 if (parser->m_endCdataSectionHandler) in doCdataSection()
3733 parser->m_endCdataSectionHandler(parser->m_handlerArg); in doCdataSection()
3736 else if (parser->m_characterDataHandler) in doCdataSection()
3737 parser->m_characterDataHandler(parser->m_handlerArg, parser->m_dataBuf, 0); in doCdataSection()
3739 else if (parser->m_defaultHandler) in doCdataSection()
3740 reportDefault(parser, enc, s, next); in doCdataSection()
3743 if (parser->m_parsingStatus.parsing == XML_FINISHED) in doCdataSection()
3748 if (parser->m_characterDataHandler) { in doCdataSection()
3750 parser->m_characterDataHandler(parser->m_handlerArg, &c, 1); in doCdataSection()
3752 else if (parser->m_defaultHandler) in doCdataSection()
3753 reportDefault(parser, enc, s, next); in doCdataSection()
3757 XML_CharacterDataHandler charDataHandler = parser->m_characterDataHandler; in doCdataSection()
3761 ICHAR *dataPtr = (ICHAR *)parser->m_dataBuf; in doCdataSection()
3762 …ML_Convert_Result convert_res = XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)parser->m_dataBufEnd); in doCdataSection()
3764 charDataHandler(parser->m_handlerArg, parser->m_dataBuf, in doCdataSection()
3765 (int)(dataPtr - (ICHAR *)parser->m_dataBuf)); in doCdataSection()
3772 charDataHandler(parser->m_handlerArg, in doCdataSection()
3776 else if (parser->m_defaultHandler) in doCdataSection()
3777 reportDefault(parser, enc, s, next); in doCdataSection()
3810 switch (parser->m_parsingStatus.parsing) { in doCdataSection()
3828 ignoreSectionProcessor(XML_Parser parser, in ignoreSectionProcessor() argument
3833 enum XML_Error result = doIgnoreSection(parser, parser->m_encoding, &start, end, in ignoreSectionProcessor()
3834 endPtr, (XML_Bool)!parser->m_parsingStatus.finalBuffer); in ignoreSectionProcessor()
3838 parser->m_processor = prologProcessor; in ignoreSectionProcessor()
3839 return prologProcessor(parser, start, end, endPtr); in ignoreSectionProcessor()
3848 doIgnoreSection(XML_Parser parser, in doIgnoreSection() argument
3860 if (enc == parser->m_encoding) { in doIgnoreSection()
3861 eventPP = &parser->m_eventPtr; in doIgnoreSection()
3863 eventEndPP = &parser->m_eventEndPtr; in doIgnoreSection()
3877 eventPP = &(parser->m_openInternalEntities->internalEventPtr); in doIgnoreSection()
3878 eventEndPP = &(parser->m_openInternalEntities->internalEventEndPtr); in doIgnoreSection()
3887 if (parser->m_defaultHandler) in doIgnoreSection()
3888 reportDefault(parser, enc, s, next); in doIgnoreSection()
3891 if (parser->m_parsingStatus.parsing == XML_FINISHED) in doIgnoreSection()
3929 initializeEncoding(XML_Parser parser) in initializeEncoding() argument
3935 if (!parser->m_protocolEncodingName) in initializeEncoding()
3939 for (i = 0; parser->m_protocolEncodingName[i]; i++) { in initializeEncoding()
3941 || (parser->m_protocolEncodingName[i] & ~0x7f) != 0) { in initializeEncoding()
3945 encodingBuf[i] = (char)parser->m_protocolEncodingName[i]; in initializeEncoding()
3951 s = parser->m_protocolEncodingName; in initializeEncoding()
3953 …if ((parser->m_ns ? XmlInitEncodingNS : XmlInitEncoding)(&parser->m_initEncoding, &parser->m_encod… in initializeEncoding()
3955 return handleUnknownEncoding(parser, parser->m_protocolEncodingName); in initializeEncoding()
3959 processXmlDecl(XML_Parser parser, int isGeneralTextEntity, in processXmlDecl() argument
3969 if (!(parser->m_ns in processXmlDecl()
3972 parser->m_encoding, in processXmlDecl()
3975 &parser->m_eventPtr, in processXmlDecl()
3987 parser->m_dtd->standalone = XML_TRUE; in processXmlDecl()
3989 if (parser->m_paramEntityParsing == XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE) in processXmlDecl()
3990 parser->m_paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER; in processXmlDecl()
3993 if (parser->m_xmlDeclHandler) { in processXmlDecl()
3995 storedEncName = poolStoreString(&parser->m_temp2Pool, in processXmlDecl()
3996 parser->m_encoding, in processXmlDecl()
3999 + XmlNameLength(parser->m_encoding, encodingName)); in processXmlDecl()
4002 poolFinish(&parser->m_temp2Pool); in processXmlDecl()
4005 storedversion = poolStoreString(&parser->m_temp2Pool, in processXmlDecl()
4006 parser->m_encoding, in processXmlDecl()
4008 versionend - parser->m_encoding->minBytesPerChar); in processXmlDecl()
4012 parser->m_xmlDeclHandler(parser->m_handlerArg, storedversion, storedEncName, standalone); in processXmlDecl()
4014 else if (parser->m_defaultHandler) in processXmlDecl()
4015 reportDefault(parser, parser->m_encoding, s, next); in processXmlDecl()
4016 if (parser->m_protocolEncodingName == NULL) { in processXmlDecl()
4023 if (newEncoding->minBytesPerChar != parser->m_encoding->minBytesPerChar in processXmlDecl()
4025 newEncoding != parser->m_encoding)) { in processXmlDecl()
4026 parser->m_eventPtr = encodingName; in processXmlDecl()
4029 parser->m_encoding = newEncoding; in processXmlDecl()
4035 &parser->m_temp2Pool, parser->m_encoding, encodingName, in processXmlDecl()
4036 encodingName + XmlNameLength(parser->m_encoding, encodingName)); in processXmlDecl()
4040 result = handleUnknownEncoding(parser, storedEncName); in processXmlDecl()
4041 poolClear(&parser->m_temp2Pool); in processXmlDecl()
4043 parser->m_eventPtr = encodingName; in processXmlDecl()
4049 poolClear(&parser->m_temp2Pool); in processXmlDecl()
4055 handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName) in handleUnknownEncoding() argument
4057 if (parser->m_unknownEncodingHandler) { in handleUnknownEncoding()
4065 if (parser->m_unknownEncodingHandler(parser->m_unknownEncodingHandlerData, encodingName, in handleUnknownEncoding()
4068 parser->m_unknownEncodingMem = MALLOC(parser, XmlSizeOfUnknownEncoding()); in handleUnknownEncoding()
4069 if (!parser->m_unknownEncodingMem) { in handleUnknownEncoding()
4074 enc = (parser->m_ns in handleUnknownEncoding()
4076 : XmlInitUnknownEncoding)(parser->m_unknownEncodingMem, in handleUnknownEncoding()
4081 parser->m_unknownEncodingData = info.data; in handleUnknownEncoding()
4082 parser->m_unknownEncodingRelease = info.release; in handleUnknownEncoding()
4083 parser->m_encoding = enc; in handleUnknownEncoding()
4094 prologInitProcessor(XML_Parser parser, in prologInitProcessor() argument
4099 enum XML_Error result = initializeEncoding(parser); in prologInitProcessor()
4102 parser->m_processor = prologProcessor; in prologInitProcessor()
4103 return prologProcessor(parser, s, end, nextPtr); in prologInitProcessor()
4109 externalParEntInitProcessor(XML_Parser parser, in externalParEntInitProcessor() argument
4114 enum XML_Error result = initializeEncoding(parser); in externalParEntInitProcessor()
4120 parser->m_dtd->paramEntityRead = XML_TRUE; in externalParEntInitProcessor()
4122 if (parser->m_prologState.inEntityValue) { in externalParEntInitProcessor()
4123 parser->m_processor = entityValueInitProcessor; in externalParEntInitProcessor()
4124 return entityValueInitProcessor(parser, s, end, nextPtr); in externalParEntInitProcessor()
4127 parser->m_processor = externalParEntProcessor; in externalParEntInitProcessor()
4128 return externalParEntProcessor(parser, s, end, nextPtr); in externalParEntInitProcessor()
4133 entityValueInitProcessor(XML_Parser parser, in entityValueInitProcessor() argument
4141 parser->m_eventPtr = start; in entityValueInitProcessor()
4144 tok = XmlPrologTok(parser->m_encoding, start, end, &next); in entityValueInitProcessor()
4145 parser->m_eventEndPtr = next; in entityValueInitProcessor()
4147 if (!parser->m_parsingStatus.finalBuffer && tok != XML_TOK_INVALID) { in entityValueInitProcessor()
4163 return storeEntityValue(parser, parser->m_encoding, s, end); in entityValueInitProcessor()
4167 result = processXmlDecl(parser, 0, start, next); in entityValueInitProcessor()
4175 if (parser->m_parsingStatus.parsing == XML_FINISHED) in entityValueInitProcessor()
4179 parser->m_processor = entityValueProcessor; in entityValueInitProcessor()
4180 return entityValueProcessor(parser, next, end, nextPtr); in entityValueInitProcessor()
4189 else if (tok == XML_TOK_BOM && next == end && !parser->m_parsingStatus.finalBuffer) { in entityValueInitProcessor()
4202 parser->m_eventPtr = start; in entityValueInitProcessor()
4207 externalParEntProcessor(XML_Parser parser, in externalParEntProcessor() argument
4215 tok = XmlPrologTok(parser->m_encoding, s, end, &next); in externalParEntProcessor()
4217 if (!parser->m_parsingStatus.finalBuffer && tok != XML_TOK_INVALID) { in externalParEntProcessor()
4239 tok = XmlPrologTok(parser->m_encoding, s, end, &next); in externalParEntProcessor()
4242 parser->m_processor = prologProcessor; in externalParEntProcessor()
4243 return doProlog(parser, parser->m_encoding, s, end, tok, next, in externalParEntProcessor()
4244 nextPtr, (XML_Bool)!parser->m_parsingStatus.finalBuffer); in externalParEntProcessor()
4248 entityValueProcessor(XML_Parser parser, in entityValueProcessor() argument
4255 const ENCODING *enc = parser->m_encoding; in entityValueProcessor()
4261 if (!parser->m_parsingStatus.finalBuffer && tok != XML_TOK_INVALID) { in entityValueProcessor()
4277 return storeEntityValue(parser, enc, s, end); in entityValueProcessor()
4286 prologProcessor(XML_Parser parser, in prologProcessor() argument
4292 int tok = XmlPrologTok(parser->m_encoding, s, end, &next); in prologProcessor()
4293 return doProlog(parser, parser->m_encoding, s, end, tok, next, in prologProcessor()
4294 nextPtr, (XML_Bool)!parser->m_parsingStatus.finalBuffer); in prologProcessor()
4298 doProlog(XML_Parser parser, in doProlog() argument
4331 DTD * const dtd = parser->m_dtd; in doProlog()
4337 if (enc == parser->m_encoding) { in doProlog()
4338 eventPP = &parser->m_eventPtr; in doProlog()
4339 eventEndPP = &parser->m_eventEndPtr; in doProlog()
4342 eventPP = &(parser->m_openInternalEntities->internalEventPtr); in doProlog()
4343 eventEndPP = &(parser->m_openInternalEntities->internalEventEndPtr); in doProlog()
4370 if (enc != parser->m_encoding && !parser->m_openInternalEntities->betweenDecl) { in doProlog()
4378 if (parser->m_isParamEntity || enc != parser->m_encoding) { in doProlog()
4379 if (XmlTokenRole(&parser->m_prologState, XML_TOK_NONE, end, end, enc) in doProlog()
4393 role = XmlTokenRole(&parser->m_prologState, tok, s, next, enc); in doProlog()
4397 enum XML_Error result = processXmlDecl(parser, 0, s, next); in doProlog()
4400 enc = parser->m_encoding; in doProlog()
4405 if (parser->m_startDoctypeDeclHandler) { in doProlog()
4406 parser->m_doctypeName = poolStoreString(&parser->m_tempPool, enc, s, next); in doProlog()
4407 if (!parser->m_doctypeName) in doProlog()
4409 poolFinish(&parser->m_tempPool); in doProlog()
4410 parser->m_doctypePubid = NULL; in doProlog()
4413 parser->m_doctypeSysid = NULL; /* always initialize to NULL */ in doProlog()
4416 if (parser->m_startDoctypeDeclHandler) { in doProlog()
4417parser->m_startDoctypeDeclHandler(parser->m_handlerArg, parser->m_doctypeName, parser->m_doctypeSy… in doProlog()
4418 parser->m_doctypePubid, 1); in doProlog()
4419 parser->m_doctypeName = NULL; in doProlog()
4420 poolClear(&parser->m_tempPool); in doProlog()
4427 enum XML_Error result = processXmlDecl(parser, 1, s, next); in doProlog()
4430 enc = parser->m_encoding; in doProlog()
4437 parser->m_useForeignDTD = XML_FALSE; in doProlog()
4438 parser->m_declEntity = (ENTITY *)lookup(parser, in doProlog()
4442 if (!parser->m_declEntity) in doProlog()
4446 if (parser->m_startDoctypeDeclHandler) { in doProlog()
4450 pubId = poolStoreString(&parser->m_tempPool, enc, in doProlog()
4456 poolFinish(&parser->m_tempPool); in doProlog()
4457 parser->m_doctypePubid = pubId; in doProlog()
4466 if (dtd->keepProcessing && parser->m_declEntity) { in doProlog()
4474 parser->m_declEntity->publicId = tem; in doProlog()
4479 if (parser->m_entityDeclHandler && role == XML_ROLE_ENTITY_PUBLIC_ID) in doProlog()
4484 if (parser->m_doctypeName) { in doProlog()
4485 parser->m_startDoctypeDeclHandler(parser->m_handlerArg, parser->m_doctypeName, in doProlog()
4486 parser->m_doctypeSysid, parser->m_doctypePubid, 0); in doProlog()
4487 poolClear(&parser->m_tempPool); in doProlog()
4495 if (parser->m_doctypeSysid || parser->m_useForeignDTD) { in doProlog()
4498 if (parser->m_paramEntityParsing && parser->m_externalEntityRefHandler) { in doProlog()
4499 ENTITY *entity = (ENTITY *)lookup(parser, in doProlog()
4511 if (parser->m_useForeignDTD) in doProlog()
4512 entity->base = parser->m_curBase; in doProlog()
4514 if (!parser->m_externalEntityRefHandler(parser->m_externalEntityRefHandlerArg, in doProlog()
4522 parser->m_notStandaloneHandler && in doProlog()
4523 !parser->m_notStandaloneHandler(parser->m_handlerArg)) in doProlog()
4529 else if (!parser->m_doctypeSysid) in doProlog()
4533 parser->m_useForeignDTD = XML_FALSE; in doProlog()
4536 if (parser->m_endDoctypeDeclHandler) { in doProlog()
4537 parser->m_endDoctypeDeclHandler(parser->m_handlerArg); in doProlog()
4546 if (parser->m_useForeignDTD) { in doProlog()
4549 if (parser->m_paramEntityParsing && parser->m_externalEntityRefHandler) { in doProlog()
4550 ENTITY *entity = (ENTITY *)lookup(parser, &dtd->paramEntities, in doProlog()
4555 entity->base = parser->m_curBase; in doProlog()
4557 if (!parser->m_externalEntityRefHandler(parser->m_externalEntityRefHandlerArg, in doProlog()
4565 parser->m_notStandaloneHandler && in doProlog()
4566 !parser->m_notStandaloneHandler(parser->m_handlerArg)) in doProlog()
4578 parser->m_processor = contentProcessor; in doProlog()
4579 return contentProcessor(parser, s, end, nextPtr); in doProlog()
4581 parser->m_declElementType = getElementType(parser, enc, s, next); in doProlog()
4582 if (!parser->m_declElementType) in doProlog()
4586 parser->m_declAttributeId = getAttributeId(parser, enc, s, next); in doProlog()
4587 if (!parser->m_declAttributeId) in doProlog()
4589 parser->m_declAttributeIsCdata = XML_FALSE; in doProlog()
4590 parser->m_declAttributeType = NULL; in doProlog()
4591 parser->m_declAttributeIsId = XML_FALSE; in doProlog()
4594 parser->m_declAttributeIsCdata = XML_TRUE; in doProlog()
4595 parser->m_declAttributeType = atypeCDATA; in doProlog()
4598 parser->m_declAttributeIsId = XML_TRUE; in doProlog()
4599 parser->m_declAttributeType = atypeID; in doProlog()
4602 parser->m_declAttributeType = atypeIDREF; in doProlog()
4605 parser->m_declAttributeType = atypeIDREFS; in doProlog()
4608 parser->m_declAttributeType = atypeENTITY; in doProlog()
4611 parser->m_declAttributeType = atypeENTITIES; in doProlog()
4614 parser->m_declAttributeType = atypeNMTOKEN; in doProlog()
4617 parser->m_declAttributeType = atypeNMTOKENS; in doProlog()
4619 if (dtd->keepProcessing && parser->m_attlistDeclHandler) in doProlog()
4624 if (dtd->keepProcessing && parser->m_attlistDeclHandler) { in doProlog()
4626 if (parser->m_declAttributeType) { in doProlog()
4634 if (!poolAppendString(&parser->m_tempPool, prefix)) in doProlog()
4636 if (!poolAppend(&parser->m_tempPool, enc, s, next)) in doProlog()
4638 parser->m_declAttributeType = parser->m_tempPool.start; in doProlog()
4645 if (!defineAttribute(parser->m_declElementType, parser->m_declAttributeId, in doProlog()
4646 parser->m_declAttributeIsCdata, parser->m_declAttributeIsId, in doProlog()
4647 0, parser)) in doProlog()
4649 if (parser->m_attlistDeclHandler && parser->m_declAttributeType) { in doProlog()
4650 if (*parser->m_declAttributeType == XML_T(ASCII_LPAREN) in doProlog()
4651 || (*parser->m_declAttributeType == XML_T(ASCII_N) in doProlog()
4652 && parser->m_declAttributeType[1] == XML_T(ASCII_O))) { in doProlog()
4654 if (!poolAppendChar(&parser->m_tempPool, XML_T(ASCII_RPAREN)) in doProlog()
4655 || !poolAppendChar(&parser->m_tempPool, XML_T('\0'))) in doProlog()
4657 parser->m_declAttributeType = parser->m_tempPool.start; in doProlog()
4658 poolFinish(&parser->m_tempPool); in doProlog()
4661 parser->m_attlistDeclHandler(parser->m_handlerArg, parser->m_declElementType->name, in doProlog()
4662 parser->m_declAttributeId->name, parser->m_declAttributeType, in doProlog()
4664 poolClear(&parser->m_tempPool); in doProlog()
4674 storeAttributeValue(parser, enc, parser->m_declAttributeIsCdata, in doProlog()
4683 if (!defineAttribute(parser->m_declElementType, parser->m_declAttributeId, in doProlog()
4684 parser->m_declAttributeIsCdata, XML_FALSE, attVal, parser)) in doProlog()
4686 if (parser->m_attlistDeclHandler && parser->m_declAttributeType) { in doProlog()
4687 if (*parser->m_declAttributeType == XML_T(ASCII_LPAREN) in doProlog()
4688 || (*parser->m_declAttributeType == XML_T(ASCII_N) in doProlog()
4689 && parser->m_declAttributeType[1] == XML_T(ASCII_O))) { in doProlog()
4691 if (!poolAppendChar(&parser->m_tempPool, XML_T(ASCII_RPAREN)) in doProlog()
4692 || !poolAppendChar(&parser->m_tempPool, XML_T('\0'))) in doProlog()
4694 parser->m_declAttributeType = parser->m_tempPool.start; in doProlog()
4695 poolFinish(&parser->m_tempPool); in doProlog()
4698 parser->m_attlistDeclHandler(parser->m_handlerArg, parser->m_declElementType->name, in doProlog()
4699 parser->m_declAttributeId->name, parser->m_declAttributeType, in doProlog()
4702 poolClear(&parser->m_tempPool); in doProlog()
4709 enum XML_Error result = storeEntityValue(parser, enc, in doProlog()
4712 if (parser->m_declEntity) { in doProlog()
4713 parser->m_declEntity->textPtr = poolStart(&dtd->entityValuePool); in doProlog()
4714 parser->m_declEntity->textLen = (int)(poolLength(&dtd->entityValuePool)); in doProlog()
4716 if (parser->m_entityDeclHandler) { in doProlog()
4718 parser->m_entityDeclHandler(parser->m_handlerArg, in doProlog()
4719 parser->m_declEntity->name, in doProlog()
4720 parser->m_declEntity->is_param, in doProlog()
4721 parser->m_declEntity->textPtr, in doProlog()
4722 parser->m_declEntity->textLen, in doProlog()
4723 parser->m_curBase, 0, 0, 0); in doProlog()
4735 parser->m_useForeignDTD = XML_FALSE; in doProlog()
4738 if (parser->m_startDoctypeDeclHandler) { in doProlog()
4739 parser->m_doctypeSysid = poolStoreString(&parser->m_tempPool, enc, in doProlog()
4742 if (parser->m_doctypeSysid == NULL) in doProlog()
4744 poolFinish(&parser->m_tempPool); in doProlog()
4751 parser->m_doctypeSysid = externalSubsetName; in doProlog()
4755 && !parser->m_paramEntityParsing in doProlog()
4757 && parser->m_notStandaloneHandler in doProlog()
4758 && !parser->m_notStandaloneHandler(parser->m_handlerArg)) in doProlog()
4763 if (!parser->m_declEntity) { in doProlog()
4764 parser->m_declEntity = (ENTITY *)lookup(parser, in doProlog()
4768 if (!parser->m_declEntity) in doProlog()
4770 parser->m_declEntity->publicId = NULL; in doProlog()
4775 if (dtd->keepProcessing && parser->m_declEntity) { in doProlog()
4776 parser->m_declEntity->systemId = poolStoreString(&dtd->pool, enc, in doProlog()
4779 if (!parser->m_declEntity->systemId) in doProlog()
4781 parser->m_declEntity->base = parser->m_curBase; in doProlog()
4786 if (parser->m_entityDeclHandler && role == XML_ROLE_ENTITY_SYSTEM_ID) in doProlog()
4791 if (dtd->keepProcessing && parser->m_declEntity && parser->m_entityDeclHandler) { in doProlog()
4793 parser->m_entityDeclHandler(parser->m_handlerArg, in doProlog()
4794 parser->m_declEntity->name, in doProlog()
4795 parser->m_declEntity->is_param, in doProlog()
4797 parser->m_declEntity->base, in doProlog()
4798 parser->m_declEntity->systemId, in doProlog()
4799 parser->m_declEntity->publicId, in doProlog()
4805 if (dtd->keepProcessing && parser->m_declEntity) { in doProlog()
4806 parser->m_declEntity->notation = poolStoreString(&dtd->pool, enc, s, next); in doProlog()
4807 if (!parser->m_declEntity->notation) in doProlog()
4810 if (parser->m_unparsedEntityDeclHandler) { in doProlog()
4812 parser->m_unparsedEntityDeclHandler(parser->m_handlerArg, in doProlog()
4813 parser->m_declEntity->name, in doProlog()
4814 parser->m_declEntity->base, in doProlog()
4815 parser->m_declEntity->systemId, in doProlog()
4816 parser->m_declEntity->publicId, in doProlog()
4817 parser->m_declEntity->notation); in doProlog()
4820 else if (parser->m_entityDeclHandler) { in doProlog()
4822 parser->m_entityDeclHandler(parser->m_handlerArg, in doProlog()
4823 parser->m_declEntity->name, in doProlog()
4825 parser->m_declEntity->base, in doProlog()
4826 parser->m_declEntity->systemId, in doProlog()
4827 parser->m_declEntity->publicId, in doProlog()
4828 parser->m_declEntity->notation); in doProlog()
4836 parser->m_declEntity = NULL; in doProlog()
4843 parser->m_declEntity = (ENTITY *)lookup(parser, &dtd->generalEntities, name, in doProlog()
4845 if (!parser->m_declEntity) in doProlog()
4847 if (parser->m_declEntity->name != name) { in doProlog()
4849 parser->m_declEntity = NULL; in doProlog()
4853 parser->m_declEntity->publicId = NULL; in doProlog()
4854 parser->m_declEntity->is_param = XML_FALSE; in doProlog()
4858parser->m_declEntity->is_internal = !(parser->m_parentParser || parser->m_openInternalEntities); in doProlog()
4859 if (parser->m_entityDeclHandler) in doProlog()
4865 parser->m_declEntity = NULL; in doProlog()
4875 parser->m_declEntity = (ENTITY *)lookup(parser, &dtd->paramEntities, in doProlog()
4877 if (!parser->m_declEntity) in doProlog()
4879 if (parser->m_declEntity->name != name) { in doProlog()
4881 parser->m_declEntity = NULL; in doProlog()
4885 parser->m_declEntity->publicId = NULL; in doProlog()
4886 parser->m_declEntity->is_param = XML_TRUE; in doProlog()
4890parser->m_declEntity->is_internal = !(parser->m_parentParser || parser->m_openInternalEntities); in doProlog()
4891 if (parser->m_entityDeclHandler) in doProlog()
4897 parser->m_declEntity = NULL; in doProlog()
4900 parser->m_declEntity = NULL; in doProlog()
4904 parser->m_declNotationPublicId = NULL; in doProlog()
4905 parser->m_declNotationName = NULL; in doProlog()
4906 if (parser->m_notationDeclHandler) { in doProlog()
4907 parser->m_declNotationName = poolStoreString(&parser->m_tempPool, enc, s, next); in doProlog()
4908 if (!parser->m_declNotationName) in doProlog()
4910 poolFinish(&parser->m_tempPool); in doProlog()
4917 if (parser->m_declNotationName) { /* means m_notationDeclHandler != NULL */ in doProlog()
4918 XML_Char *tem = poolStoreString(&parser->m_tempPool, in doProlog()
4925 parser->m_declNotationPublicId = tem; in doProlog()
4926 poolFinish(&parser->m_tempPool); in doProlog()
4931 if (parser->m_declNotationName && parser->m_notationDeclHandler) { in doProlog()
4933 = poolStoreString(&parser->m_tempPool, enc, in doProlog()
4939 parser->m_notationDeclHandler(parser->m_handlerArg, in doProlog()
4940 parser->m_declNotationName, in doProlog()
4941 parser->m_curBase, in doProlog()
4943 parser->m_declNotationPublicId); in doProlog()
4946 poolClear(&parser->m_tempPool); in doProlog()
4949 if (parser->m_declNotationPublicId && parser->m_notationDeclHandler) { in doProlog()
4951 parser->m_notationDeclHandler(parser->m_handlerArg, in doProlog()
4952 parser->m_declNotationName, in doProlog()
4953 parser->m_curBase, in doProlog()
4955 parser->m_declNotationPublicId); in doProlog()
4958 poolClear(&parser->m_tempPool); in doProlog()
4975 if (parser->m_defaultHandler) in doProlog()
4976 reportDefault(parser, enc, s, next); in doProlog()
4978 result = doIgnoreSection(parser, enc, &next, end, nextPtr, haveMore); in doProlog()
4982 parser->m_processor = ignoreSectionProcessor; in doProlog()
4989 if (parser->m_prologState.level >= parser->m_groupSize) { in doProlog()
4990 if (parser->m_groupSize) { in doProlog()
4991 char *temp = (char *)REALLOC(parser, parser->m_groupConnector, parser->m_groupSize *= 2); in doProlog()
4993 parser->m_groupSize /= 2; in doProlog()
4996 parser->m_groupConnector = temp; in doProlog()
4998 int *temp = (int *)REALLOC(parser, dtd->scaffIndex, in doProlog()
4999 parser->m_groupSize * sizeof(int)); in doProlog()
5006 parser->m_groupConnector = (char *)MALLOC(parser, parser->m_groupSize = 32); in doProlog()
5007 if (!parser->m_groupConnector) { in doProlog()
5008 parser->m_groupSize = 0; in doProlog()
5013 parser->m_groupConnector[parser->m_prologState.level] = 0; in doProlog()
5015 int myindex = nextScaffoldPart(parser); in doProlog()
5021 if (parser->m_elementDeclHandler) in doProlog()
5026 if (parser->m_groupConnector[parser->m_prologState.level] == ASCII_PIPE) in doProlog()
5028 parser->m_groupConnector[parser->m_prologState.level] = ASCII_COMMA; in doProlog()
5029 if (dtd->in_eldecl && parser->m_elementDeclHandler) in doProlog()
5033 if (parser->m_groupConnector[parser->m_prologState.level] == ASCII_COMMA) in doProlog()
5036 && !parser->m_groupConnector[parser->m_prologState.level] in doProlog()
5042 if (parser->m_elementDeclHandler) in doProlog()
5045 parser->m_groupConnector[parser->m_prologState.level] = ASCII_PIPE; in doProlog()
5051 if (!parser->m_paramEntityParsing) in doProlog()
5061 entity = (ENTITY *)lookup(parser, &dtd->paramEntities, name, 0); in doProlog()
5067 if (parser->m_prologState.documentEntity && in doProlog()
5069 ? !parser->m_openInternalEntities in doProlog()
5100 if ((role == XML_ROLE_PARAM_ENTITY_REF) && parser->m_skippedEntityHandler) { in doProlog()
5101 parser->m_skippedEntityHandler(parser->m_handlerArg, name, 1); in doProlog()
5112 result = processInternalEntity(parser, entity, betweenDecl); in doProlog()
5118 if (parser->m_externalEntityRefHandler) { in doProlog()
5121 if (!parser->m_externalEntityRefHandler(parser->m_externalEntityRefHandlerArg, in doProlog()
5143 parser->m_notStandaloneHandler && in doProlog()
5144 !parser->m_notStandaloneHandler(parser->m_handlerArg)) in doProlog()
5151 if (parser->m_elementDeclHandler) { in doProlog()
5152 parser->m_declElementType = getElementType(parser, enc, s, next); in doProlog()
5153 if (!parser->m_declElementType) in doProlog()
5165 if (parser->m_elementDeclHandler) { in doProlog()
5166 XML_Content * content = (XML_Content *) MALLOC(parser, sizeof(XML_Content)); in doProlog()
5177parser->m_elementDeclHandler(parser->m_handlerArg, parser->m_declElementType->name, content); in doProlog()
5188 if (parser->m_elementDeclHandler) in doProlog()
5212 int myindex = nextScaffoldPart(parser); in doProlog()
5217 el = getElementType(parser, enc, s, nxt); in doProlog()
5225 if (parser->m_elementDeclHandler) in doProlog()
5243 if (parser->m_elementDeclHandler) in doProlog()
5249 XML_Content *model = build_model(parser); in doProlog()
5253parser->m_elementDeclHandler(parser->m_handlerArg, parser->m_declElementType->name, model); in doProlog()
5263 if (!reportProcessingInstruction(parser, enc, s, next)) in doProlog()
5268 if (!reportComment(parser, enc, s, next)) in doProlog()
5280 if (parser->m_startDoctypeDeclHandler) in doProlog()
5284 if (dtd->keepProcessing && parser->m_entityDeclHandler) in doProlog()
5288 if (parser->m_notationDeclHandler) in doProlog()
5292 if (dtd->keepProcessing && parser->m_attlistDeclHandler) in doProlog()
5296 if (parser->m_elementDeclHandler) in doProlog()
5301 if (handleDefault && parser->m_defaultHandler) in doProlog()
5302 reportDefault(parser, enc, s, next); in doProlog()
5304 switch (parser->m_parsingStatus.parsing) { in doProlog()
5319 epilogProcessor(XML_Parser parser, in epilogProcessor() argument
5324 parser->m_processor = epilogProcessor; in epilogProcessor()
5325 parser->m_eventPtr = s; in epilogProcessor()
5328 int tok = XmlPrologTok(parser->m_encoding, s, end, &next); in epilogProcessor()
5329 parser->m_eventEndPtr = next; in epilogProcessor()
5333 if (parser->m_defaultHandler) { in epilogProcessor()
5334 reportDefault(parser, parser->m_encoding, s, next); in epilogProcessor()
5335 if (parser->m_parsingStatus.parsing == XML_FINISHED) in epilogProcessor()
5344 if (parser->m_defaultHandler) in epilogProcessor()
5345 reportDefault(parser, parser->m_encoding, s, next); in epilogProcessor()
5348 if (!reportProcessingInstruction(parser, parser->m_encoding, s, next)) in epilogProcessor()
5352 if (!reportComment(parser, parser->m_encoding, s, next)) in epilogProcessor()
5356 parser->m_eventPtr = next; in epilogProcessor()
5359 if (!parser->m_parsingStatus.finalBuffer) { in epilogProcessor()
5365 if (!parser->m_parsingStatus.finalBuffer) { in epilogProcessor()
5373 parser->m_eventPtr = s = next; in epilogProcessor()
5374 switch (parser->m_parsingStatus.parsing) { in epilogProcessor()
5386 processInternalEntity(XML_Parser parser, ENTITY *entity, in processInternalEntity() argument
5394 if (parser->m_freeInternalEntities) { in processInternalEntity()
5395 openEntity = parser->m_freeInternalEntities; in processInternalEntity()
5396 parser->m_freeInternalEntities = openEntity->next; in processInternalEntity()
5399 openEntity = (OPEN_INTERNAL_ENTITY *)MALLOC(parser, sizeof(OPEN_INTERNAL_ENTITY)); in processInternalEntity()
5405 openEntity->next = parser->m_openInternalEntities; in processInternalEntity()
5406 parser->m_openInternalEntities = openEntity; in processInternalEntity()
5408 openEntity->startTagLevel = parser->m_tagLevel; in processInternalEntity()
5419 int tok = XmlPrologTok(parser->m_internalEncoding, textStart, textEnd, &next); in processInternalEntity()
5420 result = doProlog(parser, parser->m_internalEncoding, textStart, textEnd, tok, in processInternalEntity()
5425 result = doContent(parser, parser->m_tagLevel, parser->m_internalEncoding, textStart, in processInternalEntity()
5429 if (textEnd != next && parser->m_parsingStatus.parsing == XML_SUSPENDED) { in processInternalEntity()
5431 parser->m_processor = internalEntityProcessor; in processInternalEntity()
5435 parser->m_openInternalEntities = openEntity->next; in processInternalEntity()
5437 openEntity->next = parser->m_freeInternalEntities; in processInternalEntity()
5438 parser->m_freeInternalEntities = openEntity; in processInternalEntity()
5445 internalEntityProcessor(XML_Parser parser, in internalEntityProcessor() argument
5454 OPEN_INTERNAL_ENTITY *openEntity = parser->m_openInternalEntities; in internalEntityProcessor()
5466 int tok = XmlPrologTok(parser->m_internalEncoding, textStart, textEnd, &next); in internalEntityProcessor()
5467 result = doProlog(parser, parser->m_internalEncoding, textStart, textEnd, tok, in internalEntityProcessor()
5472 result = doContent(parser, openEntity->startTagLevel, parser->m_internalEncoding, in internalEntityProcessor()
5477 else if (textEnd != next && parser->m_parsingStatus.parsing == XML_SUSPENDED) { in internalEntityProcessor()
5483 parser->m_openInternalEntities = openEntity->next; in internalEntityProcessor()
5485 openEntity->next = parser->m_freeInternalEntities; in internalEntityProcessor()
5486 parser->m_freeInternalEntities = openEntity; in internalEntityProcessor()
5492 parser->m_processor = prologProcessor; in internalEntityProcessor()
5493 tok = XmlPrologTok(parser->m_encoding, s, end, &next); in internalEntityProcessor()
5494 return doProlog(parser, parser->m_encoding, s, end, tok, next, nextPtr, in internalEntityProcessor()
5495 (XML_Bool)!parser->m_parsingStatus.finalBuffer); in internalEntityProcessor()
5500 parser->m_processor = contentProcessor; in internalEntityProcessor()
5502 return doContent(parser, parser->m_parentParser ? 1 : 0, parser->m_encoding, s, end, in internalEntityProcessor()
5503 nextPtr, (XML_Bool)!parser->m_parsingStatus.finalBuffer); in internalEntityProcessor()
5508 errorProcessor(XML_Parser parser, in errorProcessor() argument
5513 return parser->m_errorCode; in errorProcessor()
5517 storeAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata, in storeAttributeValue() argument
5521 enum XML_Error result = appendAttributeValue(parser, enc, isCdata, ptr, in storeAttributeValue()
5533 appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata, in appendAttributeValue() argument
5537 DTD * const dtd = parser->m_dtd; /* save one level of indirection */ in appendAttributeValue()
5545 if (enc == parser->m_encoding) in appendAttributeValue()
5546 parser->m_eventPtr = next; in appendAttributeValue()
5549 if (enc == parser->m_encoding) in appendAttributeValue()
5550 parser->m_eventPtr = ptr; in appendAttributeValue()
5558 if (enc == parser->m_encoding) in appendAttributeValue()
5559 parser->m_eventPtr = ptr; in appendAttributeValue()
5609 name = poolStoreString(&parser->m_temp2Pool, enc, in appendAttributeValue()
5614 entity = (ENTITY *)lookup(parser, &dtd->generalEntities, name, 0); in appendAttributeValue()
5615 poolDiscard(&parser->m_temp2Pool); in appendAttributeValue()
5622 parser->m_prologState.documentEntity && in appendAttributeValue()
5625 ? !parser->m_openInternalEntities in appendAttributeValue()
5649 if (enc == parser->m_encoding) { in appendAttributeValue()
5667 parser->m_eventPtr = ptr; /* LCOV_EXCL_LINE */ in appendAttributeValue()
5672 if (enc == parser->m_encoding) in appendAttributeValue()
5673 parser->m_eventPtr = ptr; in appendAttributeValue()
5677 if (enc == parser->m_encoding) in appendAttributeValue()
5678 parser->m_eventPtr = ptr; in appendAttributeValue()
5685 result = appendAttributeValue(parser, parser->m_internalEncoding, isCdata, in appendAttributeValue()
5706 if (enc == parser->m_encoding) in appendAttributeValue()
5707 parser->m_eventPtr = ptr; in appendAttributeValue()
5717 storeEntityValue(XML_Parser parser, in storeEntityValue() argument
5722 DTD * const dtd = parser->m_dtd; /* save one level of indirection */ in storeEntityValue()
5726 int oldInEntityValue = parser->m_prologState.inEntityValue; in storeEntityValue()
5727 parser->m_prologState.inEntityValue = 1; in storeEntityValue()
5743 if (parser->m_isParamEntity || enc != parser->m_encoding) { in storeEntityValue()
5746 name = poolStoreString(&parser->m_tempPool, enc, in storeEntityValue()
5753 entity = (ENTITY *)lookup(parser, &dtd->paramEntities, name, 0); in storeEntityValue()
5754 poolDiscard(&parser->m_tempPool); in storeEntityValue()
5766 if (enc == parser->m_encoding) in storeEntityValue()
5767 parser->m_eventPtr = entityTextPtr; in storeEntityValue()
5772 if (parser->m_externalEntityRefHandler) { in storeEntityValue()
5775 if (!parser->m_externalEntityRefHandler(parser->m_externalEntityRefHandlerArg, in storeEntityValue()
5793 result = storeEntityValue(parser, in storeEntityValue()
5794 parser->m_internalEncoding, in storeEntityValue()
5807 parser->m_eventPtr = entityTextPtr; in storeEntityValue()
5836 if (enc == parser->m_encoding) in storeEntityValue()
5837 parser->m_eventPtr = entityTextPtr; in storeEntityValue()
5861 if (enc == parser->m_encoding) in storeEntityValue()
5862 parser->m_eventPtr = entityTextPtr; in storeEntityValue()
5866 if (enc == parser->m_encoding) in storeEntityValue()
5867 parser->m_eventPtr = next; in storeEntityValue()
5878 if (enc == parser->m_encoding) in storeEntityValue()
5879 parser->m_eventPtr = entityTextPtr; in storeEntityValue()
5888 parser->m_prologState.inEntityValue = oldInEntityValue; in storeEntityValue()
5917 reportProcessingInstruction(XML_Parser parser, const ENCODING *enc, in reportProcessingInstruction() argument
5923 if (!parser->m_processingInstructionHandler) { in reportProcessingInstruction()
5924 if (parser->m_defaultHandler) in reportProcessingInstruction()
5925 reportDefault(parser, enc, start, end); in reportProcessingInstruction()
5930 target = poolStoreString(&parser->m_tempPool, enc, start, tem); in reportProcessingInstruction()
5933 poolFinish(&parser->m_tempPool); in reportProcessingInstruction()
5934 data = poolStoreString(&parser->m_tempPool, enc, in reportProcessingInstruction()
5940 parser->m_processingInstructionHandler(parser->m_handlerArg, target, data); in reportProcessingInstruction()
5941 poolClear(&parser->m_tempPool); in reportProcessingInstruction()
5946 reportComment(XML_Parser parser, const ENCODING *enc, in reportComment() argument
5950 if (!parser->m_commentHandler) { in reportComment()
5951 if (parser->m_defaultHandler) in reportComment()
5952 reportDefault(parser, enc, start, end); in reportComment()
5955 data = poolStoreString(&parser->m_tempPool, in reportComment()
5962 parser->m_commentHandler(parser->m_handlerArg, data); in reportComment()
5963 poolClear(&parser->m_tempPool); in reportComment()
5968 reportDefault(XML_Parser parser, const ENCODING *enc, in reportDefault() argument
5975 if (enc == parser->m_encoding) { in reportDefault()
5976 eventPP = &parser->m_eventPtr; in reportDefault()
5977 eventEndPP = &parser->m_eventEndPtr; in reportDefault()
5996 eventPP = &(parser->m_openInternalEntities->internalEventPtr); in reportDefault()
5997 eventEndPP = &(parser->m_openInternalEntities->internalEventEndPtr); in reportDefault()
6001 ICHAR *dataPtr = (ICHAR *)parser->m_dataBuf; in reportDefault()
6002 convert_res = XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)parser->m_dataBufEnd); in reportDefault()
6004parser->m_defaultHandler(parser->m_handlerArg, parser->m_dataBuf, (int)(dataPtr - (ICHAR *)parser-… in reportDefault()
6009parser->m_defaultHandler(parser->m_handlerArg, (XML_Char *)s, (int)((XML_Char *)end - (XML_Char *)… in reportDefault()
6015 XML_Bool isId, const XML_Char *value, XML_Parser parser) in defineAttribute() argument
6031 type->defaultAtts = (DEFAULT_ATTRIBUTE *)MALLOC(parser, type->allocDefaultAtts in defineAttribute()
6042 REALLOC(parser, type->defaultAtts, (count * sizeof(DEFAULT_ATTRIBUTE))); in defineAttribute()
6060 setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *elementType) in setElementTypePrefix() argument
6062 DTD * const dtd = parser->m_dtd; /* save one level of indirection */ in setElementTypePrefix()
6074 prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&dtd->pool), in setElementTypePrefix()
6090 getAttributeId(XML_Parser parser, const ENCODING *enc, in getAttributeId() argument
6093 DTD * const dtd = parser->m_dtd; /* save one level of indirection */ in getAttributeId()
6103 id = (ATTRIBUTE_ID *)lookup(parser, &dtd->attributeIds, name, sizeof(ATTRIBUTE_ID)); in getAttributeId()
6110 if (!parser->m_ns) in getAttributeId()
6121 id->prefix = (PREFIX *)lookup(parser, &dtd->prefixes, name + 6, sizeof(PREFIX)); in getAttributeId()
6136 id->prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&dtd->pool), in getAttributeId()
6155 getContext(XML_Parser parser) in getContext() argument
6157 DTD * const dtd = parser->m_dtd; /* save one level of indirection */ in getContext()
6164 if (!poolAppendChar(&parser->m_tempPool, XML_T(ASCII_EQUALS))) in getContext()
6167 if (parser->m_namespaceSeparator) in getContext()
6170 if (!poolAppendChar(&parser->m_tempPool, dtd->defaultPrefix.binding->uri[i])) { in getContext()
6213 if (needSep && !poolAppendChar(&parser->m_tempPool, CONTEXT_SEP)) in getContext()
6216 if (!poolAppendChar(&parser->m_tempPool, *s)) in getContext()
6218 if (!poolAppendChar(&parser->m_tempPool, XML_T(ASCII_EQUALS))) in getContext()
6221 if (parser->m_namespaceSeparator) in getContext()
6224 if (!poolAppendChar(&parser->m_tempPool, prefix->binding->uri[i])) in getContext()
6238 if (needSep && !poolAppendChar(&parser->m_tempPool, CONTEXT_SEP)) in getContext()
6241 if (!poolAppendChar(&parser->m_tempPool, *s)) in getContext()
6246 if (!poolAppendChar(&parser->m_tempPool, XML_T('\0'))) in getContext()
6248 return parser->m_tempPool.start; in getContext()
6252 setContext(XML_Parser parser, const XML_Char *context) in setContext() argument
6254 DTD * const dtd = parser->m_dtd; /* save one level of indirection */ in setContext()
6260 if (!poolAppendChar(&parser->m_tempPool, XML_T('\0'))) in setContext()
6262 e = (ENTITY *)lookup(parser, &dtd->generalEntities, poolStart(&parser->m_tempPool), 0); in setContext()
6268 poolDiscard(&parser->m_tempPool); in setContext()
6272 if (poolLength(&parser->m_tempPool) == 0) in setContext()
6275 if (!poolAppendChar(&parser->m_tempPool, XML_T('\0'))) in setContext()
6277 prefix = (PREFIX *)lookup(parser, &dtd->prefixes, poolStart(&parser->m_tempPool), in setContext()
6281 if (prefix->name == poolStart(&parser->m_tempPool)) { in setContext()
6286 poolDiscard(&parser->m_tempPool); in setContext()
6291 if (!poolAppendChar(&parser->m_tempPool, *context)) in setContext()
6293 if (!poolAppendChar(&parser->m_tempPool, XML_T('\0'))) in setContext()
6295 if (addBinding(parser, prefix, NULL, poolStart(&parser->m_tempPool), in setContext()
6296 &parser->m_inheritedBindings) != XML_ERROR_NONE) in setContext()
6298 poolDiscard(&parser->m_tempPool); in setContext()
6304 if (!poolAppendChar(&parser->m_tempPool, *s)) in setContext()
6658 copy_salt_to_sipkey(XML_Parser parser, struct sipkey * key) in copy_salt_to_sipkey() argument
6661 key->k[1] = get_hash_secret_salt(parser); in copy_salt_to_sipkey()
6665 hash(XML_Parser parser, KEY s) in hash() argument
6670 copy_salt_to_sipkey(parser, &key); in hash()
6677 lookup(XML_Parser parser, HASH_TABLE *table, KEY name, size_t createSize) in lookup() argument
6694 i = hash(parser, name) & ((unsigned long)table->size - 1); in lookup()
6697 unsigned long h = hash(parser, name); in lookup()
6723 unsigned long newHash = hash(parser, table->v[i]->name); in lookup()
7065 nextScaffoldPart(XML_Parser parser) in nextScaffoldPart() argument
7067 DTD * const dtd = parser->m_dtd; /* save one level of indirection */ in nextScaffoldPart()
7072 dtd->scaffIndex = (int *)MALLOC(parser, parser->m_groupSize * sizeof(int)); in nextScaffoldPart()
7082 REALLOC(parser, dtd->scaffold, dtd->scaffSize * 2 * sizeof(CONTENT_SCAFFOLD)); in nextScaffoldPart()
7088 temp = (CONTENT_SCAFFOLD *)MALLOC(parser, INIT_SCAFFOLD_ELEMENTS in nextScaffoldPart()
7113 build_node(XML_Parser parser, in build_node() argument
7119 DTD * const dtd = parser->m_dtd; /* save one level of indirection */ in build_node()
7144 build_node(parser, cn, &(dest->children[i]), contpos, strpos); in build_node()
7151 build_model (XML_Parser parser) in build_model() argument
7153 DTD * const dtd = parser->m_dtd; /* save one level of indirection */ in build_model()
7160 ret = (XML_Content *)MALLOC(parser, allocsize); in build_model()
7167 build_node(parser, 0, ret, &cpos, &str); in build_model()
7172 getElementType(XML_Parser parser, in getElementType() argument
7177 DTD * const dtd = parser->m_dtd; /* save one level of indirection */ in getElementType()
7183 ret = (ELEMENT_TYPE *) lookup(parser, &dtd->elementTypes, name, sizeof(ELEMENT_TYPE)); in getElementType()
7190 if (!setElementTypePrefix(parser, ret)) in getElementType()