Tcl Source Code

Check-in [e52c9bd3ce]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:
TIP #338 IMPLEMENTATION
* doc/AppInit.c: Made routines Tcl_SetStartupScript and * doc/Tcl_Main.3: Tcl_GetStartupScript public. Removed all * generic/tcl.h: internal stub access to Tcl*Startup* routines, * generic/tclInt.decls: and removed their implementations. Their * generic/tclMain.c: function can now be completely performed with the new public interface. *** POTENTIAL INCOMPATIBILITY for callers of the internal Tcl*Startup* routines. ***
* generic/tclIntDecls.h: make genstubs * generic/tclStubInit.c:
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | potential incompatibility
Files: files | file ages | folders
SHA1: e52c9bd3ce5799bb2a70f70623cd081fd3cdfd69
User & Date: dgp 2008-12-15 15:48:33
Context
2008-12-15
17:11
Fix [Bug 2380293]. Redefine non-strict decoding to ignore only whitespace. check-in: 1d99671194 user: ferrieux tags: trunk
15:48
TIP #338 IMPLEMENTATION
* doc/AppInit.c: Made routines Tcl_SetStartupScript ...
check-in: e52c9bd3ce user: dgp tags: trunk, potential incompatibility
2008-12-14
15:10
add new zlib files check-in: aa236f24f4 user: das tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.

















1
2
3
4
5
6
7
...
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162















2008-12-14  Donal K. Fellows  <[email protected]>

	* tests/zlib.test: Added constraint so that tests don't fail where
	they cannot work due to zlib support being missing.

	* unix/configure.in, win/configure.in: Improve the autodetection code.
	* win/tcl.m4 (SC_CONFIG_CFLAGS): Remove the assumption of the presence
................................................................................
	* generic/tclStubInit.c:

	* generic/tclIO.c:	Update callers.
	* generic/tclIOCmd.c:
	* generic/tclInterp.c:
	* generic/tclTimer.c:
	*** POTENTIAL INCOMPATIBILITY only for extensions using the converted
	internal routine ***

2008-12-09  Donal K. Fellows  <[email protected]>

	* generic/tclIO.c (ChanClose,ChanRead,...): Factored out some of the
	code to connect to channel drivers that was common in multiple
	locations so as to make code more readable.

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
...
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
2008-12-15  Don Porter	<[email protected]>

	TIP #338 IMPLEMENTATION

	* doc/AppInit.c:	Made routines Tcl_SetStartupScript and
	* doc/Tcl_Main.3:	Tcl_GetStartupScript public.  Removed all
	* generic/tcl.h:	internal stub access to Tcl*Startup* routines,
	* generic/tclInt.decls:	and removed their implementations.  Their
	* generic/tclMain.c:	function can now be completely performed with
				the new public interface.
	*** POTENTIAL INCOMPATIBILITY for callers of the internal 
	    Tcl*Startup* routines. ***

	* generic/tclIntDecls.h:	make genstubs
	* generic/tclStubInit.c:	

2008-12-14  Donal K. Fellows  <[email protected]>

	* tests/zlib.test: Added constraint so that tests don't fail where
	they cannot work due to zlib support being missing.

	* unix/configure.in, win/configure.in: Improve the autodetection code.
	* win/tcl.m4 (SC_CONFIG_CFLAGS): Remove the assumption of the presence
................................................................................
	* generic/tclStubInit.c:

	* generic/tclIO.c:	Update callers.
	* generic/tclIOCmd.c:
	* generic/tclInterp.c:
	* generic/tclTimer.c:
	*** POTENTIAL INCOMPATIBILITY only for extensions using the converted
	    internal routine ***

2008-12-09  Donal K. Fellows  <[email protected]>

	* generic/tclIO.c (ChanClose,ChanRead,...): Factored out some of the
	code to connect to channel drivers that was common in multiple
	locations so as to make code more readable.

Changes to doc/AppInit.3.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
..
46
47
48
49
50
51
52





53
54
55
56
57
58
59
..
68
69
70
71
72
73
74



75
76
77
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" 
'\" RCS: @(#) $Id: AppInit.3,v 1.10 2008/10/15 10:43:37 dkf Exp $
'\" 
.so man.macros
.TH Tcl_AppInit 3 7.0 Tcl "Tcl Library Procedures"
.BS
.SH NAME
Tcl_AppInit \- perform application-specific initialization
.SH SYNOPSIS
................................................................................
Each initialization procedure adds new commands to \fIinterp\fR
for its package and performs other package-specific initialization.
.IP [2]
Process command-line arguments, which can be accessed from the
Tcl variables \fBargv\fR and \fBargv0\fR in \fIinterp\fR.
.IP [3]
Invoke a startup script to initialize the application.





.LP
\fBTcl_AppInit\fR returns \fBTCL_OK\fR or \fBTCL_ERROR\fR.
If it returns \fBTCL_ERROR\fR then it must leave an error message in
for the interpreter's result;  otherwise the result is ignored.
.PP
In addition to \fBTcl_AppInit\fR, your application should also contain
a procedure \fBmain\fR that calls \fBTcl_Main\fR as follows:
................................................................................
for the procedure, but in practice the name is nearly always
\fBTcl_AppInit\fR (in versions before Tcl 7.4 the name \fBTcl_AppInit\fR
was implicit;  there was no way to specify the procedure explicitly).
The best way to get started is to make a copy of the file
\fBtclAppInit.c\fR from the Tcl library or source directory.
It already contains a \fBmain\fR procedure and a template for
\fBTcl_AppInit\fR that you can modify for your application.




.SH KEYWORDS
application, argument, command, initialization, interpreter






|







 







>
>
>
>
>







 







>
>
>



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
..
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
..
73
74
75
76
77
78
79
80
81
82
83
84
85
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" 
'\" RCS: @(#) $Id: AppInit.3,v 1.11 2008/12/15 15:48:33 dgp Exp $
'\" 
.so man.macros
.TH Tcl_AppInit 3 7.0 Tcl "Tcl Library Procedures"
.BS
.SH NAME
Tcl_AppInit \- perform application-specific initialization
.SH SYNOPSIS
................................................................................
Each initialization procedure adds new commands to \fIinterp\fR
for its package and performs other package-specific initialization.
.IP [2]
Process command-line arguments, which can be accessed from the
Tcl variables \fBargv\fR and \fBargv0\fR in \fIinterp\fR.
.IP [3]
Invoke a startup script to initialize the application.
.IP [4]
Use the routines \fBTcl_SetStartupScript\fR and
\fBTcl_GetStartupScript\fR to set or query the file and encoding
that the active \fBTcl_Main\fR or \fBTk_Main\fR routine will
use as a startup script. 
.LP
\fBTcl_AppInit\fR returns \fBTCL_OK\fR or \fBTCL_ERROR\fR.
If it returns \fBTCL_ERROR\fR then it must leave an error message in
for the interpreter's result;  otherwise the result is ignored.
.PP
In addition to \fBTcl_AppInit\fR, your application should also contain
a procedure \fBmain\fR that calls \fBTcl_Main\fR as follows:
................................................................................
for the procedure, but in practice the name is nearly always
\fBTcl_AppInit\fR (in versions before Tcl 7.4 the name \fBTcl_AppInit\fR
was implicit;  there was no way to specify the procedure explicitly).
The best way to get started is to make a copy of the file
\fBtclAppInit.c\fR from the Tcl library or source directory.
It already contains a \fBmain\fR procedure and a template for
\fBTcl_AppInit\fR that you can modify for your application.

