summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-06-25 20:41:56 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-06-25 20:41:56 (GMT)
commit77bd578d9f6fd5b168738b2a88a37d140a1302ec (patch)
treef8078ce2c1084ea547c66cbb93e4dfe1123109bd
parentfdee46ab16b879589155729e6db4fdabe235880f (diff)
downloadtcl-77bd578d9f6fd5b168738b2a88a37d140a1302ec.zip
tcl-77bd578d9f6fd5b168738b2a88a37d140a1302ec.tar.gz
tcl-77bd578d9f6fd5b168738b2a88a37d140a1302ec.tar.bz2
TIP #512 implementation
-rw-r--r--generic/tcl.decls6
-rw-r--r--generic/tclDecls.h6
-rw-r--r--generic/tclStubInit.c4
-rw-r--r--tools/genStubs.tcl12
4 files changed, 22 insertions, 6 deletions
diff --git a/generic/tcl.decls b/generic/tcl.decls
index da551bb..3734339 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -513,7 +513,7 @@ declare 142 {
declare 143 {
void Tcl_Finalize(void)
}
-declare 144 {
+declare 144 {nostub {Don't use this function in a stub-enabled extension}} {
void Tcl_FindExecutable(const char *argv0)
}
declare 145 {
@@ -812,7 +812,7 @@ declare 228 {
declare 229 {
void Tcl_SetMaxBlockTime(const Tcl_Time *timePtr)
}
-declare 230 {
+declare 230 {nostub {Don't use this function in a stub-enabled extension}} {
void Tcl_SetPanicProc(TCL_NORETURN1 Tcl_PanicProc *panicProc)
}
declare 231 {
@@ -1868,7 +1868,7 @@ declare 518 {
}
# TIP#121 (exit handler) dkf for Joe Mistachkin
-declare 519 {
+declare 519 {nostub {Don't use this function in a stub-enabled extension}} {
Tcl_ExitProc *Tcl_SetExitProc(TCL_NORETURN1 Tcl_ExitProc *proc)
}
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index 592d945..b96b963 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -2009,7 +2009,7 @@ typedef struct TclStubs {
int (*tcl_ExprObj) (Tcl_Interp *interp, Tcl_Obj *objPtr, Tcl_Obj **resultPtrPtr); /* 141 */
int (*tcl_ExprString) (Tcl_Interp *interp, const char *expr); /* 142 */
void (*tcl_Finalize) (void); /* 143 */
- void (*tcl_FindExecutable) (const char *argv0); /* 144 */
+ TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") void (*tcl_FindExecutable) (const char *argv0); /* 144 */
Tcl_HashEntry * (*tcl_FirstHashEntry) (Tcl_HashTable *tablePtr, Tcl_HashSearch *searchPtr); /* 145 */
int (*tcl_Flush) (Tcl_Channel chan); /* 146 */
void (*tcl_FreeResult) (Tcl_Interp *interp); /* 147 */
@@ -2103,7 +2103,7 @@ typedef struct TclStubs {
void (*tcl_SetErrno) (int err); /* 227 */
void (*tcl_SetErrorCode) (Tcl_Interp *interp, ...); /* 228 */
void (*tcl_SetMaxBlockTime) (const Tcl_Time *timePtr); /* 229 */
- void (*tcl_SetPanicProc) (TCL_NORETURN1 Tcl_PanicProc *panicProc); /* 230 */
+ TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") void (*tcl_SetPanicProc) (TCL_NORETURN1 Tcl_PanicProc *panicProc); /* 230 */
int (*tcl_SetRecursionLimit) (Tcl_Interp *interp, int depth); /* 231 */
void (*tcl_SetResult) (Tcl_Interp *interp, char *result, Tcl_FreeProc *freeProc); /* 232 */
int (*tcl_SetServiceMode) (int mode); /* 233 */
@@ -2392,7 +2392,7 @@ typedef struct TclStubs {
Tcl_Command (*tcl_GetCommandFromObj) (Tcl_Interp *interp, Tcl_Obj *objPtr); /* 516 */
void (*tcl_GetCommandFullName) (Tcl_Interp *interp, Tcl_Command command, Tcl_Obj *objPtr); /* 517 */
int (*tcl_FSEvalFileEx) (Tcl_Interp *interp, Tcl_Obj *fileName, const char *encodingName); /* 518 */
- Tcl_ExitProc * (*tcl_SetExitProc) (TCL_NORETURN1 Tcl_ExitProc *proc); /* 519 */
+ TCL_DEPRECATED_API("Don't use this function in a stub-enabled extension") Tcl_ExitProc * (*tcl_SetExitProc) (TCL_NORETURN1 Tcl_ExitProc *proc); /* 519 */
void (*tcl_LimitAddHandler) (Tcl_Interp *interp, int type, Tcl_LimitHandlerProc *handlerProc, ClientData clientData, Tcl_LimitHandlerDeleteProc *deleteProc); /* 520 */
void (*tcl_LimitRemoveHandler) (Tcl_Interp *interp, int type, Tcl_LimitHandlerProc *handlerProc, ClientData clientData); /* 521 */
int (*tcl_LimitReady) (Tcl_Interp *interp); /* 522 */
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index 7ce0758..0548825 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -40,6 +40,7 @@
#undef Tcl_CreateHashEntry
#undef Tcl_Panic
#undef Tcl_FindExecutable
+#undef Tcl_SetExitProc
#undef Tcl_SetPanicProc
#undef TclpGetPid
#undef TclSockMinimumBuffers
@@ -402,6 +403,9 @@ static int uniCharNcasecmp(const Tcl_UniChar *ucs, const Tcl_UniChar *uct, unsig
# define TclpGmtime 0
# define TclpLocaltime_unix 0
# define TclpGmtime_unix 0
+# define Tcl_SetExitProc 0
+# define Tcl_SetPanicProc 0
+# define Tcl_FindExecutable 0
#else /* TCL_NO_DEPRECATED */
# define Tcl_SeekOld seekOld
# define Tcl_TellOld tellOld
diff --git a/tools/genStubs.tcl b/tools/genStubs.tcl
index 830ba2b..f2f410f 100644
--- a/tools/genStubs.tcl
+++ b/tools/genStubs.tcl
@@ -198,6 +198,13 @@ proc genStubs::declare {args} {
|| ($index > $stubs($curName,generic,lastNum))} {
set stubs($curName,generic,lastNum) $index
}
+ } elseif {([lindex $platformList 0] eq "nostub")} {
+ set stubs($curName,nostub,$index) [lindex $platformList 1]
+ set stubs($curName,generic,$index) $decl
+ if {![info exists stubs($curName,generic,lastNum)] \
+ || ($index > $stubs($curName,generic,lastNum))} {
+ set stubs($curName,generic,lastNum) $index
+ }
} else {
foreach platform $platformList {
if {$decl ne ""} {
@@ -593,6 +600,8 @@ proc genStubs::makeSlot {name decl index} {
set text " "
if {[info exists stubs($name,deprecated,$index)]} {
append text "TCL_DEPRECATED_API(\"$stubs($name,deprecated,$index)\") "
+ } elseif {[info exists stubs($name,nostub,$index)]} {
+ append text "TCL_DEPRECATED_API(\"$stubs($name,nostub,$index)\") "
}
if {$args eq ""} {
append text $rtype " *" $lfname "; /* $index */\n"
@@ -705,6 +714,9 @@ proc genStubs::forAllStubs {name slotProc onAll textVar
if {[info exists stubs($name,deprecated,$i)]} {
append text [$slotProc $name $stubs($name,generic,$i) $i]
set emit 1
+ } elseif {[info exists stubs($name,nostub,$i)]} {
+ append text [$slotProc $name $stubs($name,generic,$i) $i]
+ set emit 1
} elseif {[info exists stubs($name,generic,$i)]} {
if {[llength $slots] > 1} {
puts stderr "conflicting generic and platform entries:\