summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/SetResult.328
-rw-r--r--generic/tcl.decls2
-rw-r--r--generic/tclDecls.h4
-rw-r--r--generic/tclResult.c32
-rw-r--r--library/encoding/tis-620.enc2
-rw-r--r--tests/encoding.test15
-rwxr-xr-xunix/configure1
-rw-r--r--unix/tcl.m41
8 files changed, 48 insertions, 37 deletions
diff --git a/doc/SetResult.3 b/doc/SetResult.3
index 81f0264..a7e4558 100644
--- a/doc/SetResult.3
+++ b/doc/SetResult.3
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-.TH Tcl_SetResult 3 8.0 Tcl "Tcl Library Procedures"
+.TH Tcl_SetResult 3 8.6 Tcl "Tcl Library Procedures"
.so man.macros
.BS
.SH NAME
@@ -29,7 +29,7 @@ const char *
\fBTcl_ResetResult\fR(\fIinterp\fR)
.sp
.VS 8.6
-\fBTcl_TransferResult\fR(\fIsourceInterp, result, targetInterp\fR)
+\fBTcl_TransferResult\fR(\fIsourceInterp, code, targetInterp\fR)
.VE 8.6
.sp
\fBTcl_AppendElement\fR(\fIinterp, element\fR)
@@ -56,16 +56,15 @@ An argument list which must have been initialized using
\fBva_start\fR, and cleared using \fBva_end\fR.
.AP Tcl_Interp *sourceInterp in
.VS 8.6
-Interpreter that the result and error information should be copied from.
+Interpreter that the result and return options should be transferred from.
.VE 8.6
.AP Tcl_Interp *targetInterp in
.VS 8.6
-Interpreter that the result and error information should be copied to.
+Interpreter that the result and return options should be transferred to.
.VE 8.6
-.AP int result in
+.AP int code in
.VS 8.6
-If \fBTCL_OK\fR, only copy the result. If \fBTCL_ERROR\fR, copy the error
-information as well.
+Return code value that controls transfer of return options.
.VE 8.6
.BE
.SH DESCRIPTION
@@ -151,10 +150,14 @@ Any number of \fIresult\fR arguments may be passed in a single
call; the last argument in the list must be a NULL pointer.
.PP
.VS 8.6
-\fBTcl_TransferResult\fR moves a result from one interpreter to another,
-optionally (dependent on the \fIresult\fR parameter) including the error
-information dictionary as well. The interpreters must be in the same thread.
-The source interpreter will have its result reset by this operation.
+\fBTcl_TransferResult\fR transfers interpreter state from \fIsourceInterp\fR
+to \fItargetInterp\fR. The two interpreters must have been created in the
+same thread. If \fIsourceInterp\fR and \fItargetInterp\fR are the same,
+nothing is done. Otherwise, \fBTcl_TransferResult\fR moves the result
+from \fIsourceInterp\fR to \fItargetInterp\fR, and resets the result
+in \fIsourceInterp\fR. It also moves the return options dictionary as
+controlled by the return code value \fIcode\fR in the same manner
+as \fBTcl_GetReturnOptions\fR.
.VE 8.6
.SH "DEPRECATED INTERFACES"
.SS "OLD STRING PROCEDURES"
@@ -232,6 +235,7 @@ typedef void \fBTcl_FreeProc\fR(
When \fIfreeProc\fR is called, its \fIblockPtr\fR will be set to
the value of \fIresult\fR passed to \fBTcl_SetResult\fR.
.SH "SEE ALSO"
-Tcl_AddErrorInfo, Tcl_CreateObjCommand, Tcl_SetErrorCode, Tcl_Interp
+Tcl_AddErrorInfo, Tcl_CreateObjCommand, Tcl_SetErrorCode, Tcl_Interp,
+Tcl_GetReturnOptions
.SH KEYWORDS
append, command, element, list, value, result, return value, interpreter
diff --git a/generic/tcl.decls b/generic/tcl.decls
index 2c72914..f852601 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -2274,7 +2274,7 @@ declare 606 {
# TIP#307 (move results between interpreters) dkf
declare 607 {
- void Tcl_TransferResult(Tcl_Interp *sourceInterp, int result,
+ void Tcl_TransferResult(Tcl_Interp *sourceInterp, int code,
Tcl_Interp *targetInterp)
}
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index e525b26..be71893 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -1645,7 +1645,7 @@ EXTERN int Tcl_GetErrorLine(Tcl_Interp *interp);
EXTERN void Tcl_SetErrorLine(Tcl_Interp *interp, int lineNum);
/* 607 */
EXTERN void Tcl_TransferResult(Tcl_Interp *sourceInterp,
- int result, Tcl_Interp *targetInterp);
+ int code, Tcl_Interp *targetInterp);
/* 608 */
EXTERN int Tcl_InterpActive(Tcl_Interp *interp);
/* 609 */
@@ -2409,7 +2409,7 @@ typedef struct TclStubs {
int (*tcl_ParseArgsObjv) (Tcl_Interp *interp, const Tcl_ArgvInfo *argTable, int *objcPtr, Tcl_Obj *const *objv, Tcl_Obj ***remObjv); /* 604 */
int (*tcl_GetErrorLine) (Tcl_Interp *interp); /* 605 */
void (*tcl_SetErrorLine) (Tcl_Interp *interp, int lineNum); /* 606 */
- void (*tcl_TransferResult) (Tcl_Interp *sourceInterp, int result, Tcl_Interp *targetInterp); /* 607 */
+ void (*tcl_TransferResult) (Tcl_Interp *sourceInterp, int code, Tcl_Interp *targetInterp); /* 607 */
int (*tcl_InterpActive) (Tcl_Interp *interp); /* 608 */
void (*tcl_BackgroundException) (Tcl_Interp *interp, int code); /* 609 */
int (*tcl_ZlibDeflate) (Tcl_Interp *interp, int format, Tcl_Obj *data, int level, Tcl_Obj *gzipHeaderDictObj); /* 610 */
diff --git a/generic/tclResult.c b/generic/tclResult.c
index aa2bad7..dc90df7 100644
--- a/generic/tclResult.c
+++ b/generic/tclResult.c
@@ -1155,22 +1155,14 @@ Tcl_SetReturnOptions(
*
* Tcl_TransferResult --
*
- * Copy the result (and error information) from one interp to another.
+ * Transfer the result (and error information) from one interp to another.
* Used when one interp has caused another interp to evaluate a script
* and then wants to transfer the results back to itself.
*
- * This routine copies the string reps of the result and error
- * information. It does not simply increment the refcounts of the result
- * and error information objects themselves. It is not legal to exchange
- * objects between interps, because an object may be kept alive by one
- * interp, but have an internal rep that is only valid while some other
- * interp is alive.
- *
* Results:
- * The target interp's result is set to a copy of the source interp's
- * result. The source's errorInfo field may be transferred to the
- * target's errorInfo field, and the source's errorCode field may be
- * transferred to the target's errorCode field.
+ * The result of targetInterp is set to the result read from sourceInterp.
+ * The return options dictionary of sourceInterp is transferred to
+ * targetInterp as appropriate for the return code value code.
*
* Side effects:
* None.
@@ -1180,14 +1172,16 @@ Tcl_SetReturnOptions(
void
Tcl_TransferResult(
- Tcl_Interp *sourceInterp, /* Interp whose result and error information
+ Tcl_Interp *sourceInterp, /* Interp whose result and return options
* should be moved to the target interp.
* After moving result, this interp's result
* is reset. */
- int result, /* TCL_OK if just the result should be copied,
- * TCL_ERROR if both the result and error
- * information should be copied. */
- Tcl_Interp *targetInterp) /* Interp where result and error information
+ int code, /* The return code value active in
+ * sourceInterp. Controls how the return options
+ * dictionary is retrieved from sourceInterp,
+ * same as in Tcl_GetReturnOptions, to then be
+ * transferred to targetInterp. */
+ Tcl_Interp *targetInterp) /* Interp where result and return options
* should be stored. If source and target are
* the same, nothing is done. */
{
@@ -1198,7 +1192,7 @@ Tcl_TransferResult(
return;
}
- if (result == TCL_OK && siPtr->returnOpts == NULL) {
+ if (code == TCL_OK && siPtr->returnOpts == NULL) {
/*
* Special optimization for the common case of normal command return
* code and no explicit return options.
@@ -1210,7 +1204,7 @@ Tcl_TransferResult(
}
} else {
Tcl_SetReturnOptions(targetInterp,
- Tcl_GetReturnOptions(sourceInterp, result));
+ Tcl_GetReturnOptions(sourceInterp, code));
tiPtr->flags &= ~(ERR_ALREADY_LOGGED);
}
Tcl_SetObjResult(targetInterp, Tcl_GetObjResult(sourceInterp));
diff --git a/library/encoding/tis-620.enc b/library/encoding/tis-620.enc
index c233be5..2e9142a 100644
--- a/library/encoding/tis-620.enc
+++ b/library/encoding/tis-620.enc
@@ -17,4 +17,4 @@ S
0E200E210E220E230E240E250E260E270E280E290E2A0E2B0E2C0E2D0E2E0E2F
0E300E310E320E330E340E350E360E370E380E390E3A00000000000000000E3F
0E400E410E420E430E440E450E460E470E480E490E4A0E4B0E4C0E4D0E4E0E4F
-0E500E510E520E530E540E550E560E570E580E590E5A0E5B0000000000000000 \ No newline at end of file
+0E500E510E520E530E540E550E560E570E580E590E5A0E5B0000000000000000
diff --git a/tests/encoding.test b/tests/encoding.test
index 643d493..7f95279 100644
--- a/tests/encoding.test
+++ b/tests/encoding.test
@@ -717,6 +717,21 @@ test encoding-27.2 {encoding dirs basic behavior} -returnCodes error -body {
} -result "expected directory list but got \"\{not a list\""
}
+
+
+test encoding-28.0 {all encodings load} -body {
+ set string hello
+ foreach name [encoding names] {
+ incr count
+ encoding convertto $name $string
+
+ # discard the cached internal representation of Tcl_Encoding
+ # Unfortunately, without this, encoding 2-1 fails.
+ llength $name
+ }
+ return $count
+} -result 81
+
runtests
}
diff --git a/unix/configure b/unix/configure
index 5a6a5ac..7c432ee 100755
--- a/unix/configure
+++ b/unix/configure
@@ -5845,7 +5845,6 @@ fi
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
- LDFLAGS=""
if test $doRpath = yes; then :
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index d0a6c0a..9fa0675 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -1385,7 +1385,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
- LDFLAGS=""
AS_IF([test $doRpath = yes], [
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])