.SH "SEE ALSO"
Tcl_Main(3)

.SH KEYWORDS
application, argument, command, initialization, interpreter

Changes to doc/Tcl_Main.3.

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20





21
22
23
24
25
26
27
28
29
30
31







32
33
34
35
36
37
38
..
72
73
74
75
76
77
78
79






























80
81
82
83
84
85
86
87

88
89

90
91
92
93
94
95
96
97
98


99
100
101
102
103
104
105
106
107
108
109
110

111
112
113
114
115
116
117
118
119
120
121
122
123
...
144
145
146
147
148
149
150
151
152
153
'\" Copyright (c) 1994 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\" Copyright (c) 2000 Ajuba Solutions.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" 
'\" RCS: @(#) $Id: Tcl_Main.3,v 1.18 2008/10/17 10:22:25 dkf Exp $
'\" 
.so man.macros
.TH Tcl_Main 3 8.4 Tcl "Tcl Library Procedures"
.BS
.SH NAME
Tcl_Main, Tcl_SetMainLoop \- main program and event loop definition for Tcl-based applications
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
.sp
\fBTcl_Main\fR(\fIargc, argv, appInitProc\fR)





.sp
\fBTcl_SetMainLoop\fR(\fImainLoopProc\fR)
.SH ARGUMENTS
.AS Tcl_MainLoopProc *mainLoopProc
.AP int argc in
Number of elements in \fIargv\fR.
.AP char *argv[] in
Array of strings containing command-line arguments.
.AP Tcl_AppInitProc *appInitProc in
Address of an application-specific initialization procedure.
The value for this argument is usually \fBTcl_AppInit\fR.







.AP Tcl_MainLoopProc *mainLoopProc in
Address of an application-specific event loop procedure.
.BE
.SH DESCRIPTION
.PP
\fBTcl_Main\fR can serve as the main program for Tcl-based shell
applications.  A
................................................................................
restriction is not a problem with normal use described above.
.PP
\fBTcl_Main\fR and therefore all applications based upon it, like
\fBtclsh\fR, use \fBTcl_GetStdChannel\fR to initialize the standard
channels to their default values. See \fBTcl_StandardChannels\fR for
more information.
.PP
\fBTcl_Main\fR supports two modes of operation, depending on the






























values of \fIargc\fR and \fIargv\fR.  If the first few arguments
in \fIargv\fR match ?\fB\-encoding \fIname\fR? ?\fIfileName\fR?,
where \fIfileName\fR does not begin with the character \fI\-\fR,
then \fIfileName\fR is taken to be the name of a file containing
a \fIstartup script\fR, and \fIname\fR is taken to be the name
of the encoding of the contents of that file, which \fBTcl_Main\fR
will attempt to evaluate.  Otherwise, \fBTcl_Main\fR will enter an
interactive mode.

.PP
In either mode, \fBTcl_Main\fR will define in its master interpreter

the Tcl variables \fIargc\fR, \fIargv\fR, \fIargv0\fR, and
\fItcl_interactive\fR, as described in the documentation for \fBtclsh\fR.
.PP
When it has finished its own initialization, but before it processes
commands, \fBTcl_Main\fR calls the procedure given by the
\fIappInitProc\fR argument.  This procedure provides a
.QW hook
for the application to perform its own initialization of the interpreter
created by \fBTcl_Main\fR, such as defining application-specific


commands.  The procedure must have an interface that matches the
type \fBTcl_AppInitProc\fR:
.PP
.CS
typedef int \fBTcl_AppInitProc\fR(
        Tcl_Interp *\fIinterp\fR);
.CE
.PP
\fIAppInitProc\fR is almost always a pointer to \fBTcl_AppInit\fR; for more
details on this procedure, see the documentation for \fBTcl_AppInit\fR.
.PP
When the \fIappInitProc\fR is finished, \fBTcl_Main\fR enters one

of its two modes.  If a startup script has been provided, \fBTcl_Main\fR
attempts to evaluate it.  Otherwise, interactive mode begins with
examination of the variable \fItcl_rcFileName\fR in the master
interpreter.  If that variable exists and holds the name of a readable
file, the contents of that file are evaluated in the master interpreter.
Then interactive operations begin,
with prompts and command evaluation results written to the standard
output channel, and commands read from the standard input channel
and then evaluated.  The prompts written to the standard output
channel may be customized by defining the Tcl variables \fItcl_prompt1\fR
and \fItcl_prompt2\fR as described in the documentation for \fBtclsh\fR.
The prompts and command evaluation results are written to the standard
output channel only if the Tcl variable \fItcl_interactive\fR in the
................................................................................
itself will evaluate the \fBexit\fR command after the main loop
procedure (if any) returns.  In non-interactive mode, after
\fBTcl_Main\fR evaluates the startup script, and the main loop
procedure (if any) returns, \fBTcl_Main\fR will also evaluate
the \fBexit\fR command.
.SH "SEE ALSO"
tclsh(1), Tcl_GetStdChannel(3), Tcl_StandardChannels(3), Tcl_AppInit(3),
exit(n)
.SH KEYWORDS
application-specific initialization, command-line arguments, main program






|





|





>
>
>
>
>











>
>
>
>
>
>
>







 







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|



|
<
<
>

<
>









>
>
|
|









|
>
|
|
|
|
|
|







 







