Itcl - the [incr Tcl] extension

Check-in [a036f93dad]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Support Tcl 8.7. Put migration supports in place for Tcl 8.4 and 8.5.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | itcl-3-branch
Files: files | file ages | folders
SHA3-256: a036f93dad15f1d43dcec70ee77dce29460b06b9aefee88e6df16218d7136cfa
User & Date: dgp 2017-12-12 04:20:16
Context
2018-06-14
12:40
Remove [source -rsrc]. Only in Tcl 8.3 and only works on Max OS 9. check-in: 94d9228227 user: dgp tags: itcl-3-branch
2017-12-12
04:20
Support Tcl 8.7. Put migration supports in place for Tcl 8.4 and 8.5. check-in: a036f93dad user: dgp tags: itcl-3-branch
2017-11-28
17:04
[SF Bug 279] Drop surplus quote. check-in: 9c5d63471a user: dgp tags: itcl-3-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/itclInt.h.

56
57
58
59
60
61
62












63
64
65
66
67
68
69
#endif

/*
 * Handle hiding of errorLine in 8.6
 */
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 6)
#define Tcl_GetErrorLine(interp) ((interp)->errorLine)












#endif

#define ITCL_TCL_PRE_8_5 (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 5)

#define ItclCallFrame CallFrame

#if !ITCL_TCL_PRE_8_5







>
>
>
>
>
>
>
>
>
>
>
>







56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#endif

/*
 * Handle hiding of errorLine in 8.6
 */
#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 6)
#define Tcl_GetErrorLine(interp) ((interp)->errorLine)
#define TclInitRewriteEnsemble(interp, remove, insert, objv) {	\
    Interp *iPtr = (Interp *)(interp); 				\
    iPtr->ensembleRewrite.sourceObjs = (objv); 			\
    iPtr->ensembleRewrite.numRemovedObjs = (remove);		\
    iPtr->ensembleRewrite.numInsertedObjs = (insert);		\
}
#define TclResetRewriteEnsemble(interp, root) {			\
    Interp *iPtr = (Interp *)(interp); 				\
    iPtr->ensembleRewrite.sourceObjs = NULL; 			\
    iPtr->ensembleRewrite.numRemovedObjs = 0;			\
    iPtr->ensembleRewrite.numInsertedObjs = 0;			\
}
#endif

#define ITCL_TCL_PRE_8_5 (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 5)

#define ItclCallFrame CallFrame

#if !ITCL_TCL_PRE_8_5
244
245
246
247
248
249
250




251
252
253
254
255
256
257
#ifndef MODULE_SCOPE
#define MODULE_SCOPE
#endif

MODULE_SCOPE Var * ItclVarHashCreateVar (TclVarHashTable * tablePtr, 
				const char * key, int * newPtr);





#endif /* Version dependent defs and macros */


#define ItclVarHashFindVar(tablePtr, key) \
    ItclVarHashCreateVar((tablePtr), (key), NULL)









>
>
>
>







256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
#ifndef MODULE_SCOPE
#define MODULE_SCOPE
#endif

MODULE_SCOPE Var * ItclVarHashCreateVar (TclVarHashTable * tablePtr, 
				const char * key, int * newPtr);

#undef TclInitRewriteEnsemble
#undef TclResetRewriteEnsemble
#define TclInitRewriteEnsemble(interp, remove, insert, objv)
#define TclResetRewriteEnsemble(interp, root)
#endif /* Version dependent defs and macros */


#define ItclVarHashFindVar(tablePtr, key) \
    ItclVarHashCreateVar((tablePtr), (key), NULL)


Changes to generic/itcl_ensemble.c.

1493
1494
1495
1496
1497
1498
1499

1500
1501

1502
1503
1504
1505
1506
1507
1508
     */
    if (ensPart == NULL) {
        if (FindEnsemblePart(interp, ensData, "@error", &ensPart) != TCL_OK) {
            return TCL_ERROR;
        }
        if (ensPart != NULL) {
            cmdPtr = (Command*)ensPart->cmdPtr;

            result = (*cmdPtr->objProc)(cmdPtr->objClientData,
                interp, objc, objv);

            return result;
        }
    }
    if (ensPart == NULL) {
        return Itcl_EnsembleErrorCmd((ClientData)ensData,
            interp, objc-1, objv+1);
    }







>


>







1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
     */
    if (ensPart == NULL) {
        if (FindEnsemblePart(interp, ensData, "@error", &ensPart) != TCL_OK) {
            return TCL_ERROR;
        }
        if (ensPart != NULL) {
            cmdPtr = (Command*)ensPart->cmdPtr;
	    TclInitRewriteEnsemble(interp, 2, 1, objv);
            result = (*cmdPtr->objProc)(cmdPtr->objClientData,
                interp, objc, objv);
	    TclResetRewriteEnsemble(interp, 1);
            return result;
        }
    }
    if (ensPart == NULL) {
        return Itcl_EnsembleErrorCmd((ClientData)ensData,
            interp, objc-1, objv+1);
    }
1525
1526
1527
1528
1529
1530
1531

1532
1533

1534
1535
1536
1537
1538
1539
1540
    Tcl_IncrRefCount(cmdlinePtr);

    result = Tcl_ListObjGetElements((Tcl_Interp*)NULL, cmdlinePtr,
        &cmdlinec, &cmdlinev);

    if (result == TCL_OK) {
        cmdPtr = (Command*)ensPart->cmdPtr;

        result = (*cmdPtr->objProc)(cmdPtr->objClientData, interp,
            cmdlinec, cmdlinev);

    }
    Tcl_DecrRefCount(cmdlinePtr);

    return result;
}









>


>







1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
    Tcl_IncrRefCount(cmdlinePtr);

    result = Tcl_ListObjGetElements((Tcl_Interp*)NULL, cmdlinePtr,
        &cmdlinec, &cmdlinev);

    if (result == TCL_OK) {
        cmdPtr = (Command*)ensPart->cmdPtr;
	TclInitRewriteEnsemble(interp, 2, 1, objv);
        result = (*cmdPtr->objProc)(cmdPtr->objClientData, interp,
            cmdlinec, cmdlinev);
	TclResetRewriteEnsemble(interp, 1);
    }
    Tcl_DecrRefCount(cmdlinePtr);

    return result;
}