Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Comment: | More complete purge of things only present for supporting long-dead Mac 9 systems. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | core-8-4-branch |
Files: | files | file ages | folders |
SHA1: |
7506775d5276e239209325afd088755e |
User & Date: | dgp 2012-11-15 17:55:25 |
2012-11-16
| ||
10:16 | Fix msgcat.test (in case a higher msgcat version is encountered, which is not included with Tcl 8.4)... check-in: feb6e6bc81 user: jan.nijtmans tags: core-8-4-branch | |
2012-11-15
| ||
17:55 | More complete purge of things only present for supporting long-dead Mac 9 systems. check-in: 7506775d52 user: dgp tags: core-8-4-branch | |
15:00 | Fix bug in genStubs.tcl: If the macosx section doesn't contain any macosx-specific entries, no secti... check-in: 3c4decb155 user: jan.nijtmans tags: core-8-4-branch | |
Changes to compat/string.h.
︙ | ︙ | |||
18 19 20 21 22 23 24 | /* * The following #include is needed to define size_t. (This used to * include sys/stdtypes.h but that doesn't exist on older versions * of SunOS, e.g. 4.0.2, so I'm trying sys/types.h now.... hopefully * it exists everywhere) */ | < < | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | /* * The following #include is needed to define size_t. (This used to * include sys/stdtypes.h but that doesn't exist on older versions * of SunOS, e.g. 4.0.2, so I'm trying sys/types.h now.... hopefully * it exists everywhere) */ #include <sys/types.h> #ifdef __APPLE__ extern VOID * memchr _ANSI_ARGS_((CONST VOID *s, int c, size_t n)); #else extern char * memchr _ANSI_ARGS_((CONST VOID *s, int c, size_t n)); #endif extern int memcmp _ANSI_ARGS_((CONST VOID *s1, CONST VOID *s2, |
︙ | ︙ |
Changes to doc/Init.3.
︙ | ︙ | |||
18 19 20 21 22 23 24 | Interpreter to initialize. .BE .SH DESCRIPTION .PP \fBTcl_Init\fR is a helper procedure that finds and \fBsource\fR's the \fBinit.tcl\fR script, which should exist somewhere on the Tcl library | | < < | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | Interpreter to initialize. .BE .SH DESCRIPTION .PP \fBTcl_Init\fR is a helper procedure that finds and \fBsource\fR's the \fBinit.tcl\fR script, which should exist somewhere on the Tcl library path. .PP \fBTcl_Init\fR is typically called from \fBTcl_AppInit\fR procedures. .SH "SEE ALSO" Tcl_AppInit, Tcl_Main .SH KEYWORDS |
︙ | ︙ |
Deleted doc/Macintosh.3.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to doc/OpenFileChnl.3.
︙ | ︙ | |||
669 670 671 672 673 674 675 | The handles returned from \fBTcl_GetChannelHandle\fR depend on the platform and the channel type. On Unix platforms, the handle is always a Unix file descriptor as returned from the \fBopen\fR system call. On Windows platforms, the handle is a file \fBHANDLE\fR when the channel was created with \fBTcl_OpenFileChannel\fR, \fBTcl_OpenCommandChannel\fR, or \fBTcl_MakeFileChannel\fR. Other channel types may return a different type of handle on Windows | | < | 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 | The handles returned from \fBTcl_GetChannelHandle\fR depend on the platform and the channel type. On Unix platforms, the handle is always a Unix file descriptor as returned from the \fBopen\fR system call. On Windows platforms, the handle is a file \fBHANDLE\fR when the channel was created with \fBTcl_OpenFileChannel\fR, \fBTcl_OpenCommandChannel\fR, or \fBTcl_MakeFileChannel\fR. Other channel types may return a different type of handle on Windows platforms. .SH "SEE ALSO" DString(3), fconfigure(n), filename(n), fopen(3), Tcl_CreateChannel(3) .SH KEYWORDS access point, blocking, buffered I/O, channel, channel driver, end of file, flush, input, nonblocking, output, read, seek, write |
Changes to doc/OpenTcp.3.
︙ | ︙ | |||
163 164 165 166 167 168 169 | replacement for the standard channel. .VS .SH "PLATFORM ISSUES" .PP On Unix platforms, the socket handle is a Unix file descriptor as returned by the \fBsocket\fR system call. On the Windows platform, the | | < | 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | replacement for the standard channel. .VS .SH "PLATFORM ISSUES" .PP On Unix platforms, the socket handle is a Unix file descriptor as returned by the \fBsocket\fR system call. On the Windows platform, the socket handle is a \fBSOCKET\fR as defined in the WinSock API. .VE .SH "SEE ALSO" Tcl_OpenFileChannel(3), Tcl_RegisterChannel(3), vwait(n) .SH KEYWORDS client, server, TCP |
Changes to doc/SourceRCFile.3.
︙ | ︙ | |||
22 23 24 25 26 27 28 | .PP \fBTcl_SourceRCFile\fR is used to source the Tcl rc file at startup. It is typically invoked by Tcl_Main or Tk_Main. The name of the file sourced is obtained from the global variable \fBtcl_rcFileName\fR in the interpreter given by \fIinterp\fR. If this variable is not defined, or if the file it indicates cannot be found, no action is taken. | < < < < | 22 23 24 25 26 27 28 29 30 31 | .PP \fBTcl_SourceRCFile\fR is used to source the Tcl rc file at startup. It is typically invoked by Tcl_Main or Tk_Main. The name of the file sourced is obtained from the global variable \fBtcl_rcFileName\fR in the interpreter given by \fIinterp\fR. If this variable is not defined, or if the file it indicates cannot be found, no action is taken. .SH KEYWORDS application-specific initialization, main program, rc file |
Changes to doc/exec.n.
︙ | ︙ | |||
311 312 313 314 315 316 317 | Certain applications, such as \fBcommand.com\fR, should not be executed interactively. Applications which directly access the console window, rather than reading from their standard input and writing to their standard output may fail, hang Tcl, or even hang the system if their own private console window is not available to them. .RE .TP | < < < | 311 312 313 314 315 316 317 318 319 320 321 322 323 324 | Certain applications, such as \fBcommand.com\fR, should not be executed interactively. Applications which directly access the console window, rather than reading from their standard input and writing to their standard output may fail, hang Tcl, or even hang the system if their own private console window is not available to them. .RE .TP \fBUnix\fR\0\0\0\0\0\0\0 The \fBexec\fR command is fully functional and works as described. .SH "UNIX EXAMPLES" Here are some examples of the use of the \fBexec\fR command on Unix. .PP To execute a simple program and get its result: |
︙ | ︙ |
Changes to doc/fconfigure.n.
︙ | ︙ | |||
147 148 149 150 151 152 153 | . As the input translation mode, \fBauto\fR treats any of newline (\fBlf\fP), carriage return (\fBcr\fP), or carriage return followed by a newline (\fBcrlf\fP) as the end of line representation. The end of line representation can even change from line-to-line, and all cases are translated to a newline. As the output translation mode, \fBauto\fR chooses a platform specific representation; for sockets on all platforms | | | | 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | . As the input translation mode, \fBauto\fR treats any of newline (\fBlf\fP), carriage return (\fBcr\fP), or carriage return followed by a newline (\fBcrlf\fP) as the end of line representation. The end of line representation can even change from line-to-line, and all cases are translated to a newline. As the output translation mode, \fBauto\fR chooses a platform specific representation; for sockets on all platforms Tcl chooses \fBcrlf\fR, for all Unix flavors, it chooses \fBlf\fR and for the various flavors of Windows it chooses \fBcrlf\fR. The default setting for \fB\-translation\fR is \fBauto\fR for both input and output. .TP \fBbinary\fR . No end-of-line translations are performed. This is nearly identical to \fBlf\fP mode, except that in addition \fBbinary\fP mode also sets the |
︙ | ︙ |
Changes to doc/file.n.
︙ | ︙ | |||
63 64 65 66 67 68 69 | or clears the hidden attribute of the file. \fB-longname\fR will expand each path element to its long version. This attribute cannot be set. \fB-readonly\fR gives the value or sets or clears the readonly attribute of the file. \fB-shortname\fR gives a string where every path element is replaced with its short (8.3) version of the name. This attribute cannot be set. \fB-system\fR gives or sets or clears the value of the system attribute of the file. | < < < < < < < | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | or clears the hidden attribute of the file. \fB-longname\fR will expand each path element to its long version. This attribute cannot be set. \fB-readonly\fR gives the value or sets or clears the readonly attribute of the file. \fB-shortname\fR gives a string where every path element is replaced with its short (8.3) version of the name. This attribute cannot be set. \fB-system\fR gives or sets or clears the value of the system attribute of the file. .RE .VS .TP \fBfile channels ?\fIpattern\fR? . If \fIpattern\fR isn't specified, returns a list of names of all registered open channels in this interpreter. If \fIpattern\fR is |
︙ | ︙ | |||
122 123 124 125 126 127 128 | A \fB\-\|\-\fR marks the end of switches; the argument following the \fB\-\|\-\fR will be treated as a \fIpathname\fR even if it starts with a \fB\-\fR. .TP \fBfile dirname \fIname\fR Returns a name comprised of all of the path components in \fIname\fR excluding the last element. If \fIname\fR is a relative file name and | | | | 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | A \fB\-\|\-\fR marks the end of switches; the argument following the \fB\-\|\-\fR will be treated as a \fIpathname\fR even if it starts with a \fB\-\fR. .TP \fBfile dirname \fIname\fR Returns a name comprised of all of the path components in \fIname\fR excluding the last element. If \fIname\fR is a relative file name and only contains one path element, then returns ``\fB.\fR''. If \fIname\fR refers to a root directory, then the root directory is returned. For example, .RS .CS \fBfile dirname c:/\fR .CE returns \fBc:/\fR. .PP |
︙ | ︙ | |||
182 183 184 185 186 187 188 | .CS \fBfile join a b /foo bar\fR .CE returns \fB/foo/bar\fR. .PP Note that any of the names can contain separators, and that the result is always canonical for the current platform: \fB/\fR for Unix and | | | 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | .CS \fBfile join a b /foo bar\fR .CE returns \fB/foo/bar\fR. .PP Note that any of the names can contain separators, and that the result is always canonical for the current platform: \fB/\fR for Unix and Windows. .RE .TP \fBfile link ?\fI-linktype\fR? \fIlinkName\fR ?\fItarget\fR? . If only one argument is given, that argument is assumed to be \fIlinkName\fR, and this command returns the value of the link given by \fIlinkName\fR (i.e. the name of the file it points to). If |
︙ | ︙ | |||
247 248 249 250 251 252 253 | 1, 1970). If the file doesn't exist or its modified time cannot be queried or set then an error is generated. .TP \fBfile nativename \fIname\fR . Returns the platform-specific name of the file. This is useful if the filename is needed to pass to a platform-specific call, such as exec | | | 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | 1, 1970). If the file doesn't exist or its modified time cannot be queried or set then an error is generated. .TP \fBfile nativename \fIname\fR . Returns the platform-specific name of the file. This is useful if the filename is needed to pass to a platform-specific call, such as exec under Windows. .TP \fBfile normalize \fIname\fR . .RS Returns a unique normalized path representation for the file-system object (file, directory, link, etc), whose string value can be used as a unique identifier for it. A normalized path is an absolute path which has |
︙ | ︙ | |||
394 395 396 397 398 399 400 | Returns a string giving the type of file \fIname\fR, which will be one of \fBfile\fR, \fBdirectory\fR, \fBcharacterSpecial\fR, \fBblockSpecial\fR, \fBfifo\fR, \fBlink\fR, or \fBsocket\fR. .TP \fBfile volumes\fR . Returns the absolute paths to the volumes mounted on the system, as a | | < < < | 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 | Returns a string giving the type of file \fIname\fR, which will be one of \fBfile\fR, \fBdirectory\fR, \fBcharacterSpecial\fR, \fBblockSpecial\fR, \fBfifo\fR, \fBlink\fR, or \fBsocket\fR. .TP \fBfile volumes\fR . Returns the absolute paths to the volumes mounted on the system, as a proper Tcl list. On UNIX, the command will always return "/", since all filesystems are locally mounted. On Windows, it will return a list of the available local drives (e.g. {a:/ c:/}). .TP \fBfile writable \fIname\fR . Returns \fB1\fR if file \fIname\fR is writable by the current user, |
︙ | ︙ |
Changes to doc/filename.n.
︙ | ︙ | |||
38 39 40 41 42 43 44 | type of a given path. .SH "PATH SYNTAX" .PP The rules for native names depend on the value reported in the Tcl array element \fBtcl_platform(platform)\fR: .TP 10 | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | type of a given path. .SH "PATH SYNTAX" .PP The rules for native names depend on the value reported in the Tcl array element \fBtcl_platform(platform)\fR: .TP 10 \fBunix\fR On Unix platforms, Tcl uses path names where the components are separated by slashes. Path names may be relative or absolute, and file names may contain any character other than slash. The file names \fB\&.\fR and \fB\&..\fR are special and refer to the current directory and the parent of the current directory respectively. Multiple adjacent slash characters are interpreted as a single separator. |
︙ | ︙ | |||
178 179 180 181 182 183 184 | is replaced with the location of the home directory for the given user. If the tilde is followed immediately by a separator, then the \fB$HOME\fR environment variable is substituted. Otherwise the characters between the tilde and the next separator are taken as a user name, which is used to retrieve the user's home directory for substitution. .PP | | | 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | is replaced with the location of the home directory for the given user. If the tilde is followed immediately by a separator, then the \fB$HOME\fR environment variable is substituted. Otherwise the characters between the tilde and the next separator are taken as a user name, which is used to retrieve the user's home directory for substitution. .PP The Windows platform does not support tilde substitution when a user name follows the tilde. On these platforms, attempts to use a tilde followed by a user name will generate an error that the user does not exist when Tcl attempts to interpret that part of the path or otherwise access the file. The behaviour of these paths when not trying to interpret them is the same as on Unix. File names that have a tilde without a user name will be correctly substituted using the \fB$HOME\fR environment variable, just like |
︙ | ︙ |
Changes to doc/glob.n.
︙ | ︙ | |||
79 80 81 82 83 84 85 | Note that symbolic links will be returned both if \fB\-types l\fR is given, or if the target of a link matches the requested type. So, a link to a directory will be returned if \fB\-types d\fR was specified. .RS .PP The second form specifies types where all the types given must match. These are \fIr\fR, \fIw\fR, \fIx\fR as file permissions, and | | < < < < < < | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | Note that symbolic links will be returned both if \fB\-types l\fR is given, or if the target of a link matches the requested type. So, a link to a directory will be returned if \fB\-types d\fR was specified. .RS .PP The second form specifies types where all the types given must match. These are \fIr\fR, \fIw\fR, \fIx\fR as file permissions, and \fIreadonly\fR, \fIhidden\fR as special permission cases. .PP The two forms may be mixed, so \fB\-types {d f r w}\fR will find all regular files OR directories that have both read AND write permissions. The following are equivalent: .RS .CS \fBglob \-type d *\fR |
︙ | ︙ | |||
180 181 182 183 184 185 186 | special care. The pattern \fIC:\e\efoo\e\e*\fR is interpreted as \fIC:\efoo\e*\fR where \fI\ef\fR will match the single character \fIf\fR and \fI\e*\fR will match the single character \fI*\fR and will not be interpreted as a wildcard character. One solution to this problem is to use the Unix style forward slash as a path separator. Windows style paths can be converted to Unix style paths with the command \fBfile join $path\fR (or \fBfile normalize $path\fR in Tcl 8.4). | < < < < < < < | 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | special care. The pattern \fIC:\e\efoo\e\e*\fR is interpreted as \fIC:\efoo\e*\fR where \fI\ef\fR will match the single character \fIf\fR and \fI\e*\fR will match the single character \fI*\fR and will not be interpreted as a wildcard character. One solution to this problem is to use the Unix style forward slash as a path separator. Windows style paths can be converted to Unix style paths with the command \fBfile join $path\fR (or \fBfile normalize $path\fR in Tcl 8.4). .SH EXAMPLES Find all the Tcl files in the current directory: .CS \fBglob\fR *.tcl .CE .PP Find all the Tcl files in the user's home directory, irrespective of |
︙ | ︙ |
Changes to doc/open.n.
︙ | ︙ | |||
374 375 376 377 378 379 380 | for reading from a 16-bit DOS application, the call to \fBopen\fR will not return until end-of-file has been received from the command pipeline's standard output. If a command pipeline is opened for writing to a 16-bit DOS application, no data will be sent to the command pipeline's standard output until the pipe is actually closed. This problem occurs because 16-bit DOS applications are run synchronously, as described above. .TP | < < < < < < | 374 375 376 377 378 379 380 381 382 383 384 385 386 387 | for reading from a 16-bit DOS application, the call to \fBopen\fR will not return until end-of-file has been received from the command pipeline's standard output. If a command pipeline is opened for writing to a 16-bit DOS application, no data will be sent to the command pipeline's standard output until the pipe is actually closed. This problem occurs because 16-bit DOS applications are run synchronously, as described above. .TP \fBUnix\fR\0\0\0\0\0\0\0 Valid values for \fIfileName\fR to open a serial port are generally of the form \fB/dev/tty\fIX\fR, where \fIX\fR is \fBa\fR or \fBb\fR, but the name of any pseudo-file that maps to a serial port may be used. .VS 8.4 Advanced configuration options are only supported for serial ports when Tcl is built to use the POSIX serial interface. |
︙ | ︙ |
Changes to doc/puts.n.
︙ | ︙ | |||
33 34 35 36 37 38 39 | \fIstring\fR, but this feature may be suppressed by specifying the \fB\-nonewline\fR switch. .PP Newline characters in the output are translated by \fBputs\fR to platform-specific end-of-line sequences according to the current value of the \fB\-translation\fR option for the channel (for example, on PCs newlines are normally replaced with carriage-return-linefeed | | < | 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | \fIstring\fR, but this feature may be suppressed by specifying the \fB\-nonewline\fR switch. .PP Newline characters in the output are translated by \fBputs\fR to platform-specific end-of-line sequences according to the current value of the \fB\-translation\fR option for the channel (for example, on PCs newlines are normally replaced with carriage-return-linefeed sequences). See the \fBfconfigure\fR manual entry for a discussion on ways in which \fBfconfigure\fR will alter output. .PP Tcl buffers output internally, so characters written with \fBputs\fR may not appear immediately on the output file or device; Tcl will normally delay output until the buffer is full or the channel is closed. |
︙ | ︙ |
Deleted doc/resource.n.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to doc/source.n.
︙ | ︙ | |||
36 37 38 39 40 41 42 | The source command will read files up to this character. This restriction does not exist for the \fBread\fR or \fBgets\fR commands, allowing for files containing code and data segments (scripted documents). If you require a ``^Z'' in code for string comparison, you can use ``\\032'' or ``\\u001a'', which will be safely substituted by the Tcl interpreter into ``^Z''. .VE 8.4 | < < < < < < < < | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | The source command will read files up to this character. This restriction does not exist for the \fBread\fR or \fBgets\fR commands, allowing for files containing code and data segments (scripted documents). If you require a ``^Z'' in code for string comparison, you can use ``\\032'' or ``\\u001a'', which will be safely substituted by the Tcl interpreter into ``^Z''. .VE 8.4 .SH EXAMPLE Run the script in the file \fBfoo.tcl\fR and then the script in the file \fBbar.tcl\fR: .CS \fBsource\fR foo.tcl \fBsource\fR bar.tcl .CE |
︙ | ︙ |
Changes to doc/tclvars.n.
︙ | ︙ | |||
41 42 43 44 45 46 47 | PATH variable could be exported by the operating system as ``path'', ``Path'', ``PaTh'', etc., causing otherwise simple Tcl code to have to support many special cases. All other environment variables inherited by Tcl are left unmodified. Setting an env array variable to blank is the same as unsetting it as this is the behavior of the underlying Windows OS. It should be noted that relying on an existing and empty environment variable won't work on windows and is discouraged for cross-platform usage. | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | PATH variable could be exported by the operating system as ``path'', ``Path'', ``PaTh'', etc., causing otherwise simple Tcl code to have to support many special cases. All other environment variables inherited by Tcl are left unmodified. Setting an env array variable to blank is the same as unsetting it as this is the behavior of the underlying Windows OS. It should be noted that relying on an existing and empty environment variable won't work on windows and is discouraged for cross-platform usage. .RE .TP \fBerrorCode\fR After an error has occurred, this variable will be set to hold a list value representing additional information about the error in a form that is easy to process with programs. The first element of the list identifies a general class of |
︙ | ︙ | |||
275 276 277 278 279 280 281 | \fBosVersion\fR The version number for the operating system running on this machine. On UNIX machines, this is the value returned by \fBuname -r\fR. On Windows 95, the version will be 4.0; on Windows 98, the version will be 4.10. .TP \fBplatform\fR | | | | 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 | \fBosVersion\fR The version number for the operating system running on this machine. On UNIX machines, this is the value returned by \fBuname -r\fR. On Windows 95, the version will be 4.0; on Windows 98, the version will be 4.10. .TP \fBplatform\fR Either \fBwindows\fR or \fBunix\fR. This identifies the general operating environment of the machine. .TP \fBthreaded\fR If this variable exists, then the interpreter was compiled with threads enabled. .TP \fBuser\fR This identifies the current user based on the login information available on the platform. This comes from the USER or LOGNAME environment variable on Unix, and the value from GetUserName on Windows. .TP \fBwordSize\fR .VS 8.4 This gives the size of the native-machine word in bytes (strictly, it is same as the result of evaluating \fIsizeof(long)\fR in C.) .VE 8.4 .RE |
︙ | ︙ | |||
322 323 324 325 326 327 328 | This variable is used during initialization to indicate the name of a user-specific startup file. If it is set by application-specific initialization, then the Tcl startup code will check for the existence of this file and \fBsource\fR it if it exists. For example, for \fBwish\fR the variable is set to \fB~/.wishrc\fR for Unix and \fB~/wishrc.tcl\fR for Windows. .TP | < < < < < < < < < | 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | This variable is used during initialization to indicate the name of a user-specific startup file. If it is set by application-specific initialization, then the Tcl startup code will check for the existence of this file and \fBsource\fR it if it exists. For example, for \fBwish\fR the variable is set to \fB~/.wishrc\fR for Unix and \fB~/wishrc.tcl\fR for Windows. .TP \fBtcl_traceCompile\fR The value of this variable can be set to control how much tracing information is displayed during bytecode compilation. By default, tcl_traceCompile is zero and no information is displayed. Setting tcl_traceCompile to 1 generates a one-line summary in stdout whenever a procedure or top-level command is compiled. |
︙ | ︙ |
Changes to generic/README.
1 | This directory contains Tcl source files that work on all the platforms | | | | 1 2 3 | This directory contains Tcl source files that work on all the platforms where Tcl runs (e.g. UNIX, PCs). Platform-specific sources are in the directories ../unix, ../win, and ../macosx. |
Changes to generic/tcl.h.
︙ | ︙ | |||
84 85 86 87 88 89 90 | */ #ifdef __WIN32__ # ifndef STRICT # define STRICT # endif #endif /* __WIN32__ */ | < < < < < < < < < < < < < < < < < | | < | 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 | */ #ifdef __WIN32__ # ifndef STRICT # define STRICT # endif #endif /* __WIN32__ */ /* * Utility macros: STRINGIFY takes an argument and wraps it in "" (double * quotation marks), JOIN joins two arguments. */ #ifndef STRINGIFY # define STRINGIFY(x) STRINGIFY1(x) # define STRINGIFY1(x) #x #endif #ifndef JOIN # define JOIN(a,b) JOIN1(a,b) # define JOIN1(a,b) a##b #endif /* * A special definition used to allow this header file to be included * from windows resource files so that they can obtain version * information. RC_INVOKED is defined by default by the windows RC tool. * * Resource compilers don't like all the C stuff, like typedefs and * procedure declarations, that occur below, so block them out. */ #ifndef RC_INVOKED |
︙ | ︙ | |||
534 535 536 537 538 539 540 | /* * Definition of the interface to procedures implementing threads. * A procedure following this definition is given to each call of * 'Tcl_CreateThread' and will be called as the main fuction of * the new thread created by that call. */ | < < | < < < | | 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 | /* * Definition of the interface to procedures implementing threads. * A procedure following this definition is given to each call of * 'Tcl_CreateThread' and will be called as the main fuction of * the new thread created by that call. */ #if defined __WIN32__ typedef unsigned (__stdcall Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData)); #else typedef void (Tcl_ThreadCreateProc) _ANSI_ARGS_((ClientData clientData)); #endif /* * Threading function return types used for abstracting away platform * differences when writing a Tcl_ThreadCreateProc. See the NewThread * function in generic/tclThreadTest.c for it's usage. */ #ifdef __WIN32__ # define Tcl_ThreadCreateType unsigned __stdcall # define TCL_THREAD_CREATE_RETURN return 0 #else # define Tcl_ThreadCreateType void # define TCL_THREAD_CREATE_RETURN #endif |
︙ | ︙ | |||
1429 1430 1431 1432 1433 1434 1435 | #define TCL_SERVICE_NONE 0 #define TCL_SERVICE_ALL 1 /* * The following structure keeps is used to hold a time value, either as * an absolute time (the number of seconds from the epoch) or as an * elapsed time. On Unix systems the epoch is Midnight Jan 1, 1970 GMT. | < | 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 | #define TCL_SERVICE_NONE 0 #define TCL_SERVICE_ALL 1 /* * The following structure keeps is used to hold a time value, either as * an absolute time (the number of seconds from the epoch) or as an * elapsed time. On Unix systems the epoch is Midnight Jan 1, 1970 GMT. */ typedef struct Tcl_Time { long sec; /* Seconds. */ long usec; /* Microseconds. */ } Tcl_Time; |
︙ | ︙ | |||
2362 2363 2364 2365 2366 2367 2368 | #include "tclDecls.h" /* * Include platform specific public function declarations that are * accessible via the stubs table. */ | < < < < < < < < < < < < < | 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 | #include "tclDecls.h" /* * Include platform specific public function declarations that are * accessible via the stubs table. */ #include "tclPlatDecls.h" /* * Public functions that are not accessible via the stubs table. */ EXTERN void Tcl_Main _ANSI_ARGS_((int argc, char **argv, Tcl_AppInitProc *appInitProc)); |
︙ | ︙ |
Changes to generic/tclAlloc.c.
︙ | ︙ | |||
28 29 30 31 32 33 34 | #if USE_TCLALLOC /* * We should really make use of AC_CHECK_TYPE(caddr_t) * here, but it can wait until Tcl uses config.h properly. */ | | | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | #if USE_TCLALLOC /* * We should really make use of AC_CHECK_TYPE(caddr_t) * here, but it can wait until Tcl uses config.h properly. */ #if defined(_MSC_VER) || defined(__MINGW32__) || defined(__BORLANDC__) typedef unsigned long caddr_t; #endif /* * Alignment for allocated memory. */ |
︙ | ︙ |
Changes to generic/tclBasic.c.
︙ | ︙ | |||
238 239 240 241 242 243 244 | (CompileProc *) NULL, 1}, {"time", (Tcl_CmdProc *) NULL, Tcl_TimeObjCmd, (CompileProc *) NULL, 1}, {"update", (Tcl_CmdProc *) NULL, Tcl_UpdateObjCmd, (CompileProc *) NULL, 1}, {"vwait", (Tcl_CmdProc *) NULL, Tcl_VwaitObjCmd, (CompileProc *) NULL, 1}, | < < < < < < < < < < < < < < | 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | (CompileProc *) NULL, 1}, {"time", (Tcl_CmdProc *) NULL, Tcl_TimeObjCmd, (CompileProc *) NULL, 1}, {"update", (Tcl_CmdProc *) NULL, Tcl_UpdateObjCmd, (CompileProc *) NULL, 1}, {"vwait", (Tcl_CmdProc *) NULL, Tcl_VwaitObjCmd, (CompileProc *) NULL, 1}, {"exec", (Tcl_CmdProc *) NULL, Tcl_ExecObjCmd, (CompileProc *) NULL, 0}, {"source", (Tcl_CmdProc *) NULL, Tcl_SourceObjCmd, (CompileProc *) NULL, 0}, #endif /* TCL_GENERIC_ONLY */ {NULL, (Tcl_CmdProc *) NULL, (Tcl_ObjCmdProc *) NULL, (CompileProc *) NULL, 0} }; /* |
︙ | ︙ |
Changes to generic/tclCmdAH.c.
︙ | ︙ | |||
1164 1165 1166 1167 1168 1169 1170 | if (objc != 3) { goto only3Args; } value = 0; if (GetStatBuf(NULL, objv[2], Tcl_FSStat, &buf) == TCL_OK) { /* | | | | 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 | if (objc != 3) { goto only3Args; } value = 0; if (GetStatBuf(NULL, objv[2], Tcl_FSStat, &buf) == TCL_OK) { /* * For Windows there are no user ids * associated with a file, so we always return 1. */ #if defined(__WIN32__) || defined(__CYGWIN__) value = 1; #else value = (geteuid() == buf.st_uid); #endif } Tcl_SetBooleanObj(Tcl_GetObjResult(interp), value); return TCL_OK; |
︙ | ︙ | |||
1258 1259 1260 1261 1262 1263 1264 | switch (tclPlatform) { case TCL_PLATFORM_UNIX: separator = "/"; break; case TCL_PLATFORM_WINDOWS: separator = "\\"; break; | < < < | 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 | switch (tclPlatform) { case TCL_PLATFORM_UNIX: separator = "/"; break; case TCL_PLATFORM_WINDOWS: separator = "\\"; break; } Tcl_SetObjResult(interp, Tcl_NewStringObj(separator,1)); } else { Tcl_Obj *separatorObj = Tcl_FSPathSeparator(objv[2]); if (separatorObj != NULL) { Tcl_SetObjResult(interp, separatorObj); } else { |
︙ | ︙ |
Changes to generic/tclDate.c.
︙ | ︙ | |||
10 11 12 13 14 15 16 | * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclInt.h" #include "tclPort.h" | < < < < < | | | < | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclInt.h" #include "tclPort.h" #define EPOCH 1970 #define START_OF_TIME 1902 #define END_OF_TIME 2037 /* * The offset of tm_year of struct tm returned by localtime, gmtime, etc. * I don't know how universal this is; K&R II, the NetBSD manpages, and * ../compat/strftime.c all agree that tm_year is the year-1900. However, * some systems may have a different value. This #define should be the * same as in ../compat/strftime.c. |
︙ | ︙ |
Changes to generic/tclExecute.c.
︙ | ︙ | |||
12 13 14 15 16 17 18 | * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclInt.h" #include "tclCompile.h" #ifndef TCL_NO_MATH | | | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclInt.h" #include "tclCompile.h" #ifndef TCL_NO_MATH # include <math.h> #endif /* * The stuff below is a bit of a hack so that this file can be used * in environments that include no UNIX, i.e. no errno. Just define * errno here. */ |
︙ | ︙ |
Changes to generic/tclFileName.c.
︙ | ︙ | |||
12 13 14 15 16 17 18 | */ #include <sys/stat.h> #include "tclInt.h" #include "tclPort.h" #include "tclRegexp.h" | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 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 | */ #include <sys/stat.h> #include "tclInt.h" #include "tclPort.h" #include "tclRegexp.h" /* * The following variable is set in the TclPlatformInit call to one * of: TCL_PLATFORM_UNIX, or TCL_PLATFORM_WINDOWS. */ TclPlatformType tclPlatform = TCL_PLATFORM_UNIX; /* * Prototypes for local procedures defined in this file: */ static CONST char * DoTildeSubst _ANSI_ARGS_((Tcl_Interp *interp, CONST char *user, Tcl_DString *resultPtr)); static CONST char * ExtractWinRoot _ANSI_ARGS_((CONST char *path, Tcl_DString *resultPtr, int offset, Tcl_PathType *typePtr)); static int SkipToChar _ANSI_ARGS_((char **stringPtr, char *match)); static Tcl_Obj* SplitWinPath _ANSI_ARGS_((CONST char *path)); static Tcl_Obj* SplitUnixPath _ANSI_ARGS_((CONST char *path)); /* *---------------------------------------------------------------------- * * ExtractWinRoot -- * * Matches the root portion of a Windows path and appends it |
︙ | ︙ | |||
407 408 409 410 411 412 413 | *driveNameLengthPtr = (1 + path - origPath); } } else { type = TCL_PATH_RELATIVE; } break; } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 309 310 311 312 313 314 315 316 317 318 319 320 321 322 | *driveNameLengthPtr = (1 + path - origPath); } } else { type = TCL_PATH_RELATIVE; } break; } case TCL_PLATFORM_WINDOWS: { Tcl_DString ds; CONST char *rootEnd; Tcl_DStringInit(&ds); rootEnd = ExtractWinRoot(path, &ds, 0, &type); |
︙ | ︙ | |||
555 556 557 558 559 560 561 | resultPtr = SplitUnixPath(Tcl_GetString(pathPtr)); break; case TCL_PLATFORM_WINDOWS: resultPtr = SplitWinPath(Tcl_GetString(pathPtr)); break; | < < < | 376 377 378 379 380 381 382 383 384 385 386 387 388 389 | resultPtr = SplitUnixPath(Tcl_GetString(pathPtr)); break; case TCL_PLATFORM_WINDOWS: resultPtr = SplitWinPath(Tcl_GetString(pathPtr)); break; } /* * Compute the number of elements in the result. */ if (lenPtr != NULL) { |
︙ | ︙ | |||
815 816 817 818 819 820 821 | } Tcl_ListObjAppendElement(NULL, result, nextElt); } } while (*p++ != '\0'); return result; } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 633 634 635 636 637 638 639 640 641 642 643 644 645 646 | } Tcl_ListObjAppendElement(NULL, result, nextElt); } } while (*p++ != '\0'); return result; } /* *--------------------------------------------------------------------------- * * Tcl_FSJoinToPath -- * * This function takes the given object, which should usually be a |
︙ | ︙ | |||
1218 1219 1220 1221 1222 1223 1224 | needsSep = 1; } } length = dest - Tcl_GetString(prefix); Tcl_SetObjLength(prefix, length); break; | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 796 797 798 799 800 801 802 803 804 805 806 807 808 809 | needsSep = 1; } } length = dest - Tcl_GetString(prefix); Tcl_SetObjLength(prefix, length); break; } return; } /* *---------------------------------------------------------------------- * |
︙ | ︙ | |||
1453 1454 1455 1456 1457 1458 1459 | * First find the last directory separator. */ lastSep = NULL; /* Needed only to prevent gcc warnings. */ switch (tclPlatform) { case TCL_PLATFORM_UNIX: lastSep = strrchr(name, '/'); | < < < < < < < < < < < < | 952 953 954 955 956 957 958 959 960 961 962 963 964 965 | * First find the last directory separator. */ lastSep = NULL; /* Needed only to prevent gcc warnings. */ switch (tclPlatform) { case TCL_PLATFORM_UNIX: lastSep = strrchr(name, '/'); break; case TCL_PLATFORM_WINDOWS: lastSep = NULL; for (p = name; *p != '\0'; p++) { if (strchr("/\\:", *p) != NULL) { lastSep = p; |
︙ | ︙ | |||
1695 1696 1697 1698 1699 1700 1701 | switch (tclPlatform) { case TCL_PLATFORM_UNIX: separators = "/"; break; case TCL_PLATFORM_WINDOWS: separators = "/\\:"; break; | < < < | 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 | switch (tclPlatform) { case TCL_PLATFORM_UNIX: separators = "/"; break; case TCL_PLATFORM_WINDOWS: separators = "/\\:"; break; } if (dir == PATH_GENERAL) { int pathlength; char *last; char *first = Tcl_GetStringFromObj(pathOrDir,&pathlength); /* |
︙ | ︙ | |||
2035 2036 2037 2038 2039 2040 2041 | separators = NULL; /* lint. */ switch (tclPlatform) { case TCL_PLATFORM_UNIX: separators = "/"; break; case TCL_PLATFORM_WINDOWS: separators = "/\\:"; | < < < < < < < < < < < | 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 | separators = NULL; /* lint. */ switch (tclPlatform) { case TCL_PLATFORM_UNIX: separators = "/"; break; case TCL_PLATFORM_WINDOWS: separators = "/\\:"; break; } Tcl_DStringInit(&buffer); if (unquotedPrefix != NULL) { start = Tcl_GetString(unquotedPrefix); } else { |
︙ | ︙ | |||
2179 2180 2181 2182 2183 2184 2185 | Tcl_DecrRefCount(oldResult); oldResult = Tcl_DuplicateObj(oldResult); Tcl_IncrRefCount(oldResult); } Tcl_ListObjGetElements(NULL, Tcl_GetObjResult(interp), &objc, &objv); | < < < < < < < < < < | 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 | Tcl_DecrRefCount(oldResult); oldResult = Tcl_DuplicateObj(oldResult); Tcl_IncrRefCount(oldResult); } Tcl_ListObjGetElements(NULL, Tcl_GetObjResult(interp), &objc, &objv); for (i = 0; i< objc; i++) { Tcl_Obj* elt; if (globFlags & TCL_GLOBMODE_TAILS) { int len; char *oldStr = Tcl_GetStringFromObj(objv[i],&len); if (len == prefixLen) { if ((pattern[0] == '\0') |
︙ | ︙ | |||
2349 2350 2351 2352 2353 2354 2355 | tail++; } else { break; } } else if (strchr(separators, *tail) == NULL) { break; } | < < < < < < < < < < < < < < < < < < < < < < < < < < < | 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 | tail++; } else { break; } } else if (strchr(separators, *tail) == NULL) { break; } if (*tail == '\\') { Tcl_DStringAppend(headPtr, separators, 1); } else { Tcl_DStringAppend(headPtr, tail, 1); } count++; } /* * Deal with path separators. On the Mac, we have to watch out * for multiple separators, since they are special in Mac-style * paths. */ switch (tclPlatform) { case TCL_PLATFORM_WINDOWS: /* * If this is a drive relative path, add the colon and the * trailing slash if needed. Otherwise add the slash if * this is the first absolute element, or a later relative * element. Add an extra slash if this is a UNC path. |
︙ | ︙ | |||
2571 2572 2573 2574 2575 2576 2577 | if (Tcl_GetString(elt)[0] == '~') { Tcl_Obj *paths = Tcl_GetObjResult(interp); Tcl_ListObjLength(NULL, paths, &repair); Tcl_DStringAppend(&ds, "./", 2); } Tcl_DStringAppend(&ds, Tcl_GetString(elt), -1); | < < < < | 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 | if (Tcl_GetString(elt)[0] == '~') { Tcl_Obj *paths = Tcl_GetObjResult(interp); Tcl_ListObjLength(NULL, paths, &repair); Tcl_DStringAppend(&ds, "./", 2); } Tcl_DStringAppend(&ds, Tcl_GetString(elt), -1); Tcl_DStringAppend(&ds, "/",1); ret = TclDoGlob(interp, separators, &ds, p+1, types); Tcl_DStringFree(&ds); if (ret != TCL_OK) { break; } if (repair >= 0) { Tcl_Obj *paths = Tcl_GetObjResult(interp); |
︙ | ︙ | |||
2626 2627 2628 2629 2630 2631 2632 | * no such flag was given, we could just use 'Tcl_FSLStat', but * for simplicity we keep to a common approach). */ Tcl_Obj *nameObj; switch (tclPlatform) { | < < < < < < | 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 | * no such flag was given, we could just use 'Tcl_FSLStat', but * for simplicity we keep to a common approach). */ Tcl_Obj *nameObj; switch (tclPlatform) { case TCL_PLATFORM_WINDOWS: { if (Tcl_DStringLength(headPtr) == 0) { if (((*name == '\\') && (name[1] == '/' || name[1] == '\\')) || (*name == '/')) { Tcl_DStringAppend(headPtr, "/", 1); } else { Tcl_DStringAppend(headPtr, ".", 1); |
︙ | ︙ | |||
2733 2734 2735 2736 2737 2738 2739 | * return the current directory. */ if (splitElements > 1) { splitResultPtr = Tcl_FSJoinPath(splitPtr, splitElements - 1); } else if (splitElements == 0 || (Tcl_FSGetPathType(pathPtr) == TCL_PATH_RELATIVE)) { | | < | 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 | * return the current directory. */ if (splitElements > 1) { splitResultPtr = Tcl_FSJoinPath(splitPtr, splitElements - 1); } else if (splitElements == 0 || (Tcl_FSGetPathType(pathPtr) == TCL_PATH_RELATIVE)) { splitResultPtr = Tcl_NewStringObj(".", 1); } else { Tcl_ListObjIndex(NULL, splitPtr, 0, &splitResultPtr); } Tcl_IncrRefCount(splitResultPtr); Tcl_DecrRefCount(splitPtr); return splitResultPtr; } |
︙ | ︙ |
Changes to generic/tclGet.c.
︙ | ︙ | |||
10 11 12 13 14 15 16 | * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclInt.h" #include "tclPort.h" | | | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclInt.h" #include "tclPort.h" #include <math.h> /* *---------------------------------------------------------------------- * * Tcl_GetInt -- * |
︙ | ︙ |
Changes to generic/tclGetDate.y.
︙ | ︙ | |||
27 28 29 30 31 32 33 | * * SCCSID */ #include "tclInt.h" #include "tclPort.h" | < < < < < | | | < | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | * * SCCSID */ #include "tclInt.h" #include "tclPort.h" #define EPOCH 1970 #define START_OF_TIME 1902 #define END_OF_TIME 2037 /* * The offset of tm_year of struct tm returned by localtime, gmtime, etc. * I don't know how universal this is; K&R II, the NetBSD manpages, and * ../compat/strftime.c all agree that tm_year is the year-1900. However, * some systems may have a different value. This #define should be the * same as in ../compat/strftime.c. |
︙ | ︙ |
Changes to generic/tclIOCmd.c.
︙ | ︙ | |||
702 703 704 705 706 707 708 | int Tcl_ExecObjCmd(dummy, interp, objc, objv) ClientData dummy; /* Not used. */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ Tcl_Obj *CONST objv[]; /* Argument objects. */ { | < < < < < < < < | 702 703 704 705 706 707 708 709 710 711 712 713 714 715 | int Tcl_ExecObjCmd(dummy, interp, objc, objv) ClientData dummy; /* Not used. */ Tcl_Interp *interp; /* Current interpreter. */ int objc; /* Number of arguments. */ Tcl_Obj *CONST objv[]; /* Argument objects. */ { /* * This procedure generates an argv array for the string arguments. It * starts out with stack-allocated space but uses dynamically-allocated * storage if needed. */ #define NUM_ARGS 20 |
︙ | ︙ | |||
850 851 852 853 854 855 856 | if ((length > 0) && (string[length - 1] == '\n')) { Tcl_SetObjLength(resultPtr, length - 1); } } Tcl_SetObjResult(interp, resultPtr); return result; | < | 842 843 844 845 846 847 848 849 850 851 852 853 854 855 | if ((length > 0) && (string[length - 1] == '\n')) { Tcl_SetObjLength(resultPtr, length - 1); } } Tcl_SetObjResult(interp, resultPtr); return result; } /* *--------------------------------------------------------------------------- * * Tcl_FblockedObjCmd -- * |
︙ | ︙ | |||
961 962 963 964 965 966 967 | /* * Open the file or create a process pipeline. */ if (!pipeline) { chan = Tcl_FSOpenFileChannel(interp, objv[1], modeString, prot); } else { | < < < < < < | 952 953 954 955 956 957 958 959 960 961 962 963 964 965 | /* * Open the file or create a process pipeline. */ if (!pipeline) { chan = Tcl_FSOpenFileChannel(interp, objv[1], modeString, prot); } else { int mode, seekFlag, cmdObjc; CONST char **cmdArgv; if (Tcl_SplitList(interp, what+1, &cmdObjc, &cmdArgv) != TCL_OK) { return TCL_ERROR; } |
︙ | ︙ | |||
996 997 998 999 1000 1001 1002 | default: panic("Tcl_OpenCmd: invalid mode value"); break; } chan = Tcl_OpenCommandChannel(interp, cmdObjc, cmdArgv, flags); } ckfree((char *) cmdArgv); | < | 981 982 983 984 985 986 987 988 989 990 991 992 993 994 | default: panic("Tcl_OpenCmd: invalid mode value"); break; } chan = Tcl_OpenCommandChannel(interp, cmdObjc, cmdArgv, flags); } ckfree((char *) cmdArgv); } if (chan == (Tcl_Channel) NULL) { return TCL_ERROR; } Tcl_RegisterChannel(interp, chan); Tcl_AppendResult(interp, Tcl_GetChannelName(chan), (char *) NULL); return TCL_OK; |
︙ | ︙ |
Changes to generic/tclIOUtil.c.
︙ | ︙ | |||
22 23 24 25 26 27 28 | /* See [Bug 3354324]: file mtime sets wrong time */ # define _USE_32BIT_TIME_T #endif #include <sys/stat.h> #include "tclInt.h" #include "tclPort.h" | < < < | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | /* See [Bug 3354324]: file mtime sets wrong time */ # define _USE_32BIT_TIME_T #endif #include <sys/stat.h> #include "tclInt.h" #include "tclPort.h" #ifdef __WIN32__ /* for tclWinProcs->useWide */ #include "tclWinInt.h" #endif /* * struct FilesystemRecord -- |
︙ | ︙ | |||
2903 2904 2905 2906 2907 2908 2909 | if (TclCrossFilesystemCopy(interp, pathPtr, copyToPtr) == TCL_OK) { Tcl_LoadHandle newLoadHandle = NULL; Tcl_FSUnloadFileProc *newUnloadProcPtr = NULL; FsDivertLoad *tvdlPtr; int retVal; | | | 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 | if (TclCrossFilesystemCopy(interp, pathPtr, copyToPtr) == TCL_OK) { Tcl_LoadHandle newLoadHandle = NULL; Tcl_FSUnloadFileProc *newUnloadProcPtr = NULL; FsDivertLoad *tvdlPtr; int retVal; #if !defined(__WIN32__) /* * Do we need to set appropriate permissions * on the file? This may be required on some * systems. On Unix we could loop over * the file attributes, and set any that are * called "-permissions" to 0700. However, * we just do this directly, like this: |
︙ | ︙ | |||
4288 4289 4290 4291 4292 4293 4294 | switch (tclPlatform) { case TCL_PLATFORM_UNIX: separator = "/"; break; case TCL_PLATFORM_WINDOWS: separator = "\\"; break; | < < < | 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 | switch (tclPlatform) { case TCL_PLATFORM_UNIX: separator = "/"; break; case TCL_PLATFORM_WINDOWS: separator = "\\"; break; } return Tcl_NewStringObj(separator,1); } /* Everything from here on is contained in this obsolete ifdef */ #ifdef USE_OBSOLETE_FS_HOOKS |
︙ | ︙ | |||
4908 4909 4910 4911 4912 4913 4914 | int len; str = Tcl_GetStringFromObj(tail,&len); if (tclPlatform == TCL_PLATFORM_WINDOWS) { if (strchr(str, '\\') == NULL) { Tcl_DecrRefCount(res); return tail; } | < < < < < | 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 | int len; str = Tcl_GetStringFromObj(tail,&len); if (tclPlatform == TCL_PLATFORM_WINDOWS) { if (strchr(str, '\\') == NULL) { Tcl_DecrRefCount(res); return tail; } } } } } strElt = Tcl_GetStringFromObj(elt, &strEltLen); type = GetPathType(elt, &fsPtr, &driveNameLength, &driveName); if (type != TCL_PATH_RELATIVE) { |
︙ | ︙ | |||
5062 5063 5064 5065 5066 5067 5068 | FindSplitPos(path, separator) char *path; char *separator; { int count = 0; switch (tclPlatform) { case TCL_PLATFORM_UNIX: | < | 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 | FindSplitPos(path, separator) char *path; char *separator; { int count = 0; switch (tclPlatform) { case TCL_PLATFORM_UNIX: while (path[count] != 0) { if (path[count] == *separator) { return count; } count++; } break; |
︙ | ︙ | |||
5117 5118 5119 5120 5121 5122 5123 | ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); CONST char *p; int state = 0, count = 0; objPtr = Tcl_NewObj(); fsPathPtr = (FsPath*)ckalloc((unsigned)sizeof(FsPath)); | < < < < < < < < < < < < | 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 | ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); CONST char *p; int state = 0, count = 0; objPtr = Tcl_NewObj(); fsPathPtr = (FsPath*)ckalloc((unsigned)sizeof(FsPath)); /* Setup the path */ fsPathPtr->translatedPathPtr = NULL; fsPathPtr->normPathPtr = Tcl_NewStringObj(addStrRep, len); Tcl_IncrRefCount(fsPathPtr->normPathPtr); fsPathPtr->cwdPtr = dirPtr; Tcl_IncrRefCount(dirPtr); fsPathPtr->nativePathPtr = NULL; |
︙ | ︙ | |||
5307 5308 5309 5310 5311 5312 5313 | } break; case TCL_PLATFORM_WINDOWS: if (tempStr[cwdLen-1] != '/' && tempStr[cwdLen-1] != '\\') { cwdLen++; } | < < < < < | 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 | } break; case TCL_PLATFORM_WINDOWS: if (tempStr[cwdLen-1] != '/' && tempStr[cwdLen-1] != '\\') { cwdLen++; } break; } tempStr = Tcl_GetStringFromObj(objPtr, &len); return Tcl_NewStringObj(tempStr + cwdLen, len - cwdLen); } |
︙ | ︙ | |||
5640 5641 5642 5643 5644 5645 5646 | break; case TCL_PLATFORM_WINDOWS: if (cwdStr[cwdLen-1] != '/' && cwdStr[cwdLen-1] != '\\') { Tcl_AppendToObj(copy, "/", 1); cwdLen++; } | < < < < < < | 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 | break; case TCL_PLATFORM_WINDOWS: if (cwdStr[cwdLen-1] != '/' && cwdStr[cwdLen-1] != '\\') { Tcl_AppendToObj(copy, "/", 1); cwdLen++; } break; } Tcl_AppendObjToObj(copy, fsPathPtr->normPathPtr); /* Normalize the combined string. */ if (PATHFLAGS(pathObjPtr) & TCLPATH_NEEDNORM) { |
︙ | ︙ | |||
5743 5744 5745 5746 5747 5748 5749 | break; case TCL_PLATFORM_WINDOWS: if (cwdStr[cwdLen-1] != '/' && cwdStr[cwdLen-1] != '\\') { Tcl_AppendToObj(copy, "/", 1); cwdLen++; } | < < < < < < | 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 | break; case TCL_PLATFORM_WINDOWS: if (cwdStr[cwdLen-1] != '/' && cwdStr[cwdLen-1] != '\\') { Tcl_AppendToObj(copy, "/", 1); cwdLen++; } break; } Tcl_AppendObjToObj(copy, pathObjPtr); /* * Normalize the combined string, but only starting after * the end of the previously normalized 'dir'. This should * be much faster! |
︙ | ︙ | |||
6180 6181 6182 6183 6184 6185 6186 | */ if (name[0] == '~') { char *expandedUser; Tcl_DString temp; int split; char separator='/'; | < < < < | 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 | */ if (name[0] == '~') { char *expandedUser; Tcl_DString temp; int split; char separator='/'; split = FindSplitPos(name, &separator); if (split != len) { /* We have multiple pieces '~user/foo/bar...' */ name[split] = '\0'; } /* Do some tilde substitution */ if (name[1] == '\0') { |
︙ | ︙ | |||
6448 6449 6450 6451 6452 6453 6454 | if (cwdStr[cwdLen-1] != '/' && cwdStr[cwdLen-1] != '\\') { if (cwdLen != 2 || cwdStr[1] != ':') { Tcl_AppendToObj(copy, "/", 1); cwdLen++; } } | < < < < < < | 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 | if (cwdStr[cwdLen-1] != '/' && cwdStr[cwdLen-1] != '\\') { if (cwdLen != 2 || cwdStr[1] != ':') { Tcl_AppendToObj(copy, "/", 1); cwdLen++; } } break; } Tcl_AppendObjToObj(copy, fsPathPtr->normPathPtr); objPtr->bytes = Tcl_GetStringFromObj(copy, &cwdLen); objPtr->length = cwdLen; copy->bytes = tclEmptyStringRep; copy->length = 0; |
︙ | ︙ |
Changes to generic/tclInt.h.
︙ | ︙ | |||
1690 1691 1692 1693 1694 1695 1696 | /* * The following enum values are used to specify the runtime platform * setting of the tclPlatform variable. */ typedef enum { TCL_PLATFORM_UNIX, /* Any Unix-like OS. */ | < | | 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 | /* * The following enum values are used to specify the runtime platform * setting of the tclPlatform variable. */ typedef enum { TCL_PLATFORM_UNIX, /* Any Unix-like OS. */ TCL_PLATFORM_WINDOWS=2 /* Any Microsoft Windows OS. */ } TclPlatformType; /* * The following enum values are used to indicate the translation * of a Tcl channel. Declared here so that each platform can define * TCL_PLATFORM_TRANSLATION to the native translation on that platform */ |
︙ | ︙ | |||
2289 2290 2291 2292 2293 2294 2295 | EXTERN int Tcl_VariableObjCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); EXTERN int Tcl_VwaitObjCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); EXTERN int Tcl_WhileObjCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); | < < < < < < < < < < < < < < < < < < < | 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 | EXTERN int Tcl_VariableObjCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); EXTERN int Tcl_VwaitObjCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); EXTERN int Tcl_WhileObjCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); /* *---------------------------------------------------------------- * Compilation procedures for commands in the generic core: *---------------------------------------------------------------- */ EXTERN int TclCompileAppendCmd _ANSI_ARGS_((Tcl_Interp *interp, |
︙ | ︙ |
Changes to generic/tclMain.c.
︙ | ︙ | |||
19 20 21 22 23 24 25 | /* * Declarations for various library procedures 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). */ | < < < < | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | /* * Declarations for various library procedures 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 int isatty _ANSI_ARGS_((int fd)); static Tcl_Obj *tclStartupScriptPath = NULL; static Tcl_MainLoopProc *mainLoopProc = NULL; /* * Structure definition for information used to keep the state of |
︙ | ︙ |
Changes to generic/tclMath.h.
︙ | ︙ | |||
12 13 14 15 16 17 18 | * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #ifndef _TCLMATH #define _TCLMATH | < < < | < | 12 13 14 15 16 17 18 19 20 21 | * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #ifndef _TCLMATH #define _TCLMATH #include <math.h> #endif /* _TCLMATH */ |
Changes to generic/tclNotify.c.
︙ | ︙ | |||
209 210 211 212 213 214 215 | *---------------------------------------------------------------------- */ void Tcl_SetNotifier(notifierProcPtr) Tcl_NotifierProcs *notifierProcPtr; { | | | 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | *---------------------------------------------------------------------- */ void Tcl_SetNotifier(notifierProcPtr) Tcl_NotifierProcs *notifierProcPtr; { #if !defined(__WIN32__) /* UNIX */ tclStubs.tcl_CreateFileHandler = notifierProcPtr->createFileHandlerProc; tclStubs.tcl_DeleteFileHandler = notifierProcPtr->deleteFileHandlerProc; #endif tclStubs.tcl_SetTimer = notifierProcPtr->setTimerProc; tclStubs.tcl_WaitForEvent = notifierProcPtr->waitForEventProc; tclStubs.tcl_InitNotifier = notifierProcPtr->initNotifierProc; tclStubs.tcl_FinalizeNotifier = notifierProcPtr->finalizeNotifierProc; |
︙ | ︙ |
Changes to generic/tclPort.h.
︙ | ︙ | |||
15 16 17 18 19 20 21 | #define _TCLPORT #include "tcl.h" #if defined(__WIN32__) # include "tclWinPort.h" #else | < < < | < | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | #define _TCLPORT #include "tcl.h" #if defined(__WIN32__) # include "tclWinPort.h" #else # include "tclUnixPort.h" #endif #if !defined(LLONG_MIN) # ifdef TCL_WIDE_INT_IS_LONG # define LLONG_MIN LONG_MIN # else # ifdef LLONG_BIT |
︙ | ︙ |
Changes to generic/tclStubInit.c.
︙ | ︙ | |||
40 41 42 43 44 45 46 | * portable comparisons to see whether a Tcl_SetNotifier() call swapped * new routines into the stub table. */ Tcl_NotifierProcs tclOriginalNotifier = { Tcl_SetTimer, Tcl_WaitForEvent, | | | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | * portable comparisons to see whether a Tcl_SetNotifier() call swapped * new routines into the stub table. */ Tcl_NotifierProcs tclOriginalNotifier = { Tcl_SetTimer, Tcl_WaitForEvent, #if !defined(__WIN32__) /* UNIX */ Tcl_CreateFileHandler, Tcl_DeleteFileHandler, #else NULL, NULL, #endif NULL, |
︙ | ︙ | |||
190 191 192 193 194 195 196 | #else /* UNIX and MAC */ # define TclpGetPid 0 # define TclpLocaltime_unix TclpLocaltime # define TclpGmtime_unix TclpGmtime #endif | < < < < < < < < < < | 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | #else /* UNIX and MAC */ # define TclpGetPid 0 # define TclpLocaltime_unix TclpLocaltime # define TclpGmtime_unix TclpGmtime #endif /* * WARNING: The contents of this file is automatically generated by the * tools/genStubs.tcl script. Any modifications to the function declarations * below should be made in the generic/tcl.decls script. */ /* !BEGIN!: Do not edit below this line. */ |
︙ | ︙ |
Changes to generic/tclTest.c.
︙ | ︙ | |||
3753 3754 3755 3756 3757 3758 3759 | " platform\"", (char *) NULL); return TCL_ERROR; } length = strlen(argv[1]); if (strncmp(argv[1], "unix", length) == 0) { *platform = TCL_PLATFORM_UNIX; | < < | 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 | " platform\"", (char *) NULL); return TCL_ERROR; } length = strlen(argv[1]); if (strncmp(argv[1], "unix", length) == 0) { *platform = TCL_PLATFORM_UNIX; } else if (strncmp(argv[1], "windows", length) == 0) { *platform = TCL_PLATFORM_WINDOWS; } else { Tcl_AppendResult(interp, "unsupported platform: should be one of ", "unix, mac, or windows", (char *) NULL); return TCL_ERROR; } |
︙ | ︙ | |||
4821 4822 4823 4824 4825 4826 4827 | buf->st_blocks = (blkcnt_t) realBuf.st_blocks; # endif } return ret; #endif /* TCL_WIDE_INT_IS_LONG */ } | < < < < < | 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 | buf->st_blocks = (blkcnt_t) realBuf.st_blocks; # endif } return ret; #endif /* TCL_WIDE_INT_IS_LONG */ } static int TestStatProc1(path, buf) CONST char *path; Tcl_StatBuf *buf; { memset(buf, 0, sizeof(Tcl_StatBuf)); buf->st_size = 1234; |
︙ | ︙ |
Changes to generic/tclThreadJoin.c.
︙ | ︙ | |||
10 11 12 13 14 15 16 | * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclInt.h" | | | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include "tclInt.h" #if defined(WIN32) /* The information about each joinable thread is remembered in a * structure as defined below. */ typedef struct JoinableThread { Tcl_ThreadId id; /* The id of the joinable thread */ |
︙ | ︙ | |||
302 303 304 305 306 307 308 | if (threadPtr->waitedUpon) { Tcl_ConditionNotify (&threadPtr->cond); } Tcl_MutexUnlock (&threadPtr->threadMutex); } | | | 302 303 304 305 306 307 308 309 | if (threadPtr->waitedUpon) { Tcl_ConditionNotify (&threadPtr->cond); } Tcl_MutexUnlock (&threadPtr->threadMutex); } #endif /* WIN32 */ |
Changes to library/init.tcl.
︙ | ︙ | |||
31 32 33 34 35 36 37 | # Also add the directory ../lib relative to the directory where the # executable is located. This is meant to find binary packages for the # same architecture as the current executable. # # tcl_pkgPath, which is set by the platform-specific initialization routines # On UNIX it is compiled in # On Windows, it is not used | < | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | # Also add the directory ../lib relative to the directory where the # executable is located. This is meant to find binary packages for the # same architecture as the current executable. # # tcl_pkgPath, which is set by the platform-specific initialization routines # On UNIX it is compiled in # On Windows, it is not used if {![info exists auto_path]} { if {[info exists env(TCLLIBPATH)]} { set auto_path $env(TCLLIBPATH) } else { set auto_path "" } |
︙ | ︙ | |||
113 114 115 116 117 118 119 | if {![interp issafe]} { # setup platform specific unknown package handlers if {$::tcl_platform(platform) eq "unix" && $::tcl_platform(os) eq "Darwin"} { package unknown [list tcl::MacOSXPkgUnknown [package unknown]] } | < < < < < < < | 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | if {![interp issafe]} { # setup platform specific unknown package handlers if {$::tcl_platform(platform) eq "unix" && $::tcl_platform(os) eq "Darwin"} { package unknown [list tcl::MacOSXPkgUnknown [package unknown]] } } # Conditionalize for presence of exec. if {[namespace which -command exec] eq ""} { set auto_noexec 1 } set errorCode "" set errorInfo "" # Define a log command (which can be overwitten to log errors # differently, specially when stderr is not available) |
︙ | ︙ |
Changes to library/package.tcl.
︙ | ︙ | |||
456 457 458 459 460 461 462 | } # tclPkgUnknown -- # This procedure provides the default for the "package unknown" function. # It is invoked when a package that's needed can't be found. It scans # the auto_path directories and their immediate children looking for # pkgIndex.tcl files and sources any such files that are found to setup | < | | 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 | } # tclPkgUnknown -- # This procedure provides the default for the "package unknown" function. # It is invoked when a package that's needed can't be found. It scans # the auto_path directories and their immediate children looking for # pkgIndex.tcl files and sources any such files that are found to setup # the package database. As it searches, it will recognize changes # to the auto_path and scan any new directories. # # Arguments: # name - Name of desired package. Not used. # version - Version of desired package. Not used. # exact - Either "-exact" or omitted. Not used. |
︙ | ︙ |
Changes to tests/all.tcl.
︙ | ︙ | |||
9 10 11 12 13 14 15 | # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. set tcltestVersion [package require tcltest] namespace import -force tcltest::* | < < < < | 9 10 11 12 13 14 15 16 17 18 19 | # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. set tcltestVersion [package require tcltest] namespace import -force tcltest::* tcltest::testsDirectory [file dir [info script]] tcltest::runAllTests return |
Changes to tests/binary.test.
︙ | ︙ | |||
508 509 510 511 512 513 514 | } \x3f\xf9\x99\x99\x99\x99\x99\x9a\x40\x0b\x33\x33\x33\x33\x33\x33 test binary-14.11 {Tcl_BinaryObjCmd: format} {nonPortable pcOnly} { binary format d2 {1.6 3.4 5.6} } \x9a\x99\x99\x99\x99\x99\xf9\x3f\x33\x33\x33\x33\x33\x33\x0b\x40 test binary-14.12 {Tcl_BinaryObjCmd: float overflow} {nonPortable unixOnly} { binary format d NaN } \x7f\xff\xff\xff\xff\xff\xff\xff | < < < | 508 509 510 511 512 513 514 515 516 517 518 519 520 521 | } \x3f\xf9\x99\x99\x99\x99\x99\x9a\x40\x0b\x33\x33\x33\x33\x33\x33 test binary-14.11 {Tcl_BinaryObjCmd: format} {nonPortable pcOnly} { binary format d2 {1.6 3.4 5.6} } \x9a\x99\x99\x99\x99\x99\xf9\x3f\x33\x33\x33\x33\x33\x33\x0b\x40 test binary-14.12 {Tcl_BinaryObjCmd: float overflow} {nonPortable unixOnly} { binary format d NaN } \x7f\xff\xff\xff\xff\xff\xff\xff test binary-14.14 {Tcl_BinaryObjCmd: format} { list [catch {binary format d2 {1.6}} msg] $msg } {1 {number of elements in list does not match count}} test binary-14.15 {Tcl_BinaryObjCmd: format} { set a {1.6 3.4} list [catch {binary format d $a} msg] $msg } [list 1 "expected floating-point number but got \"1.6 3.4\""] |
︙ | ︙ | |||
1399 1400 1401 1402 1403 1404 1405 | list [binary scan \x01\x01\x01\x02\x81\x01\x01\x01\x01\x82\x01\x01\x01\x01\x82\x01\x01\x01\x01\x81 I5 arg1] $arg1 } {1 {16843010 -2130640639 25297153 16876033 16843137}} test binary-40.1 {ScanNumber: floating point overflow} {nonPortable unixOnly} { catch {unset arg1} list [binary scan \xff\xff\xff\xff f1 arg1] $arg1 } {1 -NaN} | < < < < < < < < | 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 | list [binary scan \x01\x01\x01\x02\x81\x01\x01\x01\x01\x82\x01\x01\x01\x01\x82\x01\x01\x01\x01\x81 I5 arg1] $arg1 } {1 {16843010 -2130640639 25297153 16876033 16843137}} test binary-40.1 {ScanNumber: floating point overflow} {nonPortable unixOnly} { catch {unset arg1} list [binary scan \xff\xff\xff\xff f1 arg1] $arg1 } {1 -NaN} test binary-40.3 {ScanNumber: floating point overflow} {nonPortable pcOnly} { catch {unset arg1} set result [binary scan \xff\xff\xff\xff f1 arg1] if {([string compare $arg1 -1.\#QNAN] == 0) || ([string compare $arg1 -NAN] == 0)} { lappend result success } else { lappend result failure } } {1 success} test binary-40.4 {ScanNumber: floating point overflow} {nonPortable unixOnly} { catch {unset arg1} list [binary scan \xff\xff\xff\xff\xff\xff\xff\xff d1 arg1] $arg1 } {1 -NaN} test binary-40.6 {ScanNumber: floating point overflow} {nonPortable pcOnly} { catch {unset arg1} set result [binary scan \xff\xff\xff\xff\xff\xff\xff\xff d1 arg1] if {([string compare $arg1 -1.\#QNAN] == 0) || ([string compare $arg1 -NAN] == 0)} { lappend result success } else { |
︙ | ︙ |
Changes to tests/cmdAH.test.
︙ | ︙ | |||
234 235 236 237 238 239 240 | testsetplatform unix file dirname /a/b } /a test cmdAH-8.3 {Tcl_FileObjCmd: dirname} { testsetplatform unix file dirname {} } . | < < < < < < < < | 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | testsetplatform unix file dirname /a/b } /a test cmdAH-8.3 {Tcl_FileObjCmd: dirname} { testsetplatform unix file dirname {} } . test cmdAH-8.5 {Tcl_FileObjCmd: dirname} { testsetplatform win file dirname {} } . test cmdAH-8.6 {Tcl_FileObjCmd: dirname} { testsetplatform unix file dirname .def } . test cmdAH-8.8 {Tcl_FileObjCmd: dirname} { testsetplatform win file dirname a } . test cmdAH-8.9 {Tcl_FileObjCmd: dirname} { testsetplatform unix file dirname a/b/c.d |
︙ | ︙ | |||
326 327 328 329 330 331 332 | testsetplatform windows list [catch {file dirname {//foo/bar/baz}} msg] $msg } {0 //foo/bar} test cmdAH-8.26 {Tcl_FileObjCmd: dirname} { testsetplatform windows list [catch {file dirname {//foo/bar}} msg] $msg } {0 //foo/bar} | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | testsetplatform windows list [catch {file dirname {//foo/bar/baz}} msg] $msg } {0 //foo/bar} test cmdAH-8.26 {Tcl_FileObjCmd: dirname} { testsetplatform windows list [catch {file dirname {//foo/bar}} msg] $msg } {0 //foo/bar} test cmdAH-8.38 {Tcl_FileObjCmd: dirname} { testsetplatform unix list [catch {file dirname ~/foo} msg] $msg } {0 ~} test cmdAH-8.39 {Tcl_FileObjCmd: dirname} { testsetplatform unix list [catch {file dirname ~bar/foo} msg] $msg } {0 ~bar} test cmdAH-8.43 {Tcl_FileObjCmd: dirname} { global env set temp $env(HOME) set env(HOME) "/homewontexist/test" testsetplatform unix set result [list [catch {file dirname ~} msg] $msg] set env(HOME) $temp |
︙ | ︙ | |||
417 418 419 420 421 422 423 | set temp $env(HOME) set env(HOME) "/homewontexist/test" testsetplatform windows set result [list [catch {file dirname ~} msg] $msg] set env(HOME) $temp set result } {0 /homewontexist} | < < < < < < < < < < < < < < < < < | 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 | set temp $env(HOME) set env(HOME) "/homewontexist/test" testsetplatform windows set result [list [catch {file dirname ~} msg] $msg] set env(HOME) $temp set result } {0 /homewontexist} # tail test cmdAH-9.1 {Tcl_FileObjCmd: tail} { testsetplatform unix list [catch {file tail a b} msg] $msg } {1 {wrong # args: should be "file tail name"}} test cmdAH-9.2 {Tcl_FileObjCmd: tail} { testsetplatform unix file tail /a/b } b test cmdAH-9.3 {Tcl_FileObjCmd: tail} { testsetplatform unix file tail {} } {} test cmdAH-9.5 {Tcl_FileObjCmd: tail} { testsetplatform win file tail {} } {} test cmdAH-9.6 {Tcl_FileObjCmd: tail} { testsetplatform unix file tail .def } .def test cmdAH-9.8 {Tcl_FileObjCmd: tail} { testsetplatform win file tail a } a test cmdAH-9.9 {Tcl_FileObjCmd: tail} { testsetplatform unix file ta a/b/c.d |
︙ | ︙ | |||
533 534 535 536 537 538 539 | testsetplatform windows file tail {//foo/bar/baz} } baz test cmdAH-9.26 {Tcl_FileObjCmd: tail} { testsetplatform windows file tail {//foo/bar} } {} | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 452 453 454 455 456 457 458 459 460 461 462 463 464 465 | testsetplatform windows file tail {//foo/bar/baz} } baz test cmdAH-9.26 {Tcl_FileObjCmd: tail} { testsetplatform windows file tail {//foo/bar} } {} test cmdAH-9.42 {Tcl_FileObjCmd: tail} { global env set temp $env(HOME) set env(HOME) "/home/test" testsetplatform unix set result [file tail ~] set env(HOME) $temp |
︙ | ︙ | |||
616 617 618 619 620 621 622 | set result } {} test cmdAH-9.44 {Tcl_FileObjCmd: tail} { global env set temp $env(HOME) set env(HOME) "/home/test" testsetplatform windows | < < < < < < < < < | 475 476 477 478 479 480 481 482 483 484 485 486 487 488 | set result } {} test cmdAH-9.44 {Tcl_FileObjCmd: tail} { global env set temp $env(HOME) set env(HOME) "/home/test" testsetplatform windows set result [file tail ~] set env(HOME) $temp set result } test test cmdAH-9.46 {Tcl_FileObjCmd: tail} { testsetplatform unix file tail {f.oo\bar/baz.bat} |
︙ | ︙ | |||
696 697 698 699 700 701 702 | testsetplatform unix file rootname a/b.c/d } a/b.c/d test cmdAH-10.10 {Tcl_FileObjCmd: rootname} { testsetplatform unix file rootname a/b.c/ } a/b.c/ | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 546 547 548 549 550 551 552 553 554 555 556 557 558 559 | testsetplatform unix file rootname a/b.c/d } a/b.c/d test cmdAH-10.10 {Tcl_FileObjCmd: rootname} { testsetplatform unix file rootname a/b.c/ } a/b.c/ test cmdAH-10.23 {Tcl_FileObjCmd: rootname} { testsetplatform windows file rootname {} } {} test cmdAH-10.24 {Tcl_FileObjCmd: rootname} { testsetplatform windows file ro foo |
︙ | ︙ | |||
846 847 848 849 850 851 852 | testsetplatform unix file extension a/b.c/d } {} test cmdAH-11.10 {Tcl_FileObjCmd: extension} { testsetplatform unix file extension a/b.c/ } {} | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 648 649 650 651 652 653 654 655 656 657 658 659 660 661 | testsetplatform unix file extension a/b.c/d } {} test cmdAH-11.10 {Tcl_FileObjCmd: extension} { testsetplatform unix file extension a/b.c/ } {} test cmdAH-11.23 {Tcl_FileObjCmd: extension} { testsetplatform windows file extension {} } {} test cmdAH-11.24 {Tcl_FileObjCmd: extension} { testsetplatform windows file ext foo |
︙ | ︙ | |||
944 945 946 947 948 949 950 | } {} test cmdAH-11.34 {Tcl_FileObjCmd: extension} { testsetplatform windows file extension a\\b.c\\ } {} set num 35 foreach value {a..b a...b a.c..b ..b} result {.b .b .b .b} { | | | 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 | } {} test cmdAH-11.34 {Tcl_FileObjCmd: extension} { testsetplatform windows file extension a\\b.c\\ } {} set num 35 foreach value {a..b a...b a.c..b ..b} result {.b .b .b .b} { foreach p {unix windows} { ; test cmdAH-7.$num {Tcl_FileObjCmd: extension} " testsetplatform $p file extension $value " $result incr num } } |
︙ | ︙ | |||
1069 1070 1071 1072 1073 1074 1075 | # Only on unix will setting the execute bit on a regular file # cause that file to be executable. testchmod 0775 $gorpfile file exe $gorpfile } 1 | < < < < < < < | 823 824 825 826 827 828 829 830 831 832 833 834 835 836 | # Only on unix will setting the execute bit on a regular file # cause that file to be executable. testchmod 0775 $gorpfile file exe $gorpfile } 1 test cmdAH-18.5 {Tcl_FileObjCmd: executable} {winOnly testchmod} { # On pc, must be a .exe, .com, etc. set x [file exe $gorpfile] set gorpexe [makeFile foo gorp.exe] lappend x [file exe $gorpexe] removeFile $gorpexe |
︙ | ︙ | |||
1130 1131 1132 1133 1134 1135 1136 | testsetplatform unix list [catch {file nativename a/b} msg] $msg [testsetplatform $platform] } {0 a/b {}} test cmdAH-19.7 {Tcl_FileObjCmd: nativename} { testsetplatform windows list [catch {file nativename a/b} msg] $msg [testsetplatform $platform] } {0 {a\b} {}} | < < < < | 877 878 879 880 881 882 883 884 885 886 887 888 889 890 | testsetplatform unix list [catch {file nativename a/b} msg] $msg [testsetplatform $platform] } {0 a/b {}} test cmdAH-19.7 {Tcl_FileObjCmd: nativename} { testsetplatform windows list [catch {file nativename a/b} msg] $msg [testsetplatform $platform] } {0 {a\b} {}} } test cmdAH-19.9 {Tcl_FileObjCmd: ~ : exists} { file exists ~nOsUcHuSeR } 0 test cmdAH-19.10 {Tcl_FileObjCmd: ~ : nativename} { # should probably be 0 in fact... |
︙ | ︙ | |||
1481 1482 1483 1484 1485 1486 1487 | } {1 {wrong # args: should be "file readlink name"}} test cmdAH-26.2 {Tcl_FileObjCmd: readlink} {unixOnly nonPortable} { file readlink $linkfile } $gorpfile test cmdAH-26.3 {Tcl_FileObjCmd: readlink errors} {unixOnly nonPortable} { list [catch {file readlink _bogus_} msg] [string tolower $msg] \ [string tolower $errorCode] | < < < < | 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 | } {1 {wrong # args: should be "file readlink name"}} test cmdAH-26.2 {Tcl_FileObjCmd: readlink} {unixOnly nonPortable} { file readlink $linkfile } $gorpfile test cmdAH-26.3 {Tcl_FileObjCmd: readlink errors} {unixOnly nonPortable} { list [catch {file readlink _bogus_} msg] [string tolower $msg] \ [string tolower $errorCode] } {1 {could not readlink "_bogus_": no such file or directory} {posix enoent {no such file or directory}}} test cmdAH-26.5 {Tcl_FileObjCmd: readlink errors} {winOnly nonPortable} { list [catch {file readlink _bogus_} msg] [string tolower $msg] \ [string tolower $errorCode] } {1 {could not readlink "_bogus_": invalid argument} {posix einval {invalid argument}}} # size |
︙ | ︙ |
Changes to tests/cmdMZ.test.
︙ | ︙ | |||
66 67 68 69 70 71 72 | } {1 {invalid command name "r1"}} # The tests for Tcl_ReturnObjCmd are in proc-old.test # The tests for Tcl_ScanObjCmd are in scan.test # Tcl_SourceObjCmd | < < < < < < | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | } {1 {invalid command name "r1"}} # The tests for Tcl_ReturnObjCmd are in proc-old.test # The tests for Tcl_ScanObjCmd are in scan.test # Tcl_SourceObjCmd test cmdMZ-3.3 {Tcl_SourceObjCmd: error conditions} {unixOrPc} { list [catch {source} msg] $msg } {1 {wrong # args: should be "source fileName"}} test cmdMZ-3.4 {Tcl_SourceObjCmd: error conditions} {unixOrPc} { list [catch {source a b} msg] $msg } {1 {wrong # args: should be "source fileName"}} |
︙ | ︙ |
Changes to tests/fCmd.test.
︙ | ︙ | |||
82 83 84 85 86 87 88 | openup $p } } } } proc cleanup {args} { | < < < | < | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | openup $p } } } } proc cleanup {args} { set wd [list .] foreach p [concat $wd $args] { set x "" catch { set x [glob -directory $p tf* td*] } foreach file $x { if {[catch {file delete -force -- $file}]} { |
︙ | ︙ | |||
112 113 114 115 116 117 118 | set r } cd [temporaryDirectory] set ::tcltest::testConstraints(fileSharing) 0 set ::tcltest::testConstraints(notFileSharing) 1 | < < < < < < < < < < < | 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | set r } cd [temporaryDirectory] set ::tcltest::testConstraints(fileSharing) 0 set ::tcltest::testConstraints(notFileSharing) 1 set ::tcltest::testConstraints(xdev) 0 if {$tcl_platform(platform) == "unix"} { if {[catch {set m1 [exec df .]; set m2 [exec df /tmp]}] == 0} { set m1 [string range $m1 0 [expr [string first " " $m1]-1]] set m2 [string range $m2 0 [expr [string first " " $m2]-1]] if {$m1 != "" && $m2 != "" && $m1 != $m2 && [file exists $m1] && [file exists $m2]} { |
︙ | ︙ | |||
314 315 316 317 318 319 320 | cleanup file mkdir td1/td2/td3 testchmod 000 td1/td2 set msg [list [catch {file mkdir td1/td2/td3/td4} msg] $msg] testchmod 755 td1/td2 set msg } {1 {can't create directory "td1/td2/td3": permission denied}} | < < < < < < < | 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 | cleanup file mkdir td1/td2/td3 testchmod 000 td1/td2 set msg [list [catch {file mkdir td1/td2/td3/td4} msg] $msg] testchmod 755 td1/td2 set msg } {1 {can't create directory "td1/td2/td3": permission denied}} test fCmd-4.13 {TclFileMakeDirsCmd: doesn't exist: errno == ENOENT} {notRoot} { cleanup set x [file exists td1] file mkdir td1 list $x [file exists td1] } {0 1} test fCmd-4.14 {TclFileMakeDirsCmd: TclpCreateDirectory fails} \ {unixOnly notRoot} { cleanup file delete -force foo file mkdir foo file attr foo -perm 040000 set result [list [catch {file mkdir foo/tf1} msg] $msg] file delete -force foo set result } {1 {can't create directory "foo/tf1": permission denied}} test fCmd-4.16 {TclFileMakeDirsCmd: TclpCreateDirectory succeeds} {notRoot} { cleanup file mkdir tf1 file exists tf1 } {1} test fCmd-5.1 {TclFileDeleteCmd: FileForceOption fails} {notRoot} { |
︙ | ︙ | |||
450 451 452 453 454 455 456 | createfile tf1 set msg [list [catch {file rename tf1 td1} msg] $msg] testchmod 755 td1 set msg } {1 {error renaming "tf1" to "td1/tf1": permission denied}} test fCmd-6.7 {CopyRenameOneFile: errno != ENOENT} {pcOnly 95} { cleanup | < < < < < | 428 429 430 431 432 433 434 435 436 437 438 439 440 441 | createfile tf1 set msg [list [catch {file rename tf1 td1} msg] $msg] testchmod 755 td1 set msg } {1 {error renaming "tf1" to "td1/tf1": permission denied}} test fCmd-6.7 {CopyRenameOneFile: errno != ENOENT} {pcOnly 95} { cleanup createfile tf1 list [catch {file rename tf1 $long} msg] $msg } [subst {1 {error renaming "tf1" to "$long": file name too long}}] test fCmd-6.9 {CopyRenameOneFile: errno == ENOENT} {unixOnly notRoot} { cleanup createfile tf1 file rename tf1 tf2 |
︙ | ︙ | |||
780 781 782 783 784 785 786 | file mkdir tds2 file mkdir tds3 file mkdir tds4 file mkdir [file join tdd1 tds1] file mkdir [file join tdd2 tds2] file mkdir [file join tdd3 tds3] file mkdir [file join tdd4 tds4] | | < | | < | | | | 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 | file mkdir tds2 file mkdir tds3 file mkdir tds4 file mkdir [file join tdd1 tds1] file mkdir [file join tdd2 tds2] file mkdir [file join tdd3 tds3] file mkdir [file join tdd4 tds4] if {$tcl_platform(platform) != "unix"} { testchmod 555 tds3 testchmod 555 tds4 } testchmod 555 [file join tdd2 tds2] testchmod 555 [file join tdd4 tds4] set msg [list [catch {file rename td1 td2} msg] $msg] file rename -force tds1 tdd1 file rename -force tds2 tdd2 file rename -force tds3 tdd3 file rename -force tds4 tdd4 if {$tcl_platform(platform) != "unix"} { set w3 [file writable [file join tdd3 tds3]] set w4 [file writable [file join tdd4 tds4]] } else { set w3 0 set w4 0 } list [lsort [glob td*]] $msg [file writable [file join tdd1 tds1]] \ [file writable [file join tdd2 tds2]] $w3 $w4 } [subst {{td1 td2 tdd1 tdd2 tdd3 tdd4} {1 {error renaming "td1" to "[file join td2 td1]": file already exists}} 1 1 0 0}] test fCmd-9.9 {file rename: comprehensive: dir to non-empty dir} {notRoot testchmod} { cleanup file mkdir tds1 file mkdir tds2 file mkdir [file join tdd1 tds1 xxx] file mkdir [file join tdd2 tds2 xxx] if {!([testConstraint unix] || [testConstraint winVista])} { testchmod 555 tds2 } set a1 [list [catch {file rename -force tds1 tdd1} msg] $msg] set a2 [list [catch {file rename -force tds2 tdd2} msg] $msg] if {!([testConstraint unix] || [testConstraint winVista])} { set w2 [file writable tds2] } else { set w2 0 } list [lsort [glob td*]] $a1 $a2 [file writable tds1] $w2 } [subst {{tdd1 tdd2 tds1 tds2} {1 {error renaming "tds1" to "[file join tdd1 tds1]": file already exists}} {1 {error renaming "tds2" to "[file join tdd2 tds2]": file already exists}} 1 0}] test fCmd-9.10 {file rename: comprehensive: file to new name and dir} {notRoot testchmod} { |
︙ | ︙ | |||
837 838 839 840 841 842 843 | [file writable [file join td1 tf3]] [file writable [file join td1 tf4]] } [subst {1 {[file join td1 tf3] [file join td1 tf4]} 1 0}] test fCmd-9.11 {file rename: comprehensive: dir to new name and dir} {notRoot testchmod} { cleanup file mkdir td1 file mkdir td2 file mkdir td3 | | | < < < < | 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 | [file writable [file join td1 tf3]] [file writable [file join td1 tf4]] } [subst {1 {[file join td1 tf3] [file join td1 tf4]} 1 0}] test fCmd-9.11 {file rename: comprehensive: dir to new name and dir} {notRoot testchmod} { cleanup file mkdir td1 file mkdir td2 file mkdir td3 if {!([testConstraint unix] || [testConstraint winVista])} { testchmod 555 td2 } file rename td1 [file join td3 td3] file rename td2 [file join td3 td4] if {!([testConstraint unix] || [testConstraint winVista])} { set w4 [file writable [file join td3 td4]] } else { set w4 0 } list [lsort [glob td*]] [lsort [glob -directory td3 t*]] \ [file writable [file join td3 td3]] $w4 } [subst {td3 {[file join td3 td3] [file join td3 td4]} 1 0}] test fCmd-9.12 {file rename: comprehensive: target exists} {notRoot testchmod notNetworkFilesystem} { cleanup file mkdir [file join td1 td2] [file join td2 td1] testchmod 555 [file join td2 td1] file mkdir [file join td3 td4] [file join td4 td3] file rename -force td3 td4 set msg [list [file exists td3] [file exists [file join td4 td3 td4]] \ [catch {file rename td1 td2} msg] $msg] testchmod 755 [file join td2 td1] set msg } [subst {0 1 1 {error renaming "td1" to "[file join td2 td1]": file already exists}}] test fCmd-9.13 {file rename: comprehensive: can't overwrite target} {notRoot} { cleanup file mkdir [file join td1 td2] [file join td2 td1 td4] list [catch {file rename -force td1 td2} msg] $msg } [subst {1 {error renaming "td1" to "[file join td2 td1]": file already exists}}] |
︙ | ︙ | |||
912 913 914 915 916 917 918 | file mkdir [file join td1 tdx] file mkdir [file join td2 tdy] testchmod 555 td2 file copy td1 td3 file copy td2 td4 set msg [list [lsort [glob td*]] [glob -directory td3 t*] \ [glob -directory td4 t*] [file writable td3] [file writable td4]] | < < | 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 | file mkdir [file join td1 tdx] file mkdir [file join td2 tdy] testchmod 555 td2 file copy td1 td3 file copy td2 td4 set msg [list [lsort [glob td*]] [glob -directory td3 t*] \ [glob -directory td4 t*] [file writable td3] [file writable td4]] testchmod 755 td2 testchmod 755 td4 set msg } [subst {{td1 td2 td3 td4} [file join td3 tdx] [file join td4 tdy] 1 0}] test fCmd-10.3.1 {file copy: comprehensive: dir to new name} {notRoot pc 2000orNewer testchmod} { # On Windows with ACLs, copying a directory is defined like this cleanup file mkdir [file join td1 tdx] file mkdir [file join td2 tdy] |
︙ | ︙ | |||
967 968 969 970 971 972 973 | file mkdir tds2 file mkdir tds3 file mkdir tds4 file mkdir [file join tdd1 tds1] file mkdir [file join tdd2 tds2] file mkdir [file join tdd3 tds3] file mkdir [file join tdd4 tds4] | < < | 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 | file mkdir tds2 file mkdir tds3 file mkdir tds4 file mkdir [file join tdd1 tds1] file mkdir [file join tdd2 tds2] file mkdir [file join tdd3 tds3] file mkdir [file join tdd4 tds4] testchmod 555 tds3 testchmod 555 tds4 testchmod 555 [file join tdd2 tds2] testchmod 555 [file join tdd4 tds4] set a1 [list [catch {file copy td1 td2} msg] $msg] set a2 [list [catch {file copy -force tds1 tdd1} msg] $msg] set a3 [catch {file copy -force tds2 tdd2}] set a4 [catch {file copy -force tds3 tdd3}] set a5 [catch {file copy -force tds4 tdd4}] list [lsort [glob td*]] $a1 $a2 $a3 $a4 $a5 } [subst {{td1 td2 tdd1 tdd2 tdd3 tdd4 tds1 tds2 tds3 tds4} {1 {error copying "td1" to "[file join td2 td1]": file already exists}} {1 {error copying "tds1" to "[file join tdd1 tds1]": file already exists}} 1 1 1}] |
︙ | ︙ |
Changes to tests/fileName.test.
︙ | ︙ | |||
52 53 54 55 56 57 58 | file pathtype ~foo } absolute test filename-1.8 {Tcl_GetPathType: unix} {testsetplatform} { testsetplatform unix file pathtype ./~foo } relative | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | file pathtype ~foo } absolute test filename-1.8 {Tcl_GetPathType: unix} {testsetplatform} { testsetplatform unix file pathtype ./~foo } relative test filename-3.1 {Tcl_GetPathType: windows} {testsetplatform} { testsetplatform windows file pathtype / } volumerelative test filename-3.2 {Tcl_GetPathType: windows} {testsetplatform} { testsetplatform windows file pathtype \\ |
︙ | ︙ | |||
329 330 331 332 333 334 335 | set norm } err] cd $oldDir catch {file delete -force [file join [temporaryDirectory] tildetmp]} list $res $err } {0 tildetmp/~tilde} | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | set norm } err] cd $oldDir catch {file delete -force [file join [temporaryDirectory] tildetmp]} list $res $err } {0 tildetmp/~tilde} test filename-6.1 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split / } {/} test filename-6.2 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split /foo |
︙ | ︙ | |||
728 729 730 731 732 733 734 | file join //a b } {/a/b} test filename-7.18 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix file join /// a b } {/a/b} | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 414 415 416 417 418 419 420 421 422 423 424 425 426 427 | file join //a b } {/a/b} test filename-7.18 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix file join /// a b } {/a/b} test filename-9.1 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win file join a b } {a/b} test filename-9.2 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win file join /a b |
︙ | ︙ | |||
922 923 924 925 926 927 928 | testsetplatform unix set res {} lappend res \ [file join {/foo/bar}] \ [file join /x {/foo/bar}] \ [file join /x /x {/foo/bar}] } {/foo/bar /foo/bar /foo/bar} | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 | testsetplatform unix set res {} lappend res \ [file join {/foo/bar}] \ [file join /x {/foo/bar}] \ [file join /x /x {/foo/bar}] } {/foo/bar /foo/bar /foo/bar} test filename-9.23 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win set res {} lappend res \ [file join {foo\bar}] \ [file join C:/blah {foo\bar}] \ [file join C:/blah C:/blah {foo\bar}] string map [list C:/blah ""] $res } {foo/bar /foo/bar /foo/bar} test filename-9.24 {Tcl_JoinPath: unix} {testsetplatform} { testsetplatform unix set res {} lappend res \ [file join {foo/bar}] \ [file join /x {foo/bar}] \ [file join /x /x {foo/bar}] string map [list /x ""] $res } {foo/bar /foo/bar /foo/bar} test filename-10.1 {Tcl_TranslateFileName} {testsetplatform} { testsetplatform unix list [catch {testtranslatefilename foo} msg] $msg } {0 foo} test filename-10.2 {Tcl_TranslateFileName} {testsetplatform} { testsetplatform windows list [catch {testtranslatefilename {c:/foo}} msg] $msg } {0 {c:\foo}} test filename-10.3 {Tcl_TranslateFileName} {testsetplatform} { testsetplatform windows list [catch {testtranslatefilename {c:/\\foo/}} msg] $msg } {0 {c:\foo}} test filename-10.6 {Tcl_TranslateFileName} {testsetplatform} { global env set temp $env(HOME) set env(HOME) "/home/test" testsetplatform unix set result [list [catch {testtranslatefilename ~/foo} msg] $msg] set env(HOME) $temp |
︙ | ︙ | |||
1040 1041 1042 1043 1044 1045 1046 | set temp $env(HOME) set env(HOME) "/home/test/" testsetplatform unix set result [list [catch {testtranslatefilename ~/foo} msg] $msg] set env(HOME) $temp set result } {0 /home/test/foo} | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 595 596 597 598 599 600 601 602 603 604 605 606 607 608 | set temp $env(HOME) set env(HOME) "/home/test/" testsetplatform unix set result [list [catch {testtranslatefilename ~/foo} msg] $msg] set env(HOME) $temp set result } {0 /home/test/foo} test filename-10.17 {Tcl_TranslateFileName} {testsetplatform} { global env set temp $env(HOME) set env(HOME) "\\home\\" testsetplatform windows set result [list [catch {testtranslatefilename ~/foo} msg] $msg] set env(HOME) $temp |
︙ | ︙ | |||
1245 1246 1247 1248 1249 1250 1251 | list [catch {lsort [glob -directory $globname *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] | | | 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 | list [catch {lsort [glob -directory $globname *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] test filename-11.17.1 {Tcl_GlobCmd} {pcOnly} { list [catch {lsort [glob -directory $globname *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ |
︙ | ︙ | |||
1375 1376 1377 1378 1379 1380 1381 | list [catch {lsort [glob -path $globname/ *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] | | | | 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 | list [catch {lsort [glob -path $globname/ *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] test filename-11.18.1 {Tcl_GlobCmd} {pcOnly} { list [catch {lsort [glob -path $globname/ *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] test filename-11.19 {Tcl_GlobCmd} {unixOnly} { list [catch {lsort [glob -join -path \ [string range $globname 0 5] * *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] test filename-11.19.1 {Tcl_GlobCmd} {pcOnly} { list [catch {lsort [glob -join -path \ [string range $globname 0 5] * *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ |
︙ | ︙ | |||
1435 1436 1437 1438 1439 1440 1441 | list [catch {lsort [glob -dir $globname *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] | | | | | 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 | list [catch {lsort [glob -dir $globname *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] test filename-11.22.1 {Tcl_GlobCmd} {pcOnly} { list [catch {lsort [glob -dir $globname *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] test filename-11.23 {Tcl_GlobCmd} {unixOnly} { list [catch {lsort [glob -path $globname/ *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] test filename-11.23.1 {Tcl_GlobCmd} {pcOnly} { list [catch {lsort [glob -path $globname/ *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] test filename-11.24 {Tcl_GlobCmd} {unixOnly} { list [catch {lsort [glob -join -path \ [string range $globname 0 5] * *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] test filename-11.24.1 {Tcl_GlobCmd} {pcOnly} { list [catch {lsort [glob -join -path \ [string range $globname 0 5] * *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ [file join $globname a3]\ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ |
︙ | ︙ | |||
1610 1611 1612 1613 1614 1615 1616 | } {1 {no files matched glob pattern ""}} test filename-12.1.5 {simple globbing} {pcOnly} { list [catch {glob -types hidden c:/} msg] $msg } {1 {no files matched glob pattern "c:/"}} test filename-12.1.6 {simple globbing} {pcOnly} { list [catch {glob c:/} msg] $msg } {0 c:/} | < < < < < < < < < < < < < < < < | 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 | } {1 {no files matched glob pattern ""}} test filename-12.1.5 {simple globbing} {pcOnly} { list [catch {glob -types hidden c:/} msg] $msg } {1 {no files matched glob pattern "c:/"}} test filename-12.1.6 {simple globbing} {pcOnly} { list [catch {glob c:/} msg] $msg } {0 c:/} test filename-12.3 {simple globbing} { list [catch {glob -nocomplain \{a1,a2\}} msg] $msg } {0 {}} set globPreResult globTest/ set x1 x1.c set y1 y1.c test filename-12.4 {simple globbing} {unixOrPc} { lsort [glob globTest/x1.c globTest/y1.c globTest/foo] } "$globPreResult$x1 $globPreResult$y1" test filename-12.5 {simple globbing} { list [catch {glob globTest\\/x1.c} msg] $msg |
︙ | ︙ | |||
1709 1710 1711 1712 1713 1714 1715 | } [list 0 [list $globPreResult$x1 $globPreResult$y1]] test filename-13.10 {globbing with brace substitution} { list [lsort [catch {glob globTest/\{x,,y\}1.c} msg]] $msg } [list 0 [list $globPreResult$x1 $globPreResult$y1]] test filename-13.11 {globbing with brace substitution} {unixOrPc} { list [lsort [catch {glob globTest/\{x,x\\,z,z\}1.c} msg]] $msg } {0 {globTest/x1.c globTest/x,z1.c globTest/z1.c}} | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 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 | } [list 0 [list $globPreResult$x1 $globPreResult$y1]] test filename-13.10 {globbing with brace substitution} { list [lsort [catch {glob globTest/\{x,,y\}1.c} msg]] $msg } [list 0 [list $globPreResult$x1 $globPreResult$y1]] test filename-13.11 {globbing with brace substitution} {unixOrPc} { list [lsort [catch {glob globTest/\{x,x\\,z,z\}1.c} msg]] $msg } {0 {globTest/x1.c globTest/x,z1.c globTest/z1.c}} test filename-13.13 {globbing with brace substitution} { lsort [glob globTest/{a,b,x,y}1.c] } [list $globPreResult$x1 $globPreResult$y1] test filename-13.14 {globbing with brace substitution} {unixOrPc} { lsort [glob {globTest/{x1,y2,weird name}.c}] } {{globTest/weird name.c} globTest/x1.c} test filename-13.16 {globbing with brace substitution} {unixOrPc} { lsort [glob globTest/{x1.c,a1/*}] } {globTest/a1/b1 globTest/a1/b2 globTest/x1.c} test filename-13.18 {globbing with brace substitution} {unixOrPc} { lsort [glob globTest/{x1.c,{a},a1/*}] } {globTest/a1/b1 globTest/a1/b2 globTest/x1.c} test filename-13.20 {globbing with brace substitution} {unixOrPc} { lsort [glob globTest/{a,x}1/*/{x,y}*] } {globTest/a1/b1/x2.c globTest/a1/b2/y2.c} test filename-13.22 {globbing with brace substitution} { list [catch {glob globTest/\{a,x\}1/*/\{} msg] $msg } {1 {unmatched open-brace in file name}} test filename-14.1 {asterisks, question marks, and brackets} {unixOrPc} { lsort [glob glo*/*.c] } {{globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c} test filename-14.3 {asterisks, question marks, and brackets} {unixOrPc} { lsort [glob globTest/?1.c] } {globTest/x1.c globTest/y1.c globTest/z1.c} # The current directory could be anywhere; do this to stop spurious matches file mkdir globTestContext file rename globTest [file join globTestContext globTest] set savepwd [pwd] cd globTestContext test filename-14.5 {asterisks, question marks, and brackets} {unixOrPc} { lsort [glob */*/*/*.c] } {globTest/a1/b1/x2.c globTest/a1/b2/y2.c} # Reset to where we were cd $savepwd file rename [file join globTestContext globTest] globTest file delete globTestContext test filename-14.7 {asterisks, question marks, and brackets} {unixOnly} { lsort [glob globTest/*] } {globTest/a1 globTest/a2 globTest/a3 {globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c} test filename-14.7.1 {asterisks, question marks, and brackets} {pcOnly} { lsort [glob globTest/*] } {globTest/.1 globTest/a1 globTest/a2 globTest/a3 {globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c} test filename-14.9 {asterisks, question marks, and brackets} {unixOrPc} { lsort [glob globTest/.*] } {globTest/. globTest/.. globTest/.1} test filename-14.11 {asterisks, question marks, and brackets} {unixOrPc} { lsort [glob globTest/*/*] } {globTest/a1/b1 globTest/a1/b2 globTest/a2/b3} test filename-14.13 {asterisks, question marks, and brackets} {unixOrPc} { lsort [glob {globTest/[xyab]1.*}] } {globTest/x1.c globTest/y1.c} test filename-14.15 {asterisks, question marks, and brackets} {unixOrPc} { lsort [glob globTest/*/] } {globTest/a1/ globTest/a2/ globTest/a3/} test filename-14.17 {asterisks, question marks, and brackets} { global env set temp $env(HOME) set env(HOME) [file join $env(HOME) globTest] set result [list [catch {glob ~/z*} msg] $msg] set env(HOME) $temp set result } [list 0 [list [file join $env(HOME) globTest z1.c]]] test filename-14.18 {asterisks, question marks, and brackets} {unixOrPc} { list [catch {lsort [glob globTest/*.c goo/*]} msg] $msg } {0 {{globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c}} test filename-14.20 {asterisks, question marks, and brackets} { list [catch {glob -nocomplain goo/*} msg] $msg } {0 {}} test filename-14.21 {asterisks, question marks, and brackets} { list [catch {glob globTest/*/gorp} msg] $msg } {1 {no files matched glob pattern "globTest/*/gorp"}} test filename-14.22 {asterisks, question marks, and brackets} { list [catch {glob goo/* x*z foo?q} msg] $msg } {1 {no files matched glob patterns "goo/* x*z foo?q"}} test filename-14.23 {slash globbing} {unixOrPc} { glob / } / test filename-14.24 {slash globbing} {pcOnly} { glob {\\} } / test filename-14.25 {type specific globbing} {unixOnly} { list [catch {lsort [glob -dir globTest -types f *]} msg] $msg } [list 0 [lsort [list \ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] test filename-14.26 {type specific globbing} { list [catch {glob -nocomplain -dir globTest -types {readonly} *} msg] $msg } [list 0 {}] |
︙ | ︙ |
Changes to tests/interp.test.
︙ | ︙ | |||
11 12 13 14 15 16 17 | # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2.1 namespace import -force ::tcltest::* } | < < < < < | < | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # of this file, and for a DISCLAIMER OF ALL WARRANTIES. if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2.1 namespace import -force ::tcltest::* } set hidden_cmds {cd encoding exec exit fconfigure file glob load open pwd socket source} foreach i [interp slaves] { interp delete $i } proc equiv {x} {return $x} |
︙ | ︙ | |||
1738 1739 1740 1741 1742 1743 1744 | a alias bar {} lappend l [interp aliases a] lappend l [lsort [interp hidden a]] interp delete a set l } {{cd encoding exec exit fconfigure file glob load open pwd socket source} bar {cd encoding exec exit fconfigure file glob load open pwd socket source} bar {bar cd encoding exec exit fconfigure file glob load open pwd socket source} {} {cd encoding exec exit fconfigure file glob load open pwd socket source}} | < < < < < < < < < < < < < < < < < < | 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 | a alias bar {} lappend l [interp aliases a] lappend l [lsort [interp hidden a]] interp delete a set l } {{cd encoding exec exit fconfigure file glob load open pwd socket source} bar {cd encoding exec exit fconfigure file glob load open pwd socket source} bar {bar cd encoding exec exit fconfigure file glob load open pwd socket source} {} {cd encoding exec exit fconfigure file glob load open pwd socket source}} test interp-24.1 {result resetting on error} { catch {interp delete a} interp create a proc foo args {error $args} interp alias a foo {} foo set l [interp eval a { set l {} |
︙ | ︙ |
Changes to tests/io.test.
︙ | ︙ | |||
1605 1606 1607 1608 1609 1610 1611 | } "\n\n\nab\n\nd" # Test standard handle management. The functions tested are # Tcl_SetStdChannel and Tcl_GetStdChannel. Incidentally we are # also testing channel table management. if {[info commands testchannel] != ""} { | < < < | < | 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 | } "\n\n\nab\n\nd" # Test standard handle management. The functions tested are # Tcl_SetStdChannel and Tcl_GetStdChannel. Incidentally we are # also testing channel table management. if {[info commands testchannel] != ""} { set consoleFileNames [lsort [testchannel open]] } else { # just to avoid an error set consoleFileNames [list] } test io-14.1 {Tcl_SetStdChannel and Tcl_GetStdChannel} {testchannel} { set l "" |
︙ | ︙ | |||
1932 1933 1934 1935 1936 1937 1938 | } [list [list \x1a ""] {auto crlf}] test io-20.3 {Tcl_CreateChannel: initial settings} {unixOnly} { set f [open $path(test1) w+] set x [list [fconfigure $f -eofchar] [fconfigure $f -translation]] close $f set x } {{{} {}} {auto lf}} | < < < < < < | 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 | } [list [list \x1a ""] {auto crlf}] test io-20.3 {Tcl_CreateChannel: initial settings} {unixOnly} { set f [open $path(test1) w+] set x [list [fconfigure $f -eofchar] [fconfigure $f -translation]] close $f set x } {{{} {}} {auto lf}} set path(stdout) [makeFile {} stdout] test io-20.5 {Tcl_CreateChannel: install channel in empty slot} {stdio openpipe} { set f [open $path(script) w] puts -nonewline $f { close stdout |
︙ | ︙ |
Changes to tests/load.test.
︙ | ︙ | |||
14 15 16 17 18 19 20 | package require tcltest 2 namespace import -force ::tcltest::* } # Figure out what extension is used for shared libraries on this # platform. | < < < < < < | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | package require tcltest 2 namespace import -force ::tcltest::* } # Figure out what extension is used for shared libraries on this # platform. # Tests require the existence of one of the DLLs in the dltest directory. set ext [info sharedlibextension] set testDir [file join [file dirname [info nameofexecutable]] dltest] set x [file join $testDir pkga$ext] set dll "[file tail $x]Required" ::tcltest::testConstraint $dll [file readable $x] |
︙ | ︙ |
Deleted tests/macFCmd.test.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted tests/osa.test.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted tests/resource.test.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to tests/socket.test.
︙ | ︙ | |||
87 88 89 90 91 92 93 | } # # Check if we're supposed to do tests against the remote server # set doTestsWithRemoteServer 1 | | | 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | } # # Check if we're supposed to do tests against the remote server # set doTestsWithRemoteServer 1 if {![info exists remoteServerIP]} { set remoteServerIP 127.0.0.1 } if {($doTestsWithRemoteServer == 1) && (![info exists remoteServerPort])} { set remoteServerPort 2048 } # Attempt to connect to a remote server if one is already running. If it |
︙ | ︙ | |||
1150 1151 1152 1153 1154 1155 1156 | break } } close $f sendCommand {close $socket10_7_test_server} set cnt } 50 | < < < < < < | | 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 | break } } close $f sendCommand {close $socket10_7_test_server} set cnt } 50 test socket-11.6 {socket conflict} {socket doTestsWithRemoteServer} { set s1 [socket -server accept 2836] if {[catch {set s2 [socket -server accept 2836]} msg]} { set result [list 1 $msg] } else { set result [list 0 [lindex [fconfigure $s2 -sockname] 2]] close $s2 } close $s1 set result } {1 {couldn't open socket: address already in use}} test socket-11.7 {server with several clients} {socket doTestsWithRemoteServer} { sendCommand { set socket10_9_test_server [socket -server accept 2836] proc accept {s a p} { fconfigure $s -buffering line fileevent $s readable [list echo $s] } |
︙ | ︙ |
Changes to tests/source.test.
︙ | ︙ | |||
199 200 201 202 203 204 205 | } -body { list [catch {source $sourcefile} msg] $msg $::errorInfo $::errorCode } -cleanup { removeFile source.file } -result {1 {} {Simulated errorInfo stuff invoked from within "source $sourcefile"} {a b c}} | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | } -body { list [catch {source $sourcefile} msg] $msg $::errorInfo $::errorCode } -cleanup { removeFile source.file } -result {1 {} {Simulated errorInfo stuff invoked from within "source $sourcefile"} {a b c}} test source-6.1 {source is binary ok} -setup { # Note [makeFile] writes in the system encoding. # [source] defaults to reading in the system encoding. set sourcefile [makeFile [list set x "a b\0c"] source.file] } -body { set x {} |
︙ | ︙ |
Changes to unix/Makefile.in.
︙ | ︙ | |||
1440 1441 1442 1443 1444 1445 1446 | BUILD_HTML = \ @@LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}; export @LD_LIBRARY_PATH_VAR@; \ TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \ ./tclsh $(TOOL_DIR)/tcltk-man2html.tcl --htmldir=$(HTML_INSTALL_DIR) \ --srcdir=$(TOP_DIR)/.. $(BUILD_HTML_FLAGS) | < < < < < < < < < < < < < < | 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 | BUILD_HTML = \ @@LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}; export @LD_LIBRARY_PATH_VAR@; \ TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \ ./tclsh $(TOOL_DIR)/tcltk-man2html.tcl --htmldir=$(HTML_INSTALL_DIR) \ --srcdir=$(TOP_DIR)/.. $(BUILD_HTML_FLAGS) # # Targets to build Solaris package of the distribution for the current # architecture. To build stream packages for both sun4 and i86pc # architectures: # # On the sun4 machine, execute the following: # make distclean; ./configure |
︙ | ︙ |
Changes to unix/README.
︙ | ︙ | |||
16 17 18 19 20 21 22 | The rest of this file contains instructions on how to do this. The release should compile and run either "out of the box" or with trivial changes on any UNIX-like system that approximates POSIX, BSD, or System V. We know that it runs on workstations from Sun, H-P, DEC, IBM, and SGI, as well as PCs running Linux, BSDI, and SCO UNIX. To compile for a PC running Windows, see the README file in the directory ../win. To | | < | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | The rest of this file contains instructions on how to do this. The release should compile and run either "out of the box" or with trivial changes on any UNIX-like system that approximates POSIX, BSD, or System V. We know that it runs on workstations from Sun, H-P, DEC, IBM, and SGI, as well as PCs running Linux, BSDI, and SCO UNIX. To compile for a PC running Windows, see the README file in the directory ../win. To compile for Max OS X, see the README in the directory ../macosx. How To Compile And Install Tcl: ------------------------------- (a) If you have already compiled Tcl once in this directory and are now preparing to compile again in the same directory but for a different platform, or if you have applied patches, type "make distclean" to |
︙ | ︙ |
Changes to win/tcl.dsp.
︙ | ︙ | |||
648 649 650 651 652 653 654 | # End Source File # Begin Source File SOURCE=..\doc\lsort.n # End Source File # Begin Source File | < < < < | 648 649 650 651 652 653 654 655 656 657 658 659 660 661 | # End Source File # Begin Source File SOURCE=..\doc\lsort.n # End Source File # Begin Source File SOURCE=..\doc\man.macros # End Source File # Begin Source File SOURCE=..\doc\memory.n # End Source File # Begin Source File |
︙ | ︙ | |||
774 775 776 777 778 779 780 | SOURCE=..\doc\regsub.n # End Source File # Begin Source File SOURCE=..\doc\rename.n # End Source File | < < < < | 770 771 772 773 774 775 776 777 778 779 780 781 782 783 | SOURCE=..\doc\regsub.n # End Source File # Begin Source File SOURCE=..\doc\rename.n # End Source File # Begin Source File SOURCE=..\doc\return.n # End Source File # Begin Source File SOURCE=..\doc\safe.n |
︙ | ︙ |