|


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
..
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
...
188
189
190
191
192
193
194
195
196
197
'\" Copyright (c) 1994 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\" Copyright (c) 2000 Ajuba Solutions.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" 
'\" RCS: @(#) $Id: Tcl_Main.3,v 1.19 2008/12/15 15:48:33 dgp Exp $
'\" 
.so man.macros
.TH Tcl_Main 3 8.4 Tcl "Tcl Library Procedures"
.BS
.SH NAME
Tcl_Main, Tcl_SetStartupScript, Tcl_GetStartupScript, Tcl_SetMainLoop \- main program, startup script, and event loop definition for Tcl-based applications
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
.sp
\fBTcl_Main\fR(\fIargc, argv, appInitProc\fR)
.sp
\fBTcl_SetStartupScript\fR(\fIpath, encoding\fR)
.sp
Tcl_Obj *
\fBTcl_GetStartupScript\fR(\fIencodingPtr\fR)
.sp
\fBTcl_SetMainLoop\fR(\fImainLoopProc\fR)
.SH ARGUMENTS
.AS Tcl_MainLoopProc *mainLoopProc
.AP int argc in
Number of elements in \fIargv\fR.
.AP char *argv[] in
Array of strings containing command-line arguments.
.AP Tcl_AppInitProc *appInitProc in
Address of an application-specific initialization procedure.
The value for this argument is usually \fBTcl_AppInit\fR.
.AP Tcl_Obj *path in
Name of file to use as startup script, or NULL.
.AP "const char" *encoding in
Encoding of file to use as startup script, or NULL.
.AP "const char" **encodingPtr out
If non-NULL, location to write a copy of the (const char *)
pointing to the encoding name.
.AP Tcl_MainLoopProc *mainLoopProc in
Address of an application-specific event loop procedure.
.BE
.SH DESCRIPTION
.PP
\fBTcl_Main\fR can serve as the main program for Tcl-based shell
applications.  A
................................................................................
restriction is not a problem with normal use described above.
.PP
\fBTcl_Main\fR and therefore all applications based upon it, like
\fBtclsh\fR, use \fBTcl_GetStdChannel\fR to initialize the standard
channels to their default values. See \fBTcl_StandardChannels\fR for
more information.
.PP
\fBTcl_Main\fR supports two modes of operation, depending on
whether the filename and encoding of a startup script has been
established.  The routines \fBTcl_SetStartupScript\fR and
\fBTcl_GetStartupScript\fR are the tools for controlling this
configuration of \fBTcl_Main\fR.
.PP
\fBTcl_SetStartupScript\fR registers the value \fIpath\fR
as the name of the file for \fBTcl_Main\fR to evaluate as
its startup script.  The value \fIencoding\fR is Tcl's name
for the encoding used to store the text in that file.  A
value of \fBNULL\fR for \fIencoding\fR is a signal to use
the system encoding.  A value of \fBNULL\fR for \fIpath\fR
erases any existing registration so that \fBTcl_Main\fR
will not evaluate any startup script.
.PP
\fBTcl_GetStartupScript\fR queries the registered file name
and encoding set by the most recent \fBTcl_SetStartupScript\fR
call in the same thread.  The stored file name is returned,
and the stored encoding name is written to space pointed to
by \fIencodingPtr\fR, when that is not NULL.  
.PP
The file name and encoding values managed by the routines
\fBTcl_SetStartupScript\fR and \fBTcl_GetStartupScript\fR
are stored per-thread.  Although the storage and retrieval
functions of these routines work in any thread, only those
calls in the same master thread as \fBTcl_Main\fR can have
any influence on it.
.PP
The caller of \fBTcl_Main\fR may call \fBTcl_SetStartupScript\fR
first to establish its desired startup script.  If \fBTcl_Main\fR
finds that no such startup script has been established, it consults
the first few arguments in \fIargv\fR.  If they match
?\fB\-encoding \fIname\fR? \fIfileName\fR,
where \fIfileName\fR does not begin with the character \fI\-\fR,
then \fIfileName\fR is taken to be the name of a file containing
a \fIstartup script\fR, and \fIname\fR is taken to be the name
of the encoding of the contents of that file.  \fBTcl_Main\fR


then calls \fRTcl_SetStartupScript\fR with these values.
.PP

\fBTcl_Main\fR then defines in its master interpreter
the Tcl variables \fIargc\fR, \fIargv\fR, \fIargv0\fR, and
\fItcl_interactive\fR, as described in the documentation for \fBtclsh\fR.
.PP
When it has finished its own initialization, but before it processes
commands, \fBTcl_Main\fR calls the procedure given by the
\fIappInitProc\fR argument.  This procedure provides a
.QW hook
for the application to perform its own initialization of the interpreter
created by \fBTcl_Main\fR, such as defining application-specific
commands.  The application initialization routine might also 
call \fBTcl_SetStartupScript\fR to (re-)set the file and encoding
to be used as a startup script.  The procedure must have an interface
that matches the type \fBTcl_AppInitProc\fR:
.PP
.CS
typedef int \fBTcl_AppInitProc\fR(
        Tcl_Interp *\fIinterp\fR);
.CE
.PP
\fIAppInitProc\fR is almost always a pointer to \fBTcl_AppInit\fR; for more
details on this procedure, see the documentation for \fBTcl_AppInit\fR.
.PP
When the \fIappInitProc\fR is finished, \fBTcl_Main\fR calls
\fBTcl_GetStartupScript\fR to determine what startup script has
been requested, if any.  If a startup script has been provided,
\fBTcl_Main\fR attempts to evaluate it.  Otherwise, interactive
mode begins with examination of the variable \fItcl_rcFileName\fR
in the master interpreter.  If that variable exists and holds the
name of a readable file, the contents of that file are evaluated
in the master interpreter.  Then interactive operations begin,
with prompts and command evaluation results written to the standard
output channel, and commands read from the standard input channel
and then evaluated.  The prompts written to the standard output
channel may be customized by defining the Tcl variables \fItcl_prompt1\fR
and \fItcl_prompt2\fR as described in the documentation for \fBtclsh\fR.
The prompts and command evaluation results are written to the standard
output channel only if the Tcl variable \fItcl_interactive\fR in the
................................................................................
itself will evaluate the \fBexit\fR command after the main loop
procedure (if any) returns.  In non-interactive mode, after
\fBTcl_Main\fR evaluates the startup script, and the main loop
procedure (if any) returns, \fBTcl_Main\fR will also evaluate
the \fBexit\fR command.
.SH "SEE ALSO"
tclsh(1), Tcl_GetStdChannel(3), Tcl_StandardChannels(3), Tcl_AppInit(3),
exit(n), encoding(n)
.SH KEYWORDS
application-specific initialization, command-line arguments, main program

Changes to generic/tcl.h.

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
....
2335
2336
2337
2338
2339
2340
2341



2342
2343
2344
2345
2346
2347
2348
 * Copyright (c) 1994-1998 Sun Microsystems, Inc.
 * Copyright (c) 1998-2000 by Scriptics Corporation.
 * Copyright (c) 2002 by Kevin B. Kenny.  All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tcl.h,v 1.281 2008/12/11 01:21:52 dkf Exp $
 */

#ifndef _TCL
#define _TCL

/*
 * For C++ compilers, use extern "C"
................................................................................
/*
 * Public functions that are not accessible via the stubs table.
 * Tcl_GetMemoryInfo is needed for AOLserver. [Bug 1868171]
 */

EXTERN void		Tcl_Main (int argc, char **argv,
				Tcl_AppInitProc *appInitProc);



EXTERN const char *	Tcl_PkgInitStubsCheck (Tcl_Interp *interp,
				const char *version, int exact);
#if defined(TCL_THREADS) && defined(USE_THREAD_ALLOC)
EXTERN void		Tcl_GetMemoryInfo (Tcl_DString *dsPtr);
#endif








|







 







>
>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
....
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
 * Copyright (c) 1994-1998 Sun Microsystems, Inc.
 * Copyright (c) 1998-2000 by Scriptics Corporation.
 * Copyright (c) 2002 by Kevin B. Kenny.  All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tcl.h,v 1.282 2008/12/15 15:48:33 dgp Exp $
 */

#ifndef _TCL
#define _TCL

/*
 * For C++ compilers, use extern "C"
................................................................................
/*
 * Public functions that are not accessible via the stubs table.
 * Tcl_GetMemoryInfo is needed for AOLserver. [Bug 1868171]
 */

EXTERN void		Tcl_Main (int argc, char **argv,
				Tcl_AppInitProc *appInitProc);
EXTERN void		Tcl_SetStartupScript(Tcl_Obj *path,
				const char *encoding);
EXTERN Tcl_Obj *	Tcl_GetStartupScript(const char **encodingPtr);
EXTERN const char *	Tcl_PkgInitStubsCheck (Tcl_Interp *interp,
				const char *version, int exact);
#if defined(TCL_THREADS) && defined(USE_THREAD_ALLOC)
EXTERN void		Tcl_GetMemoryInfo (Tcl_DString *dsPtr);
#endif


