Overview
Comment: | There is no compiler supporting blocks but not properties. This allows us to always use properties for blocks. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
aaf4e02cb8ccc723e61a7b2cf0a32fbb |
User & Date: | js on 2010-11-21 00:03:05 |
Other Links: | manifest | tags |
Context
2010-11-21
| ||
00:34 | OFXMLParser: Parse processing instructions. check-in: b31d5c02df user: js tags: trunk | |
00:03 |
There is no compiler supporting blocks but not properties. This allows us to always use properties for blocks. check-in: aaf4e02cb8 user: js tags: trunk | |
2010-11-20
| ||
22:57 | Allow debugging & optimization flags to be specified with objfw-compile. check-in: 4708bb6887 user: js tags: trunk | |
Changes
Modified src/OFXMLParser.h from [257797093f] to [3ddff73a69].
︙ | ︙ | |||
13 14 15 16 17 18 19 | #import "OFString.h" #import "OFXMLAttribute.h" @class OFXMLParser; @class OFArray; @class OFMutableArray; | | | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #import "OFString.h" #import "OFXMLAttribute.h" @class OFXMLParser; @class OFArray; @class OFMutableArray; #if defined(OF_HAVE_PROPERTIES) && defined(OF_HAVE_BLOCKS) typedef void (^of_xml_parser_element_start_block_t)(OFXMLParser *parser, OFString *name, OFString *prefix, OFString *ns, OFArray *attrs); typedef void (^of_xml_parser_element_end_block_t)(OFXMLParser *parser, OFString *name, OFString *prefix, OFString *ns); typedef void (^of_xml_parser_string_block_t)(OFXMLParser *parser, OFString *string); typedef OFString* (^of_xml_parser_unknown_entity_block_t)(OFXMLParser *parser, |
︙ | ︙ | |||
140 141 142 143 144 145 146 | OFString *prefix; OFMutableArray *namespaces; OFMutableArray *attrs; OFString *attrName; OFString *attrPrefix; char delim; OFMutableArray *previous; | | | 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | OFString *prefix; OFMutableArray *namespaces; OFMutableArray *attrs; OFString *attrName; OFString *attrPrefix; char delim; OFMutableArray *previous; #if defined(OF_HAVE_PROPERTIES) && defined(OF_HAVE_BLOCKS) of_xml_parser_element_start_block_t elementStartHandler; of_xml_parser_element_end_block_t elementEndHandler; of_xml_parser_string_block_t charactersHandler; of_xml_parser_string_block_t CDATAHandler; of_xml_parser_string_block_t commentHandler; of_xml_parser_unknown_entity_block_t unknownEntityHandler; #endif |
︙ | ︙ | |||
180 181 182 183 184 185 186 | /** * Sets the delegate the OFXMLParser should use. * * \param delegate The delegate to use */ - (void)setDelegate: (id <OFXMLParserDelegate>)delegate; | | | 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | /** * Sets the delegate the OFXMLParser should use. * * \param delegate The delegate to use */ - (void)setDelegate: (id <OFXMLParserDelegate>)delegate; #if defined(OF_HAVE_PROPERTIES) && defined(OF_HAVE_BLOCKS) /** * \return The element start handler */ - (of_xml_parser_element_start_block_t)elementStartHandler; /** * Sets the element start handler. |
︙ | ︙ |
Modified src/OFXMLParser.m from [bcc7e9f4bd] to [aa41ccd975].
︙ | ︙ | |||
75 76 77 78 79 80 81 82 83 84 85 86 87 88 | prefix: attr_prefix]; [attr->ns release]; attr->ns = [attr_ns retain]; } @implementation OFXMLParser + (void)initialize { size_t i; const SEL sels[] = { @selector(_parseOutsideTagWithBuffer:i:last:), @selector(_parseTagOpenedWithBuffer:i:last:), | > > > > > | 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | prefix: attr_prefix]; [attr->ns release]; attr->ns = [attr_ns retain]; } @implementation OFXMLParser #if defined(OF_HAVE_PROPERTIES) && defined(OF_HAVE_BLOCKS) @synthesize elementStartHandler, elementEndHandler, charactersHandler; @synthesize CDATAHandler, commentHandler, unknownEntityHandler; #endif + (void)initialize { size_t i; const SEL sels[] = { @selector(_parseOutsideTagWithBuffer:i:last:), @selector(_parseTagOpenedWithBuffer:i:last:), |
︙ | ︙ | |||
155 156 157 158 159 160 161 | [name release]; [prefix release]; [namespaces release]; [attrs release]; [attrName release]; [attrPrefix release]; [previous release]; | | | 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | [name release]; [prefix release]; [namespaces release]; [attrs release]; [attrName release]; [attrPrefix release]; [previous release]; #if defined(OF_HAVE_PROPERTIES) && defined(OF_HAVE_BLOCKS) [elementStartHandler release]; [elementEndHandler release]; [charactersHandler release]; [CDATAHandler release]; [commentHandler release]; [unknownEntityHandler release]; #endif |
︙ | ︙ | |||
179 180 181 182 183 184 185 | - (void)setDelegate: (id <OFXMLParserDelegate>)delegate_ { [(id)delegate_ retain]; [(id)delegate release]; delegate = delegate_; } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | - (void)setDelegate: (id <OFXMLParserDelegate>)delegate_ { [(id)delegate_ retain]; [(id)delegate release]; delegate = delegate_; } - (void)parseBuffer: (const char*)buf withSize: (size_t)size { size_t i, last = 0; for (i = 0; i < size; i++) lookup_table[state](self, selectors[state], buf, &i, &last); |
︙ | ︙ | |||
325 326 327 328 329 330 331 | if ([cache cStringLength] > 0) { OFString *str; OFAutoreleasePool *pool; pool = [[OFAutoreleasePool alloc] init]; str = transform_string(cache, self); | | | 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 | if ([cache cStringLength] > 0) { OFString *str; OFAutoreleasePool *pool; pool = [[OFAutoreleasePool alloc] init]; str = transform_string(cache, self); #if defined(OF_HAVE_PROPERTIES) && defined(OF_HAVE_BLOCKS) if (charactersHandler != NULL) charactersHandler(self, str); else #endif [delegate parser: self foundCharacters: str]; |
︙ | ︙ | |||
421 422 423 424 425 426 427 | if (prefix != nil && ns == nil) @throw [OFUnboundNamespaceException newWithClass: isa prefix: prefix]; pool = [[OFAutoreleasePool alloc] init]; | | | | 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 | if (prefix != nil && ns == nil) @throw [OFUnboundNamespaceException newWithClass: isa prefix: prefix]; pool = [[OFAutoreleasePool alloc] init]; #if defined(OF_HAVE_PROPERTIES) && defined(OF_HAVE_BLOCKS) 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] == '/') { #if defined(OF_HAVE_PROPERTIES) && defined(OF_HAVE_BLOCKS) if (elementEndHandler != NULL) elementEndHandler(self, name, prefix, ns); else #endif [delegate parser: self didEndElement: name withPrefix: prefix |
︙ | ︙ | |||
514 515 516 517 518 519 520 | ns = namespace_for_prefix(prefix, namespaces); if (prefix != nil && ns == nil) @throw [OFUnboundNamespaceException newWithClass: isa prefix: prefix]; pool = [[OFAutoreleasePool alloc] init]; | | | 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 | ns = namespace_for_prefix(prefix, namespaces); if (prefix != nil && ns == nil) @throw [OFUnboundNamespaceException newWithClass: isa prefix: prefix]; pool = [[OFAutoreleasePool alloc] init]; #if defined(OF_HAVE_PROPERTIES) && defined(OF_HAVE_BLOCKS) if (elementEndHandler != NULL) elementEndHandler(self, name, prefix, ns); else #endif [delegate parser: self didEndElement: name withPrefix: prefix |
︙ | ︙ | |||
572 573 574 575 576 577 578 | prefix: prefix]; for (j = 0; j < attrs_cnt; j++) resolve_attr_namespace(attrs_c[j], prefix, ns, namespaces, isa); pool = [[OFAutoreleasePool alloc] init]; | | | | 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 | prefix: prefix]; for (j = 0; j < attrs_cnt; j++) resolve_attr_namespace(attrs_c[j], prefix, ns, namespaces, isa); pool = [[OFAutoreleasePool alloc] init]; #if defined(OF_HAVE_PROPERTIES) && defined(OF_HAVE_BLOCKS) 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] == '/') { #if defined(OF_HAVE_PROPERTIES) && defined(OF_HAVE_BLOCKS) if (elementEndHandler != NULL) elementEndHandler(self, name, prefix, ns); else #endif [delegate parser: self didEndElement: name withPrefix: prefix |
︙ | ︙ | |||
808 809 810 811 812 813 814 | length: *i - *last]; cdata = [[cache mutableCopy] autorelease]; len = [cdata length]; [cdata removeCharactersFromIndex: len - 2 toIndex: len]; | | | 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 | length: *i - *last]; cdata = [[cache mutableCopy] autorelease]; len = [cdata length]; [cdata removeCharactersFromIndex: len - 2 toIndex: len]; #if defined(OF_HAVE_PROPERTIES) && defined(OF_HAVE_BLOCKS) if (CDATAHandler != NULL) CDATAHandler(self, cdata); else #endif [delegate parser: self foundCDATA: cdata]; |
︙ | ︙ | |||
871 872 873 874 875 876 877 | length: *i - *last]; comment = [[cache mutableCopy] autorelease]; len = [comment length]; [comment removeCharactersFromIndex: len - 2 toIndex: len]; | | | 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 | length: *i - *last]; comment = [[cache mutableCopy] autorelease]; len = [comment length]; [comment removeCharactersFromIndex: len - 2 toIndex: len]; #if defined(OF_HAVE_PROPERTIES) && defined(OF_HAVE_BLOCKS) if (commentHandler != NULL) commentHandler(self, comment); else #endif [delegate parser: self foundComment: comment]; |
︙ | ︙ | |||
913 914 915 916 917 918 919 | *last = *i + 1; } - (OFString*)string: (OFString*)string containsUnknownEntityNamed: (OFString*)entity { | | | 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 | *last = *i + 1; } - (OFString*)string: (OFString*)string containsUnknownEntityNamed: (OFString*)entity { #if defined(OF_HAVE_PROPERTIES) && defined(OF_HAVE_BLOCKS) if (unknownEntityHandler != NULL) return unknownEntityHandler(self, entity); #endif return [delegate parser: self foundUnknownEntityNamed: entity]; } |
︙ | ︙ |