ObjFW  Check-in [39f8e079ef]

Overview
Comment:Compare blocks to NULL instead of nil. Some old clang revs require this.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 39f8e079ef71ac326efbf9b457bd973a11dd2d519a5030272bec2eb026a3797f
User & Date: js on 2010-10-24 23:31:54
Other Links: manifest | tags
Context
2010-10-25
17:59
Make OFAllocFailedException base on OFObject. check-in: 2a64b0ca64 user: js tags: trunk
2010-10-24
23:31
Compare blocks to NULL instead of nil. Some old clang revs require this. check-in: 39f8e079ef user: js tags: trunk
22:32
Add -[OFMutableString insertString:atIndex:]. check-in: e9db0f7013 user: js tags: trunk
Changes

Modified src/OFXMLParser.m from [1eee225668] to [38257f6427].

320
321
322
323
324
325
326
327

328
329
330
331
332
333
334
320
321
322
323
324
325
326

327
328
329
330
331
332
333
334







-
+







		OFString *str;
		OFAutoreleasePool *pool;

		pool = [[OFAutoreleasePool alloc] init];
		str = transform_string(cache, self);

#ifdef OF_HAVE_BLOCKS
		if (charactersHandler != nil)
		if (charactersHandler != NULL)
			charactersHandler(self, str);
		else
#endif
			[delegate parser: self
			 foundCharacters: str];

		[pool release];
417
418
419
420
421
422
423
424

425
426
427
428
429
430
431
432
433
434
435
436

437
438
439
440
441
442
443
417
418
419
420
421
422
423

424
425
426
427
428
429
430
431
432
433
434
435

436
437
438
439
440
441
442
443







-
+











-
+







			@throw
			    [OFUnboundNamespaceException newWithClass: isa
							       prefix: prefix];

		pool = [[OFAutoreleasePool alloc] init];

#ifdef OF_HAVE_BLOCKS
		if (elementStartHandler != nil)
		if (elementStartHandler != NULL)
			elementStartHandler(self, name, prefix, ns, nil);
		else
#endif
			[delegate parser: self
			 didStartElement: name
			      withPrefix: prefix
			       namespace: ns
			      attributes: nil];

		if (buf[*i] == '/') {
#ifdef OF_HAVE_BLOCKS
			if (elementEndHandler != nil)
			if (elementEndHandler != NULL)
				elementEndHandler(self, name, prefix, ns);
			else
#endif
				[delegate parser: self
				   didEndElement: name
				      withPrefix: prefix
				       namespace: ns];
510
511
512
513
514
515
516
517

518
519
520
521
522
523
524
510
511
512
513
514
515
516

517
518
519
520
521
522
523
524







-
+







	if (prefix != nil && ns == nil)
		@throw [OFUnboundNamespaceException newWithClass: isa
							  prefix: prefix];

	pool = [[OFAutoreleasePool alloc] init];

#ifdef OF_HAVE_BLOCKS
	if (elementEndHandler != nil)
	if (elementEndHandler != NULL)
		elementEndHandler(self, name, prefix, ns);
	else
#endif
		[delegate parser: self
		   didEndElement: name
		      withPrefix: prefix
		       namespace: ns];
568
569
570
571
572
573
574
575

576
577
578
579
580
581
582
583
584
585
586
587

588
589
590
591
592
593
594
568
569
570
571
572
573
574

575
576
577
578
579
580
581
582
583
584
585
586

587
588
589
590
591
592
593
594







-
+











-
+








	for (j = 0; j < attrs_cnt; j++)
		resolve_attr_namespace(attrs_c[j], prefix, ns, namespaces, isa);

	pool = [[OFAutoreleasePool alloc] init];

#ifdef OF_HAVE_BLOCKS
	if (elementStartHandler != nil)
	if (elementStartHandler != NULL)
		elementStartHandler(self, name, prefix, ns, attrs);
	else
#endif
		[delegate parser: self
		 didStartElement: name
		      withPrefix: prefix
		       namespace: ns
		      attributes: attrs];

	if (buf[*i] == '/') {
#ifdef OF_HAVE_BLOCKS
		if (elementEndHandler != nil)
		if (elementEndHandler != NULL)
			elementEndHandler(self, name, prefix, ns);
		else
#endif
			[delegate parser: self
			   didEndElement: name
			      withPrefix: prefix
			       namespace: ns];
864
865
866
867
868
869
870
871

872
873
874
875
876
877
878
864
865
866
867
868
869
870

871
872
873
874
875
876
877
878







-
+







	cdata = [[cache mutableCopy] autorelease];
	len = [cdata length];

	[cdata removeCharactersFromIndex: len - 2
				 toIndex: len];

#ifdef OF_HAVE_BLOCKS
	if (CDATAHandler != nil)
	if (CDATAHandler != NULL)
		CDATAHandler(self, cdata);
	else
#endif
		[delegate parser: self
		      foundCDATA: cdata];

	[pool release];
931
932
933
934
935
936
937
938

939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957

958
959
960
961
962
963
964
931
932
933
934
935
936
937

938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956

957
958
959
960
961
962
963
964







-
+


















-
+







	comment = [[cache mutableCopy] autorelease];
	len = [comment length];

	[comment removeCharactersFromIndex: len - 2
				   toIndex: len];

#ifdef OF_HAVE_BLOCKS
	if (commentHandler != nil)
	if (commentHandler != NULL)
		commentHandler(self, comment);
	else
#endif
		[delegate parser: self
		    foundComment: comment];

	[pool release];

	[cache setToCString: ""];

	*last = *i + 1;
	state = OF_XMLPARSER_OUTSIDE_TAG;
}

-	   (OFString*)string: (OFString*)string
  containsUnknownEntityNamed: (OFString*)entity
{
#ifdef OF_HAVE_BLOCKS
	if (unknownEntityHandler != nil)
	if (unknownEntityHandler != NULL)
		return unknownEntityHandler(self, entity);
#endif

	return [delegate parser: self
	foundUnknownEntityNamed: entity];
}
@end