Changes to generic/tclInt.decls.

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
...
620
621
622
623
624
625
626

627
628
629


630
631
632

633
634
635
636
637
638
639
...
670
671
672
673
674
675
676

677
678
679


680
681
682

683
684
685
686
687
688
689
...
721
722
723
724
725
726
727

728
729
730

731
732
733

734
735
736
737
738
739
740
# Copyright (c) 1998-1999 by Scriptics Corporation.
# Copyright (c) 2001 by Kevin B. Kenny.  All rights reserved.
# Copyright (c) 2007 Daniel A. Steffen <[email protected]>
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: tclInt.decls,v 1.131 2008/12/09 21:47:08 nijtmans Exp $

library tcl

# Define the unsupported generic interfaces.

interface tclInt

................................................................................
declare 156 generic {
    void TclRegError(Tcl_Interp *interp, const char *msg,
	    int status)
}
declare 157 generic {
    Var *TclVarTraceExists(Tcl_Interp *interp, const char *varName)
}

declare 158 generic {
    void TclSetStartupScriptFileName(const char *filename)
}


declare 159 generic {
    CONST84_RETURN char *TclGetStartupScriptFileName(void)
}

#declare 160 generic {
#    int TclpMatchFilesTypes(Tcl_Interp *interp, char *separators,
#	    Tcl_DString *dirPtr, char *pattern, char *tail,
#	    GlobTypeData *types)
#}

# new in 8.3.2/8.4a2
................................................................................
# New function due to TIP #33
declare 166 generic {
    int TclListObjSetElement(Tcl_Interp *interp, Tcl_Obj *listPtr,
	    int index, Tcl_Obj *valuePtr)
}

# VFS-aware versions of Tcl*StartupScriptFileName (158 and 159 above)

declare 167 generic {
    void TclSetStartupScriptPath(Tcl_Obj *pathPtr)
}


declare 168 generic {
    Tcl_Obj *TclGetStartupScriptPath(void)
}

