@@ -140,29 +140,29 @@ + (void)initialize { size_t i; const SEL selectors_[] = { - @selector(_parseOutsideTagWithBuffer:i:last:), - @selector(_parseTagOpenedWithBuffer:i:last:), - @selector(_parseInProcessingInstructionsWithBuffer:i:last:), - @selector(_parseInTagNameWithBuffer:i:last:), - @selector(_parseInCloseTagNameWithBuffer:i:last:), - @selector(_parseInTagWithBuffer:i:last:), - @selector(_parseInAttributeNameWithBuffer:i:last:), - @selector(_parseExpectDelimiterWithBuffer:i:last:), - @selector(_parseInAttributeValueWithBuffer:i:last:), - @selector(_parseExpectCloseWithBuffer:i:last:), - @selector(_parseExpectSpaceOrCloseWithBuffer:i:last:), - @selector(_parseInExclamationMarkWithBuffer:i:last:), - @selector(_parseInCDATAOpeningWithBuffer:i:last:), - @selector(_parseInCDATA1WithBuffer:i:last:), - @selector(_parseInCDATA2WithBuffer:i:last:), - @selector(_parseInCommentOpeningWithBuffer:i:last:), - @selector(_parseInComment1WithBuffer:i:last:), - @selector(_parseInComment2WithBuffer:i:last:), - @selector(_parseInDoctypeWithBuffer:i:last:), + @selector(OF_parseOutsideTagWithBuffer:i:last:), + @selector(OF_parseTagOpenedWithBuffer:i:last:), + @selector(OF_parseInProcessingInstructionsWithBuffer:i:last:), + @selector(OF_parseInTagNameWithBuffer:i:last:), + @selector(OF_parseInCloseTagNameWithBuffer:i:last:), + @selector(OF_parseInTagWithBuffer:i:last:), + @selector(OF_parseInAttributeNameWithBuffer:i:last:), + @selector(OF_parseExpectDelimiterWithBuffer:i:last:), + @selector(OF_parseInAttributeValueWithBuffer:i:last:), + @selector(OF_parseExpectCloseWithBuffer:i:last:), + @selector(OF_parseExpectSpaceOrCloseWithBuffer:i:last:), + @selector(OF_parseInExclamationMarkWithBuffer:i:last:), + @selector(OF_parseInCDATAOpeningWithBuffer:i:last:), + @selector(OF_parseInCDATA1WithBuffer:i:last:), + @selector(OF_parseInCDATA2WithBuffer:i:last:), + @selector(OF_parseInCommentOpeningWithBuffer:i:last:), + @selector(OF_parseInComment1WithBuffer:i:last:), + @selector(OF_parseInComment2WithBuffer:i:last:), + @selector(OF_parseInDoctypeWithBuffer:i:last:), }; memcpy(selectors, selectors_, sizeof(selectors_)); for (i = 0; i < OF_XMLPARSER_NUM_STATES; i++) { if (![self instancesRespondToSelector: selectors[i]]) @@ -301,13 +301,13 @@ * looked up in +[initialize] and put in a lookup table to speed things up. * One dispatch for every character would be way too slow! */ /* Not in a tag */ -- (void)_parseOutsideTagWithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseOutsideTagWithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { size_t length; if ((finishedParsing || [previous count] < 1) && buffer[*i] != ' ' && buffer[*i] != '\t' && buffer[*i] != '\n' && buffer[*i] != '\r' && @@ -336,13 +336,13 @@ *last = *i + 1; state = OF_XMLPARSER_TAG_OPENED; } /* Tag was just opened */ -- (void)_parseTagOpenedWithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseTagOpenedWithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { if (finishedParsing && buffer[*i] != '!' && buffer[*i] != '?') @throw [OFMalformedXMLException exceptionWithClass: [self class] parser: self]; @@ -369,11 +369,11 @@ break; } } /* */ -- (BOOL)_parseXMLProcessingInstructions: (OFString*)pi +- (BOOL)OF_parseXMLProcessingInstructions: (OFString*)pi { const char *cString; size_t i, last, length; int piState = 0; OFString *attribute = nil; @@ -465,13 +465,13 @@ return YES; } /* Inside processing instructions */ -- (void)_parseInProcessingInstructionsWithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseInProcessingInstructionsWithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { if (buffer[*i] == '?') level = 1; else if (level == 1 && buffer[*i] == '>') { void *pool = objc_autoreleasePoolPush(); @@ -481,11 +481,11 @@ pi = transform_string(cache, 1, NO, nil); if ([pi isEqual: @"xml"] || [pi hasPrefix: @"xml "] || [pi hasPrefix: @"xml\t"] || [pi hasPrefix: @"xml\r"] || [pi hasPrefix: @"xml\n"]) - if (![self _parseXMLProcessingInstructions: pi]) + if (![self OF_parseXMLProcessingInstructions: pi]) @throw [OFMalformedXMLException exceptionWithClass: [self class] parser: self]; [delegate parser: self @@ -500,13 +500,13 @@ } else level = 0; } /* Inside a tag, no name yet */ -- (void)_parseInTagNameWithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseInTagNameWithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { void *pool; const char *cacheCString, *tmp; size_t length, cacheLength; OFString *cacheString; @@ -582,13 +582,13 @@ [cache removeAllItems]; *last = *i + 1; } /* Inside a close tag, no name yet */ -- (void)_parseInCloseTagNameWithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseInCloseTagNameWithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { void *pool; const char *cacheCString, *tmp; size_t length, cacheLength; OFString *cacheString; @@ -654,13 +654,13 @@ if ([previous count] == 0) finishedParsing = YES; } /* Inside a tag, name found */ -- (void)_parseInTagWithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseInTagWithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { void *pool; OFString *ns; OFXMLAttribute **attributesObjects; size_t j, attributesCount; @@ -727,13 +727,13 @@ ? OF_XMLPARSER_EXPECT_CLOSE : OF_XMLPARSER_OUTSIDE_TAG); } /* Looking for attribute name */ -- (void)_parseInAttributeNameWithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseInAttributeNameWithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { void *pool; OFMutableString *cacheString; const char *cacheCString, *tmp; size_t length, cacheLength; @@ -774,13 +774,13 @@ *last = *i + 1; state = OF_XMLPARSER_EXPECT_DELIM; } /* Expecting delimiter */ -- (void)_parseExpectDelimiterWithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseExpectDelimiterWithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { *last = *i + 1; if (buffer[*i] == ' ' || buffer[*i] == '\t' || buffer[*i] == '\n' || buffer[*i] == '\r') @@ -793,13 +793,13 @@ delimiter = buffer[*i]; state = OF_XMLPARSER_IN_ATTR_VALUE; } /* Looking for attribute value */ -- (void)_parseInAttributeValueWithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseInAttributeValueWithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { void *pool; OFString *attributeValue; size_t length; @@ -834,13 +834,13 @@ *last = *i + 1; state = OF_XMLPARSER_IN_TAG; } /* Expecting closing '>' */ -- (void)_parseExpectCloseWithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseExpectCloseWithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { if (buffer[*i] == '>') { *last = *i + 1; state = OF_XMLPARSER_OUTSIDE_TAG; } else @@ -847,13 +847,13 @@ @throw [OFMalformedXMLException exceptionWithClass: [self class] parser: self]; } /* Expecting closing '>' or space */ -- (void)_parseExpectSpaceOrCloseWithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseExpectSpaceOrCloseWithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { if (buffer[*i] == '>') { *last = *i + 1; state = OF_XMLPARSER_OUTSIDE_TAG; } else if (buffer[*i] != ' ' && buffer[*i] != '\t' && @@ -861,13 +861,13 @@ @throw [OFMalformedXMLException exceptionWithClass: [self class] parser: self]; } /* In ') { @@ -945,13 +945,13 @@ *last = *i + 1; state = OF_XMLPARSER_OUTSIDE_TAG; } /* Comment */ -- (void)_parseInCommentOpeningWithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseInCommentOpeningWithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { if (buffer[*i] != '-') @throw [OFMalformedXMLException exceptionWithClass: [self class] parser: self]; @@ -958,13 +958,13 @@ *last = *i + 1; state = OF_XMLPARSER_IN_COMMENT_1; level = 0; } -- (void)_parseInComment1WithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseInComment1WithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { if (buffer[*i] == '-') level++; else level = 0; @@ -971,13 +971,13 @@ if (level == 2) state = OF_XMLPARSER_IN_COMMENT_2; } -- (void)_parseInComment2WithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseInComment2WithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { void *pool; OFString *comment; if (buffer[*i] != '>') @@ -999,13 +999,13 @@ *last = *i + 1; state = OF_XMLPARSER_OUTSIDE_TAG; } /* In */ -- (void)_parseInDoctypeWithBuffer: (const char*)buffer - i: (size_t*)i - last: (size_t*)last +- (void)OF_parseInDoctypeWithBuffer: (const char*)buffer + i: (size_t*)i + last: (size_t*)last { if ((level < 6 && buffer[*i] != "OCTYPE"[level]) || (level == 6 && buffer[*i] != ' ' && buffer[*i] != '\t' && buffer[*i] != '\n' && buffer[*i] != '\r')) @throw [OFMalformedXMLException exceptionWithClass: [self class]