1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
-
+
|
/*
* tclUnixTest.c --
*
* Contains platform specific test commands for the Unix platform.
*
* Copyright (c) 1996-1997 Sun Microsystems, Inc.
* Copyright (c) 1998 by Scriptics Corporation.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
* RCS: @(#) $Id: tclUnixTest.c,v 1.32 2009/11/18 23:46:05 nijtmans Exp $
* RCS: @(#) $Id: tclUnixTest.c,v 1.33 2010/02/25 22:20:10 nijtmans Exp $
*/
#ifndef USE_TCL_STUBS
# define USE_TCL_STUBS
#endif
#include "tclInt.h"
|
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
|
*/
int
TclplatformtestInit(
Tcl_Interp *interp) /* Interpreter to add commands to. */
{
Tcl_CreateCommand(interp, "testchmod", TestchmodCmd,
(ClientData) 0, NULL);
NULL, NULL);
Tcl_CreateCommand(interp, "testfilehandler", TestfilehandlerCmd,
(ClientData) 0, NULL);
NULL, NULL);
Tcl_CreateCommand(interp, "testfilewait", TestfilewaitCmd,
(ClientData) 0, NULL);
NULL, NULL);
Tcl_CreateCommand(interp, "testfindexecutable", TestfindexecutableCmd,
(ClientData) 0, NULL);
NULL, NULL);
Tcl_CreateCommand(interp, "testgetopenfile", TestgetopenfileCmd,
(ClientData) 0, NULL);
NULL, NULL);
Tcl_CreateCommand(interp, "testgetdefenc", TestgetdefencdirCmd,
(ClientData) 0, NULL);
NULL, NULL);
Tcl_CreateCommand(interp, "testsetdefenc", TestsetdefencdirCmd,
(ClientData) 0, NULL);
NULL, NULL);
Tcl_CreateCommand(interp, "testalarm", TestalarmCmd,
(ClientData) 0, NULL);
NULL, NULL);
Tcl_CreateCommand(interp, "testgotsig", TestgotsigCmd,
(ClientData) 0, NULL);
NULL, NULL);
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* TestfilehandlerCmd --
|
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
|
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
|
-
+
|
" channelName forWriting\"", NULL);
return TCL_ERROR;
}
if (Tcl_GetOpenFile(interp, argv[1], atoi(argv[2]), 1, &filePtr)
== TCL_ERROR) {
return TCL_ERROR;
}
if (filePtr == (ClientData) NULL) {
if (filePtr == NULL) {
Tcl_AppendResult(interp,
"Tcl_GetOpenFile succeeded but FILE * NULL!", NULL);
return TCL_ERROR;
}
return TCL_OK;
}
|