# variant of Tcl_UtfNCmp that takes n as bytes, not chars
declare 169 generic {
    int TclpUtfNcmp2(const char *s1, const char *s2, unsigned long n)
}
declare 170 generic {
    int TclCheckInterpTraces(Tcl_Interp *interp, const char *command,
            int numChars, Command *cmdPtr, int result, int traceFlags,
................................................................................
declare 176 generic {
    void TclCleanupVar(Var *varPtr, Var *arrayPtr)
}
declare 177 generic {
    void TclVarErrMsg(Tcl_Interp *interp, const char *part1, const char *part2,
	    const char *operation, const char *reason)
}

declare 178 generic {
    void Tcl_SetStartupScript(Tcl_Obj *pathPtr, const char* encodingName)
}

declare 179 generic {
    Tcl_Obj *Tcl_GetStartupScript(const char **encodingNamePtr)
}


# REMOVED
# Allocate lists without copying arrays
# declare 180 generic {
#    Tcl_Obj *TclNewListObjDirect(int objc, Tcl_Obj **objv)
# }
#declare 181 generic {






|







 







>
|
|
<
>
>
|
|
<
>







 







>
|
|
<
>
>
|
|
<
>







 







>
|
|
<
>
|
|
<
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
...
620
621
622
623
624
625
626
627
628
629

630
631
632
633

634
635
636
637
638
639
640
641
...
672
673
674
675
676
677
678
679
680
681

682
683
684
685

686
687
688
689
690
691
692
693
...
725
726
727
728
729
730
731
732
733
734

735
736
737

738
739
740
741
742
743
744
745
# Copyright (c) 1998-1999 by Scriptics Corporation.
# Copyright (c) 2001 by Kevin B. Kenny.  All rights reserved.
# Copyright (c) 2007 Daniel A. Steffen <[email protected]>
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: tclInt.decls,v 1.132 2008/12/15 15:48:33 dgp Exp $

library tcl

# Define the unsupported generic interfaces.

interface tclInt

................................................................................
declare 156 generic {
    void TclRegError(Tcl_Interp *interp, const char *msg,
	    int status)
}
declare 157 generic {
    Var *TclVarTraceExists(Tcl_Interp *interp, const char *varName)
}
# REMOVED - use public Tcl_SetStartupPath()
#declare 158 generic {
#    void TclSetStartupScriptFileName(const char *filename)

#}
# REMOVED - use public Tcl_GetStartupPath()
#declare 159 generic {
#    CONST84_RETURN char *TclGetStartupScriptFileName(void)

#}
#declare 160 generic {
#    int TclpMatchFilesTypes(Tcl_Interp *interp, char *separators,
#	    Tcl_DString *dirPtr, char *pattern, char *tail,
#	    GlobTypeData *types)
#}

# new in 8.3.2/8.4a2
................................................................................
# New function due to TIP #33
declare 166 generic {
    int TclListObjSetElement(Tcl_Interp *interp, Tcl_Obj *listPtr,
	    int index, Tcl_Obj *valuePtr)
}

# VFS-aware versions of Tcl*StartupScriptFileName (158 and 159 above)
# REMOVED - use public Tcl_SetStartupPath()
#declare 167 generic {
#    void TclSetStartupScriptPath(Tcl_Obj *pathPtr)

#}
# REMOVED - use public Tcl_GetStartupPath()
#declare 168 generic {
#    Tcl_Obj *TclGetStartupScriptPath(void)

#}
# variant of Tcl_UtfNCmp that takes n as bytes, not chars
declare 169 generic {
    int TclpUtfNcmp2(const char *s1, const char *s2, unsigned long n)
}
declare 170 generic {
    int TclCheckInterpTraces(Tcl_Interp *interp, const char *command,
            int numChars, Command *cmdPtr, int result, int traceFlags,
................................................................................
declare 176 generic {
    void TclCleanupVar(Var *varPtr, Var *arrayPtr)
}
declare 177 generic {
    void TclVarErrMsg(Tcl_Interp *interp, const char *part1, const char *part2,
	    const char *operation, const char *reason)
}
# TIP 338 made these public - now declared in tcl.h
#declare 178 generic {
#    void Tcl_SetStartupScript(Tcl_Obj *pathPtr, const char* encodingName)

#}
#declare 179 generic {
#    Tcl_Obj *Tcl_GetStartupScript(const char **encodingNamePtr)

#}

# REMOVED
# Allocate lists without copying arrays
# declare 180 generic {
#    Tcl_Obj *TclNewListObjDirect(int objc, Tcl_Obj **objv)
# }
#declare 181 generic {

Changes to generic/tclIntDecls.h.

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
...
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
...
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
....
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
....
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
....
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
....
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
 *	versions.  Use at your own risk.
 *
 * Copyright (c) 1998-1999 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: tclIntDecls.h,v 1.127 2008/12/09 21:47:08 nijtmans Exp $
 */

#ifndef _TCLINTDECLS
#define _TCLINTDECLS

#include "tclPort.h"

................................................................................
#endif
#ifndef TclVarTraceExists_TCL_DECLARED
#define TclVarTraceExists_TCL_DECLARED
/* 157 */
EXTERN Var *		TclVarTraceExists (Tcl_Interp * interp,
				const char * varName);
#endif
#ifndef TclSetStartupScriptFileName_TCL_DECLARED
#define TclSetStartupScriptFileName_TCL_DECLARED
/* 158 */
EXTERN void		TclSetStartupScriptFileName (const char * filename);
#endif
#ifndef TclGetStartupScriptFileName_TCL_DECLARED
#define TclGetStartupScriptFileName_TCL_DECLARED
/* 159 */
EXTERN CONST84_RETURN char * TclGetStartupScriptFileName (void);
#endif
/* Slot 160 is reserved */
#ifndef TclChannelTransform_TCL_DECLARED
#define TclChannelTransform_TCL_DECLARED
/* 161 */
EXTERN int		TclChannelTransform (Tcl_Interp * interp,
				Tcl_Channel chan, Tcl_Obj * cmdObjPtr);
#endif
................................................................................
#ifndef TclListObjSetElement_TCL_DECLARED
#define TclListObjSetElement_TCL_DECLARED
/* 166 */
EXTERN int		TclListObjSetElement (Tcl_Interp * interp,
				Tcl_Obj * listPtr, int index,
				Tcl_Obj * valuePtr);
#endif
#ifndef TclSetStartupScriptPath_TCL_DECLARED
#define TclSetStartupScriptPath_TCL_DECLARED
/* 167 */
EXTERN void		TclSetStartupScriptPath (Tcl_Obj * pathPtr);
#endif
#ifndef TclGetStartupScriptPath_TCL_DECLARED
#define TclGetStartupScriptPath_TCL_DECLARED
/* 168 */
EXTERN Tcl_Obj *	TclGetStartupScriptPath (void);
#endif
#ifndef TclpUtfNcmp2_TCL_DECLARED
#define TclpUtfNcmp2_TCL_DECLARED
/* 169 */
EXTERN int		TclpUtfNcmp2 (const char * s1, const char * s2,
				unsigned long n);
#endif
#ifndef TclCheckInterpTraces_TCL_DECLARED
................................................................................
#ifndef TclVarErrMsg_TCL_DECLARED
#define TclVarErrMsg_TCL_DECLARED
/* 177 */
EXTERN void		TclVarErrMsg (Tcl_Interp * interp,
				const char * part1, const char * part2,
				const char * operation, const char * reason);
#endif
#ifndef Tcl_SetStartupScript_TCL_DECLARED
#define Tcl_SetStartupScript_TCL_DECLARED
/* 178 */
EXTERN void		Tcl_SetStartupScript (Tcl_Obj * pathPtr,
				const char* encodingName);
#endif
#ifndef Tcl_GetStartupScript_TCL_DECLARED
#define Tcl_GetStartupScript_TCL_DECLARED
/* 179 */
EXTERN Tcl_Obj *	Tcl_GetStartupScript (const char ** encodingNamePtr);
#endif
/* Slot 180 is reserved */
/* Slot 181 is reserved */
#ifndef TclpLocaltime_TCL_DECLARED
#define TclpLocaltime_TCL_DECLARED
/* 182 */
EXTERN struct tm *	TclpLocaltime (const time_t * clock);
#endif
................................................................................
    void (*tclRegExpRangeUniChar) (Tcl_RegExp re, int index, int * startPtr, int * endPtr); /* 151 */
    void (*tclSetLibraryPath) (Tcl_Obj * pathPtr); /* 152 */
    Tcl_Obj * (*tclGetLibraryPath) (void); /* 153 */
    void *reserved154;
    void *reserved155;
    void (*tclRegError) (Tcl_Interp * interp, const char * msg, int status); /* 156 */
    Var * (*tclVarTraceExists) (Tcl_Interp * interp, const char * varName); /* 157 */
    void (*tclSetStartupScriptFileName) (const char * filename); /* 158 */
    CONST84_RETURN char * (*tclGetStartupScriptFileName) (void); /* 159 */
    void *reserved160;
    int (*tclChannelTransform) (Tcl_Interp * interp, Tcl_Channel chan, Tcl_Obj * cmdObjPtr); /* 161 */
    void (*tclChannelEventScriptInvoker) (ClientData clientData, int flags); /* 162 */
    CONST86 void * (*tclGetInstructionTable) (void); /* 163 */
    void (*tclExpandCodeArray) (void * envPtr); /* 164 */
    void (*tclpSetInitialEncodings) (void); /* 165 */
    int (*tclListObjSetElement) (Tcl_Interp * interp, Tcl_Obj * listPtr, int index, Tcl_Obj * valuePtr); /* 166 */
    void (*tclSetStartupScriptPath) (Tcl_Obj * pathPtr); /* 167 */
    Tcl_Obj * (*tclGetStartupScriptPath) (void); /* 168 */
    int (*tclpUtfNcmp2) (const char * s1, const char * s2, unsigned long n); /* 169 */
    int (*tclCheckInterpTraces) (Tcl_Interp * interp, const char * command, int numChars, Command * cmdPtr, int result, int traceFlags, int objc, Tcl_Obj *const objv[]); /* 170 */
    int (*tclCheckExecutionTraces) (Tcl_Interp * interp, const char * command, int numChars, Command * cmdPtr, int result, int traceFlags, int objc, Tcl_Obj *const objv[]); /* 171 */
    int (*tclInThreadExit) (void); /* 172 */
    int (*tclUniCharMatch) (const Tcl_UniChar * string, int strLen, const Tcl_UniChar * pattern, int ptnLen, int flags); /* 173 */
    void *reserved174;
    int (*tclCallVarTraces) (Interp * iPtr, Var * arrayPtr, Var * varPtr, const char * part1, const char * part2, int flags, int leaveErrMsg); /* 175 */
    void (*tclCleanupVar) (Var * varPtr, Var * arrayPtr); /* 176 */
    void (*tclVarErrMsg) (Tcl_Interp * interp, const char * part1, const char * part2, const char * operation, const char * reason); /* 177 */
    void (*tcl_SetStartupScript) (Tcl_Obj * pathPtr, const char* encodingName); /* 178 */
    Tcl_Obj * (*tcl_GetStartupScript) (const char ** encodingNamePtr); /* 179 */
    void *reserved180;
    void *reserved181;
    struct tm * (*tclpLocaltime) (const time_t * clock); /* 182 */
    struct tm * (*tclpGmtime) (const time_t * clock); /* 183 */
    void *reserved184;
    void *reserved185;
    void *reserved186;
................................................................................
#define TclRegError \
	(tclIntStubsPtr->tclRegError) /* 156 */
#endif
#ifndef TclVarTraceExists
#define TclVarTraceExists \
	(tclIntStubsPtr->tclVarTraceExists) /* 157 */
#endif
#ifndef TclSetStartupScriptFileName
#define TclSetStartupScriptFileName \
	(tclIntStubsPtr->tclSetStartupScriptFileName) /* 158 */
#endif
#ifndef TclGetStartupScriptFileName
#define TclGetStartupScriptFileName \
	(tclIntStubsPtr->tclGetStartupScriptFileName) /* 159 */
#endif
/* Slot 160 is reserved */
#ifndef TclChannelTransform
#define TclChannelTransform \
	(tclIntStubsPtr->tclChannelTransform) /* 161 */
#endif
#ifndef TclChannelEventScriptInvoker
#define TclChannelEventScriptInvoker \
................................................................................
#define TclpSetInitialEncodings \
	(tclIntStubsPtr->tclpSetInitialEncodings) /* 165 */
#endif
#ifndef TclListObjSetElement
#define TclListObjSetElement \
	(tclIntStubsPtr->tclListObjSetElement) /* 166 */
#endif
#ifndef TclSetStartupScriptPath
#define TclSetStartupScriptPath \
	(tclIntStubsPtr->tclSetStartupScriptPath) /* 167 */
#endif
#ifndef TclGetStartupScriptPath
#define TclGetStartupScriptPath \
	(tclIntStubsPtr->tclGetStartupScriptPath) /* 168 */
#endif
#ifndef TclpUtfNcmp2
#define TclpUtfNcmp2 \
	(tclIntStubsPtr->tclpUtfNcmp2) /* 169 */
#endif
#ifndef TclCheckInterpTraces
#define TclCheckInterpTraces \
	(tclIntStubsPtr->tclCheckInterpTraces) /* 170 */
................................................................................
#define TclCleanupVar \
	(tclIntStubsPtr->tclCleanupVar) /* 176 */
#endif
#ifndef TclVarErrMsg
#define TclVarErrMsg \
	(tclIntStubsPtr->tclVarErrMsg) /* 177 */
#endif
#ifndef Tcl_SetStartupScript
#define Tcl_SetStartupScript \
	(tclIntStubsPtr->tcl_SetStartupScript) /* 178 */
#endif
#ifndef Tcl_GetStartupScript
#define Tcl_GetStartupScript \
	(tclIntStubsPtr->tcl_GetStartupScript) /* 179 */
#endif
/* Slot 180 is reserved */
/* Slot 181 is reserved */
#ifndef TclpLocaltime
#define TclpLocaltime \
	(tclIntStubsPtr->tclpLocaltime) /* 182 */
#endif
#ifndef TclpGmtime






|







 







|
|
<
<
<
<
<
<
<
<







 







|
|
<
<
<
<
<
<
<
<







 







|
|
<
<
<
<
<
<
<
<
<







 







|
|







|
|









|
|







 







|
|
<
<
<
<
<
<







 







|
|
<
<
<
<
<
<







 







|
|
<
<
<
<
<
<







7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
737
738
739
740
741
742
743
744
745








746
747
748
749
750
751
752
...
774
775
776
777
778
779
780
781
782








783
784
785
786
787
788
789
...
831
832
833
834
835
836
837
838
839









840
841
842
843
844
845
846
....
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
....
1856
1857
1858
1859
1860
1861
1862
1863
1864






1865
1866
1867
1868
1869
1870
1871
....
1883
1884
1885
1886
1887
1888
1889
1890
1891






1892
1893
1894
1895
1896
1897
1898
....
1918
1919
1920
1921
1922
1923
1924
1925
1926






1927
1928
1929
1930
1931
1932
1933
 *	versions.  Use at your own risk.
 *
 * Copyright (c) 1998-1999 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: tclIntDecls.h,v 1.128 2008/12/15 15:48:33 dgp Exp $
 */

#ifndef _TCLINTDECLS
#define _TCLINTDECLS

#include "tclPort.h"

................................................................................
#endif
#ifndef TclVarTraceExists_TCL_DECLARED
#define TclVarTraceExists_TCL_DECLARED
/* 157 */
EXTERN Var *		TclVarTraceExists (Tcl_Interp * interp,
				const char * varName);
#endif
/* Slot 158 is reserved */
/* Slot 159 is reserved */








/* Slot 160 is reserved */
#ifndef TclChannelTransform_TCL_DECLARED
#define TclChannelTransform_TCL_DECLARED
/* 161 */
EXTERN int		TclChannelTransform (Tcl_Interp * interp,
				Tcl_Channel chan, Tcl_Obj * cmdObjPtr);
#endif
................................................................................
#ifndef TclListObjSetElement_TCL_DECLARED
#define TclListObjSetElement_TCL_DECLARED
/* 166 */
EXTERN int		TclListObjSetElement (Tcl_Interp * interp,
				Tcl_Obj * listPtr, int index,
				Tcl_Obj * valuePtr);
#endif
/* Slot 167 is reserved */
/* Slot 168 is reserved */








#ifndef TclpUtfNcmp2_TCL_DECLARED
#define TclpUtfNcmp2_TCL_DECLARED
/* 169 */
EXTERN int		TclpUtfNcmp2 (const char * s1, const char * s2,
				unsigned long n);
#endif
#ifndef TclCheckInterpTraces_TCL_DECLARED
................................................................................
#ifndef TclVarErrMsg_TCL_DECLARED
#define TclVarErrMsg_TCL_DECLARED
/* 177 */
EXTERN void		TclVarErrMsg (Tcl_Interp * interp,
				const char * part1, const char * part2,
				const char * operation, const char * reason);
#endif
/* Slot 178 is reserved */
/* Slot 179 is reserved */









/* Slot 180 is reserved */
/* Slot 181 is reserved */
#ifndef TclpLocaltime_TCL_DECLARED
#define TclpLocaltime_TCL_DECLARED
/* 182 */
EXTERN struct tm *	TclpLocaltime (const time_t * clock);
#endif
................................................................................
    void (*tclRegExpRangeUniChar) (Tcl_RegExp re, int index, int * startPtr, int * endPtr); /* 151 */
    void (*tclSetLibraryPath) (Tcl_Obj * pathPtr); /* 152 */
    Tcl_Obj * (*tclGetLibraryPath) (void); /* 153 */
    void *reserved154;
    void *reserved155;
    void (*tclRegError) (Tcl_Interp * interp, const char * msg, int status); /* 156 */
    Var * (*tclVarTraceExists) (Tcl_Interp * interp, const char * varName); /* 157 */
    void *reserved158;
    void *reserved159;
    void *reserved160;
    int (*tclChannelTransform) (Tcl_Interp * interp, Tcl_Channel chan, Tcl_Obj * cmdObjPtr); /* 161 */
    void (*tclChannelEventScriptInvoker) (ClientData clientData, int flags); /* 162 */
    CONST86 void * (*tclGetInstructionTable) (void); /* 163 */
    void (*tclExpandCodeArray) (void * envPtr); /* 164 */
    void (*tclpSetInitialEncodings) (void); /* 165 */
    int (*tclListObjSetElement) (Tcl_Interp * interp, Tcl_Obj * listPtr, int index, Tcl_Obj * valuePtr); /* 166 */
    void *reserved167;
    void *reserved168;
    int (*tclpUtfNcmp2) (const char * s1, const char * s2, unsigned long n); /* 169 */
    int (*tclCheckInterpTraces) (Tcl_Interp * interp, const char * command, int numChars, Command * cmdPtr, int result, int traceFlags, int objc, Tcl_Obj *const objv[]); /* 170 */
    int (*tclCheckExecutionTraces) (Tcl_Interp * interp, const char * command, int numChars, Command * cmdPtr, int result, int traceFlags, int objc, Tcl_Obj *const objv[]); /* 171 */
    int (*tclInThreadExit) (void); /* 172 */
    int (*tclUniCharMatch) (const Tcl_UniChar * string, int strLen, const Tcl_UniChar * pattern, int ptnLen, int flags); /* 173 */
    void *reserved174;
    int (*tclCallVarTraces) (Interp * iPtr, Var * arrayPtr, Var * varPtr, const char * part1, const char * part2, int flags, int leaveErrMsg); /* 175 */
    void (*tclCleanupVar) (Var * varPtr, Var * arrayPtr); /* 176 */
    void (*tclVarErrMsg) (Tcl_Interp * interp, const char * part1, const char * part2, const char * operation, const char * reason); /* 177 */
    void *reserved178;
    void *reserved179;
    void *reserved180;
    void *reserved181;
    struct tm * (*tclpLocaltime) (const time_t * clock); /* 182 */
    struct tm * (*tclpGmtime) (const time_t * clock); /* 183 */
    void *reserved184;
    void *reserved185;
    void *reserved186;
................................................................................
#define TclRegError \
	(tclIntStubsPtr->tclRegError) /* 156 */
#endif
#ifndef TclVarTraceExists
#define TclVarTraceExists \
	(tclIntStubsPtr->tclVarTraceExists) /* 157 */
#endif
/* Slot 158 is reserved */
/* Slot 159 is reserved */






/* Slot 160 is reserved */
#ifndef TclChannelTransform
#define TclChannelTransform \
	(tclIntStubsPtr->tclChannelTransform) /* 161 */
#endif
#ifndef TclChannelEventScriptInvoker
#define TclChannelEventScriptInvoker \
................................................................................
#define TclpSetInitialEncodings \
	(tclIntStubsPtr->tclpSetInitialEncodings) /* 165 */
#endif
#ifndef TclListObjSetElement
#define TclListObjSetElement \
	(tclIntStubsPtr->tclListObjSetElement) /* 166 */
#endif
/* Slot 167 is reserved */
/* Slot 168 is reserved */






#ifndef TclpUtfNcmp2
#define TclpUtfNcmp2 \
	(tclIntStubsPtr->tclpUtfNcmp2) /* 169 */
#endif
#ifndef TclCheckInterpTraces
#define TclCheckInterpTraces \
	(tclIntStubsPtr->tclCheckInterpTraces) /* 170 */
................................................................................
#define TclCleanupVar \
	(tclIntStubsPtr->tclCleanupVar) /* 176 */
#endif
#ifndef TclVarErrMsg
#define TclVarErrMsg \
	(tclIntStubsPtr->tclVarErrMsg) /* 177 */
#endif
/* Slot 178 is reserved */
/* Slot 179 is reserved */






/* Slot 180 is reserved */
/* Slot 181 is reserved */
#ifndef TclpLocaltime
#define TclpLocaltime \
	(tclIntStubsPtr->tclpLocaltime) /* 182 */
#endif
#ifndef TclpGmtime

Changes to generic/tclMain.c.

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
..
28
29
30
31
32
33
34
35




36



37
38
39
40
41
42
43
..
85
86
87
88
89
90
91


92

93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
...
134
135
136
137
138
139
140



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
 * Copyright (c) 1988-1994 The Regents of the University of California.
 * Copyright (c) 1994-1997 Sun Microsystems, Inc.
 * Copyright (c) 2000 Ajuba Solutions.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclMain.c,v 1.46 2008/10/02 23:36:12 dkf Exp $
 */

#include "tclInt.h"

#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLEXPORT

................................................................................
 * Declarations for various library functions and variables (don't want to
 * include tclPort.h here, because people might copy this file out of the Tcl
 * source directory to make their own modified versions).
 */

extern CRTIMPORT int	isatty(int fd);

static Tcl_Obj *tclStartupScriptPath = NULL;




static Tcl_Obj *tclStartupScriptEncoding = NULL;



static Tcl_MainLoopProc *mainLoopProc = NULL;

/*
 * Structure definition for information used to keep the state of an
 * interactive command processor that reads lines from standard input and
 * writes prompts and results to standard output.
 */
................................................................................
 */

void
Tcl_SetStartupScript(
    Tcl_Obj *path,		/* Filesystem path of startup script file */
    const char *encoding)	/* Encoding of the data in that file */
{


    Tcl_Obj *newEncoding = NULL;

    if (encoding != NULL) {
	newEncoding = Tcl_NewStringObj(encoding, -1);
    }

    if (tclStartupScriptPath != NULL) {
	Tcl_DecrRefCount(tclStartupScriptPath);
    }
    tclStartupScriptPath = path;
    if (tclStartupScriptPath != NULL) {
	Tcl_IncrRefCount(tclStartupScriptPath);
    }

    if (tclStartupScriptEncoding != NULL) {
	Tcl_DecrRefCount(tclStartupScriptEncoding);
    }
    tclStartupScriptEncoding = newEncoding;
    if (tclStartupScriptEncoding != NULL) {
	Tcl_IncrRefCount(tclStartupScriptEncoding);
    }
}
 
/*
 *----------------------------------------------------------------------
 *
 * Tcl_GetStartupScript --
................................................................................
Tcl_Obj *
Tcl_GetStartupScript(
    const char **encodingPtr)	/* When not NULL, points to storage for the
				 * (const char *) that points to the
				 * registered encoding name for the startup
				 * script */
{



    if (encodingPtr != NULL) {
	if (tclStartupScriptEncoding == NULL) {
	    *encodingPtr = NULL;
	} else {
	    *encodingPtr = Tcl_GetString(tclStartupScriptEncoding);
	}
    }
    return tclStartupScriptPath;
}
 
/*
 *----------------------------------------------------------------------
 *
 * TclSetStartupScriptPath --
 *
 *	Primes the startup script VFS path, used to override the command line
 *	processing.
 *
 * Results:
 *	None.
 *
 * Side effects:
 *	This function initializes the VFS path of the Tcl script to run at
 *	startup.
 *
 *----------------------------------------------------------------------
 */

void
TclSetStartupScriptPath(
    Tcl_Obj *path)
{
    Tcl_SetStartupScript(path, NULL);
}
 
/*
 *----------------------------------------------------------------------
 *
 * TclGetStartupScriptPath --
 *
 *	Gets the startup script VFS path, used to override the command line
 *	processing.
 *
 * Results:
 *	The startup script VFS path, NULL if none has been set.
 *
 * Side effects:
 *	None.
 *
 *----------------------------------------------------------------------
 */

Tcl_Obj *
TclGetStartupScriptPath(void)
{
    return Tcl_GetStartupScript(NULL);
}
 
/*
 *----------------------------------------------------------------------
 *
 * TclSetStartupScriptFileName --
 *
 *	Primes the startup script file name, used to override the command line
 *	processing.
 *
 * Results:
 *	None.
 *
 * Side effects:
 *	This function initializes the file name of the Tcl script to run at
 *	startup.
 *
 *----------------------------------------------------------------------
 */

void
TclSetStartupScriptFileName(
    const char *fileName)
{
    Tcl_Obj *path = Tcl_NewStringObj(fileName,-1);
    Tcl_SetStartupScript(path, NULL);
}
 
/*
 *----------------------------------------------------------------------
 *
 * TclGetStartupScriptFileName --
 *
 *	Gets the startup script file name, used to override the command line
 *	processing.
 *
 * Results:
 *	The startup script file name, NULL if none has been set.
 *
 * Side effects:
 *	None.
 *
 *----------------------------------------------------------------------
 */

const char *
TclGetStartupScriptFileName(void)
{
    Tcl_Obj *path = Tcl_GetStartupScript(NULL);

    if (path == NULL) {
	return NULL;
    }
    return Tcl_GetString(path);
}
 
/*----------------------------------------------------------------------
 *
 * Tcl_SourceRCFile --
 *
 *	This function is typically invoked by Tcl_Main of Tk_Main function to






|







 







|
>
>
>
>
|
>
>
>







 







>
>

>




|
|

|
|
|


|
|

|
|
|







 







>
>
>

|


|


<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<
<







6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
..
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
..
92
93
94
95
96
97
98
99
100
101
102
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
...
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160




































































































161


162
163
164
165
166
167
168
 * Copyright (c) 1988-1994 The Regents of the University of California.
 * Copyright (c) 1994-1997 Sun Microsystems, Inc.
 * Copyright (c) 2000 Ajuba Solutions.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclMain.c,v 1.47 2008/12/15 15:48:33 dgp Exp $
 */

#include "tclInt.h"

#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLEXPORT

................................................................................
 * Declarations for various library functions and variables (don't want to
 * include tclPort.h here, because people might copy this file out of the Tcl
 * source directory to make their own modified versions).
 */

extern CRTIMPORT int	isatty(int fd);

typedef struct StartupScript {
    Tcl_Obj *path;	/* The filename of the script for *_Main() routines
			 * to [source] as a startup script, or NULL for
			 * none set, meaning enter interactive mode. */
    Tcl_Obj *encoding;	/* The encoding of the startup script file. */
} StartupScript;

static Tcl_ThreadDataKey startupScriptKey;

static Tcl_MainLoopProc *mainLoopProc = NULL;

/*
 * Structure definition for information used to keep the state of an
 * interactive command processor that reads lines from standard input and
 * writes prompts and results to standard output.
 */
................................................................................
 */

void
Tcl_SetStartupScript(
    Tcl_Obj *path,		/* Filesystem path of startup script file */
    const char *encoding)	/* Encoding of the data in that file */
{
    StartupScript *scriptPtr = Tcl_GetThreadData(&startupScriptKey,
	    (int) sizeof(StartupScript));
    Tcl_Obj *newEncoding = NULL;

    if (encoding != NULL) {
	newEncoding = Tcl_NewStringObj(encoding, -1);
    }

    if (scriptPtr->path != NULL) {
	Tcl_DecrRefCount(scriptPtr->path);
    }
    scriptPtr->path = path;
    if (scriptPtr->path != NULL) {
	Tcl_IncrRefCount(scriptPtr->path);
    }

    if (scriptPtr->encoding != NULL) {
	Tcl_DecrRefCount(scriptPtr->encoding);
    }
    scriptPtr->encoding = newEncoding;
    if (scriptPtr->encoding != NULL) {
	Tcl_IncrRefCount(scriptPtr->encoding);
    }
}
 
/*
 *----------------------------------------------------------------------
 *
 * Tcl_GetStartupScript --
................................................................................
Tcl_Obj *
Tcl_GetStartupScript(
    const char **encodingPtr)	/* When not NULL, points to storage for the
				 * (const char *) that points to the
				 * registered encoding name for the startup
				 * script */
{
    StartupScript *scriptPtr = Tcl_GetThreadData(&startupScriptKey,
	    (int) sizeof(StartupScript));

    if (encodingPtr != NULL) {
	if (scriptPtr->encoding == NULL) {
	    *encodingPtr = NULL;
	} else {
	    *encodingPtr = Tcl_GetString(scriptPtr->encoding);
	}
    }




































































































    return scriptPtr->path;


}
 
/*----------------------------------------------------------------------
 *
 * Tcl_SourceRCFile --
 *
 *	This function is typically invoked by Tcl_Main of Tk_Main function to

Changes to generic/tclStubInit.c.

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
...
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
 *	This file contains the initializers for the Tcl stub vectors.
 *
 * Copyright (c) 1998-1999 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: tclStubInit.c,v 1.173 2008/12/11 14:17:23 dkf Exp $
 */

#include "tclInt.h"
#include "tommath.h"

/*
 * Remove macros that will interfere with the definitions below.
................................................................................
    TclRegExpRangeUniChar, /* 151 */
    TclSetLibraryPath, /* 152 */
    TclGetLibraryPath, /* 153 */
    NULL, /* 154 */
    NULL, /* 155 */
    TclRegError, /* 156 */
    TclVarTraceExists, /* 157 */
    TclSetStartupScriptFileName, /* 158 */
    TclGetStartupScriptFileName, /* 159 */
    NULL, /* 160 */
    TclChannelTransform, /* 161 */
    TclChannelEventScriptInvoker, /* 162 */
    TclGetInstructionTable, /* 163 */
    TclExpandCodeArray, /* 164 */
    TclpSetInitialEncodings, /* 165 */
    TclListObjSetElement, /* 166 */
    TclSetStartupScriptPath, /* 167 */
    TclGetStartupScriptPath, /* 168 */
    TclpUtfNcmp2, /* 169 */
    TclCheckInterpTraces, /* 170 */
    TclCheckExecutionTraces, /* 171 */
    TclInThreadExit, /* 172 */
    TclUniCharMatch, /* 173 */
    NULL, /* 174 */
    TclCallVarTraces, /* 175 */
    TclCleanupVar, /* 176 */
    TclVarErrMsg, /* 177 */
    Tcl_SetStartupScript, /* 178 */
    Tcl_GetStartupScript, /* 179 */
    NULL, /* 180 */
    NULL, /* 181 */
    TclpLocaltime, /* 182 */
    TclpGmtime, /* 183 */
    NULL, /* 184 */
    NULL, /* 185 */
    NULL, /* 186 */






|







 







|
|







|
|









|
|







4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
...
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
 *	This file contains the initializers for the Tcl stub vectors.
 *
 * Copyright (c) 1998-1999 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: tclStubInit.c,v 1.174 2008/12/15 15:48:33 dgp Exp $
 */

#include "tclInt.h"
#include "tommath.h"

/*
 * Remove macros that will interfere with the definitions below.
................................................................................
    TclRegExpRangeUniChar, /* 151 */
    TclSetLibraryPath, /* 152 */
    TclGetLibraryPath, /* 153 */
    NULL, /* 154 */
    NULL, /* 155 */
    TclRegError, /* 156 */
    TclVarTraceExists, /* 157 */
    NULL, /* 158 */
    NULL, /* 159 */
    NULL, /* 160 */
    TclChannelTransform, /* 161 */
    TclChannelEventScriptInvoker, /* 162 */
    TclGetInstructionTable, /* 163 */
    TclExpandCodeArray, /* 164 */
    TclpSetInitialEncodings, /* 165 */
    TclListObjSetElement, /* 166 */
    NULL, /* 167 */
    NULL, /* 168 */
    TclpUtfNcmp2, /* 169 */
    TclCheckInterpTraces, /* 170 */
    TclCheckExecutionTraces, /* 171 */
    TclInThreadExit, /* 172 */
    TclUniCharMatch, /* 173 */
    NULL, /* 174 */
    TclCallVarTraces, /* 175 */
    TclCleanupVar, /* 176 */
    TclVarErrMsg, /* 177 */
    NULL, /* 178 */
    NULL, /* 179 */
    NULL, /* 180 */
    NULL, /* 181 */
    TclpLocaltime, /* 182 */
    TclpGmtime, /* 183 */
    NULL, /* 184 */
    NULL, /* 185 */
    NULL, /* 186 */