summaryrefslogtreecommitdiffstats
path: root/generic/tclTest.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-09-26 19:26:11 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-09-26 19:26:11 (GMT)
commitdd1dc3c6e807176799c1fee7ea75c5f29775da8c (patch)
tree3c3ab8dda51122d9c4c87dd4fe6b2263fa3c205f /generic/tclTest.c
parentcc185b1d763af5b2a80b5fc5c25fb2f0c69d0661 (diff)
parent3636d805fcf6da495f444297a7159347ff1ed3a0 (diff)
downloadtcl-dd1dc3c6e807176799c1fee7ea75c5f29775da8c.zip
tcl-dd1dc3c6e807176799c1fee7ea75c5f29775da8c.tar.gz
tcl-dd1dc3c6e807176799c1fee7ea75c5f29775da8c.tar.bz2
Merge 8.7
Diffstat (limited to 'generic/tclTest.c')
-rw-r--r--generic/tclTest.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/generic/tclTest.c b/generic/tclTest.c
index f6515c1..354ea9c 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -176,6 +176,15 @@ typedef struct TestChannel {
static TestChannel *firstDetached;
+#ifdef __GNUC__
+/*
+ * The rest of this file shouldn't warn about deprecated functions; they're
+ * there because we intend them to be so and know that this file is OK to
+ * touch those fields.
+ */
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
/*
* Forward declarations for procedures defined later in this file:
*/
@@ -6041,6 +6050,45 @@ TestChannelCmd(
return TCL_OK;
}
+ if ((cmdName[0] == 'm') && (strncmp(cmdName, "maxmode", len) == 0)) {
+ if (argc != 3) {
+ Tcl_AppendResult(interp, "channel name required", NULL);
+ return TCL_ERROR;
+ }
+
+ if (statePtr->maxPerms & TCL_READABLE) {
+ Tcl_AppendElement(interp, "read");
+ } else {
+ Tcl_AppendElement(interp, "");
+ }
+ if (statePtr->maxPerms & TCL_WRITABLE) {
+ Tcl_AppendElement(interp, "write");
+ } else {
+ Tcl_AppendElement(interp, "");
+ }
+ return TCL_OK;
+ }
+
+ if ((cmdName[0] == 'm') && (strncmp(cmdName, "mremove-rd", len) == 0)) {
+ if (argc != 3) {
+ Tcl_AppendResult(interp, "channel name required",
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ return Tcl_RemoveChannelMode(interp, chan, TCL_READABLE);
+ }
+
+ if ((cmdName[0] == 'm') && (strncmp(cmdName, "mremove-wr", len) == 0)) {
+ if (argc != 3) {
+ Tcl_AppendResult(interp, "channel name required",
+ (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ return Tcl_RemoveChannelMode(interp, chan, TCL_WRITABLE);
+ }
+
if ((cmdName[0] == 'm') && (strncmp(cmdName, "mthread", len) == 0)) {
if (argc != 3) {
Tcl_AppendResult(interp, "channel name required", NULL);