summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tcl.decls2
-rw-r--r--generic/tclDecls.h4
-rw-r--r--generic/tclIO.c8
3 files changed, 8 insertions, 6 deletions
diff --git a/generic/tcl.decls b/generic/tcl.decls
index 4d4bf5f..cca6f08 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -748,7 +748,7 @@ declare 209 {
int Tcl_RecordAndEvalObj(Tcl_Interp *interp, Tcl_Obj *cmdPtr, int flags)
}
declare 210 {
- void Tcl_RegisterChannel(Tcl_Interp *interp, Tcl_Channel chan)
+ Tcl_Channel Tcl_RegisterChannel(Tcl_Interp *interp, Tcl_Channel chan)
}
declare 211 {
void Tcl_RegisterObjType(const Tcl_ObjType *typePtr)
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index 185546b..94a4f39 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -633,7 +633,7 @@ EXTERN int Tcl_RecordAndEval(Tcl_Interp *interp,
EXTERN int Tcl_RecordAndEvalObj(Tcl_Interp *interp,
Tcl_Obj *cmdPtr, int flags);
/* 210 */
-EXTERN void Tcl_RegisterChannel(Tcl_Interp *interp,
+EXTERN Tcl_Channel Tcl_RegisterChannel(Tcl_Interp *interp,
Tcl_Channel chan);
/* 211 */
EXTERN void Tcl_RegisterObjType(const Tcl_ObjType *typePtr);
@@ -2067,7 +2067,7 @@ typedef struct TclStubs {
void (*tcl_ReapDetachedProcs) (void); /* 207 */
int (*tcl_RecordAndEval) (Tcl_Interp *interp, const char *cmd, int flags); /* 208 */
int (*tcl_RecordAndEvalObj) (Tcl_Interp *interp, Tcl_Obj *cmdPtr, int flags); /* 209 */
- void (*tcl_RegisterChannel) (Tcl_Interp *interp, Tcl_Channel chan); /* 210 */
+ Tcl_Channel (*tcl_RegisterChannel) (Tcl_Interp *interp, Tcl_Channel chan); /* 210 */
void (*tcl_RegisterObjType) (const Tcl_ObjType *typePtr); /* 211 */
Tcl_RegExp (*tcl_RegExpCompile) (Tcl_Interp *interp, const char *pattern); /* 212 */
int (*tcl_RegExpExec) (Tcl_Interp *interp, Tcl_RegExp regexp, const char *text, const char *start); /* 213 */
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 1460392..a1f9e30 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -1138,7 +1138,7 @@ Tcl_IsStandardChannel(
* channel refCount.
*
* Results:
- * None.
+ * The channel.
*
* Side effects:
* May increment the reference count of a channel.
@@ -1146,7 +1146,7 @@ Tcl_IsStandardChannel(
*----------------------------------------------------------------------
*/
-void
+Tcl_Channel
Tcl_RegisterChannel(
Tcl_Interp *interp, /* Interpreter in which to add the channel. */
Tcl_Channel chan) /* The channel to add to this interpreter
@@ -1175,7 +1175,7 @@ Tcl_RegisterChannel(
hPtr = Tcl_CreateHashEntry(hTblPtr, statePtr->channelName, &isNew);
if (!isNew) {
if (chan == Tcl_GetHashValue(hPtr)) {
- return;
+ return chan;
}
Tcl_Panic("Tcl_RegisterChannel: duplicate channel names");
@@ -1183,6 +1183,8 @@ Tcl_RegisterChannel(
Tcl_SetHashValue(hPtr, chanPtr);
}
statePtr->refCount++;
+
+ return chan;
}
/*