Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch deCONST Excluding Merge-Ins
This is equivalent to a diff from a54f9b058d to 9eb5979f33
2018-04-07
| ||
00:59 | Still builds (and works) back to 8.4 (and maybe even to 8.3) and now new also with (current) 9.0. Test suite needs some more updates to work w/ 9.0 without errors. check-in: c20f5260c7 user: rolf tags: trunk | |
00:51 | Builds now with 8.4 (and maybe even with 8.3) until (current) 9.0. Test suite needs some more updates to work w/ 9.0 without errors. Closed-Leaf check-in: 9eb5979f33 user: rolf tags: deCONST | |
2018-04-06
| ||
16:18 | Merged from trunk. check-in: 920496e776 user: rolf tags: deCONST | |
16:18 | Pruned out more old ANSI_ARGS usage. check-in: a54f9b058d user: rolf tags: trunk | |
09:44 | Test to document problem fixed with [0fb34974584ae2]. check-in: d573bb0b47 user: rolf tags: trunk | |
Changes to doc/expatapi.html.
154 154 parser object in the interpreter <i class="m">interp</i>, otherwise it returns 155 155 0. Example:</p><pre class="example"> 156 156 int 157 157 TclExampleObjCmd(dummy, interp, objc, objv) 158 158 ClientData dummy; 159 159 Tcl_Interp *interp; 160 160 int objc; 161 - Tcl_Obj *CONST objv[]; 161 + Tcl_Obj *const objv[]; 162 162 { 163 163 char *method; 164 164 CHandlerSet *handlerSet; 165 165 int methodIndex, result; 166 166 simpleCounter *counter; 167 167 168 168
Changes to doc/expatapi.n.
324 324 .CS 325 325 326 326 int 327 327 TclExampleObjCmd(dummy, interp, objc, objv) 328 328 ClientData dummy; 329 329 Tcl_Interp *interp; 330 330 int objc; 331 - Tcl_Obj *CONST objv[]; 331 + Tcl_Obj *const objv[]; 332 332 { 333 333 char *method; 334 334 CHandlerSet *handlerSet; 335 335 int methodIndex, result; 336 336 simpleCounter *counter; 337 337 338 338
Changes to doc/expatapi.xml.
191 191 192 192 <example> 193 193 int 194 194 TclExampleObjCmd(dummy, interp, objc, objv) 195 195 ClientData dummy; 196 196 Tcl_Interp *interp; 197 197 int objc; 198 - Tcl_Obj *CONST objv[]; 198 + Tcl_Obj *const objv[]; 199 199 { 200 200 char *method; 201 201 CHandlerSet *handlerSet; 202 202 int methodIndex, result; 203 203 simpleCounter *counter; 204 204 205 205
Changes to generic/dom.c.
1810 1810 /*--------------------------------------------------------------------------- 1811 1811 | externalEntityRefHandler 1812 1812 | 1813 1813 \--------------------------------------------------------------------------*/ 1814 1814 static int 1815 1815 externalEntityRefHandler ( 1816 1816 XML_Parser parser, 1817 - CONST char *openEntityNames, 1818 - CONST char *base, 1819 - CONST char *systemId, 1820 - CONST char *publicId 1817 + const char *openEntityNames, 1818 + const char *base, 1819 + const char *systemId, 1820 + const char *publicId 1821 1821 ) 1822 1822 { 1823 1823 domReadInfo *info = (domReadInfo *) XML_GetUserData (parser); 1824 1824 1825 1825 Tcl_Obj *cmdPtr, *resultObj, *resultTypeObj, *extbaseObj, *xmlstringObj; 1826 1826 Tcl_Obj *channelIdObj; 1827 1827 int result, mode, done, byteIndex, i; ................................................................................ 1829 1829 size_t len; 1830 1830 int tclLen; 1831 1831 XML_Parser extparser, oldparser = NULL; 1832 1832 char buf[4096], *resultType, *extbase, *xmlstring, *channelId, s[50]; 1833 1833 Tcl_Channel chan = (Tcl_Channel) NULL; 1834 1834 enum XML_Status status; 1835 1835 XML_Index storedNextFeedbackPosition; 1836 - CONST84 char *interpResult; 1836 + const char *interpResult; 1837 1837 1838 1838 if (info->document->extResolver == NULL) { 1839 1839 Tcl_AppendResult (info->interp, "Can't read external entity \"", 1840 1840 systemId, "\": No -externalentitycommand given", 1841 1841 NULL); 1842 1842 return 0; 1843 1843 } ................................................................................ 5329 5329 } 5330 5330 5331 5331 int 5332 5332 TclTdomObjCmd (dummy, interp, objc, objv) 5333 5333 ClientData dummy; 5334 5334 Tcl_Interp *interp; 5335 5335 int objc; 5336 - Tcl_Obj *CONST objv[]; 5336 + Tcl_Obj *const objv[]; 5337 5337 { 5338 5338 char *encodingName; 5339 5339 CHandlerSet *handlerSet; 5340 5340 int methodIndex, result, bool; 5341 5341 tdomCmdReadInfo *info; 5342 5342 TclGenExpatInfo *expat; 5343 5343 Tcl_Obj *newObjName = NULL; 5344 5344 TEncoding *encoding; 5345 5345 5346 - static CONST84 char *tdomMethods[] = { 5346 + static const char *tdomMethods[] = { 5347 5347 "enable", "getdoc", 5348 5348 "setResultEncoding", "setStoreLineColumn", 5349 5349 "setExternalEntityResolver", "keepEmpties", 5350 5350 "remove", "ignorexmlns", "keepCDATA", 5351 5351 NULL 5352 5352 }; 5353 5353 enum tdomMethod {
Changes to generic/dom.h.
82 82 my_malloc, my_realloc, my_free 83 83 }; 84 84 # define MEM_SUITE &memsuite 85 85 #else 86 86 # define MEM_SUITE NULL 87 87 #endif 88 88 89 -/* 90 - * Beginning with 8.4, Tcl API is CONST'ified 91 - */ 92 -#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION <= 3) 93 -# define CONST84 94 -#endif 95 - 96 89 /* 97 90 * Beginning with 8.6, interp->errorLine isn't public visible anymore 98 91 * (TIP 330) 99 92 */ 100 93 #if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 6) 101 94 # define Tcl_GetErrorLine(interp) (interp)->errorLine 102 95 #endif
Changes to generic/domxslt.c.
5904 5904 { 5905 5905 Tcl_Obj *cmdPtr, *resultObj, *extbaseObj, *xmlstringObj; 5906 5906 Tcl_Obj *channelIdObj, *resultTypeObj; 5907 5907 int len, mode, result, storeLineColumn; 5908 5908 int resultcode = 0; 5909 5909 char *resultType, *extbase, *xmlstring, *channelId, s[20]; 5910 5910 Tcl_Obj *extResolver = NULL; 5911 - CONST84 char *str; 5911 + const char *str; 5912 5912 domDocument *doc; 5913 5913 xsltSubDoc *sdoc; 5914 5914 XML_Parser parser; 5915 5915 Tcl_Channel chan; 5916 5916 Tcl_DString dStr; 5917 5917 5918 5918 if (isStylesheet && (href[0] == '\0')) {
Changes to generic/nodecmd.c.
103 103 /*---------------------------------------------------------------------------- 104 104 | Forward declarations 105 105 | 106 106 \---------------------------------------------------------------------------*/ 107 107 static void * StackPush (void *); 108 108 static void * StackPop (void); 109 109 static void * StackTop (void); 110 -static int NodeObjCmd (ClientData,Tcl_Interp*,int,Tcl_Obj *CONST o[]); 110 +static int NodeObjCmd (ClientData,Tcl_Interp*,int,Tcl_Obj *const o[]); 111 111 static void StackFinalize (ClientData); 112 112 113 113 extern int tcldom_appendXML (Tcl_Interp*, domNode*, Tcl_Obj*); 114 114 115 115 116 116 /*---------------------------------------------------------------------------- 117 117 | StackPush ................................................................................ 278 278 | 279 279 \---------------------------------------------------------------------------*/ 280 280 static int 281 281 NodeObjCmd ( 282 282 ClientData arg, /* Type of node to create. */ 283 283 Tcl_Interp * interp, /* Current interpreter. */ 284 284 int objc, /* Number of arguments. */ 285 - Tcl_Obj *CONST objv[] /* Argument objects. */ 285 + Tcl_Obj *const objv[] /* Argument objects. */ 286 286 ) { 287 287 int type, createType, len, dlen, i, ret, disableOutputEscaping = 0, 288 288 index = 1; 289 289 char *tag, *p, *tval, *aval; 290 290 domNode *parent, *newNode = NULL; 291 291 domTextNode *textNode = NULL; 292 292 domDocument *doc; ................................................................................ 516 516 | % puts [$n asHTML] 517 517 | 518 518 \---------------------------------------------------------------------------*/ 519 519 int 520 520 nodecmd_createNodeCmd ( 521 521 Tcl_Interp * interp, /* Current interpreter. */ 522 522 int objc, /* Number of arguments. */ 523 - Tcl_Obj *CONST objv[], /* Argument objects. */ 523 + Tcl_Obj *const objv[], /* Argument objects. */ 524 524 int checkName, /* Flag: Name checks? */ 525 525 int checkCharData /* Flag: Data checks? */ 526 526 ) { 527 527 int index, ret, type, nodecmd = 0, jsonType = 0, haveJsonType = 0; 528 528 int isElement = 0; 529 529 char *nsName, buf[64]; 530 530 Tcl_Obj *tagName = NULL, *namespace = NULL; ................................................................................ 537 537 * dom createNodeCmd ?-returnNodeCmd? nodeType commandName 538 538 */ 539 539 540 540 enum subCmd { 541 541 ELM_NODE, TXT_NODE, CDS_NODE, CMT_NODE, PIC_NODE, PRS_NODE 542 542 }; 543 543 544 - static CONST84 char *subcmds[] = { 544 + static const char *subcmds[] = { 545 545 "elementNode", "textNode", "cdataNode", "commentNode", "piNode", 546 546 "parserNode", NULL 547 547 }; 548 548 549 - static CONST84 char *options[] = { 549 + static const char *options[] = { 550 550 "-returnNodeCmd", "-jsonType", "-tagName", "-namespace", NULL 551 551 }; 552 552 553 553 enum option { 554 554 o_returnNodeCmd, o_jsonType, o_tagName, o_namespace 555 555 }; 556 556
Changes to generic/nodecmd.h.
30 30 | Written by Zoran Vasiljevic 31 31 | July 12, 2000 32 32 | 33 33 \---------------------------------------------------------------------------*/ 34 34 35 35 int nodecmd_createNodeCmd (Tcl_Interp * interp, 36 36 int objc, 37 - Tcl_Obj *CONST objv[], 37 + Tcl_Obj *const objv[], 38 38 int checkName, 39 39 int checkCharData); 40 40 41 41 int nodecmd_appendFromScript (Tcl_Interp *interp, 42 42 domNode *node, 43 43 Tcl_Obj *cmdObj); 44 44
Changes to generic/tcldom.c.
356 356 " jsonType ?jsonType? \n" 357 357 TDomThreaded( 358 358 " readlock \n" 359 359 " writelock \n" 360 360 ) 361 361 ; 362 362 363 -static CONST84 char *jsonTypes[] = { 363 +static const char *jsonTypes[] = { 364 364 "NONE", 365 365 "ARRAY", 366 366 "OBJECT", 367 367 "NULL", 368 368 "TRUE", 369 369 "FALSE", 370 370 "STRING", ................................................................................ 394 394 SetTdomNodeFromAny 395 395 }; 396 396 397 397 /*---------------------------------------------------------------------------- 398 398 | Prototypes for procedures defined later in this file: 399 399 | 400 400 \---------------------------------------------------------------------------*/ 401 - 401 +#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION <= 3) 402 +/* 403 + * Before Tcl 8.4, Tcl_VarTraceProc and Tcl_CmdDeleteProc were not 404 + * CONST84'ified. When compiling with -DTCL_NO_DEPRECATED, CONST84 is 405 + * gone, therefore we can't use the function type definitions of 406 + * Tcl_VarTraceProc and Tcl_CmdDeleteProc for these old version. 407 + * 408 + */ 409 +static char * tcldom_docTrace( 410 + ClientData clientData, Tcl_Interp *interp, 411 + const char *part1, const char *part2, int flags); 412 +static void tcldom_docCmdDeleteProc(ClientData clientData); 413 +#else 402 414 static Tcl_VarTraceProc tcldom_docTrace; 403 - 404 415 static Tcl_CmdDeleteProc tcldom_docCmdDeleteProc; 416 +#endif 405 417 406 418 static void tcldom_treeAsJSON(Tcl_Obj *jstring, domNode *node, 407 419 Tcl_Channel channel, int indent, 408 420 int level, 409 421 int inside); 410 422 411 423 #ifdef TCL_THREADS ................................................................................ 525 537 | tcldom_docTrace 526 538 | 527 539 \---------------------------------------------------------------------------*/ 528 540 static 529 541 char * tcldom_docTrace ( 530 542 ClientData clientData, 531 543 Tcl_Interp *interp, 532 - CONST84 char *name1, 533 - CONST84 char *name2, 544 + const char *name1, 545 + const char *name2, 534 546 int flags 535 547 ) 536 548 { 537 549 domDeleteInfo *dinfo = (domDeleteInfo*) clientData; 538 550 domDocument *doc = dinfo->document; 539 551 char objCmdName[80]; 540 552 ................................................................................ 952 964 \---------------------------------------------------------------------------*/ 953 965 static 954 966 int tcldom_xpointerSearch ( 955 967 Tcl_Interp * interp, 956 968 int mode, 957 969 domNode * node, 958 970 int objc, 959 - Tcl_Obj * CONST objv[] 971 + Tcl_Obj * const objv[] 960 972 ) 961 973 { 962 974 char *str; 963 975 int i = 0; 964 976 int result = 0; 965 977 int all = 0; 966 978 int instance = 0; ................................................................................ 1621 1633 char * tcldom_xpathResolveVar ( 1622 1634 void *clientData, 1623 1635 char *strToParse, 1624 1636 int *offset, 1625 1637 char **errMsg 1626 1638 ) 1627 1639 { 1628 - CONST char *varValue; 1629 - CONST char *termPtr; 1640 + const char *varValue; 1641 + const char *termPtr; 1630 1642 Tcl_Interp *interp = (Tcl_Interp *) clientData; 1631 1643 1632 1644 *offset = 0; 1633 1645 varValue = Tcl_ParseVar(interp, strToParse, &termPtr); 1634 1646 if (varValue) { 1635 1647 *offset = termPtr - strToParse; 1636 1648 /* If strToParse start with a single '$' without a following ................................................................................ 1653 1665 | 1654 1666 \---------------------------------------------------------------------------*/ 1655 1667 static 1656 1668 int tcldom_selectNodes ( 1657 1669 Tcl_Interp *interp, 1658 1670 domNode *node, 1659 1671 int objc, 1660 - Tcl_Obj *CONST objv[] 1672 + Tcl_Obj *const objv[] 1661 1673 ) 1662 1674 { 1663 1675 char *xpathQuery, *typeVar, *option; 1664 1676 char *errMsg = NULL, **mappings = NULL; 1665 1677 int rc, i, len, optionIndex, localmapping = 0, cache = 0; 1666 1678 int mappingListObjLen = 0; 1667 1679 xpathResultSet rs; 1668 1680 Tcl_Obj *type, *objPtr, *objPtr1, *mappingListObj = NULL; 1669 1681 xpathCBs cbs; 1670 1682 xpathParseVarCB parseVarCB; 1671 1683 1672 - static CONST84 char *selectNodesOptions[] = { 1684 + static const char *selectNodesOptions[] = { 1673 1685 "-namespaces", "-cache", NULL 1674 1686 }; 1675 1687 enum selectNodesOption { 1676 1688 o_namespaces, o_cache 1677 1689 }; 1678 1690 1679 1691 if (objc < 2) { ................................................................................ 3440 3452 | serializeAsXML 3441 3453 | 3442 3454 \---------------------------------------------------------------------------*/ 3443 3455 static int serializeAsXML ( 3444 3456 domNode *node, 3445 3457 Tcl_Interp *interp, 3446 3458 int objc, 3447 - Tcl_Obj *CONST objv[] 3459 + Tcl_Obj *const objv[] 3448 3460 ) 3449 3461 { 3450 3462 char *channelId, prefix[MAX_PREFIX_LEN]; 3451 3463 const char *localName; 3452 3464 int indent, mode, escapeNonASCII = 0, doctypeDeclaration = 0; 3453 3465 int xmlDeclaration = 0; 3454 3466 int optionIndex, cdataChild, escapeAllQuot = 0; 3455 3467 Tcl_Obj *resultPtr, *encString = NULL; 3456 3468 Tcl_Channel chan = (Tcl_Channel) NULL; 3457 3469 Tcl_HashEntry *h; 3458 3470 Tcl_DString dStr; 3459 3471 int indentAttrs = -1; 3460 3472 3461 - static CONST84 char *asXMLOptions[] = { 3473 + static const char *asXMLOptions[] = { 3462 3474 "-indent", "-channel", "-escapeNonASCII", "-doctypeDeclaration", 3463 3475 "-xmlDeclaration", "-encString", "-escapeAllQuot", "-indentAttrs", 3464 3476 NULL 3465 3477 }; 3466 3478 enum asXMLOption { 3467 3479 m_indent, m_channel, m_escapeNonASCII, m_doctypeDeclaration, 3468 3480 m_xmlDeclaration, m_encString, m_escapeAllQuot, m_indentAttrs ................................................................................ 3645 3657 | serializeAsHTML 3646 3658 | 3647 3659 \---------------------------------------------------------------------------*/ 3648 3660 static int serializeAsHTML ( 3649 3661 domNode *node, 3650 3662 Tcl_Interp *interp, 3651 3663 int objc, 3652 - Tcl_Obj *CONST objv[] 3664 + Tcl_Obj *const objv[] 3653 3665 ) 3654 3666 { 3655 3667 char *channelId; 3656 3668 int optionIndex, mode, escapeNonASCII = 0, htmlEntities = 0; 3657 3669 int doctypeDeclaration = 0; 3658 3670 Tcl_Obj *resultPtr; 3659 3671 Tcl_Channel chan = (Tcl_Channel) NULL; 3660 3672 3661 - static CONST84 char *asHTMLOptions[] = { 3673 + static const char *asHTMLOptions[] = { 3662 3674 "-channel", "-escapeNonASCII", "-htmlEntities", "-doctypeDeclaration", 3663 3675 NULL 3664 3676 }; 3665 3677 enum asHTMLOption { 3666 3678 m_channel, m_escapeNonASCII, m_htmlEntities, m_doctypeDeclaration 3667 3679 }; 3668 3680 ................................................................................ 3743 3755 | serializeAsJSON 3744 3756 | 3745 3757 \---------------------------------------------------------------------------*/ 3746 3758 static int serializeAsJSON ( 3747 3759 domNode *node, 3748 3760 Tcl_Interp *interp, 3749 3761 int objc, 3750 - Tcl_Obj *CONST objv[] 3762 + Tcl_Obj *const objv[] 3751 3763 ) 3752 3764 { 3753 3765 char *channelId; 3754 3766 int optionIndex, mode, indent = -1; 3755 3767 Tcl_Obj *resultPtr; 3756 3768 Tcl_Channel chan = (Tcl_Channel) NULL; 3757 3769 3758 - static CONST84 char *asJSONOptions[] = { 3770 + static const char *asJSONOptions[] = { 3759 3771 "-channel", "-indent", 3760 3772 NULL 3761 3773 }; 3762 3774 enum asJSONOption { 3763 3775 m_channel, m_indent 3764 3776 }; 3765 3777 ................................................................................ 3837 3849 | cdataSectionElements 3838 3850 | 3839 3851 \---------------------------------------------------------------------------*/ 3840 3852 static int cdataSectionElements ( 3841 3853 domDocument *doc, 3842 3854 Tcl_Interp *interp, 3843 3855 int objc, 3844 - Tcl_Obj *CONST objv[] 3856 + Tcl_Obj *const objv[] 3845 3857 ) 3846 3858 { 3847 3859 int result, hnew; 3848 3860 Tcl_Obj *resultPtr,*namePtr; 3849 3861 Tcl_HashEntry *h; 3850 3862 Tcl_HashSearch search; 3851 3863 ................................................................................ 3927 3939 | selectNodesNamespaces 3928 3940 | 3929 3941 \---------------------------------------------------------------------------*/ 3930 3942 static int selectNodesNamespaces ( 3931 3943 domDocument *doc, 3932 3944 Tcl_Interp *interp, 3933 3945 int objc, 3934 - Tcl_Obj *CONST objv[] 3946 + Tcl_Obj *const objv[] 3935 3947 ) 3936 3948 { 3937 3949 int len, i, result; 3938 3950 Tcl_Obj *objPtr, *listPtr; 3939 3951 3940 3952 CheckArgs (2,3,2, "?prefixUriList?"); 3941 3953 if (objc == 3) { ................................................................................ 3981 3993 | renameNodes 3982 3994 | 3983 3995 \---------------------------------------------------------------------------*/ 3984 3996 static int renameNodes ( 3985 3997 domDocument *doc, 3986 3998 Tcl_Interp *interp, 3987 3999 int objc, 3988 - Tcl_Obj *CONST objv[] 4000 + Tcl_Obj *const objv[] 3989 4001 ) 3990 4002 { 3991 4003 int len, i, hnew; 3992 4004 Tcl_HashEntry *h; 3993 4005 Tcl_Obj *objPtr; 3994 4006 domNode *node; 3995 4007 ................................................................................ 4016 4028 | deleteXPathCache 4017 4029 | 4018 4030 \---------------------------------------------------------------------------*/ 4019 4031 static int deleteXPathCache ( 4020 4032 domDocument *doc, 4021 4033 Tcl_Interp *interp, 4022 4034 int objc, 4023 - Tcl_Obj *CONST objv[] 4035 + Tcl_Obj *const objv[] 4024 4036 ) 4025 4037 { 4026 4038 Tcl_HashEntry *h; 4027 4039 Tcl_HashSearch search; 4028 4040 4029 4041 CheckArgs (2,3,0, "<domDoc> deleteXPathCache ?xpathQuery?"); 4030 4042 if (objc == 3) { ................................................................................ 4058 4070 | 4059 4071 \---------------------------------------------------------------------------*/ 4060 4072 static int applyXSLT ( 4061 4073 domNode *node, 4062 4074 Tcl_Interp *interp, 4063 4075 void *clientData, 4064 4076 int objc, 4065 - Tcl_Obj *CONST objv[] 4077 + Tcl_Obj *const objv[] 4066 4078 ) 4067 4079 { 4068 4080 char *usage, **parameters = NULL, *errMsg, *option; 4069 4081 Tcl_Obj *objPtr, *localListPtr = (Tcl_Obj *)NULL; 4070 4082 int i, result, length, optionIndex; 4071 4083 int ignoreUndeclaredParameters = 0; 4072 4084 int maxApplyDepth = MAX_XSLT_APPLY_DEPTH; ................................................................................ 4079 4091 "?-xsltmessagecmd cmd? xsltDocNode ?varname?\""; 4080 4092 4081 4093 static char *cmd_usage = 4082 4094 "wrong # args: should be \"?-parameters parameterList? " 4083 4095 "?-ignoreUndeclaredParameters? ?-maxApplyDepth int? " 4084 4096 "?-xsltmessagecmd cmd? <xmlDocObj> ?objVar?\""; 4085 4097 4086 - static CONST84 char *xsltOptions[] = { 4098 + static const char *xsltOptions[] = { 4087 4099 "-parameters", "-ignoreUndeclaredParameters", 4088 4100 "-maxApplyDepth", "-xsltmessagecmd", NULL 4089 4101 }; 4090 4102 4091 4103 enum xsltOption { 4092 4104 m_parmeters, m_ignoreUndeclaredParameters, m_maxApplyDepth, 4093 4105 m_xsltmessagecmd ................................................................................ 4234 4246 | tcldom_XSLTObjCmd 4235 4247 | 4236 4248 \---------------------------------------------------------------------------*/ 4237 4249 static int tcldom_XSLTObjCmd ( 4238 4250 ClientData clientData, 4239 4251 Tcl_Interp *interp, 4240 4252 int objc, 4241 - Tcl_Obj *CONST objv[] 4253 + Tcl_Obj *const objv[] 4242 4254 ) 4243 4255 { 4244 4256 int index; 4245 4257 char *errMsg = NULL; 4246 4258 4247 - static CONST84 char *options[] = { 4259 + static const char *options[] = { 4248 4260 "transform", "delete", NULL 4249 4261 }; 4250 4262 enum option { 4251 4263 m_transform, m_delete 4252 4264 }; 4253 4265 4254 4266 ................................................................................ 4336 4348 | tcldom_NodeObjCmd 4337 4349 | 4338 4350 \---------------------------------------------------------------------------*/ 4339 4351 int tcldom_NodeObjCmd ( 4340 4352 ClientData clientData, 4341 4353 Tcl_Interp *interp, 4342 4354 int objc, 4343 - Tcl_Obj *CONST objv[] 4355 + Tcl_Obj *const objv[] 4344 4356 ) 4345 4357 { 4346 4358 GetTcldomTSD() 4347 4359 4348 4360 domNode *node, *child, *refChild, *oldChild, *refNode; 4349 4361 domNS *ns; 4350 4362 domAttrNode *attrs; ................................................................................ 4355 4367 int result, length, methodIndex, i, line, column; 4356 4368 int nsIndex, bool, hnew, legacy, jsonType; 4357 4369 Tcl_Obj *namePtr, *resultPtr; 4358 4370 Tcl_Obj *mobjv[MAX_REWRITE_ARGS]; 4359 4371 Tcl_CmdInfo cmdInfo; 4360 4372 Tcl_HashEntry *h; 4361 4373 4362 - static CONST84 char *nodeMethods[] = { 4374 + static const char *nodeMethods[] = { 4363 4375 "firstChild", "nextSibling", "getAttribute", "nodeName", 4364 4376 "nodeValue", "nodeType", "attributes", "asList", 4365 4377 "find", "setAttribute", "removeAttribute", "parentNode", 4366 4378 "previousSibling", "lastChild", "appendChild", "removeChild", 4367 4379 "hasChildNodes", "localName", "childNodes", "ownerDocument", 4368 4380 "insertBefore", "replaceChild", "getLine", "getColumn", 4369 4381 "asXML", "appendFromList", "child", "fsibling", ................................................................................ 5407 5419 | tcldom_DocObjCmd 5408 5420 | 5409 5421 \---------------------------------------------------------------------------*/ 5410 5422 int tcldom_DocObjCmd ( 5411 5423 ClientData clientData, 5412 5424 Tcl_Interp *interp, 5413 5425 int objc, 5414 - Tcl_Obj *CONST objv[] 5426 + Tcl_Obj *const objv[] 5415 5427 ) 5416 5428 { 5417 5429 GetTcldomTSD() 5418 5430 5419 5431 domDeleteInfo * dinfo; 5420 5432 domDocument * doc; 5421 5433 char * method, *tag, *data, *target, *uri, tmp[100]; ................................................................................ 5423 5435 int methodIndex, result, data_length, target_length, i; 5424 5436 int nsIndex, forXPath, bool, setDocumentElement = 0; 5425 5437 int restoreDomCreateCmdMode = 0; 5426 5438 domNode * n; 5427 5439 Tcl_CmdInfo cmdInfo; 5428 5440 Tcl_Obj * mobjv[MAX_REWRITE_ARGS]; 5429 5441 5430 - static CONST84 char *docMethods[] = { 5442 + static const char *docMethods[] = { 5431 5443 "documentElement", "getElementsByTagName", "delete", 5432 5444 "createElement", "createCDATASection", "createTextNode", 5433 5445 "createComment", "createProcessingInstruction", 5434 5446 "createElementNS", "getDefaultOutputMethod", "asXML", 5435 5447 "asHTML", "getElementsByTagNameNS", "xslt", 5436 5448 "publicId", "systemId", "internalSubset", 5437 5449 "toXSLTcmd", "asText", "normalize", ................................................................................ 6000 6012 Tcl_Obj * const objv[] 6001 6013 ) 6002 6014 { 6003 6015 int setVariable = 0, jsonType = 0, index; 6004 6016 domDocument *doc; 6005 6017 Tcl_Obj *newObjName = NULL; 6006 6018 6007 - static CONST84 char *options[] = {"-jsonType", NULL}; 6019 + static const char *options[] = {"-jsonType", NULL}; 6008 6020 6009 6021 CheckArgs(1,4,1,"?-jsonType jsonType? ?newObjVar?"); 6010 6022 6011 6023 if (objc == 2) { 6012 6024 newObjName = objv[1]; 6013 6025 setVariable = 1; 6014 6026 } ................................................................................ 6138 6150 { 6139 6151 GetTcldomTSD() 6140 6152 6141 6153 char *xml_string, *option, *errStr, *channelId, *baseURI = NULL; 6142 6154 char *jsonRoot = NULL; 6143 6155 Tcl_Obj *extResolver = NULL; 6144 6156 Tcl_Obj *feedbackCmd = NULL; 6145 - CONST84 char *interpResult; 6157 + const char *interpResult; 6146 6158 int optionIndex, value, xml_string_len, mode; 6147 6159 int jsonmaxnesting = JSON_MAX_NESTING; 6148 6160 int ignoreWhiteSpaces = 1; 6149 6161 int takeJSONParser = 0; 6150 6162 int takeSimpleParser = 0; 6151 6163 int takeHTMLParser = 0; 6152 6164 int takeGUMBOParser = 0; ................................................................................ 6159 6171 int status = 0; 6160 6172 domDocument *doc; 6161 6173 Tcl_Obj *newObjName = NULL; 6162 6174 XML_Parser parser; 6163 6175 Tcl_Channel chan = (Tcl_Channel) NULL; 6164 6176 Tcl_CmdInfo cmdInfo; 6165 6177 6166 - static CONST84 char *parseOptions[] = { 6178 + static const char *parseOptions[] = { 6167 6179 "-keepEmpties", "-simple", "-html", 6168 6180 "-feedbackAfter", "-channel", "-baseurl", 6169 6181 "-externalentitycommand", "-useForeignDTD", "-paramentityparsing", 6170 6182 "-feedbackcmd", "-json", "-jsonroot", 6171 6183 #ifdef TDOM_HAVE_GUMBO 6172 6184 "-html5", 6173 6185 #endif ................................................................................ 6182 6194 #ifdef TDOM_HAVE_GUMBO 6183 6195 o_htmlfive, 6184 6196 #endif 6185 6197 o_jsonmaxnesting, o_ignorexmlns, o_LAST, 6186 6198 o_keepCDATA 6187 6199 }; 6188 6200 6189 - static CONST84 char *paramEntityParsingValues[] = { 6201 + static const char *paramEntityParsingValues[] = { 6190 6202 "always", 6191 6203 "never", 6192 6204 "notstandalone", 6193 6205 (char *) NULL 6194 6206 }; 6195 6207 enum paramEntityParsingValue { 6196 6208 EXPAT_PARAMENTITYPARSINGALWAYS, ................................................................................ 6655 6667 Tcl_Interp *interp, 6656 6668 int objc, 6657 6669 Tcl_Obj * const objv[] 6658 6670 ) 6659 6671 { 6660 6672 int featureIndex, result; 6661 6673 6662 - static CONST84 char *features[] = { 6674 + static const char *features[] = { 6663 6675 "expatversion", "expatmajorversion", "expatminorversion", 6664 6676 "expatmicroversion", "dtd", "ns", 6665 6677 "unknown", "tdomalloc", "lessns", 6666 6678 "html5", "jsonmaxnesting", "versionhash", 6667 6679 "TCL_UTF_MAX", NULL 6668 6680 }; 6669 6681 enum feature { ................................................................................ 6759 6771 | tcldom_DomObjCmd 6760 6772 | 6761 6773 \---------------------------------------------------------------------------*/ 6762 6774 int tcldom_DomObjCmd ( 6763 6775 ClientData clientData, 6764 6776 Tcl_Interp * interp, 6765 6777 int objc, 6766 - Tcl_Obj * CONST objv[] 6778 + Tcl_Obj * const objv[] 6767 6779 ) 6768 6780 { 6769 6781 GetTcldomTSD() 6770 6782 6771 6783 char * method, tmp[300]; 6772 6784 int methodIndex, result, i, bool; 6773 6785 Tcl_CmdInfo cmdInfo; 6774 6786 Tcl_Obj * mobjv[MAX_REWRITE_ARGS]; 6775 6787 6776 - static CONST84 char *domMethods[] = { 6788 + static const char *domMethods[] = { 6777 6789 "createDocument", "createDocumentNS", "createNodeCmd", 6778 6790 "parse", "setResultEncoding", "setStoreLineColumn", 6779 6791 "isCharData", "isName", "isPIName", 6780 6792 "isQName", "isComment", "isCDATA", 6781 6793 "isPIValue", "isNCName", "createDocumentNode", 6782 6794 "setNameCheck", "setTextCheck", "setObjectCommands", 6783 6795 "featureinfo", "isBMPCharData", ................................................................................ 6795 6807 m_setNameCheck, m_setTextCheck, m_setObjectCommands, 6796 6808 m_featureinfo, m_isBMPCharData 6797 6809 #ifdef TCL_THREADS 6798 6810 ,m_attachDocument, m_detachDocument 6799 6811 #endif 6800 6812 }; 6801 6813 6802 - static CONST84 char *nodeModeValues[] = { 6814 + static const char *nodeModeValues[] = { 6803 6815 "automatic", "command", "token", NULL 6804 6816 }; 6805 6817 enum nodeModeValue { 6806 6818 v_automatic, v_command, v_token 6807 6819 }; 6808 6820 6809 6821 if (objc < 2) { ................................................................................ 7181 7193 | tcldom_unknownCmd 7182 7194 | 7183 7195 \---------------------------------------------------------------------------*/ 7184 7196 int tcldom_unknownCmd ( 7185 7197 ClientData clientData, 7186 7198 Tcl_Interp * interp, 7187 7199 int objc, 7188 - Tcl_Obj * CONST objv[] 7200 + Tcl_Obj * const objv[] 7189 7201 ) 7190 7202 { 7191 7203 int len, i, rc, openedParen, count, args; 7192 7204 char *cmd, *dot, *paren, *arg[MAX_REWRITE_ARGS], *object, *method; 7193 7205 Tcl_DString callString; 7194 7206 Tcl_CmdInfo cmdInfo; 7195 7207 Tcl_Obj *vector[2+MAX_REWRITE_ARGS];
Changes to generic/tclexpat.c.
110 110 TDomThreaded(static Tcl_Mutex counterMutex;) /* Protect the counter (zv) */ 111 111 112 112 /*---------------------------------------------------------------------------- 113 113 | Prototypes for procedures defined later in this file: 114 114 | 115 115 \---------------------------------------------------------------------------*/ 116 116 int TclExpatObjCmd (ClientData dummy, 117 - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); 117 + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); 118 118 static int TclExpatInstanceCmd (ClientData dummy, 119 - Tcl_Interp *interp, int objc, struct Tcl_Obj *CONST objv[]); 119 + Tcl_Interp *interp, int objc, struct Tcl_Obj *const objv[]); 120 120 static void TclExpatDeleteCmd (ClientData clientData); 121 121 122 122 static Tcl_Obj* FindUniqueCmdName (Tcl_Interp *interp); 123 123 static int TclExpatCheckWhiteData (char *pc, int len); 124 124 125 125 static int TclExpatInitializeParser (Tcl_Interp *interp, 126 126 TclGenExpatInfo *expat, int resetOptions ); 127 127 static void TclExpatFreeParser (TclGenExpatInfo *expat); 128 128 static int TclExpatParse (Tcl_Interp *interp, 129 129 TclGenExpatInfo *expat, char *data, int len, 130 130 TclExpat_InputType type); 131 131 static int TclExpatConfigure (Tcl_Interp *interp, 132 - TclGenExpatInfo *expat, int objc, Tcl_Obj *CONST objv[]); 132 + TclGenExpatInfo *expat, int objc, Tcl_Obj *const objv[]); 133 133 static int TclExpatCget (Tcl_Interp *interp, 134 - TclGenExpatInfo *expat, int objc, Tcl_Obj *CONST objv[]); 134 + TclGenExpatInfo *expat, int objc, Tcl_Obj *const objv[]); 135 135 136 136 static int TclExpatGet (Tcl_Interp *interp, 137 - TclGenExpatInfo *expat, int objc, Tcl_Obj *CONST objv[]); 137 + TclGenExpatInfo *expat, int objc, Tcl_Obj *const objv[]); 138 138 static void TclExpatDispatchPCDATA (TclGenExpatInfo *expat); 139 139 static void TclGenExpatElementStartHandler (void *userdata, 140 140 const XML_Char *name, 141 141 const XML_Char **atts); 142 142 static void TclGenExpatElementEndHandler (void *userData, 143 143 const XML_Char *name); 144 144 static void TclGenExpatCharacterDataHandler (void *userData, ................................................................................ 200 200 const XML_Char *encoding, 201 201 int standalone); 202 202 static void TclGenExpatEntityDeclHandler (void *userData, 203 203 const XML_Char *entityname, 204 204 int is_param, 205 205 const XML_Char *value, 206 206 int length, 207 - CONST XML_Char *base, 208 - CONST XML_Char *systemId, 209 - CONST XML_Char *publicId, 210 - CONST XML_Char *notationName); 207 + const XML_Char *base, 208 + const XML_Char *systemId, 209 + const XML_Char *publicId, 210 + const XML_Char *notationName); 211 211 212 212 /* 213 213 *---------------------------------------------------------------------------- 214 214 * 215 215 * CreateTclHandlerSet -- 216 216 * 217 217 * Malloc's and initializes a tclHandlerSet. ................................................................................ 337 337 */ 338 338 339 339 int 340 340 TclExpatObjCmd( 341 341 ClientData dummy, 342 342 Tcl_Interp *interp, 343 343 int objc, 344 - Tcl_Obj *CONST objv[] 344 + Tcl_Obj *const objv[] 345 345 ) { 346 346 TclGenExpatInfo *genexpat; 347 347 int ns_mode = 0; 348 348 char *nsoption; 349 349 350 350 351 351 /* ................................................................................ 650 650 * Stores the markup context in expapt->currentmarkup. 651 651 * 652 652 *---------------------------------------------------------------------------- 653 653 */ 654 654 static void 655 655 CurrentmarkupCommand ( 656 656 void *userData, 657 - CONST char *s, 657 + const char *s, 658 658 int len 659 659 ) { 660 660 TclGenExpatInfo *expat = (TclGenExpatInfo *) userData; 661 661 662 662 if (expat->status != TCL_OK) { 663 663 return; 664 664 } ................................................................................ 697 697 */ 698 698 699 699 static int 700 700 TclExpatInstanceCmd ( 701 701 ClientData clientData, 702 702 Tcl_Interp *interp, 703 703 int objc, 704 - Tcl_Obj *CONST objv[] 704 + Tcl_Obj *const objv[] 705 705 ) { 706 706 TclGenExpatInfo *expat = (TclGenExpatInfo *) clientData; 707 707 char *data; 708 708 int len = 0, optionIndex, result = TCL_OK; 709 709 710 - static CONST84 char *options[] = { 710 + static const char *options[] = { 711 711 "configure", "cget", "currentmarkup", "free", "get", 712 712 "parse", "parsechannel", "parsefile", "reset", "delete", 713 713 NULL 714 714 }; 715 715 enum options { 716 716 EXPAT_CONFIGURE, EXPAT_CGET, EXPAT_CURRENTMARKUP, EXPAT_FREE, EXPAT_GET, 717 717 EXPAT_PARSE, EXPAT_PARSECHANNEL, EXPAT_PARSEFILE, EXPAT_RESET, ................................................................................ 1099 1099 */ 1100 1100 1101 1101 static int 1102 1102 TclExpatConfigure ( 1103 1103 Tcl_Interp *interp, 1104 1104 TclGenExpatInfo *expat, 1105 1105 int objc, 1106 - Tcl_Obj *CONST objv[] 1106 + Tcl_Obj *const objv[] 1107 1107 ) { 1108 - static CONST84 char *switches[] = { 1108 + static const char *switches[] = { 1109 1109 "-final", 1110 1110 "-baseurl", 1111 1111 "-elementstartcommand", 1112 1112 "-elementendcommand", 1113 1113 "-characterdatacommand", 1114 1114 "-processinginstructioncommand", 1115 1115 "-defaultcommand", ................................................................................ 1156 1156 EXPAT_XMLDECLCMD, 1157 1157 EXPAT_PARAMENTITYPARSING, 1158 1158 EXPAT_ENTITYDECLCOMMAND, 1159 1159 EXPAT_NOWHITESPACE, 1160 1160 EXPAT_HANDLERSET, 1161 1161 EXPAT_NOEXPAND 1162 1162 }; 1163 - static CONST84 char *paramEntityParsingValues[] = { 1163 + static const char *paramEntityParsingValues[] = { 1164 1164 "always", 1165 1165 "never", 1166 1166 "notstandalone", 1167 1167 (char *) NULL 1168 1168 }; 1169 1169 enum paramEntityParsingValues { 1170 1170 EXPAT_PARAMENTITYPARSINGALWAYS, 1171 1171 EXPAT_PARAMENTITYPARSINGNEVER, 1172 1172 EXPAT_PARAMENTITYPARSINGNOTSTANDALONE 1173 1173 }; 1174 1174 int optionIndex, value, bool; 1175 - Tcl_Obj *CONST *objPtr = objv; 1175 + Tcl_Obj *const *objPtr = objv; 1176 1176 Tcl_CmdInfo cmdInfo; 1177 1177 int rc; 1178 1178 char *handlerSetName = NULL; 1179 1179 TclHandlerSet *tmpTclHandlerSet, *activeTclHandlerSet = NULL; 1180 1180 1181 1181 if (expat->firstTclHandlerSet 1182 1182 && (strcmp ("default", expat->firstTclHandlerSet->name)==0)) { ................................................................................ 1591 1591 */ 1592 1592 1593 1593 static int 1594 1594 TclExpatCget ( 1595 1595 Tcl_Interp *interp, 1596 1596 TclGenExpatInfo *expat, 1597 1597 int objc, 1598 - Tcl_Obj *CONST objv[] 1598 + Tcl_Obj *const objv[] 1599 1599 ) { 1600 - static CONST84 char *switches[] = { 1600 + static const char *switches[] = { 1601 1601 "-final", 1602 1602 "-baseurl", 1603 1603 "-elementstartcommand", 1604 1604 "-elementendcommand", 1605 1605 "-characterdatacommand", 1606 1606 "-processinginstructioncommand", 1607 1607 "-defaultcommand", ................................................................................ 1993 1993 *---------------------------------------------------------------------------- 1994 1994 */ 1995 1995 static int 1996 1996 TclExpatGet ( 1997 1997 Tcl_Interp *interp, 1998 1998 TclGenExpatInfo *expat, 1999 1999 int objc, 2000 - Tcl_Obj *CONST objv[] 2000 + Tcl_Obj *const objv[] 2001 2001 ) 2002 2002 { 2003 - static CONST84 char *getSwitches[] = { 2003 + static const char *getSwitches[] = { 2004 2004 "-specifiedattributecount", 2005 2005 "-currentbytecount", 2006 2006 "-currentlinenumber", 2007 2007 "-currentcolumnnumber", 2008 2008 "-currentbyteindex", 2009 2009 (char *) NULL 2010 2010 }; ................................................................................ 2287 2287 * 2288 2288 *---------------------------------------------------------------------------- 2289 2289 */ 2290 2290 2291 2291 static void 2292 2292 TclGenExpatElementEndHandler( 2293 2293 void *userData, 2294 - CONST char *name 2294 + const char *name 2295 2295 ) { 2296 2296 TclGenExpatInfo *expat = (TclGenExpatInfo *) userData; 2297 2297 int result; 2298 2298 Tcl_Obj *vector[2], *ename = NULL; 2299 2299 TclHandlerSet *activeTclHandlerSet; 2300 2300 CHandlerSet *activeCHandlerSet; 2301 2301 Tcl_Obj *cmdPtr; ................................................................................ 2502 2502 * 2503 2503 *---------------------------------------------------------------------------- 2504 2504 */ 2505 2505 2506 2506 static void 2507 2507 TclGenExpatEndNamespaceDeclHandler( 2508 2508 void *userData, 2509 - CONST char *prefix 2509 + const char *prefix 2510 2510 ) { 2511 2511 TclGenExpatInfo *expat = (TclGenExpatInfo *) userData; 2512 2512 Tcl_Obj *cmdPtr; 2513 2513 int result; 2514 2514 TclHandlerSet *activeTclHandlerSet; 2515 2515 CHandlerSet *activeCHandlerSet; 2516 2516 ................................................................................ 2625 2625 * 2626 2626 *---------------------------------------------------------------------------- 2627 2627 */ 2628 2628 2629 2629 static void 2630 2630 TclGenExpatCharacterDataHandler( 2631 2631 void *userData, 2632 - CONST char *s, 2632 + const char *s, 2633 2633 int len 2634 2634 ) { 2635 2635 TclGenExpatInfo *expat = (TclGenExpatInfo *) userData; 2636 2636 2637 2637 if (expat->status != TCL_OK) { 2638 2638 return; 2639 2639 } ................................................................................ 2780 2780 * 2781 2781 *---------------------------------------------------------------------------- 2782 2782 */ 2783 2783 2784 2784 static void 2785 2785 TclGenExpatProcessingInstructionHandler( 2786 2786 void *userData, 2787 - CONST char *target, 2788 - CONST char *data 2787 + const char *target, 2788 + const char *data 2789 2789 ) { 2790 2790 TclGenExpatInfo *expat = (TclGenExpatInfo *) userData; 2791 2791 Tcl_Obj *cmdPtr; 2792 2792 int result; 2793 2793 TclHandlerSet *activeTclHandlerSet; 2794 2794 CHandlerSet *activeCHandlerSet; 2795 2795 ................................................................................ 2866 2866 * 2867 2867 *---------------------------------------------------------------------------- 2868 2868 */ 2869 2869 2870 2870 static void 2871 2871 TclGenExpatDefaultHandler( 2872 2872 void *userData, 2873 - CONST char *s, 2873 + const char *s, 2874 2874 int len 2875 2875 ) { 2876 2876 TclGenExpatInfo *expat = (TclGenExpatInfo *) userData; 2877 2877 Tcl_Obj *cmdPtr; 2878 2878 int result; 2879 2879 TclHandlerSet *activeTclHandlerSet; 2880 2880 CHandlerSet *activeCHandlerSet; ................................................................................ 2952 2952 * 2953 2953 *---------------------------------------------------------------------------- 2954 2954 */ 2955 2955 2956 2956 static void 2957 2957 TclGenExpatEntityDeclHandler( 2958 2958 void *userData, 2959 - CONST char *entityname, 2959 + const char *entityname, 2960 2960 int is_param, 2961 - CONST char *value, 2961 + const char *value, 2962 2962 int length, 2963 - CONST char *base, 2964 - CONST char *systemId, 2965 - CONST char *publicId, 2966 - CONST char *notationName 2963 + const char *base, 2964 + const char *systemId, 2965 + const char *publicId, 2966 + const char *notationName 2967 2967 ) { 2968 2968 TclGenExpatInfo *expat = (TclGenExpatInfo *) userData; 2969 2969 Tcl_Obj *cmdPtr; 2970 2970 int result; 2971 2971 TclHandlerSet *activeTclHandlerSet; 2972 2972 CHandlerSet *activeCHandlerSet; 2973 2973 ................................................................................ 3073 3073 * 3074 3074 *---------------------------------------------------------------------------- 3075 3075 */ 3076 3076 3077 3077 static void 3078 3078 TclGenExpatNotationDeclHandler( 3079 3079 void *userData, 3080 - CONST char *notationName, 3081 - CONST char *base, 3082 - CONST char *systemId, 3083 - CONST char *publicId 3080 + const char *notationName, 3081 + const char *base, 3082 + const char *systemId, 3083 + const char *publicId 3084 3084 ) { 3085 3085 TclGenExpatInfo *expat = (TclGenExpatInfo *) userData; 3086 3086 Tcl_Obj *cmdPtr; 3087 3087 int result; 3088 3088 TclHandlerSet *activeTclHandlerSet; 3089 3089 CHandlerSet *activeCHandlerSet; 3090 3090 ................................................................................ 3172 3172 * 3173 3173 *---------------------------------------------------------------------------- 3174 3174 */ 3175 3175 3176 3176 static int 3177 3177 TclGenExpatUnknownEncodingHandler( 3178 3178 void *encodingHandlerData, 3179 - CONST char *name, 3179 + const char *name, 3180 3180 XML_Encoding *info 3181 3181 ) { 3182 3182 TclGenExpatInfo *expat = (TclGenExpatInfo *) encodingHandlerData; 3183 3183 CHandlerSet *activeCHandlerSet; 3184 3184 3185 3185 TclExpatDispatchPCDATA(expat); 3186 3186 ................................................................................ 3218 3218 * Callback scripts are invoked. 3219 3219 * 3220 3220 *---------------------------------------------------------------------------- 3221 3221 */ 3222 3222 static int 3223 3223 TclGenExpatExternalEntityRefHandler( 3224 3224 XML_Parser parser, 3225 - CONST char *openEntityNames, 3226 - CONST char *base, 3227 - CONST char *systemId, 3228 - CONST char *publicId 3225 + const char *openEntityNames, 3226 + const char *base, 3227 + const char *systemId, 3228 + const char *publicId 3229 3229 ) { 3230 3230 TclGenExpatInfo *expat = (TclGenExpatInfo *) XML_GetUserData(parser); 3231 3231 Tcl_Obj *cmdPtr, *resultObj, *resultTypeObj, *extbaseObj, *dataObj; 3232 3232 int result, mode, done, fd, tclLen; 3233 3233 size_t len; 3234 3234 TclHandlerSet *activeTclHandlerSet; 3235 3235 CHandlerSet *activeCHandlerSet; ................................................................................ 4517 4517 FREE( (char*) expat); 4518 4518 } 4519 4519 4520 4520 4521 4521 int 4522 4522 CheckExpatParserObj ( 4523 4523 Tcl_Interp *interp, 4524 - Tcl_Obj *CONST nameObj 4524 + Tcl_Obj *const nameObj 4525 4525 ) { 4526 4526 Tcl_CmdInfo info; 4527 4527 4528 4528 if (!Tcl_GetCommandInfo (interp, Tcl_GetString(nameObj), &info)) { 4529 4529 return 0; 4530 4530 } 4531 4531 if (!info.isNativeObjectProc || info.objProc != TclExpatInstanceCmd) { ................................................................................ 4533 4533 } 4534 4534 return 1; 4535 4535 } 4536 4536 4537 4537 int 4538 4538 CHandlerSetInstall ( 4539 4539 Tcl_Interp *interp, 4540 - Tcl_Obj *CONST expatObj, 4540 + Tcl_Obj *const expatObj, 4541 4541 CHandlerSet *handlerSet 4542 4542 ) { 4543 4543 Tcl_CmdInfo info; 4544 4544 TclGenExpatInfo *expat; 4545 4545 CHandlerSet *activeCHandlerSet; 4546 4546 4547 4547 if (!Tcl_GetCommandInfo (interp, Tcl_GetString(expatObj), &info)) { ................................................................................ 4570 4570 } 4571 4571 return 0; 4572 4572 } 4573 4573 4574 4574 int 4575 4575 CHandlerSetRemove ( 4576 4576 Tcl_Interp *interp, 4577 - Tcl_Obj *CONST expatObj, 4577 + Tcl_Obj *const expatObj, 4578 4578 char *handlerSetName 4579 4579 ) { 4580 4580 Tcl_CmdInfo info; 4581 4581 TclGenExpatInfo *expat; 4582 4582 CHandlerSet *activeCHandlerSet, *parentHandlerSet = NULL; 4583 4583 4584 4584 if (!Tcl_GetCommandInfo (interp, Tcl_GetString(expatObj), &info)) { ................................................................................ 4610 4610 } 4611 4611 return 2; 4612 4612 } 4613 4613 4614 4614 CHandlerSet * 4615 4615 CHandlerSetGet ( 4616 4616 Tcl_Interp *interp, 4617 - Tcl_Obj *CONST expatObj, 4617 + Tcl_Obj *const expatObj, 4618 4618 char *handlerSetName 4619 4619 ) { 4620 4620 Tcl_CmdInfo info; 4621 4621 TclGenExpatInfo *expat; 4622 4622 CHandlerSet *activeCHandlerSet; 4623 4623 4624 4624 if (!Tcl_GetCommandInfo (interp, Tcl_GetString(expatObj), &info)) { ................................................................................ 4637 4637 } 4638 4638 return NULL; 4639 4639 } 4640 4640 4641 4641 void * 4642 4642 CHandlerSetGetUserData ( 4643 4643 Tcl_Interp *interp, 4644 - Tcl_Obj *CONST expatObj, 4644 + Tcl_Obj *const expatObj, 4645 4645 char *handlerSetName 4646 4646 ) { 4647 4647 Tcl_CmdInfo info; 4648 4648 TclGenExpatInfo *expat; 4649 4649 CHandlerSet *activeCHandlerSet; 4650 4650 4651 4651 if (!Tcl_GetCommandInfo (interp, Tcl_GetString(expatObj), &info)) { ................................................................................ 4664 4664 } 4665 4665 return NULL; 4666 4666 } 4667 4667 4668 4668 TclGenExpatInfo * 4669 4669 GetExpatInfo ( 4670 4670 Tcl_Interp *interp, 4671 - Tcl_Obj *CONST expatObj 4671 + Tcl_Obj *const expatObj 4672 4672 ) { 4673 4673 Tcl_CmdInfo info; 4674 4674 if (!Tcl_GetCommandInfo (interp, Tcl_GetString(expatObj), &info)) { 4675 4675 return NULL; 4676 4676 } 4677 4677 return (TclGenExpatInfo *) info.objClientData; 4678 4678 }
Changes to generic/tclexpat.h.
130 130 int parsingState; /* 0 == freshly (re-)initialized 131 131 1 == initParserProcs called 132 132 2 == parsing an input chunk */ 133 133 XML_Char nsSeparator; 134 134 int paramentityparsing; 135 135 int noexpand; 136 136 int useForeignDTD; 137 - CONST char *currentmarkup; /* Used to transfer data for method */ 137 + const char *currentmarkup; /* Used to transfer data for method */ 138 138 int currentmarkuplen; /* currentmarkup */ 139 139 140 140 TclHandlerSet *firstTclHandlerSet; 141 141 CHandlerSet *firstCHandlerSet; 142 142 } TclGenExpatInfo; 143 143 144 144 /*-------------------------------------------------------------------------- ................................................................................ 150 150 # undef TCL_STORAGE_CLASS 151 151 # define TCL_STORAGE_CLASS DLLEXPORT 152 152 #endif 153 153 154 154 EXTERN Tcl_ObjCmdProc TclExpatObjCmd; 155 155 156 156 EXTERN int CheckExpatParserObj (Tcl_Interp *interp, 157 - Tcl_Obj *CONST nameObj); 157 + Tcl_Obj *const nameObj); 158 158 EXTERN int CHandlerSetInstall (Tcl_Interp *interp, 159 - Tcl_Obj *CONST expatObj, 159 + Tcl_Obj *const expatObj, 160 160 CHandlerSet *handlerSet); 161 161 EXTERN int CHandlerSetRemove (Tcl_Interp *interp, 162 - Tcl_Obj *CONST expatObj, 162 + Tcl_Obj *const expatObj, 163 163 char *handlerSetName); 164 164 EXTERN CHandlerSet * CHandlerSetCreate (char *name); 165 165 EXTERN CHandlerSet * CHandlerSetGet (Tcl_Interp *interp, 166 - Tcl_Obj *CONST expatObj, 166 + Tcl_Obj *const expatObj, 167 167 char *handlerSetName); 168 168 EXTERN void * CHandlerSetGetUserData (Tcl_Interp *interp, 169 - Tcl_Obj *CONST expatObj, 169 + Tcl_Obj *const expatObj, 170 170 char *handlerSetName); 171 171 172 172 EXTERN TclGenExpatInfo * GetExpatInfo (Tcl_Interp *interp, 173 - Tcl_Obj *CONST expatObj); 173 + Tcl_Obj *const expatObj);
Changes to generic/tclpull.h.
1 1 2 2 int tDOM_PullParserCmd (ClientData dummy, Tcl_Interp *interp, int objc, 3 - Tcl_Obj *CONST objv[]); 3 + Tcl_Obj *const objv[]);
Changes to generic/tdom.decls.
7 7 8 8 library tdom 9 9 interface tdom 10 10 #hooks {} 11 11 12 12 declare 0 generic { 13 13 int TclExpatObjCmd (ClientData dummy, Tcl_Interp *interp, 14 - int objc, Tcl_Obj *CONST objv[]) 14 + int objc, Tcl_Obj *const objv[]) 15 15 } 16 16 declare 1 generic { 17 - int CheckExpatParserObj (Tcl_Interp *interp, Tcl_Obj *CONST nameObj) 17 + int CheckExpatParserObj (Tcl_Interp *interp, Tcl_Obj *const nameObj) 18 18 } 19 19 declare 2 generic { 20 - int CHandlerSetInstall (Tcl_Interp *interp, Tcl_Obj *CONST expatObj, 20 + int CHandlerSetInstall (Tcl_Interp *interp, Tcl_Obj *const expatObj, 21 21 CHandlerSet *handlerSet) 22 22 } 23 23 declare 3 generic { 24 - int CHandlerSetRemove (Tcl_Interp *interp, Tcl_Obj *CONST expatObj, 24 + int CHandlerSetRemove (Tcl_Interp *interp, Tcl_Obj *const expatObj, 25 25 char *handlerSetName) 26 26 } 27 27 declare 4 generic { 28 28 CHandlerSet * CHandlerSetCreate (char *name) 29 29 } 30 30 declare 5 generic { 31 - CHandlerSet * CHandlerSetGet (Tcl_Interp *interp, Tcl_Obj *CONST expatObj, 31 + CHandlerSet * CHandlerSetGet (Tcl_Interp *interp, Tcl_Obj *const expatObj, 32 32 char *handlerSetName) 33 33 } 34 34 declare 6 generic { 35 35 void * CHandlerSetGetUserData (Tcl_Interp *interp, 36 - Tcl_Obj *CONST expatObj, 36 + Tcl_Obj *const expatObj, 37 37 char *handlerSetName) 38 38 } 39 39 declare 7 generic { 40 40 TclGenExpatInfo * GetExpatInfo (Tcl_Interp *interp, 41 - Tcl_Obj *CONST expatObj) 41 + Tcl_Obj *const expatObj) 42 42 } 43 43 declare 8 generic { 44 44 XML_Size XML_GetCurrentLineNumber(XML_Parser parser) 45 45 } 46 46 declare 9 generic { 47 47 XML_Size XML_GetCurrentColumnNumber(XML_Parser parser) 48 48 }
Changes to generic/tdomDecls.h.
11 11 12 12 /* 13 13 * Exported function declarations: 14 14 */ 15 15 16 16 /* 0 */ 17 17 EXTERN int TclExpatObjCmd(ClientData dummy, Tcl_Interp *interp, 18 - int objc, Tcl_Obj *CONST objv[]); 18 + int objc, Tcl_Obj *const objv[]); 19 19 /* 1 */ 20 20 EXTERN int CheckExpatParserObj(Tcl_Interp *interp, 21 - Tcl_Obj *CONST nameObj); 21 + Tcl_Obj *const nameObj); 22 22 /* 2 */ 23 23 EXTERN int CHandlerSetInstall(Tcl_Interp *interp, 24 - Tcl_Obj *CONST expatObj, 24 + Tcl_Obj *const expatObj, 25 25 CHandlerSet *handlerSet); 26 26 /* 3 */ 27 27 EXTERN int CHandlerSetRemove(Tcl_Interp *interp, 28 - Tcl_Obj *CONST expatObj, 28 + Tcl_Obj *const expatObj, 29 29 char *handlerSetName); 30 30 /* 4 */ 31 31 EXTERN CHandlerSet * CHandlerSetCreate(char *name); 32 32 /* 5 */ 33 33 EXTERN CHandlerSet * CHandlerSetGet(Tcl_Interp *interp, 34 - Tcl_Obj *CONST expatObj, 34 + Tcl_Obj *const expatObj, 35 35 char *handlerSetName); 36 36 /* 6 */ 37 37 EXTERN void * CHandlerSetGetUserData(Tcl_Interp *interp, 38 - Tcl_Obj *CONST expatObj, 38 + Tcl_Obj *const expatObj, 39 39 char *handlerSetName); 40 40 /* 7 */ 41 41 EXTERN TclGenExpatInfo * GetExpatInfo(Tcl_Interp *interp, 42 - Tcl_Obj *CONST expatObj); 42 + Tcl_Obj *const expatObj); 43 43 /* 8 */ 44 44 EXTERN XML_Size XML_GetCurrentLineNumber(XML_Parser parser); 45 45 /* 9 */ 46 46 EXTERN XML_Size XML_GetCurrentColumnNumber(XML_Parser parser); 47 47 /* 10 */ 48 48 EXTERN XML_Index XML_GetCurrentByteIndex(XML_Parser parser); 49 49 /* 11 */ ................................................................................ 63 63 EXTERN domDocument * tcldom_getDocumentFromName(Tcl_Interp *interp, 64 64 char *docName, char **errMsg); 65 65 66 66 typedef struct TdomStubs { 67 67 int magic; 68 68 void *hooks; 69 69 70 - int (*tclExpatObjCmd) (ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); /* 0 */ 71 - int (*checkExpatParserObj) (Tcl_Interp *interp, Tcl_Obj *CONST nameObj); /* 1 */ 72 - int (*cHandlerSetInstall) (Tcl_Interp *interp, Tcl_Obj *CONST expatObj, CHandlerSet *handlerSet); /* 2 */ 73 - int (*cHandlerSetRemove) (Tcl_Interp *interp, Tcl_Obj *CONST expatObj, char *handlerSetName); /* 3 */ 70 + int (*tclExpatObjCmd) (ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 0 */ 71 + int (*checkExpatParserObj) (Tcl_Interp *interp, Tcl_Obj *const nameObj); /* 1 */ 72 + int (*cHandlerSetInstall) (Tcl_Interp *interp, Tcl_Obj *const expatObj, CHandlerSet *handlerSet); /* 2 */ 73 + int (*cHandlerSetRemove) (Tcl_Interp *interp, Tcl_Obj *const expatObj, char *handlerSetName); /* 3 */ 74 74 CHandlerSet * (*cHandlerSetCreate) (char *name); /* 4 */ 75 - CHandlerSet * (*cHandlerSetGet) (Tcl_Interp *interp, Tcl_Obj *CONST expatObj, char *handlerSetName); /* 5 */ 76 - void * (*cHandlerSetGetUserData) (Tcl_Interp *interp, Tcl_Obj *CONST expatObj, char *handlerSetName); /* 6 */ 77 - TclGenExpatInfo * (*getExpatInfo) (Tcl_Interp *interp, Tcl_Obj *CONST expatObj); /* 7 */ 75 + CHandlerSet * (*cHandlerSetGet) (Tcl_Interp *interp, Tcl_Obj *const expatObj, char *handlerSetName); /* 5 */ 76 + void * (*cHandlerSetGetUserData) (Tcl_Interp *interp, Tcl_Obj *const expatObj, char *handlerSetName); /* 6 */ 77 + TclGenExpatInfo * (*getExpatInfo) (Tcl_Interp *interp, Tcl_Obj *const expatObj); /* 7 */ 78 78 XML_Size (*xML_GetCurrentLineNumber) (XML_Parser parser); /* 8 */ 79 79 XML_Size (*xML_GetCurrentColumnNumber) (XML_Parser parser); /* 9 */ 80 80 XML_Index (*xML_GetCurrentByteIndex) (XML_Parser parser); /* 10 */ 81 81 int (*xML_GetCurrentByteCount) (XML_Parser parser); /* 11 */ 82 82 enum XML_Status (*xML_SetBase) (XML_Parser parser, const XML_Char *base); /* 12 */ 83 83 const XML_Char * (*xML_GetBase) (XML_Parser parser); /* 13 */ 84 84 int (*xML_GetSpecifiedAttributeCount) (XML_Parser parser); /* 14 */
Changes to generic/tdomStubLib.c.
49 49 const TdomStubs *tdomStubsPtr; 50 50 51 51 /*---------------------------------------------------------------------------- 52 52 | Tdom_InitStubs 53 53 | 54 54 \---------------------------------------------------------------------------*/ 55 55 56 -CONST char * 56 +const char * 57 57 Tdom_InitStubs ( 58 58 Tcl_Interp *interp, 59 59 char *version, 60 60 int exact 61 61 ) 62 62 { 63 - CONST char *actualVersion; 63 + const char *actualVersion; 64 64 ClientData clientData = NULL; 65 65 66 66 #if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION == 0) 67 67 Tcl_SetResult(interp, "Too old Tcl version. Binary extensions " 68 68 "to tDOM are not possible, with a that outdated " 69 69 "Tcl version.", TCL_STATIC); 70 70 return NULL;
Changes to tests/all.tcl.
24 24 ::tcltest::testConstraint need_i18n 1 25 25 if {[info procs ::tDOM::extRefHandler] != ""} { 26 26 ::tcltest::testConstraint need_uri 1 27 27 } 28 28 } 29 29 } 30 30 31 +::tcltest::testConstraint needExpand 1 32 +if {$tcl_version < 8.5} { 33 + ::tcltest::testConstraint needExpand 0 34 +} 35 + 31 36 set timeCmd {clock format [clock seconds]} 32 37 33 38 set ::tcltest::testSingleFile false 34 39 35 40 puts stdout "Tcl $tcl_patchLevel tests running in interp: [info nameofexecutable]" 36 41 37 42 if {$tcl_version < 8.2} {
Changes to tests/domDoc.test.
1137 1137 lappend result [[$doc documentElement] nodeName] 1138 1138 $doc delete 1139 1139 set result 1140 1140 } {<e1/> e1} 1141 1141 1142 1142 test domDoc-22.2 {appendFromScript} { 1143 1143 set doc [dom parse <root/>] 1144 - namespace eval nodeCmds { 1145 - $doc appendFromScript { 1146 - e1 1147 - e2 1148 - } 1144 + $doc appendFromScript { 1145 + nodeCmds::e1 1146 + nodeCmds::e2 1149 1147 } 1148 + # namespace eval nodeCmds { 1149 + # $doc appendFromScript { 1150 + # e1 1151 + # e2 1152 + # } 1153 + # } 1150 1154 set result [$doc asXML -indent none] 1151 1155 foreach node [$doc selectNodes *] { 1152 1156 lappend result [$node parentNode] 1153 1157 lappend result [expr {$doc == [$node ownerDocument]}] 1154 1158 } 1155 1159 $doc delete 1156 1160 set result
Changes to tests/domjson.test.
157 157 set result 158 158 } "\"a\\u0000\"" 159 159 160 160 test json-1.19 {Invalid input - uncompled \u escape} { 161 161 catch {dom parse -json {"ab\u00"}} 162 162 } 1 163 163 164 -test json-1.20 {Escaped binary 0} { 164 +test json-1.20 {Escaped binary 0} {needExpand} { 165 165 dom parse -json "\"a\\u0000\"" doc 166 166 set textvalue [$doc selectNodes string(node())] 167 167 set result [string length $textvalue] 168 168 binary scan $textvalue c2 result2 169 169 lappend result {*}$result2 170 170 $doc delete 171 171 set result
Changes to tests/loadtdom.tcl.
9 9 package require tcltest 10 10 namespace import ::tcltest::* 11 11 if {[catch {package require -exact tdom 0.9.1}]} { 12 12 if {[catch {load [file join [file dir [info script]] ../unix/libtdom0.9.1.so]}]} { 13 13 error "Unable to load the appropriate tDOM version!" 14 14 } 15 15 } 16 -if {[info commands ::tDOM::xmlReadFile] eq ""} { 16 +if {[info commands ::tDOM::xmlReadFile] == ""} { 17 17 # tcldomsh without the script library. Source the lib. 18 18 source [file join [file dir [info script]] ../lib tdom.tcl] 19 19 } 20 20