ObjFW  Diff

Differences From Artifact [bf41f38598]:

To Artifact [12e7c5b831]:


28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#import "OFXMLAttribute.h"
#import "OFStream.h"
#import "OFFile.h"
#import "OFSystemInfo.h"

#import "OFInitializationFailedException.h"
#import "OFMalformedXMLException.h"
#import "OFUnboundNamespaceException.h"

#import "autorelease.h"
#import "macros.h"

typedef void (*state_function)(id, SEL);
static SEL selectors[OF_XMLPARSER_NUM_STATES];
static state_function lookupTable[OF_XMLPARSER_NUM_STATES];







|







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#import "OFXMLAttribute.h"
#import "OFStream.h"
#import "OFFile.h"
#import "OFSystemInfo.h"

#import "OFInitializationFailedException.h"
#import "OFMalformedXMLException.h"
#import "OFUnboundPrefixException.h"

#import "autorelease.h"
#import "macros.h"

typedef void (*state_function)(id, SEL);
static SEL selectors[OF_XMLPARSER_NUM_STATES];
static state_function lookupTable[OF_XMLPARSER_NUM_STATES];
122
123
124
125
126
127
128
129
130
131

132
133
134
135
136
137
138

	if (attributePrefix == nil)
		return;

	attributeNS = namespace_for_prefix(attributePrefix, namespaces);

	if ((attributePrefix != nil && attributeNS == nil))
		@throw [OFUnboundNamespaceException
		    exceptionWithClass: [self class]
				prefix: attributePrefix];


	[attribute->_namespace release];
	attribute->_namespace = [attributeNS retain];
}

@implementation OFXMLParser
+ (void)initialize







|

|
>







122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139

	if (attributePrefix == nil)
		return;

	attributeNS = namespace_for_prefix(attributePrefix, namespaces);

	if ((attributePrefix != nil && attributeNS == nil))
		@throw [OFUnboundPrefixException
		    exceptionWithClass: [self class]
				prefix: attributePrefix
				parser: self];

	[attribute->_namespace release];
	attribute->_namespace = [attributeNS retain];
}

@implementation OFXMLParser
+ (void)initialize
578
579
580
581
582
583
584
585
586
587

588
589
590
591
592
593
594

	if (_data[_i] == '>' || _data[_i] == '/') {
		OFString *namespace;

		namespace = namespace_for_prefix(_prefix, _namespaces);

		if (_prefix != nil && namespace == nil)
			@throw [OFUnboundNamespaceException
			    exceptionWithClass: [self class]
					prefix: _prefix];


		if ([_delegate respondsToSelector: @selector(parser:
		    didStartElement:prefix:namespace:attributes:)])
			[_delegate parser: self
			  didStartElement: _name
				   prefix: _prefix
				namespace: namespace







|

|
>







579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596

	if (_data[_i] == '>' || _data[_i] == '/') {
		OFString *namespace;

		namespace = namespace_for_prefix(_prefix, _namespaces);

		if (_prefix != nil && namespace == nil)
			@throw [OFUnboundPrefixException
			    exceptionWithClass: [self class]
					prefix: _prefix
					parser: self];

		if ([_delegate respondsToSelector: @selector(parser:
		    didStartElement:prefix:namespace:attributes:)])
			[_delegate parser: self
			  didStartElement: _name
				   prefix: _prefix
				namespace: namespace
667
668
669
670
671
672
673
674
675
676

677
678
679
680
681
682
683

	[_previous removeLastObject];

	[_buffer removeAllItems];

	namespace = namespace_for_prefix(_prefix, _namespaces);
	if (_prefix != nil && namespace == nil)
		@throw [OFUnboundNamespaceException
		    exceptionWithClass: [self class]
				prefix: _prefix];


	if ([_delegate respondsToSelector:
	    @selector(parser:didEndElement:prefix:namespace:)])
		[_delegate parser: self
		    didEndElement: _name
			   prefix: _prefix
			namespace: namespace];







|

|
>







669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686

	[_previous removeLastObject];

	[_buffer removeAllItems];

	namespace = namespace_for_prefix(_prefix, _namespaces);
	if (_prefix != nil && namespace == nil)
		@throw [OFUnboundPrefixException
		    exceptionWithClass: [self class]
				prefix: _prefix
				parser: self];

	if ([_delegate respondsToSelector:
	    @selector(parser:didEndElement:prefix:namespace:)])
		[_delegate parser: self
		    didEndElement: _name
			   prefix: _prefix
			namespace: namespace];
719
720
721
722
723
724
725
726
727
728

729
730
731
732
733
734
735

	attributesObjects = [_attributes objects];
	attributesCount = [_attributes count];

	namespace = namespace_for_prefix(_prefix, _namespaces);

	if (_prefix != nil && namespace == nil)
		@throw [OFUnboundNamespaceException
		    exceptionWithClass: [self class]
				prefix: _prefix];


	for (j = 0; j < attributesCount; j++)
		resolve_attribute_namespace(attributesObjects[j], _namespaces,
		    self);

	pool = objc_autoreleasePoolPush();








|

|
>







722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739

	attributesObjects = [_attributes objects];
	attributesCount = [_attributes count];

	namespace = namespace_for_prefix(_prefix, _namespaces);

	if (_prefix != nil && namespace == nil)
		@throw [OFUnboundPrefixException
		    exceptionWithClass: [self class]
				prefix: _prefix
				parser: self];

	for (j = 0; j < attributesCount; j++)
		resolve_attribute_namespace(attributesObjects[j], _namespaces,
		    self);

	pool = objc_autoreleasePoolPush();