Changeset 98
- Timestamp:
- Aug 21, 2001, 7:29:38 PM (24 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/expat/expat.h
r97 r98 13 13 // to save the app from having to include this as well 14 14 15 #ifndef XMLPARSEAPI15 /* #ifndef XMLPARSEAPI 16 16 #ifdef EXPATENTRY 17 #define XMLPARSEAPI(type) type EXPATENTRY 17 // #define XMLPARSEAPI(type) type EXPATENTRY 18 #define XMLPARSEAPI(type) 18 19 // V0.9.14 (2001-08-09) [umoeller] 19 20 #else 20 21 #define XMLPARSEAPI(type) type 21 22 #endif 22 #endif 23 #endif */ 24 25 #ifndef XMLPARSEAPI 26 # ifdef __declspec 27 # define XMLPARSEAPI __declspec(dllimport) 28 # else 29 # define XMLPARSEAPI /* nothing */ 30 # endif 31 #endif /* not defined XMLPARSEAPI */ 23 32 24 33 #ifdef __cplusplus … … 119 128 */ 120 129 121 typedef void (* XML_ElementDeclHandler) (void *userData,130 typedef void (* EXPATENTRY XML_ElementDeclHandler) (void *userData, 122 131 const XML_Char *name, 123 132 XMLCONTENT *model); 124 133 125 XMLPARSEAPI(void) 126 XML_SetElementDeclHandler(XML_Parser parser, 127 XML_ElementDeclHandler eldecl); 134 void EXPATENTRY XML_SetElementDeclHandler(XML_Parser parser, 135 XML_ElementDeclHandler eldecl); 128 136 129 137 /* … … 137 145 */ 138 146 139 typedef void (* XML_AttlistDeclHandler) (void *userData,147 typedef void (* EXPATENTRY XML_AttlistDeclHandler) (void *userData, 140 148 const XML_Char *elname, 141 149 const XML_Char *attname, … … 144 152 int isrequired); 145 153 146 XMLPARSEAPI(void) 154 void EXPATENTRY 147 155 XML_SetAttlistDeclHandler(XML_Parser parser, 148 156 XML_AttlistDeclHandler attdecl); … … 157 165 */ 158 166 159 typedef void (* XML_XmlDeclHandler) (void *userData,167 typedef void (* EXPATENTRY XML_XmlDeclHandler) (void *userData, 160 168 const XML_Char *version, 161 169 const XML_Char *encoding, 162 170 int standalone); 163 171 164 XMLPARSEAPI(void) 172 void EXPATENTRY 165 173 XML_SetXmlDeclHandler(XML_Parser parser, 166 174 XML_XmlDeclHandler xmldecl); … … 176 184 external protocol or null if there is none specified. */ 177 185 178 XML PARSEAPI(XML_Parser)186 XML_Parser EXPATENTRY 179 187 XML_ParserCreate(const XML_Char *encoding); 180 188 … … 189 197 the name and prefix will be passed through without expansion. */ 190 198 191 XML PARSEAPI(XML_Parser)199 XML_Parser EXPATENTRY 192 200 XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator); 193 201 … … 203 211 */ 204 212 205 XML PARSEAPI(XML_Parser)213 XML_Parser EXPATENTRY 206 214 XML_ParserCreate_MM(const XML_Char *encoding, 207 215 const XML_Memory_Handling_Suite *memsuite, … … 211 219 names and values are 0 terminated. */ 212 220 213 typedef void (* XML_StartElementHandler)(void *userData,221 typedef void (* EXPATENTRY XML_StartElementHandler)(void *userData, 214 222 const XML_Char *name, 215 223 const XML_Char **atts); 216 224 217 typedef void (* XML_EndElementHandler)(void *userData,225 typedef void (* EXPATENTRY XML_EndElementHandler)(void *userData, 218 226 const XML_Char *name); 219 227 220 228 221 229 /* s is not 0 terminated. */ 222 typedef void (* XML_CharacterDataHandler)(void *userData,230 typedef void (* EXPATENTRY XML_CharacterDataHandler)(void *userData, 223 231 const XML_Char *s, 224 232 int len); 225 233 226 234 /* target and data are 0 terminated */ 227 typedef void (* XML_ProcessingInstructionHandler)(void *userData,235 typedef void (* EXPATENTRY XML_ProcessingInstructionHandler)(void *userData, 228 236 const XML_Char *target, 229 237 const XML_Char *data); 230 238 231 239 /* data is 0 terminated */ 232 typedef void (* XML_CommentHandler)(void *userData, const XML_Char *data);233 234 typedef void (* XML_StartCdataSectionHandler)(void *userData);235 typedef void (* XML_EndCdataSectionHandler)(void *userData);240 typedef void (* EXPATENTRY XML_CommentHandler)(void *userData, const XML_Char *data); 241 242 typedef void (* EXPATENTRY XML_StartCdataSectionHandler)(void *userData); 243 typedef void (* EXPATENTRY XML_EndCdataSectionHandler)(void *userData); 236 244 237 245 /* This is called for any characters in the XML document for … … 248 256 multiple calls. */ 249 257 250 typedef void (* XML_DefaultHandler)(void *userData,258 typedef void (* EXPATENTRY XML_DefaultHandler)(void *userData, 251 259 const XML_Char *s, 252 260 int len); … … 255 263 any DTD or internal subset is parsed. */ 256 264 257 typedef void (* XML_StartDoctypeDeclHandler)(void *userData,265 typedef void (* EXPATENTRY XML_StartDoctypeDeclHandler)(void *userData, 258 266 const XML_Char *doctypeName, 259 267 const XML_Char *sysid, … … 263 271 /* This is called for the start of the DOCTYPE declaration when the 264 272 closing > is encountered, but after processing any external subset. */ 265 typedef void (* XML_EndDoctypeDeclHandler)(void *userData);273 typedef void (* EXPATENTRY XML_EndDoctypeDeclHandler)(void *userData); 266 274 267 275 /* This is called for entity declarations. The is_parameter_entity … … 281 289 */ 282 290 283 typedef void (* XML_EntityDeclHandler) (void *userData,291 typedef void (* EXPATENTRY XML_EntityDeclHandler) (void *userData, 284 292 const XML_Char *entityName, 285 293 int is_parameter_entity, … … 291 299 const XML_Char *notationName); 292 300 293 XMLPARSEAPI(void) 301 void EXPATENTRY 294 302 XML_SetEntityDeclHandler(XML_Parser parser, 295 303 XML_EntityDeclHandler handler); … … 303 311 The other arguments may be. */ 304 312 305 typedef void (* XML_UnparsedEntityDeclHandler)(void *userData,313 typedef void (* EXPATENTRY XML_UnparsedEntityDeclHandler)(void *userData, 306 314 const XML_Char *entityName, 307 315 const XML_Char *base, … … 314 322 The notationName will never be null. The other arguments can be. */ 315 323 316 typedef void (* XML_NotationDeclHandler)(void *userData,324 typedef void (* EXPATENTRY XML_NotationDeclHandler)(void *userData, 317 325 const XML_Char *notationName, 318 326 const XML_Char *base, … … 326 334 For an xmlns="" attribute, uri will be null. */ 327 335 328 typedef void (* XML_StartNamespaceDeclHandler)(void *userData,336 typedef void (* EXPATENTRY XML_StartNamespaceDeclHandler)(void *userData, 329 337 const XML_Char *prefix, 330 338 const XML_Char *uri); 331 339 332 typedef void (* XML_EndNamespaceDeclHandler)(void *userData,340 typedef void (* EXPATENTRY XML_EndNamespaceDeclHandler)(void *userData, 333 341 const XML_Char *prefix); 334 342 … … 339 347 ERROR_EXPAT_NOT_STANDALONE error. */ 340 348 341 typedef int (* XML_NotStandaloneHandler)(void *userData);349 typedef int (* EXPATENTRY XML_NotStandaloneHandler)(void *userData); 342 350 343 351 /* This is called for a reference to an external parsed general entity. … … 366 374 userData. */ 367 375 368 typedef int (* XML_ExternalEntityRefHandler)(void *userData, // added V0.9.14 (2001-08-09) [umoeller]376 typedef int (* EXPATENTRY XML_ExternalEntityRefHandler)(void *userData, // added V0.9.14 (2001-08-09) [umoeller] 369 377 XML_Parser parser, 370 378 const XML_Char *context, … … 418 426 int map[256]; 419 427 void *data; 420 int (* convert)(void *data, const char *s);421 void (* release)(void *data);428 int (* EXPATENTRY convert)(void *data, const char *s); 429 void (* EXPATENTRY release)(void *data); 422 430 } XML_Encoding; 423 431 … … 433 441 then the parser will return an XML_UNKNOWN_ENCODING error. */ 434 442 435 typedef int (* XML_UnknownEncodingHandler)(void *encodingHandlerData,443 typedef int (* EXPATENTRY XML_UnknownEncodingHandler)(void *encodingHandlerData, 436 444 const XML_Char *name, 437 445 XML_Encoding *info); 438 446 439 XMLPARSEAPI(void) 447 void EXPATENTRY 440 448 XML_SetElementHandler(XML_Parser parser, 441 449 XML_StartElementHandler start, 442 450 XML_EndElementHandler end); 443 451 444 XMLPARSEAPI(void) 452 void EXPATENTRY 445 453 XML_SetStartElementHandler(XML_Parser, XML_StartElementHandler); 446 454 447 XMLPARSEAPI(void) 455 void EXPATENTRY 448 456 XML_SetEndElementHandler(XML_Parser, XML_EndElementHandler); 449 457 450 XMLPARSEAPI(void) 458 void EXPATENTRY 451 459 XML_SetCharacterDataHandler(XML_Parser parser, 452 460 XML_CharacterDataHandler handler); 453 461 454 XMLPARSEAPI(void) 462 void EXPATENTRY 455 463 XML_SetProcessingInstructionHandler(XML_Parser parser, 456 464 XML_ProcessingInstructionHandler handler); 457 XMLPARSEAPI(void) 465 void EXPATENTRY 458 466 XML_SetCommentHandler(XML_Parser parser, 459 467 XML_CommentHandler handler); 460 468 461 XMLPARSEAPI(void) 469 void EXPATENTRY 462 470 XML_SetCdataSectionHandler(XML_Parser parser, 463 471 XML_StartCdataSectionHandler start, 464 472 XML_EndCdataSectionHandler end); 465 473 466 XMLPARSEAPI(void) 474 void EXPATENTRY 467 475 XML_SetStartCdataSectionHandler(XML_Parser parser, 468 476 XML_StartCdataSectionHandler start); 469 477 470 XMLPARSEAPI(void) 478 void EXPATENTRY 471 479 XML_SetEndCdataSectionHandler(XML_Parser parser, 472 480 XML_EndCdataSectionHandler end); … … 476 484 handler. */ 477 485 478 XMLPARSEAPI(void) 486 void EXPATENTRY 479 487 XML_SetDefaultHandler(XML_Parser parser, 480 488 XML_DefaultHandler handler); … … 484 492 default handler. */ 485 493 486 XMLPARSEAPI(void) 494 void EXPATENTRY 487 495 XML_SetDefaultHandlerExpand(XML_Parser parser, 488 496 XML_DefaultHandler handler); 489 497 490 XMLPARSEAPI(void) 498 void EXPATENTRY 491 499 XML_SetDoctypeDeclHandler(XML_Parser parser, 492 500 XML_StartDoctypeDeclHandler start, 493 501 XML_EndDoctypeDeclHandler end); 494 502 495 XMLPARSEAPI(void) 503 void EXPATENTRY 496 504 XML_SetStartDoctypeDeclHandler(XML_Parser parser, 497 505 XML_StartDoctypeDeclHandler start); 498 506 499 XMLPARSEAPI(void) 507 void EXPATENTRY 500 508 XML_SetEndDoctypeDeclHandler(XML_Parser parser, 501 509 XML_EndDoctypeDeclHandler end); 502 510 503 XMLPARSEAPI(void) 511 void EXPATENTRY 504 512 XML_SetUnparsedEntityDeclHandler(XML_Parser parser, 505 513 XML_UnparsedEntityDeclHandler handler); 506 514 507 XMLPARSEAPI(void) 515 void EXPATENTRY 508 516 XML_SetNotationDeclHandler(XML_Parser parser, 509 517 XML_NotationDeclHandler handler); 510 518 511 XMLPARSEAPI(void) 519 void EXPATENTRY 512 520 XML_SetNamespaceDeclHandler(XML_Parser parser, 513 521 XML_StartNamespaceDeclHandler start, 514 522 XML_EndNamespaceDeclHandler end); 515 523 516 XMLPARSEAPI(void) 524 void EXPATENTRY 517 525 XML_SetStartNamespaceDeclHandler(XML_Parser parser, 518 526 XML_StartNamespaceDeclHandler start); 519 527 520 XMLPARSEAPI(void) 528 void EXPATENTRY 521 529 XML_SetEndNamespaceDeclHandler(XML_Parser parser, 522 530 XML_EndNamespaceDeclHandler end); 523 531 524 XMLPARSEAPI(void) 532 void EXPATENTRY 525 533 XML_SetNotStandaloneHandler(XML_Parser parser, 526 534 XML_NotStandaloneHandler handler); 527 535 528 XMLPARSEAPI(void) 536 void EXPATENTRY 529 537 XML_SetExternalEntityRefHandler(XML_Parser parser, 530 538 XML_ExternalEntityRefHandler handler); … … 533 541 as the first argument to the external entity ref handler instead 534 542 of the parser object. */ 535 XMLPARSEAPI(void) 543 void EXPATENTRY 536 544 XML_SetExternalEntityRefHandlerArg(XML_Parser, void *arg); 537 545 538 XMLPARSEAPI(void) 546 void EXPATENTRY 539 547 XML_SetUnknownEncodingHandler(XML_Parser parser, 540 548 XML_UnknownEncodingHandler handler, … … 544 552 processing instruction or character data. It causes the corresponding 545 553 markup to be passed to the default handler. */ 546 XMLPARSEAPI(void) 554 void EXPATENTRY 547 555 XML_DefaultCurrent(XML_Parser parser); 548 556 … … 558 566 */ 559 567 560 XMLPARSEAPI(void) 568 void EXPATENTRY 561 569 XML_SetReturnNSTriplet(XML_Parser parser, int do_nst); 562 570 563 571 /* This value is passed as the userData argument to callbacks. */ 564 XMLPARSEAPI(void) 572 void EXPATENTRY 565 573 XML_SetUserData(XML_Parser parser, void *userData); 566 574 … … 572 580 or XML_ParseBuffer. */ 573 581 574 XMLPARSEAPI(int) 582 int EXPATENTRY 575 583 XML_SetEncoding(XML_Parser parser, const XML_Char *encoding); 576 584 … … 579 587 The userData will still be accessible using XML_GetUserData. */ 580 588 581 XMLPARSEAPI(void) 589 void EXPATENTRY 582 590 XML_UseParserAsHandlerArg(XML_Parser parser); 583 591 … … 589 597 Returns zero if out of memory, non-zero otherwise. */ 590 598 591 XMLPARSEAPI(int) 599 int EXPATENTRY 592 600 XML_SetBase(XML_Parser parser, const XML_Char *base); 593 601 594 XMLPARSEAPI(const XML_Char *) 602 const XML_Char * EXPATENTRY 595 603 XML_GetBase(XML_Parser parser); 596 604 … … 601 609 XML_StartElementHandler. */ 602 610 603 XMLPARSEAPI(int) 611 int EXPATENTRY 604 612 XML_GetSpecifiedAttributeCount(XML_Parser parser); 605 613 … … 609 617 into the atts array passed to the XML_StartElementHandler. */ 610 618 611 XMLPARSEAPI(int) 619 int EXPATENTRY 612 620 XML_GetIdAttributeIndex(XML_Parser parser); 613 621 … … 615 623 The last call to XML_Parse must have isFinal true; 616 624 len may be zero for this call (or any other). */ 617 XMLPARSEAPI(int) 625 int EXPATENTRY 618 626 XML_Parse(XML_Parser parser, const char *s, int len, int isFinal); 619 627 620 XMLPARSEAPI(void *) 628 void * EXPATENTRY 621 629 XML_GetBuffer(XML_Parser parser, int len); 622 630 623 XMLPARSEAPI(int) 631 int EXPATENTRY 624 632 XML_ParseBuffer(XML_Parser parser, int len, int isFinal); 625 633 … … 639 647 from the parser argument. Returns 0 if out of memory. Otherwise 640 648 returns a new XML_Parser object. */ 641 XML PARSEAPI(XML_Parser)649 XML_Parser EXPATENTRY 642 650 XML_ExternalEntityParserCreate(XML_Parser parser, 643 651 const XML_Char *context, … … 669 677 entities is requested; otherwise it will return non-zero. */ 670 678 671 XMLPARSEAPI(int) 679 int EXPATENTRY 672 680 XML_SetParamEntityParsing(XML_Parser parser, 673 681 enum XML_ParamEntityParsing parsing); … … 732 740 returns information about the error. */ 733 741 734 XML PARSEAPI(XMLERROR)742 XMLERROR EXPATENTRY 735 743 XML_GetErrorCode(XML_Parser parser); 736 744 … … 743 751 of the sequence of characters that generated the event. */ 744 752 745 XMLPARSEAPI(int)XML_GetCurrentLineNumber(XML_Parser parser);746 XMLPARSEAPI(int)XML_GetCurrentColumnNumber(XML_Parser parser);747 XMLPARSEAPI(long)XML_GetCurrentByteIndex(XML_Parser parser);753 int EXPATENTRY XML_GetCurrentLineNumber(XML_Parser parser); 754 int EXPATENTRY XML_GetCurrentColumnNumber(XML_Parser parser); 755 long EXPATENTRY XML_GetCurrentByteIndex(XML_Parser parser); 748 756 749 757 /* Return the number of bytes in the current event. 750 758 Returns 0 if the event is in an internal entity. */ 751 759 752 XMLPARSEAPI(int) 760 int EXPATENTRY 753 761 XML_GetCurrentByteCount(XML_Parser parser); 754 762 … … 763 771 the handler that makes the call. */ 764 772 765 XMLPARSEAPI(const char *) 773 const char * EXPATENTRY 766 774 XML_GetInputContext(XML_Parser parser, 767 775 int *offset, … … 774 782 775 783 /* Frees memory used by the parser. */ 776 XMLPARSEAPI(void) 784 void EXPATENTRY 777 785 XML_ParserFree(XML_Parser parser); 778 786 779 787 /* Returns a string describing the error. */ 780 XMLPARSEAPI(const XML_LChar *) 788 const XML_LChar * EXPATENTRY 781 789 XML_ErrorString(int code); 782 790 783 791 /* Return a string containing the version number of this expat */ 784 XMLPARSEAPI(const XML_LChar *) 792 const XML_LChar * EXPATENTRY 785 793 XML_ExpatVersion(void); 786 794 … … 794 802 number information for this version of expat */ 795 803 796 XML PARSEAPI(XML_Expat_Version)804 XML_Expat_Version EXPATENTRY 797 805 XML_ExpatVersionInfo(void); 798 806 -
trunk/include/expat/xmlrole.h
r97 r98 6 6 #ifndef XmlRole_INCLUDED 7 7 #define XmlRole_INCLUDED 1 8 9 #include "expat\expat_setup.h" 10 // V0.9.9 (2001-02-10) [umoeller] 11 // to save the app from having to include this as well 8 12 9 13 #include "expat\xmltok.h" … … 73 77 }; 74 78 79 struct prolog_state; 80 typedef int EXPATENTRY FNHANDLER(struct prolog_state *state, 81 int tok, 82 const char *ptr, 83 const char *end, 84 const ENCODING *enc); 85 75 86 typedef struct prolog_state { 76 int (*handler)(struct prolog_state *state, 77 int tok, 78 const char *ptr, 79 const char *end, 80 const ENCODING *enc); 87 FNHANDLER *handler; 81 88 unsigned level; 82 89 #ifdef XML_DTD -
trunk/include/expat/xmltok.h
r97 r98 6 6 #ifndef XmlTok_INCLUDED 7 7 #define XmlTok_INCLUDED 1 8 9 #include "expat\expat_setup.h" 10 // V0.9.9 (2001-02-10) [umoeller] 11 // to save the app from having to include this as well 8 12 9 13 #ifdef __cplusplus … … 17 21 #define XML_TOK_NONE -4 /* The string to be scanned is empty */ 18 22 #define XML_TOK_TRAILING_CR -3 /* A CR at the end of the scan; 19 might be part of CRLF sequence */ 23 might be part of CRLF sequence */ 20 24 #define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */ 21 25 #define XML_TOK_PARTIAL -1 /* only part of a token */ … … 122 126 typedef struct encoding ENCODING; 123 127 128 typedef int EXPATENTRY SCANNERFUNC(const ENCODING *, 129 const char *, 130 const char *, 131 const char **); 132 typedef SCANNERFUNC *PSCANNERFUNC; 133 124 134 struct encoding { 125 int (*scanners[XML_N_STATES])(const ENCODING *, 126 const char *, 127 const char *, 128 const char **); 129 int (*literalScanners[XML_N_LITERAL_TYPES])(const ENCODING *, 130 const char *, 131 const char *, 132 const char **); 133 int (*sameName)(const ENCODING *, 134 const char *, const char *); 135 int (*nameMatchesAscii)(const ENCODING *, 136 const char *, const char *, const char *); 137 int (*nameLength)(const ENCODING *, const char *); 138 const char *(*skipS)(const ENCODING *, const char *); 139 int (*getAtts)(const ENCODING *enc, const char *ptr, 140 int attsMax, ATTRIBUTE *atts); 141 int (*charRefNumber)(const ENCODING *enc, const char *ptr); 142 int (*predefinedEntityName)(const ENCODING *, const char *, const char *); 143 void (*updatePosition)(const ENCODING *, 144 const char *ptr, 145 const char *end, 146 POSITION *); 147 int (*isPublicId)(const ENCODING *enc, const char *ptr, const char *end, 148 const char **badPtr); 149 void (*utf8Convert)(const ENCODING *enc, 150 const char **fromP, 151 const char *fromLim, 152 char **toP, 153 const char *toLim); 154 void (*utf16Convert)(const ENCODING *enc, 155 const char **fromP, 156 const char *fromLim, 157 unsigned short **toP, 158 const unsigned short *toLim); 135 PSCANNERFUNC scanners[XML_N_STATES]; 136 PSCANNERFUNC literalScanners[XML_N_LITERAL_TYPES]; 137 /* int (* EXPATENTRY literalScanners[XML_N_LITERAL_TYPES])(const ENCODING *, 138 const char *, 139 const char *, 140 const char **); */ 141 int (* EXPATENTRY sameName)(const ENCODING *, 142 const char *, const char *); 143 int (* EXPATENTRY nameMatchesAscii)(const ENCODING *, 144 const char *, const char *, const char *); 145 int (* EXPATENTRY nameLength)(const ENCODING *, const char *); 146 const char *(* EXPATENTRY skipS)(const ENCODING *, const char *); 147 int (* EXPATENTRY getAtts)(const ENCODING *enc, const char *ptr, 148 int attsMax, ATTRIBUTE *atts); 149 int (* EXPATENTRY charRefNumber)(const ENCODING *enc, const char *ptr); 150 int (* EXPATENTRY predefinedEntityName)(const ENCODING *, const char *, const char *); 151 void (* EXPATENTRY updatePosition)(const ENCODING *, 152 const char *ptr, 153 const char *end, 154 POSITION *); 155 int (* EXPATENTRY isPublicId)(const ENCODING *enc, const char *ptr, const char *end, 156 const char **badPtr); 157 void (* EXPATENTRY utf8Convert)(const ENCODING *enc, 158 const char **fromP, 159 const char *fromLim, 160 char **toP, 161 const char *toLim); 162 void (* EXPATENTRY utf16Convert)(const ENCODING *enc, 163 const char **fromP, 164 const char *fromLim, 165 unsigned short **toP, 166 const unsigned short *toLim); 159 167 int minBytesPerChar; 160 168 char isUtf8; … … 203 211 204 212 /* This is used for performing a 2nd-level tokenization on 205 the content of a literal that has already been returned by XmlTok. */ 213 the content of a literal that has already been returned by XmlTok. */ 206 214 207 215 #define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \ … … 252 260 253 261 int XmlParseXmlDecl(int isGeneralTextEntity, 254 255 256 257 258 259 260 261 262 262 const ENCODING *enc, 263 const char *ptr, 264 const char *end, 265 const char **badPtr, 266 const char **versionPtr, 267 const char **versionEndPtr, 268 const char **encodingNamePtr, 269 const ENCODING **namedEncodingPtr, 270 int *standalonePtr); 263 271 264 272 int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name); … … 271 279 ENCODING * 272 280 XmlInitUnknownEncoding(void *mem, 273 274 275 281 int *table, 282 int (*conv)(void *userData, const char *p), 283 void *userData); 276 284 277 285 int XmlParseXmlDeclNS(int isGeneralTextEntity, 278 279 280 281 282 283 284 285 286 286 const ENCODING *enc, 287 const char *ptr, 288 const char *end, 289 const char **badPtr, 290 const char **versionPtr, 291 const char **versionEndPtr, 292 const char **encodingNamePtr, 293 const ENCODING **namedEncodingPtr, 294 int *standalonePtr); 287 295 int XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name); 288 296 const ENCODING *XmlGetUtf8InternalEncodingNS(void); … … 290 298 ENCODING * 291 299 XmlInitUnknownEncodingNS(void *mem, 292 293 294 300 int *table, 301 int (*conv)(void *userData, const char *p), 302 void *userData); 295 303 #ifdef __cplusplus 296 304 } -
trunk/include/helpers/xml.h
r97 r98 630 630 631 631 typedef APIRET APIENTRY FNEXTERNALHANDLER(PXMLDOM pDom, 632 XML_Parser *pSubParser,632 XML_Parser pSubParser, 633 633 const char *pcszSystemID, 634 634 const char *pcszPublicID); -
trunk/src/helpers/cctl_splitwin.c
r46 r98 510 510 511 511 case WM_MOUSEMOVE: 512 pData->hptrOld = WinSetPointer(HWND_DESKTOP, pData->hptrMove); 512 if (pData->sbcd.ulCreateFlags & SBCF_MOVEABLE) 513 // V0.9.14 (2001-08-21) [umoeller] 514 // split bar is moveable: 515 pData->hptrOld = WinSetPointer(HWND_DESKTOP, pData->hptrMove); 516 else 517 mrc = OldStaticProc(hwndBar, msg, mp1, mp2); 513 518 break; 514 519 … … 521 526 case WM_BUTTON1DOWN: 522 527 case WM_BUTTON2DOWN: 523 TrackSplitBar(hwndBar, pData); 528 if (pData->sbcd.ulCreateFlags & SBCF_MOVEABLE) 529 // V0.9.14 (2001-08-21) [umoeller] 530 // split bar is moveable: 531 TrackSplitBar(hwndBar, pData); 532 else 533 mrc = OldStaticProc(hwndBar, msg, mp1, mp2); 524 534 break; 525 535 -
trunk/src/helpers/dialog.c
r95 r98 100 100 LINKLIST llTables; 101 101 102 HWND hwndFirstFocus; 102 HWND hwndFirstFocus, 103 hwndDefPushbutton; // V0.9.14 (2001-08-21) [umoeller] 103 104 104 105 POINTL ptlTotalOfs; … … 719 720 ) 720 721 pDlgData->hwndFirstFocus = pColumnDef->hwndControl; 722 723 // if this is the first default push button, 724 // go store it too 725 // V0.9.14 (2001-08-21) [umoeller] 726 if ( (!pDlgData->hwndDefPushbutton) 727 && ((ULONG)pControlDef->pcszClass == 0xffff0003L) 728 && (pControlDef->flStyle & BS_DEFAULT) 729 ) 730 pDlgData->hwndDefPushbutton = pColumnDef->hwndControl; 721 731 } 722 732 else … … 1048 1058 * This does NOT use regular dialog templates from 1049 1059 * module resources. Instead, you pass in an array 1050 * of _DLGHITEM structures, which define the controls1060 * of DLGHITEM structures, which define the controls 1051 1061 * and how they are to be formatted. 1062 * 1063 * The main advantage compared to dialog resources is 1064 * that with this function, you will never have to 1065 * define control _positions_. Instead, you only specify 1066 * the control _sizes_, and all positions are computed 1067 * automatically here. Even better, for many controls, 1068 * auto-sizing is supported according to the control's 1069 * text (e.g. for statics and checkboxes). 1052 1070 * 1053 1071 * A regular standard dialog would use something like … … 1068 1086 * your dlg proc, use WinDefDlgProc as usual. 1069 1087 * 1070 * There is NO run-time overhead after creation; after this 1071 * function returns, the dialog is a standard dialog as if 1072 * loaded from WinLoadDlg. 1073 * 1074 * The array of _DLGHITEM structures defines how the 1088 * There is NO run-time overhead for either code or memory 1089 * after dialog creation; after this function returns, the 1090 * dialog is a standard dialog as if loaded from WinLoadDlg. 1091 * The array of DLGHITEM structures defines how the 1075 1092 * dialog is set up. All this is ONLY used by this function 1076 1093 * and NOT needed after the dialog has been created. 1077 1094 * 1078 * In _DLGHITEM, the "Type" field determines what this1095 * In DLGHITEM, the "Type" field determines what this 1079 1096 * structure defines. A number of handy macros have been 1080 1097 * defined to make this easier and to provide type-checking 1081 * at compile time. 1098 * at compile time. See dialog.h for more. 1082 1099 * 1083 1100 * Essentially, such a dialog item operates similarly to … … 1111 1128 * 1112 1129 * -- CONTROL_DEF(pDef) defines a control in a table row. 1113 * pDef must point to a _CONTROLDEF structure. 1114 * 1115 * The main difference (and advantage) of this 1116 * function is that there is NO information in 1117 * _CONTROLDEF about a control's _position_. 1130 * pDef must point to a CONTROLDEF structure. 1131 * 1132 * Again, there is is NO information in 1133 * CONTROLDEF about a control's _position_. 1118 1134 * Instead, the structure only contains the _size_ 1119 1135 * of the control. All positions are computed by … … 1251 1267 + DlgTemplate, // DLGHITEM array 1252 1268 + ARRAYITEMCOUNT(DlgTemplate), 1253 + NULL)) 1269 + NULL, // mp2 for WM_INITDLG 1270 + "9.WarpSans")) // default font 1254 1271 + { 1255 1272 + ULONG idReturn = WinProcessDlg(hwndDlg); … … 1259 1276 *@@changed V0.9.14 (2001-07-07) [umoeller]: fixed disabled mouse with hwndOwner == HWND_DESKTOP 1260 1277 *@@changed V0.9.14 (2001-08-01) [umoeller]: fixed major memory leaks with nested tables 1278 *@@changed V0.9.14 (2001-08-21) [umoeller]: fixed default push button problems 1261 1279 */ 1262 1280 … … 1317 1335 1318 1336 // push the current table on the stack 1319 PSTACKITEM pStackItem = NEW(STACKITEM); 1320 if (pStackItem) 1337 PSTACKITEM pStackItem; 1338 if (!(pStackItem = NEW(STACKITEM))) 1339 { 1340 arc = ERROR_NOT_ENOUGH_MEMORY; 1341 break; 1342 } 1343 else 1321 1344 { 1322 1345 pStackItem->pLastTable = pCurrentTable; … … 1326 1349 1327 1350 // create new table 1328 pCurrentTable = NEW(TABLEDEF); 1329 if (!pCurrentTable) 1351 if (!(pCurrentTable = NEW(TABLEDEF))) 1330 1352 arc = ERROR_NOT_ENOUGH_MEMORY; 1331 1353 else … … 1372 1394 { 1373 1395 // create new row 1374 pCurrentRow = NEW(ROWDEF); 1375 if (!pCurrentRow) 1396 if (!(pCurrentRow = NEW(ROWDEF))) 1376 1397 arc = ERROR_NOT_ENOUGH_MEMORY; 1377 1398 else … … 1465 1486 hwndOwner = NULLHANDLE; 1466 1487 1467 pDlgData->hwndDlg = WinCreateWindow(HWND_DESKTOP, 1468 WC_FRAME, 1469 (PSZ)pcszDlgTitle, 1470 flStyle, // style; invisible for now 1471 0, 0, 0, 0, 1472 hwndOwner, 1473 HWND_TOP, 1474 0, // ID 1475 &fcData, 1476 NULL); // presparams 1477 1478 if (!pDlgData->hwndDlg) 1488 if (!(pDlgData->hwndDlg = WinCreateWindow(HWND_DESKTOP, 1489 WC_FRAME, 1490 (PSZ)pcszDlgTitle, 1491 flStyle, // style; invisible for now 1492 0, 0, 0, 0, 1493 hwndOwner, 1494 HWND_TOP, 1495 0, // ID 1496 &fcData, 1497 NULL))) // presparams 1479 1498 arc = DLGERR_CANNOT_CREATE_FRAME; 1480 1499 else … … 1493 1512 &szlClient, 1494 1513 PROCESS_CALC_SIZES); 1495 1514 // this goes into major recursions... 1515 1516 // free the cached font resources that 1517 // might have been created here 1496 1518 if (pDlgData->lcidLast) 1497 1519 { … … 1501 1523 if (pDlgData->hps) 1502 1524 WinReleasePS(pDlgData->hps); 1525 1526 WinSubclassWindow(hwndDlg, pfnwpDialogProc); 1503 1527 1504 1528 /* … … 1506 1530 * size of all controls 1507 1531 */ 1508 1509 WinSubclassWindow(hwndDlg, pfnwpDialogProc);1510 1532 1511 1533 // calculate the frame size from the client size … … 1546 1568 &szlClient, 1547 1569 PROCESS_CREATE_CONTROLS); 1570 1571 if (pDlgData->hwndDefPushbutton) 1572 // we had a default pushbutton: 1573 // go set it V0.9.14 (2001-08-21) [umoeller] 1574 WinSetWindowULong(pDlgData->hwndDlg, 1575 QWL_DEFBUTTON, 1576 pDlgData->hwndDefPushbutton); 1548 1577 1549 1578 /* -
trunk/src/helpers/xmlparse.c
r97 r98 947 947 inheritedBindings = 0; 948 948 attsSize = INIT_ATTS_SIZE; 949 atts = MALLOC(attsSize * sizeof(ATTRIBUTE));949 atts = (ATTRIBUTE*)MALLOC(attsSize * sizeof(ATTRIBUTE)); 950 950 nSpecifiedAtts = 0; 951 dataBuf = MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char));951 dataBuf = (XML_Char*)MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char)); 952 952 groupSize = 0; 953 953 groupConnector = 0; … … 1065 1065 1066 1066 #ifdef XML_DTD 1067 intoldParamEntityParsing = paramEntityParsing;1067 enum XML_ParamEntityParsing oldParamEntityParsing = paramEntityParsing; 1068 1068 1069 1069 #endif … … 2252 2252 } 2253 2253 while (bufferSize < neededSize); 2254 newBuf = MALLOC(bufferSize);2254 newBuf = (char*)MALLOC(bufferSize); 2255 2255 if (newBuf == 0) 2256 2256 { … … 2783 2783 else 2784 2784 { 2785 tag = MALLOC(sizeof(TAG));2785 tag = (TAG*)MALLOC(sizeof(TAG)); 2786 2786 if (!tag) 2787 2787 return ERROR_EXPAT_NO_MEMORY; 2788 tag->buf = MALLOC(INIT_TAG_BUF_SIZE);2788 tag->buf = (char*)MALLOC(INIT_TAG_BUF_SIZE); 2789 2789 if (!tag->buf) 2790 2790 return ERROR_EXPAT_NO_MEMORY; … … 2806 2806 2807 2807 bufSize = ROUND_UP(bufSize, sizeof(XML_Char)); 2808 tag->buf = REALLOC(tag->buf, bufSize);2808 tag->buf = (char*)REALLOC(tag->buf, bufSize); 2809 2809 if (!tag->buf) 2810 2810 return ERROR_EXPAT_NO_MEMORY; … … 2837 2837 break; 2838 2838 bufSize = (tag->bufEnd - tag->buf) << 1; 2839 tag->buf = REALLOC(tag->buf, bufSize);2839 tag->buf = (char*)REALLOC(tag->buf, bufSize); 2840 2840 if (!tag->buf) 2841 2841 return ERROR_EXPAT_NO_MEMORY; … … 3140 3140 3141 3141 attsSize = n + nDefaultAtts + INIT_ATTS_SIZE; 3142 atts = REALLOC((void *)atts, attsSize * sizeof(ATTRIBUTE));3142 atts = (ATTRIBUTE*)REALLOC((void *)atts, attsSize * sizeof(ATTRIBUTE)); 3143 3143 if (!atts) 3144 3144 return ERROR_EXPAT_NO_MEMORY; … … 3365 3365 { 3366 3366 TAG *p; 3367 XML_Char *uri = MALLOC((n + EXPAND_SPARE) * sizeof(XML_Char));3367 XML_Char *uri = (XML_Char*)MALLOC((n + EXPAND_SPARE) * sizeof(XML_Char)); 3368 3368 3369 3369 if (!uri) … … 3397 3397 if (len > b->uriAlloc) 3398 3398 { 3399 b->uri = REALLOC(b->uri, sizeof(XML_Char) * (len + EXPAND_SPARE));3399 b->uri = (XML_Char*)REALLOC(b->uri, sizeof(XML_Char) * (len + EXPAND_SPARE)); 3400 3400 if (!b->uri) 3401 3401 return 0; … … 3406 3406 else 3407 3407 { 3408 b = MALLOC(sizeof(BINDING));3408 b = (BINDING*)MALLOC(sizeof(BINDING)); 3409 3409 if (!b) 3410 3410 return 0; 3411 b->uri = MALLOC(sizeof(XML_Char) * (len + EXPAND_SPARE));3411 b->uri = (XML_Char*)MALLOC(sizeof(XML_Char) * (len + EXPAND_SPARE)); 3412 3412 if (!b->uri) 3413 3413 { … … 3819 3819 { 3820 3820 unknownEncodingData = info.data; 3821 unknownEncodingRelease = info.release;3821 unknownEncodingRelease = (void(*)(void*))info.release; 3822 3822 encoding = enc; 3823 3823 return ERROR_EXPAT_NONE; … … 4453 4453 if (groupSize) 4454 4454 { 4455 groupConnector = REALLOC(groupConnector, groupSize *= 2);4455 groupConnector = (char*)REALLOC(groupConnector, groupSize *= 2); 4456 4456 if (dtd.scaffIndex) 4457 dtd.scaffIndex = REALLOC(dtd.scaffIndex, groupSize * sizeof(int));4457 dtd.scaffIndex = (int*)REALLOC(dtd.scaffIndex, groupSize * sizeof(int)); 4458 4458 } 4459 4459 else 4460 groupConnector = MALLOC(groupSize = 32);4460 groupConnector = (char*)MALLOC(groupSize = 32); 4461 4461 if (!groupConnector) 4462 4462 return ERROR_EXPAT_NO_MEMORY; … … 5232 5232 { 5233 5233 type->allocDefaultAtts = 8; 5234 type->defaultAtts = MALLOC(type->allocDefaultAtts * sizeof(DEFAULT_ATTRIBUTE));5234 type->defaultAtts = (DEFAULT_ATTRIBUTE*)MALLOC(type->allocDefaultAtts * sizeof(DEFAULT_ATTRIBUTE)); 5235 5235 } 5236 5236 else 5237 5237 { 5238 5238 type->allocDefaultAtts *= 2; 5239 type->defaultAtts = REALLOC(type->defaultAtts,5239 type->defaultAtts = (DEFAULT_ATTRIBUTE*)REALLOC(type->defaultAtts, 5240 5240 type->allocDefaultAtts * sizeof(DEFAULT_ATTRIBUTE)); 5241 5241 } … … 5814 5814 return 0; 5815 5815 tsize = INIT_SIZE * sizeof(NAMED *); 5816 table->v = table->mem->malloc_fcn(tsize);5816 table->v = (NAMED**)table->mem->malloc_fcn(tsize); 5817 5817 if (!table->v) 5818 5818 return 0; … … 5840 5840 size_t newSize = table->size * 2; 5841 5841 size_t tsize = newSize * sizeof(NAMED *); 5842 NAMED **newV = table->mem->malloc_fcn(tsize);5842 NAMED **newV = (NAMED**)table->mem->malloc_fcn(tsize); 5843 5843 5844 5844 if (!newV) … … 5866 5866 } 5867 5867 } 5868 table->v[i] = table->mem->malloc_fcn(createSize);5868 table->v[i] = (NAMED*)table->mem->malloc_fcn(createSize); 5869 5869 if (!table->v[i]) 5870 5870 return 0; … … 6140 6140 int blockSize = (pool->end - pool->start) * 2; 6141 6141 6142 pool->blocks = pool->mem->realloc_fcn(pool->blocks, offsetof(BLOCK, s) + blockSize * sizeof(XML_Char));6142 pool->blocks = (BLOCK*)pool->mem->realloc_fcn(pool->blocks, offsetof(BLOCK, s) + blockSize * sizeof(XML_Char)); 6143 6143 if (!pool->blocks) 6144 6144 return 0; … … 6157 6157 else 6158 6158 blockSize *= 2; 6159 tem = pool->mem->malloc_fcn(offsetof(BLOCK, s) + blockSize * sizeof(XML_Char));6159 tem = (BLOCK*)pool->mem->malloc_fcn(offsetof(BLOCK, s) + blockSize * sizeof(XML_Char)); 6160 6160 if (!tem) 6161 6161 return 0; … … 6180 6180 if (!dtd.scaffIndex) 6181 6181 { 6182 dtd.scaffIndex = MALLOC(groupSize * sizeof(int));6182 dtd.scaffIndex = (int*)MALLOC(groupSize * sizeof(int)); 6183 6183 6184 6184 if (!dtd.scaffIndex) … … 6273 6273 int allocsize = dtd.scaffCount * sizeof(XMLCONTENT) + dtd.contentStringLen; 6274 6274 6275 ret = MALLOC(allocsize);6275 ret = (XMLCONTENT*)MALLOC(allocsize); 6276 6276 if (!ret) 6277 6277 return 0; -
trunk/src/helpers/xmlrole.c
r97 r98 64 64 #endif /* not XML_DTD */ 65 65 66 typedef int PROLOG_HANDLER(PROLOG_STATE *state,67 int tok,68 const char *ptr,69 const char *end,70 const ENCODING *enc);66 typedef int EXPATENTRY PROLOG_HANDLER(PROLOG_STATE *state, 67 int tok, 68 const char *ptr, 69 const char *end, 70 const ENCODING *enc); 71 71 72 72 static PROLOG_HANDLER … … 92 92 93 93 static 94 int prolog0(PROLOG_STATE *state,94 int EXPATENTRY prolog0(PROLOG_STATE *state, 95 95 int tok, 96 96 const char *ptr, -
trunk/src/helpers/xmltok.c
r97 r98 86 86 87 87 static 88 int isNever(const ENCODING * enc, const char *p)88 int EXPATENTRY isNever(const ENCODING * enc, const char *p) 89 89 { 90 90 return 0; … … 92 92 93 93 static 94 int utf8_isName2(const ENCODING * enc, const char *p)94 int EXPATENTRY utf8_isName2(const ENCODING * enc, const char *p) 95 95 { 96 96 return UTF8_GET_NAMING2(namePages, (const unsigned char *)p); … … 98 98 99 99 static 100 int utf8_isName3(const ENCODING * enc, const char *p)100 int EXPATENTRY utf8_isName3(const ENCODING * enc, const char *p) 101 101 { 102 102 return UTF8_GET_NAMING3(namePages, (const unsigned char *)p); … … 106 106 107 107 static 108 int utf8_isNmstrt2(const ENCODING * enc, const char *p)108 int EXPATENTRY utf8_isNmstrt2(const ENCODING * enc, const char *p) 109 109 { 110 110 return UTF8_GET_NAMING2(nmstrtPages, (const unsigned char *)p); … … 112 112 113 113 static 114 int utf8_isNmstrt3(const ENCODING * enc, const char *p)114 int EXPATENTRY utf8_isNmstrt3(const ENCODING * enc, const char *p) 115 115 { 116 116 return UTF8_GET_NAMING3(nmstrtPages, (const unsigned char *)p); … … 122 122 123 123 static 124 int utf8_isInvalid3(const ENCODING * enc, const char *p)124 int EXPATENTRY utf8_isInvalid3(const ENCODING * enc, const char *p) 125 125 { 126 126 return UTF8_INVALID3((const unsigned char *)p); … … 128 128 129 129 static 130 int utf8_isInvalid4(const ENCODING * enc, const char *p)130 int EXPATENTRY utf8_isInvalid4(const ENCODING * enc, const char *p) 131 131 { 132 132 return UTF8_INVALID4((const unsigned char *)p); … … 138 138 unsigned char type[256]; 139 139 #ifdef XML_MIN_SIZE 140 int (* byteType) (const ENCODING *, const char *);141 int (* isNameMin) (const ENCODING *, const char *);142 int (* isNmstrtMin) (const ENCODING *, const char *);143 int (* byteToAscii) (const ENCODING *, const char *);144 int (* charMatches) (const ENCODING *, const char *, int);140 int (* EXPATENTRY byteType) (const ENCODING *, const char *); 141 int (* EXPATENTRY isNameMin) (const ENCODING *, const char *); 142 int (* EXPATENTRY isNmstrtMin) (const ENCODING *, const char *); 143 int (* EXPATENTRY byteToAscii) (const ENCODING *, const char *); 144 int (* EXPATENTRY charMatches) (const ENCODING *, const char *, int); 145 145 #endif /* XML_MIN_SIZE */ 146 int (* isName2) (const ENCODING *, const char *);147 int (* isName3) (const ENCODING *, const char *);148 int (* isName4) (const ENCODING *, const char *);149 int (* isNmstrt2) (const ENCODING *, const char *);150 int (* isNmstrt3) (const ENCODING *, const char *);151 int (* isNmstrt4) (const ENCODING *, const char *);152 int (* isInvalid2) (const ENCODING *, const char *);153 int (* isInvalid3) (const ENCODING *, const char *);154 int (* isInvalid4) (const ENCODING *, const char *);146 int (* EXPATENTRY isName2) (const ENCODING *, const char *); 147 int (* EXPATENTRY isName3) (const ENCODING *, const char *); 148 int (* EXPATENTRY isName4) (const ENCODING *, const char *); 149 int (* EXPATENTRY isNmstrt2) (const ENCODING *, const char *); 150 int (* EXPATENTRY isNmstrt3) (const ENCODING *, const char *); 151 int (* EXPATENTRY isNmstrt4) (const ENCODING *, const char *); 152 int (* EXPATENTRY isInvalid2) (const ENCODING *, const char *); 153 int (* EXPATENTRY isInvalid3) (const ENCODING *, const char *); 154 int (* EXPATENTRY isInvalid4) (const ENCODING *, const char *); 155 155 }; 156 156 … … 202 202 203 203 #ifdef XML_MIN_SIZE 204 static 205 int sb_byteType(const ENCODING * enc, const char *p) 204 static int EXPATENTRY sb_byteType(const ENCODING * enc, const char *p) 206 205 { 207 206 return SB_BYTE_TYPE(enc, p); … … 217 216 (((const struct normal_encoding *)(enc))->byteToAscii(enc, p)) 218 217 static 219 int sb_byteToAscii(const ENCODING * enc, const char *p)218 int EXPATENTRY sb_byteToAscii(const ENCODING * enc, const char *p) 220 219 { 221 220 return *p; … … 246 245 (((const struct normal_encoding *)(enc))->charMatches(enc, p, c)) 247 246 static 248 int sb_charMatches(const ENCODING * enc, const char *p, int c)247 int EXPATENTRY sb_charMatches(const ENCODING * enc, const char *p, int c) 249 248 { 250 249 return *p == c; … … 276 275 }; 277 276 278 static void utf8_toUtf8(const ENCODING * enc,277 static void EXPATENTRY utf8_toUtf8(const ENCODING * enc, 279 278 const char **fromP, 280 279 const char *fromLim, … … 302 301 } 303 302 304 static void utf8_toUtf16(const ENCODING * enc,303 static void EXPATENTRY utf8_toUtf16(const ENCODING * enc, 305 304 const char **fromP, 306 305 const char *fromLim, … … 397 396 }; 398 397 399 static void latin1_toUtf8(const ENCODING * enc,398 static void EXPATENTRY latin1_toUtf8(const ENCODING * enc, 400 399 const char **fromP, 401 400 const char *fromLim, … … 427 426 } 428 427 429 static void latin1_toUtf16(const ENCODING * enc,428 static void EXPATENTRY latin1_toUtf16(const ENCODING * enc, 430 429 const char **fromP, 431 430 const char *fromLim, … … 463 462 }; 464 463 465 static void ascii_toUtf8(const ENCODING * enc,464 static void EXPATENTRY ascii_toUtf8(const ENCODING * enc, 466 465 const char **fromP, 467 466 const char *fromLim, … … 526 525 527 526 #define DEFINE_UTF16_TO_UTF8(E) \ 528 static \ 529 void E ## toUtf8(const ENCODING *enc, \ 527 static void EXPATENTRY E ## toUtf8(const ENCODING *enc, \ 530 528 const char **fromP, const char *fromLim, \ 531 529 char **toP, const char *toLim) \ … … 589 587 590 588 #define DEFINE_UTF16_TO_UTF16(E) \ 591 static \ 592 void E ## toUtf16(const ENCODING *enc, \ 589 static void EXPATENTRY E ## toUtf16(const ENCODING *enc, \ 593 590 const char **fromP, const char *fromLim, \ 594 591 unsigned short **toP, const unsigned short *toLim) \ … … 638 635 639 636 #ifdef XML_MIN_SIZE 640 641 static 642 int little2_byteType(const ENCODING * enc, const char *p) 637 static int EXPATENTRY little2_byteType(const ENCODING * enc, const char *p) 643 638 { 644 639 return LITTLE2_BYTE_TYPE(enc, p); 645 640 } 646 641 647 static int little2_byteToAscii(const ENCODING * enc, const char *p)642 static int EXPATENTRY little2_byteToAscii(const ENCODING * enc, const char *p) 648 643 { 649 644 return LITTLE2_BYTE_TO_ASCII(enc, p); 650 645 } 651 646 652 static int little2_charMatches(const ENCODING * enc, const char *p, int c)647 static int EXPATENTRY little2_charMatches(const ENCODING * enc, const char *p, int c) 653 648 { 654 649 return LITTLE2_CHAR_MATCHES(enc, p, c); 655 650 } 656 651 657 static int little2_isNameMin(const ENCODING * enc, const char *p)652 static int EXPATENTRY little2_isNameMin(const ENCODING * enc, const char *p) 658 653 { 659 654 return LITTLE2_IS_NAME_CHAR_MINBPC(enc, p); 660 655 } 661 656 662 static int little2_isNmstrtMin(const ENCODING * enc, const char *p)657 static int EXPATENTRY little2_isNmstrtMin(const ENCODING * enc, const char *p) 663 658 { 664 659 return LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p); … … 778 773 #ifdef XML_MIN_SIZE 779 774 780 static int big2_byteType(const ENCODING * enc, const char *p)775 static int EXPATENTRY big2_byteType(const ENCODING * enc, const char *p) 781 776 { 782 777 return BIG2_BYTE_TYPE(enc, p); 783 778 } 784 779 785 static int big2_byteToAscii(const ENCODING * enc, const char *p)780 static int EXPATENTRY big2_byteToAscii(const ENCODING * enc, const char *p) 786 781 { 787 782 return BIG2_BYTE_TO_ASCII(enc, p); 788 783 } 789 784 790 static int big2_charMatches(const ENCODING * enc, const char *p, int c)785 static int EXPATENTRY big2_charMatches(const ENCODING * enc, const char *p, int c) 791 786 { 792 787 return BIG2_CHAR_MATCHES(enc, p, c); 793 788 } 794 789 795 static int big2_isNameMin(const ENCODING * enc, const char *p)790 static int EXPATENTRY big2_isNameMin(const ENCODING * enc, const char *p) 796 791 { 797 792 return BIG2_IS_NAME_CHAR_MINBPC(enc, p); 798 793 } 799 794 800 static int big2_isNmstrtMin(const ENCODING * enc, const char *p)795 static int EXPATENTRY big2_isNmstrtMin(const ENCODING * enc, const char *p) 801 796 { 802 797 return BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p); … … 923 918 } 924 919 925 static void initUpdatePosition(const ENCODING * enc, const char *ptr,920 static void EXPATENTRY initUpdatePosition(const ENCODING * enc, const char *ptr, 926 921 const char *end, POSITION * pos) 927 922 { … … 929 924 } 930 925 931 static int toAscii(const ENCODING * enc, const char *ptr, const char *end)926 static int EXPATENTRY toAscii(const ENCODING * enc, const char *ptr, const char *end) 932 927 { 933 928 char buf[1]; … … 941 936 } 942 937 943 static int isSpace(int c)938 static int EXPATENTRY isSpace(int c) 944 939 { 945 940 switch (c) … … 956 951 /* Return 1 if there's just optional white space 957 952 * or there's an S followed by name=val. */ 958 static int parsePseudoAttribute(const ENCODING * enc,953 static int EXPATENTRY parsePseudoAttribute(const ENCODING * enc, 959 954 const char *ptr, 960 955 const char *end, … … 1288 1283 } 1289 1284 1290 static int unknown_isName(const ENCODING * enc, const char *p)1285 static int EXPATENTRY unknown_isName(const ENCODING * enc, const char *p) 1291 1286 { 1292 1287 int c = ((const struct unknown_encoding *)enc) … … 1298 1293 } 1299 1294 1300 static int unknown_isNmstrt(const ENCODING * enc, const char *p)1295 static int EXPATENTRY unknown_isNmstrt(const ENCODING * enc, const char *p) 1301 1296 { 1302 1297 int c = ((const struct unknown_encoding *)enc) … … 1308 1303 } 1309 1304 1310 static int unknown_isInvalid(const ENCODING * enc, const char *p)1305 static int EXPATENTRY unknown_isInvalid(const ENCODING * enc, const char *p) 1311 1306 { 1312 1307 int c = ((const struct unknown_encoding *)enc) … … 1316 1311 } 1317 1312 1318 static void unknown_toUtf8(const ENCODING * enc,1313 static void EXPATENTRY unknown_toUtf8(const ENCODING * enc, 1319 1314 const char **fromP, 1320 1315 const char *fromLim, … … 1359 1354 } 1360 1355 1361 static void unknown_toUtf16(const ENCODING * enc,1356 static void EXPATENTRY unknown_toUtf16(const ENCODING * enc, 1362 1357 const char **fromP, 1363 1358 const char *fromLim, … … 1395 1390 { 1396 1391 int i; 1397 struct unknown_encoding *e = mem;1392 struct unknown_encoding *e = (struct unknown_encoding*)mem; 1398 1393 1399 1394 // gee, isn't this a regular memcpy?!? … … 1563 1558 1564 1559 1565 static int initScan(const ENCODING ** encodingTable,1560 static int EXPATENTRY initScan(const ENCODING ** encodingTable, 1566 1561 const INIT_ENCODING * enc, 1567 1562 int state, … … 1708 1703 ENCODING * XmlInitUnknownEncodingNS(void *mem, 1709 1704 int *table, 1710 int (* convert) (void *userData, const char *p),1705 int (* EXPATENTRY convert) (void *userData, const char *p), 1711 1706 void *userData) 1712 1707 { -
trunk/src/helpers/xmltok_impl.c
r97 r98 1 1 2 /* 2 Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd 3 See the file COPYING for copying permission. 4 */ 3 *sourcefile xmltok_impl.c 4 * part of the expat implementation. See xmlparse.c. 5 * 6 * NOTE: This file must not be compiled directly. It is 7 * #include'd from xmltok.c several times. 8 */ 9 10 /* 11 * Copyright (C) 2001 Ulrich Mller. 12 * Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd. 13 * and Clark Cooper. 14 * 15 * Permission is hereby granted, free of charge, to any person obtaining 16 * a copy of this software and associated documentation files (the 17 * "Software"), to deal in the Software without restriction, including 18 * without limitation the rights to use, copy, modify, merge, publish, 19 * distribute, sublicense, and/or sell copies of the Software, and to 20 * permit persons to whom the Software is furnished to do so, subject to 21 * the following conditions: 22 * 23 * The above copyright notice and this permission notice shall be included 24 * in all copies or substantial portions of the Software. 25 * 26 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 27 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 28 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 29 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 30 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 31 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 32 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 33 */ 5 34 6 35 #ifndef IS_INVALID_CHAR … … 88 117 /* ptr points to character following "<!-" */ 89 118 90 static 91 int PREFIX(scanComment)(const ENCODING *enc, const char *ptr, const char *end, 92 const char **nextTokPtr) 119 static int EXPATENTRY PREFIX(scanComment)(const ENCODING *enc, 120 const char *ptr, 121 const char *end, 122 const char **nextTokPtr) 93 123 { 94 124 if (ptr != end) { … … 126 156 /* ptr points to character following "<!" */ 127 157 128 static 129 int PREFIX(scanDecl)(const ENCODING *enc, const char *ptr, const char *end, 158 static int EXPATENTRY PREFIX(scanDecl)(const ENCODING *enc, const char *ptr, const char *end, 130 159 const char **nextTokPtr) 131 160 { … … 173 202 } 174 203 175 static 176 int PREFIX(checkPiTarget)(const ENCODING *enc, const char *ptr, const char *end, int *tokPtr) 204 static int EXPATENTRY PREFIX(checkPiTarget)(const ENCODING *enc, const char *ptr, const char *end, int *tokPtr) 177 205 { 178 206 int upper = 0; … … 217 245 /* ptr points to character following "<?" */ 218 246 219 static 220 int PREFIX(scanPi)(const ENCODING *enc, const char *ptr, const char *end, 247 static int EXPATENTRY PREFIX(scanPi)(const ENCODING *enc, const char *ptr, const char *end, 221 248 const char **nextTokPtr) 222 249 { … … 280 307 281 308 282 static 283 int PREFIX(scanCdataSection)(const ENCODING *enc, const char *ptr, const char *end, 309 static int EXPATENTRY PREFIX(scanCdataSection)(const ENCODING *enc, const char *ptr, const char *end, 284 310 const char **nextTokPtr) 285 311 { … … 299 325 } 300 326 301 static 302 int PREFIX(cdataSectionTok)(const ENCODING *enc, const char *ptr, const char *end, 327 static int EXPATENTRY PREFIX(cdataSectionTok)(const ENCODING *enc, const char *ptr, const char *end, 303 328 const char **nextTokPtr) 304 329 { … … 377 402 /* ptr points to character following "</" */ 378 403 379 static 380 int PREFIX(scanEndTag)(const ENCODING *enc, const char *ptr, const char *end, 404 static int EXPATENTRY PREFIX(scanEndTag)(const ENCODING *enc, const char *ptr, const char *end, 381 405 const char **nextTokPtr) 382 406 { … … 425 449 /* ptr points to character following "&#X" */ 426 450 427 static 428 int PREFIX(scanHexCharRef)(const ENCODING *enc, const char *ptr, const char *end, 451 static int EXPATENTRY PREFIX(scanHexCharRef)(const ENCODING *enc, const char *ptr, const char *end, 429 452 const char **nextTokPtr) 430 453 { … … 457 480 /* ptr points to character following "&#" */ 458 481 459 static 460 int PREFIX(scanCharRef)(const ENCODING *enc, const char *ptr, const char *end, 482 static int EXPATENTRY PREFIX(scanCharRef)(const ENCODING *enc, const char *ptr, const char *end, 461 483 const char **nextTokPtr) 462 484 { … … 489 511 /* ptr points to character following "&" */ 490 512 491 static 492 int PREFIX(scanRef)(const ENCODING *enc, const char *ptr, const char *end, 513 static int EXPATENTRY PREFIX(scanRef)(const ENCODING *enc, const char *ptr, const char *end, 493 514 const char **nextTokPtr) 494 515 { … … 519 540 /* ptr points to character following first character of attribute name */ 520 541 521 static 522 int PREFIX(scanAtts)(const ENCODING *enc, const char *ptr, const char *end, 542 static int EXPATENTRY PREFIX(scanAtts)(const ENCODING *enc, const char *ptr, const char *end, 523 543 const char **nextTokPtr) 524 544 { … … 679 699 /* ptr points to character following "<" */ 680 700 681 static 682 int PREFIX(scanLt)(const ENCODING *enc, const char *ptr, const char *end, 701 static int EXPATENTRY PREFIX(scanLt)(const ENCODING *enc, const char *ptr, const char *end, 683 702 const char **nextTokPtr) 684 703 { … … 778 797 } 779 798 780 static 781 int PREFIX(contentTok)(const ENCODING *enc, const char *ptr, const char *end, 799 static int EXPATENTRY PREFIX(contentTok)(const ENCODING *enc, const char *ptr, const char *end, 782 800 const char **nextTokPtr) 783 801 { … … 877 895 /* ptr points to character following "%" */ 878 896 879 static 880 int PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end, 897 static int EXPATENTRY PREFIX(scanPercent)(const ENCODING *enc, const char *ptr, const char *end, 881 898 const char **nextTokPtr) 882 899 { … … 906 923 } 907 924 908 static 909 int PREFIX(scanPoundName)(const ENCODING *enc, const char *ptr, const char *end, 925 static int EXPATENTRY PREFIX(scanPoundName)(const ENCODING *enc, const char *ptr, const char *end, 910 926 const char **nextTokPtr) 911 927 { … … 933 949 } 934 950 935 static 936 int PREFIX(scanLit)(int open, const ENCODING *enc, 951 static int EXPATENTRY PREFIX(scanLit)(int open, const ENCODING *enc, 937 952 const char *ptr, const char *end, 938 953 const char **nextTokPtr) … … 965 980 } 966 981 967 static 968 int PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end, 982 static int EXPATENTRY PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end, 969 983 const char **nextTokPtr) 970 984 { … … 1193 1207 } 1194 1208 1195 static 1196 int PREFIX(attributeValueTok)(const ENCODING *enc, const char *ptr, const char *end, 1209 static int EXPATENTRY PREFIX(attributeValueTok)(const ENCODING *enc, const char *ptr, const char *end, 1197 1210 const char **nextTokPtr) 1198 1211 { … … 1251 1264 } 1252 1265 1253 static 1254 int PREFIX(entityValueTok)(const ENCODING *enc, const char *ptr, const char *end, 1266 static int EXPATENTRY PREFIX(entityValueTok)(const ENCODING *enc, const char *ptr, const char *end, 1255 1267 const char **nextTokPtr) 1256 1268 { … … 1308 1320 #ifdef XML_DTD 1309 1321 1310 static 1311 int PREFIX(ignoreSectionTok)(const ENCODING *enc, const char *ptr, const char *end, 1322 static int EXPATENTRY PREFIX(ignoreSectionTok)(const ENCODING *enc, const char *ptr, const char *end, 1312 1323 const char **nextTokPtr) 1313 1324 { … … 1361 1372 #endif /* XML_DTD */ 1362 1373 1363 static 1364 int PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end, 1374 static int EXPATENTRY PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end, 1365 1375 const char **badPtr) 1366 1376 { … … 1420 1430 are stored in atts. */ 1421 1431 1422 static 1423 int PREFIX(getAtts)(const ENCODING *enc, const char *ptr, 1432 static int EXPATENTRY PREFIX(getAtts)(const ENCODING *enc, const char *ptr, 1424 1433 int attsMax, ATTRIBUTE *atts) 1425 1434 { … … 1513 1522 } 1514 1523 1515 static 1516 int PREFIX(charRefNumber)(const ENCODING *enc, const char *ptr) 1524 static int EXPATENTRY PREFIX(charRefNumber)(const ENCODING *enc, const char *ptr) 1517 1525 { 1518 1526 int result = 0; … … 1553 1561 } 1554 1562 1555 static 1556 int PREFIX(predefinedEntityName)(const ENCODING *enc, const char *ptr, const char *end) 1563 static int EXPATENTRY PREFIX(predefinedEntityName)(const ENCODING *enc, const char *ptr, const char *end) 1557 1564 { 1558 1565 switch ((end - ptr)/MINBPC(enc)) { … … 1606 1613 } 1607 1614 1608 static 1609 int PREFIX(sameName)(const ENCODING *enc, const char *ptr1, const char *ptr2) 1615 static int EXPATENTRY PREFIX(sameName)(const ENCODING *enc, const char *ptr1, const char *ptr2) 1610 1616 { 1611 1617 for (;;) { … … 1670 1676 } 1671 1677 1672 static 1673 int PREFIX(nameMatchesAscii)(const ENCODING *enc, const char *ptr1, 1678 static int EXPATENTRY PREFIX(nameMatchesAscii)(const ENCODING *enc, const char *ptr1, 1674 1679 const char *end1, const char *ptr2) 1675 1680 { … … 1683 1688 } 1684 1689 1685 static 1686 int PREFIX(nameLength)(const ENCODING *enc, const char *ptr) 1690 static int EXPATENTRY PREFIX(nameLength)(const ENCODING *enc, const char *ptr) 1687 1691 { 1688 1692 const char *start = ptr; … … 1710 1714 } 1711 1715 1712 static 1713 const char *PREFIX(skipS)(const ENCODING *enc, const char *ptr) 1716 static const char* EXPATENTRY PREFIX(skipS)(const ENCODING *enc, const char *ptr) 1714 1717 { 1715 1718 for (;;) { … … 1726 1729 } 1727 1730 1728 static 1729 void PREFIX(updatePosition)(const ENCODING *enc, 1731 static void EXPATENTRY PREFIX(updatePosition)(const ENCODING *enc, 1730 1732 const char *ptr, 1731 1733 const char *end, -
trunk/src/helpers/xmltok_ns.c
r97 r98 27 27 }; 28 28 29 static 30 int NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end, 29 static int EXPATENTRY NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end, 31 30 const char **nextTokPtr) 32 31 { … … 34 33 } 35 34 36 static 37 int NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end, 35 static int EXPATENTRY NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end, 38 36 const char **nextTokPtr) 39 37 {
Note:
See TracChangeset
for help on using the changeset viewer.