Skip to content

Commit

Permalink
Document that [file dirname [file dirname [info nameofexecutable]]]/l…
Browse files Browse the repository at this point in the history
…ib is also added to $auto_path during initialization.
  • Loading branch information
jan.nijtmans committed Oct 24, 2024
1 parent b14faba commit b099296
Showing 1 changed file with 30 additions and 35 deletions.
65 changes: 30 additions & 35 deletions doc/tclvars.n
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ argc, argv, argv0, auto_path, env, errorCode, errorInfo, tcl_interactive, tcl_li
The following global variables are created and managed automatically
by the Tcl library. Except where noted below, these variables should
normally be treated as read-only by application-specific code and by users.
.\" VARIABLE: auto_path
.TP
\fBauto_path\fR
.
Expand All @@ -27,6 +28,7 @@ This variable is initialized during startup to contain, in order:
the directories listed in the \fBTCLLIBPATH\fR environment variable,
the directory named by the \fBtcl_library\fR global variable,
the parent directory of \fBtcl_library\fR,
\fB[file dirname [file dirname [info nameofexecutable]]]/lib\fR,
the directories listed in the \fBtcl_pkgPath\fR variable.
Additional locations to look for files and package indices should
normally be added to this variable using \fBlappend\fR.
Expand All @@ -36,6 +38,7 @@ Additional variables relating to package management exist. More
details are listed in the \fBVARIABLES\fR section of the \fBlibrary\fR
manual page.
.RE
.\" VARIABLE: env
.TP
\fBenv\fR
.
Expand Down Expand Up @@ -117,6 +120,7 @@ If existing, it has the same effect as running \fBinterp debug\fR
\fB{} -frame 1\fR
as the very first command of each new Tcl interpreter.
.RE
.\" VARIABLE: errorCode
.TP
\fBerrorCode\fR
.
Expand Down Expand Up @@ -213,6 +217,7 @@ If none of these methods for setting the error code has been used,
the Tcl interpreter will reset the variable to \fBNONE\fR after
the next error.
.RE
.\" VARIABLE: errorInfo
.TP
\fBerrorInfo\fR
.
Expand All @@ -223,6 +228,7 @@ identifying the Tcl commands and procedures that were being executed
when the most recent error occurred.
Its contents take the form of a stack trace showing the various
nested Tcl commands that had been invoked at the time of the error.
.\" VARIABLE: tcl_library
.TP
\fBtcl_library\fR
.
Expand All @@ -245,6 +251,7 @@ If \fBTCL_LIBRARY\fR is not set or doesn't refer to an appropriate
directory, then Tcl checks several other directories based on a
compiled-in default location, the location of the binary containing
the application, and the current working directory.
.\" VARIABLE: tcl_patchLevel
.TP
\fBtcl_patchLevel\fR
.
Expand All @@ -254,6 +261,7 @@ hold a string giving the current patch level for Tcl, such as
\fB8.5b3\fR for the third beta release of Tcl 8.5.
The value of this variable is returned by the \fBinfo patchlevel\fR
command.
.\" VARIABLE: tcl_pkgPath
.TP
\fBtcl_pkgPath\fR
.
Expand All @@ -273,6 +281,7 @@ value is added to \fBauto_path\fR at startup; changes to \fBtcl_pkgPath\fR
are not reflected in \fBauto_path\fR. If you want Tcl to search additional
directories for packages you should add the names of those directories to
\fBauto_path\fR, not \fBtcl_pkgPath\fR.
.\" VARIABLE: tcl_platform
.TP
\fBtcl_platform\fR
.
Expand All @@ -285,76 +294,54 @@ retrieve any relevant information. In addition, extensions
and applications may add additional values to the array. The
predefined elements are:
.RS
.TP
\fBbyteOrder\fR
.
.IP \fBbyteOrder\fR
The native byte order of this machine: either \fBlittleEndian\fR or
\fBbigEndian\fR.
.TP
\fBdebug\fR
.
.IP \fBdebug\fR
If this variable exists, then the interpreter was compiled with and linked
to a debug-enabled C run-time. This variable will only exist on Windows,
so extension writers can specify which package to load depending on the
C run-time library that is in use. This is not an indication that this core
contains symbols.
.TP
\fBengine\fR
.
.IP \fBengine\fR
The name of the Tcl language implementation. When the interpreter is first
created, this is always set to the string \fBTcl\fR.
.TP
\fBmachine\fR
.
.IP \fBmachine\fR
The instruction set executed by this machine, such as
\fBintel\fR, \fBPPC\fR, \fB68k\fR, or \fBsun4m\fR. On UNIX machines, this
is the value returned by \fBuname -m\fR.
.TP
\fBos\fR
.
.IP \fBos\fR
The name of the operating system running on this machine,
such as \fBWindows NT\fR or \fBSunOS\fR.
On UNIX machines, this is the value returned by \fBuname -s\fR.
.TP
\fBosVersion\fR
.
.IP \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.
.TP
\fBpathSeparator\fR
.IP \fBpathSeparator\fR
.VS 8.6
'\" Defined by TIP #315
The character that should be used to \fBsplit\fR PATH-like environment
variables into their corresponding list of directory names.
.VE 8.6
.TP
\fBplatform\fR
.
.IP \fBplatform\fR
Either \fBwindows\fR, or \fBunix\fR. This identifies the
general operating environment of the machine.
.TP
\fBpointerSize\fR
.
.IP \fBpointerSize\fR
This gives the size of the native-machine pointer in bytes (strictly, it
is same as the result of evaluating \fIsizeof(void*)\fR in C.)
.TP
\fBthreaded\fR
.
.IP \fBthreaded\fR
If this variable exists, then the interpreter
was compiled with threads enabled.
.TP
\fBuser\fR
.
.IP \fBuser\fR
This identifies the
current user based on the login information available on the platform.
This value comes from the getuid() and getpwuid() system calls on Unix,
and the value from the GetUserName() system call on Windows.
.TP
\fBwordSize\fR
.
.IP \fBwordSize\fR
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.)
.RE
.\" VARIABLE: tcl_precision
.TP
\fBtcl_precision\fR
.
Expand Down Expand Up @@ -419,6 +406,7 @@ 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.
.\" VARIABLE: tcl_traceCompile
.TP
\fBtcl_traceCompile\fR
.
Expand All @@ -437,6 +425,7 @@ tracking down suspected problems with the Tcl compiler.
This variable and functionality only exist if
\fBTCL_COMPILE_DEBUG\fR was defined during Tcl's compilation.
.RE
.\" VARIABLE: tcl_traceExec
.TP
\fBtcl_traceExec\fR
.
Expand All @@ -463,6 +452,7 @@ and interpreter.
This variable and functionality only exist if
\fBTCL_COMPILE_DEBUG\fR was defined during Tcl's compilation.
.RE
.\" VARIABLE: tcl_wordchars
.TP
\fBtcl_wordchars\fR
.
Expand All @@ -474,6 +464,7 @@ selecting a word by double-clicking in text in Tk. It is platform
dependent. On Windows, it defaults to \fB\eS\fR, meaning anything
but a Unicode space character. Otherwise it defaults to \fB\ew\fR,
which is any Unicode word character (number, letter, or underscore).
.\" VARIABLE: tcl_nonwordchars
.TP
\fBtcl_nonwordchars\fR
.
Expand All @@ -500,20 +491,24 @@ command.
The following variables are only guaranteed to exist in \fBtclsh\fR
and \fBwish\fR executables; the Tcl library does not define them
itself but many Tcl environments do.
.\" VARIABLE: argc
.TP 6
\fBargc\fR
.
The number of arguments to \fBtclsh\fR or \fBwish\fR.
.\" VARIABLE: argv
.TP 6
\fBargv\fR
.
Tcl list of arguments to \fBtclsh\fR or \fBwish\fR.
.\" VARIABLE: argv0
.TP 6
\fBargv0\fR
.
The script that \fBtclsh\fR or \fBwish\fR started executing (if it was
specified) or otherwise the name by which \fBtclsh\fR or \fBwish\fR
was invoked.
.\" VARIABLE: tcl_interactive
.TP 6
\fBtcl_interactive\fR
.
Expand Down

0 comments on commit b099296

Please sign in to comment.