Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f7a96643d | ||
|
|
c361023404 |
@@ -1,5 +1,5 @@
|
||||
README: Tcl
|
||||
This is the Tcl 8.6.6 source distribution.
|
||||
This is the Tcl 8.6.5 source distribution.
|
||||
http://sourceforge.net/projects/tcl/files/Tcl/
|
||||
You can get any source release of Tcl from the URL above.
|
||||
|
||||
|
||||
@@ -8624,77 +8624,3 @@ improvements to regexp engine from Postgres (lane,porter,fellows,seltenreich)
|
||||
2016-02-22 (bug)[9b4702] [info exists env(missing)] kills trace (nijtmans)
|
||||
|
||||
--- Released 8.6.5, February 29, 2016 --- http://core.tcl.tk/tcl/ for details
|
||||
|
||||
2016-03-01 (bug)[803042] mem leak due to reference cycle (porter)
|
||||
|
||||
2016-03-08 (bug)[bbc304] reflected watch race condition (porter)
|
||||
|
||||
2016-03-17 (bug)[fadc99] compile-5.3 (rodriguez,porter)
|
||||
|
||||
2016-03-17 (enhancement)[1a25fd] compile [variable ${ns}::v] (porter)
|
||||
|
||||
2016-03-20 (bug)[1af8de] crash in compiled [string replace] (harder,fellows)
|
||||
|
||||
2016-03-21 (bug)[d30718] segv in notifier finalize (hirofumi,nijtmans)
|
||||
|
||||
2016-03-23 (enhancement)[7d0db7] parallel make (yarda,nijtmans)
|
||||
|
||||
2016-03-23 [f12535] enable test bindings customization (vogel,nijtmans)
|
||||
|
||||
2016-04-04 (bug)[47ac84] compiled [lreplace] fixes (aspect,ferrieux,fellows)
|
||||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
|
||||
2016-04-08 (bug)[866368] RE \w includes 'Punctuation Connector' (nijtmans)
|
||||
|
||||
2016-04-08 (bug)[2538f3] Win crash Tcl_OpenTcpServer() (griffin)
|
||||
|
||||
2016-04-10 [07d13d] Restore TclBlend support lost in 8.6.1 (buratti)
|
||||
|
||||
2016-05-13 (bug)[3154ea] Mem corruption in assembler exceptions (tkob,kenny)
|
||||
|
||||
2016-05-13 (bug) registry package support any Unicode env (nijtmans)
|
||||
=> registry 1.3.2
|
||||
|
||||
2016-05-21 (bug)[f7d4e] [namespace delete] performance (fellows)
|
||||
|
||||
2016-06-02 (TIP 447) execution time verbosity option (cerutti)
|
||||
=> tcltest 2.4.0
|
||||
|
||||
2016-06-16 (bug)[16828b] crash due to [vwait] trace undo fail (dah,porter)
|
||||
|
||||
2016-06-16 (enhancement)[4b61af] good [info frame] from more cases (beric)
|
||||
|
||||
2016-06-21 (bug)[c383eb] crash in [glob -path a] (oehlmann,porter)
|
||||
|
||||
2016-06-21 (update) Update Unicode data to 9.0 (nijtmans)
|
||||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
|
||||
2016-06-22 (bug)[16896d] Tcl_DString tolerate append to self. (dah,porter)
|
||||
|
||||
2016-06-23 (bug)[d55322] crash in [dict update] (yorick,fellows)
|
||||
|
||||
2016-06-27 (bug)[dd260a] crash in [chan configure -dictionary] (madden,aspect)
|
||||
|
||||
2016-07-02 (bug)[f961d7] usage message with parameters with spaces (porter)
|
||||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
|
||||
2016-07-02 (enhancement)[09fabc] Sort order of -relateddir (lanam)
|
||||
|
||||
2016-07-07 (bug)[5d7ca0] Win: [file executable] for .cmd and .ps1 (nadkarni)
|
||||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
|
||||
2016-07-08 (bug)[a47641] [file normalize] & Windows junctions (nadkarni)
|
||||
|
||||
2016-07-09 [ae61a6] [file] handling of Win hardcoded names (CON) (nadkarni)
|
||||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
|
||||
2016-07-09 [3613671] [file owned] (more) useful on Win (nadkarni)
|
||||
|
||||
2016-07-09 (bug)[1493a4] [namespace upvar] use of resolvers (beric,fellows)
|
||||
*** POTENTIAL INCOMPATIBILITY ***
|
||||
|
||||
2016-07-10 (bug)[da340d] integer division in clock math (nadkarni)
|
||||
|
||||
2016-07-20 tzdata updated to Olson's tzdata2016f (venkat)
|
||||
|
||||
--- Released 8.6.6, July 27, 2016 --- http://core.tcl.tk/tcl/ for details
|
||||
|
||||
Binary file not shown.
+1
-1
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_Access 3 8.1 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
|
||||
+12
-12
@@ -17,7 +17,7 @@ Tcl_GetReturnOptions, Tcl_SetReturnOptions, Tcl_AddErrorInfo, Tcl_AppendObjToErr
|
||||
Tcl_Obj *
|
||||
\fBTcl_GetReturnOptions\fR(\fIinterp, code\fR)
|
||||
.sp
|
||||
int
|
||||
int
|
||||
\fBTcl_SetReturnOptions\fR(\fIinterp, options\fR)
|
||||
.sp
|
||||
\fBTcl_AddErrorInfo\fR(\fIinterp, message\fR)
|
||||
@@ -45,7 +45,7 @@ void
|
||||
.AS Tcl_Interp commandLength
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter in which to record information.
|
||||
.AP int code
|
||||
.AP int code
|
||||
The code returned from script evaluation.
|
||||
.AP Tcl_Obj *options
|
||||
A dictionary of return options.
|
||||
@@ -121,7 +121,7 @@ retrieve the stack trace when script evaluation returns
|
||||
.CS
|
||||
int code = Tcl_Eval(interp, script);
|
||||
if (code == TCL_ERROR) {
|
||||
Tcl_Obj *options = \fBTcl_GetReturnOptions\fR(interp, code);
|
||||
Tcl_Obj *options = \fBTcl_GetReturnOptions\fR(interp, code);
|
||||
Tcl_Obj *key = Tcl_NewStringObj("-errorinfo", -1);
|
||||
Tcl_Obj *stackTrace;
|
||||
Tcl_IncrRefCount(key);
|
||||
@@ -163,12 +163,12 @@ to any reference counting. This is analogous to
|
||||
.PP
|
||||
While \fBTcl_SetReturnOptions\fR provides a general interface
|
||||
to set any collection of return options, there are a handful
|
||||
of return options that are very frequently used. Most
|
||||
of return options that are very frequently used. Most
|
||||
notably the \fB\-errorinfo\fR and \fB\-errorcode\fR return
|
||||
options should be set properly when the command procedure
|
||||
of a command returns \fBTCL_ERROR\fR. The \fB\-errorline\fR
|
||||
return option is also read by commands that evaluate scripts
|
||||
and wish to supply detailed error location information in
|
||||
and wish to supply detailed error location information in
|
||||
the stack trace text they append to the \fB\-errorinfo\fR option.
|
||||
Tcl provides several simpler interfaces to more directly set
|
||||
these return options.
|
||||
@@ -224,7 +224,7 @@ is available as a \fBTcl_Obj\fR instead of as a \fBchar\fR array.
|
||||
.PP
|
||||
\fBTcl_AddObjErrorInfo\fR is nearly identical
|
||||
to \fBTcl_AddErrorInfo\fR, except that it has an additional \fIlength\fR
|
||||
argument. This allows the \fImessage\fR string to contain
|
||||
argument. This allows the \fImessage\fR string to contain
|
||||
embedded null bytes. This is essentially never a good idea.
|
||||
If the \fImessage\fR needs to contain the null character \fBU+0000\fR,
|
||||
Tcl's usual internal encoding rules should be used to avoid
|
||||
@@ -232,9 +232,9 @@ the need for a null byte. If the \fBTcl_AddObjErrorInfo\fR
|
||||
interface is used at all, it should be with a negative \fIlength\fR value.
|
||||
.PP
|
||||
The procedure \fBTcl_SetObjErrorCode\fR is used to set the
|
||||
\fB\-errorcode\fR return option to the list value \fIerrorObjPtr\fR
|
||||
built up by the caller.
|
||||
\fBTcl_SetObjErrorCode\fR is typically invoked just
|
||||
\fB\-errorcode\fR return option to the list value \fIerrorObjPtr\fR
|
||||
built up by the caller.
|
||||
\fBTcl_SetObjErrorCode\fR is typically invoked just
|
||||
before returning an error. If an error is
|
||||
returned without calling \fBTcl_SetObjErrorCode\fR or
|
||||
\fBTcl_SetErrorCode\fR the Tcl interpreter automatically sets
|
||||
@@ -275,7 +275,7 @@ the interpreter's result.
|
||||
\fBTcl_LogCommandInfo\fR is invoked after an error occurs in an
|
||||
interpreter. It adds information about the command that was being
|
||||
executed when the error occurred to the \fB\-errorinfo\fR value, and
|
||||
the line number stored internally in the interpreter is set.
|
||||
the line number stored internally in the interpreter is set.
|
||||
.PP
|
||||
In older releases of Tcl, there was no \fBTcl_GetReturnOptions\fR
|
||||
routine. In its place, the global Tcl variables \fBerrorInfo\fR
|
||||
@@ -288,7 +288,7 @@ global variables remains a supported way to access these
|
||||
return option values, it is important not to assume that
|
||||
writing to those global variables will properly set the
|
||||
corresponding return options. It has long been emphasized
|
||||
in this manual page that it is important to
|
||||
in this manual page that it is important to
|
||||
call the procedures described here rather than
|
||||
setting \fBerrorInfo\fR or \fBerrorCode\fR directly with
|
||||
\fBTcl_ObjSetVar2\fR.
|
||||
@@ -297,7 +297,7 @@ If the procedure \fBTcl_ResetResult\fR is called,
|
||||
it clears all of the state of the interpreter associated with
|
||||
script evaluation, including the entire return options dictionary.
|
||||
In particular, the \fB\-errorinfo\fR and \fB\-errorcode\fR options
|
||||
are reset.
|
||||
are reset.
|
||||
If an error had occurred, the \fBTcl_ResetResult\fR call will
|
||||
clear the error state to make it appear as if no error had
|
||||
occurred after all.
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_Alloc 3 7.5 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_AllowExceptions 3 7.4 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -31,7 +31,7 @@ return with an appropriate message. The particular script
|
||||
evaluation procedures of Tcl that act in the manner are
|
||||
\fBTcl_EvalObjEx\fR, \fBTcl_EvalObjv\fR, \fBTcl_Eval\fR, \fBTcl_EvalEx\fR,
|
||||
\fBTcl_GlobalEval\fR, \fBTcl_GlobalEvalObj\fR, \fBTcl_VarEval\fR and
|
||||
\fBTcl_VarEvalVA\fR.
|
||||
\fBTcl_VarEvalVA\fR.
|
||||
.PP
|
||||
However, if \fBTcl_AllowExceptions\fR is invoked immediately before
|
||||
calling one of those a procedures, then arbitrary completion
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_AppInit 3 7.0 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -52,7 +52,7 @@ Invoke a startup script to initialize the application.
|
||||
Use the routines \fBTcl_SetStartupScript\fR and
|
||||
\fBTcl_GetStartupScript\fR to set or query the file and encoding
|
||||
that the active \fBTcl_Main\fR or \fBTk_Main\fR routine will
|
||||
use as a startup script.
|
||||
use as a startup script.
|
||||
.LP
|
||||
\fBTcl_AppInit\fR returns \fBTCL_OK\fR or \fBTCL_ERROR\fR.
|
||||
If it returns \fBTCL_ERROR\fR then it must leave an error message in
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_SetAssocData 3 7.5 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_AsyncCreate 3 7.0 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_BackgroundError 3 7.5 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_Backslash 3 "8.1" Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -33,7 +33,7 @@ The use of \fBTcl_Backslash\fR is deprecated in favor of
|
||||
.PP
|
||||
This is a utility procedure provided for backwards compatibility with
|
||||
non-internationalized Tcl extensions. It parses a backslash sequence and
|
||||
returns the low byte of the Unicode character corresponding to the sequence.
|
||||
returns the low byte of the Unicode character corresponding to the sequence.
|
||||
\fBTcl_Backslash\fR modifies \fI*countPtr\fR to contain the number of
|
||||
characters in the backslash sequence.
|
||||
.PP
|
||||
|
||||
+5
-5
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_BooleanObj 3 8.5 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -50,7 +50,7 @@ value \fIboolValue\fR in it, and returns a pointer to the new Tcl_Obj.
|
||||
The new Tcl_Obj has reference count of zero.
|
||||
.PP
|
||||
\fBTcl_SetBooleanObj\fR accepts \fIobjPtr\fR, a pointer to
|
||||
an existing Tcl_Obj, and stores in the Tcl_Obj \fI*objPtr\fR
|
||||
an existing Tcl_Obj, and stores in the Tcl_Obj \fI*objPtr\fR
|
||||
the boolean value \fIboolValue\fR. This is a write operation
|
||||
on \fI*objPtr\fR, so \fIobjPtr\fR must be unshared. Attempts to
|
||||
write to a shared Tcl_Obj will panic. A successful write
|
||||
@@ -61,7 +61,7 @@ any former value stored in \fI*objPtr\fR.
|
||||
from the value stored in \fI*objPtr\fR.
|
||||
If \fIobjPtr\fR holds a string value recognized by \fBTcl_GetBoolean\fR,
|
||||
then the recognized boolean value is written at the address given
|
||||
by \fIboolPtr\fR.
|
||||
by \fIboolPtr\fR.
|
||||
If \fIobjPtr\fR holds any value recognized as
|
||||
a number by Tcl, then if that value is zero a 0 is written at
|
||||
the address given by \fIboolPtr\fR and if that
|
||||
@@ -69,10 +69,10 @@ value is non-zero a 1 is written at the address given by \fIboolPtr\fR.
|
||||
In all cases where a value is written at the address given
|
||||
by \fIboolPtr\fR, \fBTcl_GetBooleanFromObj\fR returns \fBTCL_OK\fR.
|
||||
If the value of \fIobjPtr\fR does not meet any of the conditions
|
||||
above, then \fBTCL_ERROR\fR is returned and an error message is
|
||||
above, then \fBTCL_ERROR\fR is returned and an error message is
|
||||
left in the interpreter's result unless \fIinterp\fR is NULL.
|
||||
\fBTcl_GetBooleanFromObj\fR may also make changes to the internal
|
||||
fields of \fI*objPtr\fR so that future calls to
|
||||
fields of \fI*objPtr\fR so that future calls to
|
||||
\fBTcl_GetBooleanFromObj\fR on the same \fIobjPtr\fR can be
|
||||
performed more efficiently.
|
||||
.PP
|
||||
|
||||
+4
-4
@@ -3,12 +3,12 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_ByteArrayObj 3 8.1 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
.SH NAME
|
||||
Tcl_NewByteArrayObj, Tcl_SetByteArrayObj, Tcl_GetByteArrayFromObj, Tcl_SetByteArrayLength \- manipulate Tcl values as a arrays of bytes
|
||||
Tcl_NewByteArrayObj, Tcl_SetByteArrayObj, Tcl_GetByteArrayFromObj, Tcl_SetByteArrayLength \- manipulate Tcl values as a arrays of bytes
|
||||
.SH SYNOPSIS
|
||||
.nf
|
||||
\fB#include <tcl.h>\fR
|
||||
@@ -16,7 +16,7 @@ Tcl_NewByteArrayObj, Tcl_SetByteArrayObj, Tcl_GetByteArrayFromObj, Tcl_SetByteAr
|
||||
Tcl_Obj *
|
||||
\fBTcl_NewByteArrayObj\fR(\fIbytes, length\fR)
|
||||
.sp
|
||||
void
|
||||
void
|
||||
\fBTcl_SetByteArrayObj\fR(\fIobjPtr, bytes, length\fR)
|
||||
.sp
|
||||
unsigned char *
|
||||
@@ -82,7 +82,7 @@ allocated for the array, the array is reallocated to the new length; the
|
||||
newly allocated bytes at the end of the array have arbitrary values. If
|
||||
\fIlength\fR is less than the space currently allocated for the array,
|
||||
the length of array is reduced to the new length. The return value is a
|
||||
pointer to the value's new array of bytes.
|
||||
pointer to the value's new array of bytes.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
Tcl_GetStringFromObj, Tcl_NewObj, Tcl_IncrRefCount, Tcl_DecrRefCount
|
||||
|
||||
+4
-4
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_Cancel 3 8.6 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -53,10 +53,10 @@ Any ORed combination of the following values may be used for the
|
||||
\fBTCL_CANCEL_UNWIND\fR
|
||||
.
|
||||
This flag is used by \fBTcl_CancelEval\fR and \fBTcl_Canceled\fR.
|
||||
For \fBTcl_CancelEval\fR, if this flag is set, the script in progress
|
||||
For \fBTcl_CancelEval\fR, if this flag is set, the script in progress
|
||||
is canceled and the evaluation stack for the interpreter is unwound.
|
||||
For \fBTcl_Canceled\fR, if this flag is set, the script in progress
|
||||
is considered to be canceled only if the evaluation stack for the
|
||||
For \fBTcl_Canceled\fR, if this flag is set, the script in progress
|
||||
is considered to be canceled only if the evaluation stack for the
|
||||
interpreter is being unwound.
|
||||
.TP 20
|
||||
\fBTCL_LEAVE_ERR_MSG\fR
|
||||
|
||||
+5
-5
@@ -639,13 +639,13 @@ called to set them, e.g. \fB\-blockmode\fR. Other options are specific to
|
||||
each channel type and the \fIsetOptionProc\fR procedure of the channel
|
||||
driver will get called to implement them. The \fIsetOptionProc\fR field can
|
||||
be NULL, which indicates that this channel type supports no type specific
|
||||
options.
|
||||
options.
|
||||
.PP
|
||||
If the option value is successfully modified to the new value, the function
|
||||
returns \fBTCL_OK\fR.
|
||||
It should call \fBTcl_BadChannelOption\fR which itself returns
|
||||
\fBTCL_ERROR\fR if the \fIoptionName\fR is
|
||||
unrecognized.
|
||||
unrecognized.
|
||||
If \fInewValue\fR specifies a value for the option that
|
||||
is not supported or if a system call error occurs,
|
||||
the function should leave an error message in the
|
||||
@@ -674,7 +674,7 @@ channel. If the option name is not NULL, the function stores its current
|
||||
value, as a string, in the Tcl dynamic string \fIoptionValue\fR.
|
||||
If \fIoptionName\fR is NULL, the function stores in \fIoptionValue\fR an
|
||||
alternating list of all supported options and their current values.
|
||||
On success, the function returns \fBTCL_OK\fR.
|
||||
On success, the function returns \fBTCL_OK\fR.
|
||||
It should call \fBTcl_BadChannelOption\fR which itself returns
|
||||
\fBTCL_ERROR\fR if the \fIoptionName\fR is
|
||||
unrecognized. If a system call error occurs,
|
||||
@@ -839,7 +839,7 @@ which returns a pointer to the function.
|
||||
This procedure generates a
|
||||
.QW "bad option"
|
||||
error message in an
|
||||
(optional) interpreter. It is used by channel drivers when
|
||||
(optional) interpreter. It is used by channel drivers when
|
||||
an invalid Set/Get option is requested. Its purpose is to concatenate
|
||||
the generic options list to the specific ones and factorize
|
||||
the generic options error message string.
|
||||
@@ -850,7 +850,7 @@ An error message is generated in \fIinterp\fR's result value to
|
||||
indicate that a command was invoked with a bad option.
|
||||
The message has the form
|
||||
.CS
|
||||
bad option "blah": should be one of
|
||||
bad option "blah": should be one of
|
||||
<...generic options...>+<...specific options...>
|
||||
.CE
|
||||
so you get for instance:
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_CreateCommand 3 "" Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -91,7 +91,7 @@ the command, \fIargc\fR giving the number of arguments (including
|
||||
the command name) and \fIargv\fR giving the values of the arguments
|
||||
as strings. The \fIargv\fR array will contain \fIargc\fR+1 values;
|
||||
the first \fIargc\fR values point to the argument strings, and the
|
||||
last value is NULL.
|
||||
last value is NULL.
|
||||
Note that the argument strings should not be modified as they may
|
||||
point to constant strings or may be shared with other parts of the
|
||||
interpreter.
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_CreateMathFunc 3 8.4 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -147,7 +147,7 @@ released by passing it to \fBTcl_Free\fR. Some functions (the
|
||||
standard set implemented in the core, and those defined by placing
|
||||
commands in the \fBtcl::mathfunc\fR namespace) do not have
|
||||
argument type information; attempting to retrieve values for
|
||||
them causes a NULL to be stored in the variable pointed to by
|
||||
them causes a NULL to be stored in the variable pointed to by
|
||||
\fIprocPtr\fR and the variable pointed to by \fIclientDataPtr\fR
|
||||
will not be modified. The variable pointed to by \fInumArgsPointer\fR
|
||||
will contain -1, and no argument types will be stored in the variable
|
||||
|
||||
+3
-3
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_CreateObjCommand 3 8.0 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -150,7 +150,7 @@ However, if the existing command was created by a previous call to
|
||||
but instead arranges for the Tcl interpreter to call the
|
||||
\fBTcl_ObjCmdProc\fR \fIproc\fR in the future.
|
||||
The old string-based \fBTcl_CmdProc\fR associated with the command
|
||||
is retained and its address can be obtained by subsequent
|
||||
is retained and its address can be obtained by subsequent
|
||||
\fBTcl_GetCommandInfo\fR calls. This is done for backwards compatibility.
|
||||
.PP
|
||||
\fIDeleteProc\fR will be invoked when (if) \fIname\fR is deleted.
|
||||
@@ -288,7 +288,7 @@ command is not deleted or renamed; callers should copy the string if
|
||||
they need to keep it for a long time.
|
||||
.PP
|
||||
\fBTcl_GetCommandFullName\fR produces the fully qualified name
|
||||
of a command from a command token.
|
||||
of a command from a command token.
|
||||
The name, including all namespace prefixes,
|
||||
is appended to the value specified by \fIobjPtr\fR.
|
||||
.PP
|
||||
|
||||
+5
-5
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_CreateSlave 3 7.6 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -122,8 +122,8 @@ is either \fBTCL_OK\fR or \fBTCL_ERROR\fR. If \fBTCL_ERROR\fR is returned
|
||||
then the \fBresult\fR field of the interpreter contains an error message.
|
||||
.PP
|
||||
\fBTcl_CreateSlave\fR creates a new interpreter as a slave of \fIinterp\fR.
|
||||
It also creates a slave command named \fIslaveName\fR in \fIinterp\fR which
|
||||
allows \fIinterp\fR to manipulate the new slave.
|
||||
It also creates a slave command named \fIslaveName\fR in \fIinterp\fR which
|
||||
allows \fIinterp\fR to manipulate the new slave.
|
||||
If \fIisSafe\fR is zero, the command creates a trusted slave in which Tcl
|
||||
code has access to all the Tcl commands.
|
||||
If it is \fB1\fR, the command creates a
|
||||
@@ -178,7 +178,7 @@ created by \fBTcl_CreateSlave\fR) between \fIslaveInterp\fR and
|
||||
\fItargetInterp\fR. Any two interpreters can be used, without any
|
||||
restrictions on how they are related.
|
||||
.PP
|
||||
\fBTcl_CreateAliasObj\fR is similar to \fBTcl_CreateAlias\fR except
|
||||
\fBTcl_CreateAliasObj\fR is similar to \fBTcl_CreateAlias\fR except
|
||||
that it takes a vector of values to pass as additional arguments instead
|
||||
of a vector of strings.
|
||||
.PP
|
||||
@@ -196,7 +196,7 @@ strings.
|
||||
\fBTcl_ExposeCommand\fR moves the command named \fIhiddenCmdName\fR from
|
||||
the set of hidden commands to the set of exposed commands, putting
|
||||
it under the name
|
||||
\fIcmdName\fR.
|
||||
\fIcmdName\fR.
|
||||
\fIHiddenCmdName\fR must be the name of an existing hidden
|
||||
command, or the operation will return \fBTCL_ERROR\fR and leave an error
|
||||
message in the \fIresult\fR field in \fIinterp\fR.
|
||||
|
||||
+3
-3
@@ -5,7 +5,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_CreateTrace 3 "" Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -65,7 +65,7 @@ interpreter.
|
||||
\fBTcl_CmdObjTraceProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
typedef int \fBTcl_CmdObjTraceProc\fR(
|
||||
typedef int \fBTcl_CmdObjTraceProc\fR(
|
||||
\fBClientData\fR \fIclientData\fR,
|
||||
\fBTcl_Interp\fR* \fIinterp\fR,
|
||||
int \fIlevel\fR,
|
||||
@@ -143,7 +143,7 @@ When \fBTcl_DeleteTrace\fR is called, the interpreter invokes the
|
||||
\fBTcl_CmdObjTraceDeleteProc\fR:
|
||||
.PP
|
||||
.CS
|
||||
typedef void \fBTcl_CmdObjTraceDeleteProc\fR(
|
||||
typedef void \fBTcl_CmdObjTraceDeleteProc\fR(
|
||||
\fBClientData\fR \fIclientData\fR);
|
||||
.CE
|
||||
.PP
|
||||
|
||||
+3
-3
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_DoOneEvent 3 7.5 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -20,7 +20,7 @@ int
|
||||
.AS int flags
|
||||
.AP int flags in
|
||||
This parameter is normally zero. It may be an OR-ed combination
|
||||
of any of the following flag bits:
|
||||
of any of the following flag bits:
|
||||
\fBTCL_WINDOW_EVENTS\fR, \fBTCL_FILE_EVENTS\fR,
|
||||
\fBTCL_TIMER_EVENTS\fR, \fBTCL_IDLE_EVENTS\fR, \fBTCL_ALL_EVENTS\fR,
|
||||
or \fBTCL_DONT_WAIT\fR.
|
||||
@@ -43,7 +43,7 @@ handlers for the first event on the queue, and returns.
|
||||
If no events are found, \fBTcl_DoOneEvent\fR checks for \fBTcl_DoWhenIdle\fR
|
||||
callbacks; if any are found, it invokes all of them and returns.
|
||||
Finally, if no events or idle callbacks have been found, then
|
||||
\fBTcl_DoOneEvent\fR sleeps until an event occurs; then it adds any
|
||||
\fBTcl_DoOneEvent\fR sleeps until an event occurs; then it adds any
|
||||
new events to the Tcl event queue, calls handlers for the first event,
|
||||
and returns.
|
||||
The normal return value is 1 to signify that some event
|
||||
|
||||
+3
-3
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_DoubleObj 3 8.0 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -28,7 +28,7 @@ A double-precision floating-point value used to initialize or set a Tcl value.
|
||||
For \fBTcl_SetDoubleObj\fR, this points to the value in which to store a
|
||||
double value.
|
||||
For \fBTcl_GetDoubleFromObj\fR, this refers to the value
|
||||
from which to retrieve a double value.
|
||||
from which to retrieve a double value.
|
||||
.AP Tcl_Interp *interp in/out
|
||||
When non-NULL, an error message is left here when double value retrieval fails.
|
||||
.AP double *doublePtr out
|
||||
@@ -56,7 +56,7 @@ returned, and the double value is written to the storage pointed to by
|
||||
\fIdoublePtr\fR. If the attempt fails, then \fBTCL_ERROR\fR is returned,
|
||||
and if \fIinterp\fR is non-NULL, an error message is left in \fIinterp\fR.
|
||||
The \fBTcl_ObjType\fR of \fIobjPtr\fR may be changed to make subsequent
|
||||
calls to \fBTcl_GetDoubleFromObj\fR more efficient.
|
||||
calls to \fBTcl_GetDoubleFromObj\fR more efficient.
|
||||
'\" TODO: add discussion of treatment of NaN value
|
||||
.SH "SEE ALSO"
|
||||
Tcl_NewObj, Tcl_DecrRefCount, Tcl_IncrRefCount, Tcl_GetObjResult
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
'\" Copyright (c) 1992-1999 Karl Lehenbauer and Mark Diekhans.
|
||||
'\" Copyright (c) 2000 by Scriptics Corporation.
|
||||
'\" All rights reserved.
|
||||
'\"
|
||||
'\"
|
||||
.TH "Tcl_DumpActiveMemory" 3 8.1 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -39,7 +39,7 @@ These functions provide access to Tcl memory debugging information.
|
||||
They are only functional when Tcl has been compiled with
|
||||
\fBTCL_MEM_DEBUG\fR defined at compile-time. When \fBTCL_MEM_DEBUG\fR
|
||||
is not defined, these functions are all no-ops.
|
||||
.PP
|
||||
.PP
|
||||
\fBTcl_DumpActiveMemory\fR will output a list of all currently
|
||||
allocated memory to the specified file. The information output for
|
||||
each allocated block of memory is: starting and ending addresses
|
||||
|
||||
+3
-3
@@ -3,9 +3,9 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
'\" This documents the C API introduced in TIP#235
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_Ensemble 3 8.5 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -185,7 +185,7 @@ the bound namespace. May be read and written using
|
||||
\fBTcl_GetEnsembleSubcommandList\fR and
|
||||
\fBTcl_SetEnsembleSubcommandList\fR respectively. The result of both
|
||||
of those functions is a Tcl result code (\fBTCL_OK\fR, or
|
||||
\fBTCL_ERROR\fR if the
|
||||
\fBTCL_ERROR\fR if the
|
||||
token does not refer to an ensemble) and the list obtained from
|
||||
\fBTcl_GetEnsembleSubcommandList\fR should always be treated as
|
||||
immutable even if it is unshared.
|
||||
|
||||
+3
-3
@@ -5,7 +5,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_Eval 3 8.1 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -116,7 +116,7 @@ of the words for the Tcl command, one word in each value in
|
||||
a completion code and result just like \fBTcl_EvalObjEx\fR.
|
||||
The caller of \fBTcl_EvalObjv\fR has to manage the reference count of the
|
||||
elements of \fIobjv\fR, insuring that the values are valid until
|
||||
\fBTcl_EvalObjv\fR returns.
|
||||
\fBTcl_EvalObjv\fR returns.
|
||||
.PP
|
||||
\fBTcl_Eval\fR is similar to \fBTcl_EvalObjEx\fR except that the script to
|
||||
be executed is supplied as a string instead of a value and no compilation
|
||||
@@ -127,7 +127,7 @@ might be a UTF-8 special code. The string is parsed and executed directly
|
||||
(using \fBTcl_EvalObjv\fR) instead of compiling it and executing the
|
||||
bytecodes. In situations where it is known that the script will never be
|
||||
executed again, \fBTcl_Eval\fR may be faster than \fBTcl_EvalObjEx\fR.
|
||||
\fBTcl_Eval\fR returns a completion code and result just like
|
||||
\fBTcl_Eval\fR returns a completion code and result just like
|
||||
\fBTcl_EvalObjEx\fR. Note: for backward compatibility with versions before
|
||||
Tcl 8.0, \fBTcl_Eval\fR copies the value result in \fIinterp\fR to
|
||||
\fIinterp->result\fR (use is deprecated) where it can be accessed directly.
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_Exit 3 8.5 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -120,7 +120,7 @@ If extension \fBA\fR registers its exit handlers before loading extension
|
||||
\fBB\fR, this ensures that any exit handlers for \fBB\fR will be executed
|
||||
before the exit handlers for \fBA\fR.
|
||||
.PP
|
||||
\fBTcl_Finalize\fR and \fBTcl_Exit\fR call \fBTcl_FinalizeThread\fR
|
||||
\fBTcl_Finalize\fR and \fBTcl_Exit\fR call \fBTcl_FinalizeThread\fR
|
||||
and the thread exit handlers \fIafter\fR
|
||||
the process-wide exit handlers. This is because thread finalization shuts
|
||||
down the I/O channel system, so any attempt at I/O by the global exit
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_ExprLong 3 7.0 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -30,7 +30,7 @@ int
|
||||
.AP Tcl_Interp *interp in
|
||||
Interpreter in whose context to evaluate \fIexpr\fR.
|
||||
.AP "const char" *expr in
|
||||
Expression to be evaluated.
|
||||
Expression to be evaluated.
|
||||
.AP long *longPtr out
|
||||
Pointer to location in which to store the integer value of the
|
||||
expression.
|
||||
|
||||
+6
-6
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Filesystem 3 8.4 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -464,8 +464,8 @@ directory for all files which match a given pattern. The appropriate
|
||||
function for the filesystem to which \fIpathPtr\fR belongs will be called.
|
||||
.PP
|
||||
The return value is a standard Tcl result indicating whether an error
|
||||
occurred in globbing. Error messages are placed in interp (unless
|
||||
interp is NULL, which is allowed), but good results are placed in the
|
||||
occurred in globbing. Error messages are placed in interp (unless
|
||||
interp is NULL, which is allowed), but good results are placed in the
|
||||
resultPtr given.
|
||||
.PP
|
||||
Note that the \fBglob\fR code implements recursive patterns internally, so
|
||||
@@ -1256,8 +1256,8 @@ not, so code should be flexible to both possibilities.
|
||||
The return value is a standard Tcl result indicating whether an error
|
||||
occurred in the matching process. Error messages are placed in
|
||||
\fIinterp\fR, unless \fIinterp\fR in NULL in which case no error
|
||||
message need be generated; on a \fBTCL_OK\fR result, results should be
|
||||
added to the \fIresultPtr\fR value given (which can be assumed to be a
|
||||
message need be generated; on a \fBTCL_OK\fR result, results should be
|
||||
added to the \fIresultPtr\fR value given (which can be assumed to be a
|
||||
valid unshared Tcl list). The matches added
|
||||
to \fIresultPtr\fR should include any path prefix given in \fIpathPtr\fR
|
||||
(this usually means they will be absolute path specifications).
|
||||
@@ -1265,7 +1265,7 @@ Note that if no matches are found, that simply leads to an empty
|
||||
result; errors are only signaled for actual file or filesystem
|
||||
problems which may occur during the matching process.
|
||||
.PP
|
||||
The \fBTcl_GlobTypeData\fR structure passed in the \fItypes\fR
|
||||
The \fBTcl_GlobTypeData\fR structure passed in the \fItypes\fR
|
||||
parameter contains the following fields:
|
||||
.PP
|
||||
.CS
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1998-2000 by Scriptics Corporation.
|
||||
'\" All rights reserved.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_GetHostName 3 8.3 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -18,7 +18,7 @@ const char *
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTcl_GetHostName\fR is a utility procedure used by some of the
|
||||
Tcl commands. It returns a pointer to a string containing the name
|
||||
Tcl commands. It returns a pointer to a string containing the name
|
||||
for the current machine, or an empty string if the name cannot be
|
||||
determined. The string is statically allocated, and the caller must
|
||||
not modify of free it.
|
||||
|
||||
+5
-5
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_GetStdChannel 3 7.5 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -34,18 +34,18 @@ Tcl defines three special channels that are used by various I/O related
|
||||
commands if no other channels are specified. The standard input channel
|
||||
has a channel name of \fBstdin\fR and is used by \fBread\fR and \fBgets\fR.
|
||||
The standard output channel is named \fBstdout\fR and is used by
|
||||
\fBputs\fR. The standard error channel is named \fBstderr\fR and is used for
|
||||
\fBputs\fR. The standard error channel is named \fBstderr\fR and is used for
|
||||
reporting errors. In addition, the standard channels are inherited by any
|
||||
child processes created using \fBexec\fR or \fBopen\fR in the absence of any
|
||||
other redirections.
|
||||
.PP
|
||||
The standard channels are actually aliases for other normal channels. The
|
||||
current channel associated with a standard channel can be retrieved by calling
|
||||
\fBTcl_GetStdChannel\fR with one of
|
||||
\fBTcl_GetStdChannel\fR with one of
|
||||
\fBTCL_STDIN\fR, \fBTCL_STDOUT\fR, or \fBTCL_STDERR\fR as the \fItype\fR. The
|
||||
return value will be a valid channel, or NULL.
|
||||
.PP
|
||||
A new channel can be set for the standard channel specified by \fItype\fR
|
||||
A new channel can be set for the standard channel specified by \fItype\fR
|
||||
by calling \fBTcl_SetStdChannel\fR with a new channel or NULL in the
|
||||
\fIchannel\fR argument. If the specified channel is closed by a later call to
|
||||
\fBTcl_Close\fR, then the corresponding standard channel will automatically be
|
||||
@@ -64,7 +64,7 @@ be corrected without contradicting the assumptions of some existing
|
||||
code that calls \fBTcl_SetStdChannel\fR.
|
||||
.PP
|
||||
If \fBTcl_GetStdChannel\fR is called before \fBTcl_SetStdChannel\fR, Tcl will
|
||||
construct a new channel to wrap the appropriate platform-specific standard
|
||||
construct a new channel to wrap the appropriate platform-specific standard
|
||||
file handle. If \fBTcl_SetStdChannel\fR is called before
|
||||
\fBTcl_GetStdChannel\fR, then the default channel will not be created.
|
||||
.PP
|
||||
|
||||
+4
-4
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_GetVersion 3 7.5 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -24,14 +24,14 @@ Minor version number of the Tcl library.
|
||||
The patch level of the Tcl library (or alpha or beta number).
|
||||
.AP Tcl_ReleaseType *type out
|
||||
The type of release, also indicates the type of patch level. Can be
|
||||
one of \fBTCL_ALPHA_RELEASE\fR, \fBTCL_BETA_RELEASE\fR, or
|
||||
one of \fBTCL_ALPHA_RELEASE\fR, \fBTCL_BETA_RELEASE\fR, or
|
||||
\fBTCL_FINAL_RELEASE\fR.
|
||||
.BE
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
\fBTcl_GetVersion\fR should be used to query the version number
|
||||
of the Tcl library at runtime. This is useful when using a
|
||||
of the Tcl library at runtime. This is useful when using a
|
||||
dynamically loaded Tcl library or when writing a stubs-aware
|
||||
extension. For instance, if you write an extension that is
|
||||
linked against the Tcl stubs library, it could be loaded into
|
||||
@@ -39,7 +39,7 @@ a program linked to an older version of Tcl than you expected.
|
||||
Use \fBTcl_GetVersion\fR to verify that fact, and possibly to
|
||||
change the behavior of your extension.
|
||||
.PP
|
||||
\fBTcl_GetVersion\fR accepts NULL for any of the arguments. For instance if
|
||||
\fBTcl_GetVersion\fR accepts NULL for any of the arguments. For instance if
|
||||
you do not care about the \fIpatchLevel\fR of the library, pass
|
||||
a NULL for the \fIpatchLevel\fR argument.
|
||||
|
||||
|
||||
+5
-5
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_Hash 3 "" Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -131,13 +131,13 @@ The pointer value is the key; it need not (and usually does not)
|
||||
actually point to a string.
|
||||
.IP \fBTCL_CUSTOM_TYPE_KEYS\fR 25
|
||||
Keys are of arbitrary type, and are stored in the entry. Hashing
|
||||
and comparison is determined by \fItypePtr\fR. The Tcl_HashKeyType
|
||||
structure is described in the section
|
||||
and comparison is determined by \fItypePtr\fR. The Tcl_HashKeyType
|
||||
structure is described in the section
|
||||
\fBTHE TCL_HASHKEYTYPE STRUCTURE\fR below.
|
||||
.IP \fBTCL_CUSTOM_PTR_KEYS\fR 25
|
||||
Keys are pointers to an arbitrary type, and are stored in the entry. Hashing
|
||||
and comparison is determined by \fItypePtr\fR. The Tcl_HashKeyType
|
||||
structure is described in the section
|
||||
and comparison is determined by \fItypePtr\fR. The Tcl_HashKeyType
|
||||
structure is described in the section
|
||||
\fBTHE TCL_HASHKEYTYPE STRUCTURE\fR below.
|
||||
.IP \fIother\fR 25
|
||||
If \fIkeyType\fR is not one of the above,
|
||||
|
||||
+3
-3
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_IntObj 3 8.5 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -87,7 +87,7 @@ used to initialize a multi-precision integer value.
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
These procedures are used to create, modify, and read Tcl values
|
||||
that hold integral values.
|
||||
that hold integral values.
|
||||
.PP
|
||||
The different routines exist to accommodate different integral types in C
|
||||
with which values might be exchanged. The C integral types for which Tcl
|
||||
@@ -99,7 +99,7 @@ typedef defined to be whatever signed integral type covers at least the
|
||||
on the platform and the C compiler, the actual type might be
|
||||
\fBlong int\fR, \fBlong long int\fR, \fBint64\fR, or something else.
|
||||
The \fBmp_int\fR type is a multiple-precision integer type defined
|
||||
by the LibTomMath multiple-precision integer library.
|
||||
by the LibTomMath multiple-precision integer library.
|
||||
.PP
|
||||
The \fBTcl_NewIntObj\fR, \fBTcl_NewLongObj\fR, \fBTcl_NewWideIntObj\fR,
|
||||
and \fBTcl_NewBignumObj\fR routines each create and return a new
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_Interp 3 7.5 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -76,7 +76,7 @@ and store a pointer to it in \fIinterp->result\fR.
|
||||
In this case, the command procedure must also set \fIinterp->freeProc\fR
|
||||
to the address of a procedure that can free the value, or \fBTCL_DYNAMIC\fR
|
||||
if the storage was allocated directly by Tcl or by a call to
|
||||
\fBTcl_Alloc\fR.
|
||||
\fBTcl_Alloc\fR.
|
||||
If \fIinterp->freeProc\fR is non-zero, then Tcl will call \fIfreeProc\fR
|
||||
to free the space pointed to by \fIinterp->result\fR before it
|
||||
invokes the next command.
|
||||
|
||||
+3441
File diff suppressed because it is too large
Load Diff
Executable
+253
@@ -0,0 +1,253 @@
|
||||
#!../../unix/tclsh
|
||||
|
||||
int
|
||||
main(string av[])
|
||||
{
|
||||
FILE f;
|
||||
int i, ul;
|
||||
int space = 0, dd = 0, p = 0, pre = 0;
|
||||
string buf, c, tmp, title, trim, all[];
|
||||
|
||||
/*
|
||||
* -t<title> or --title=<title>
|
||||
*/
|
||||
while (c = getopt(av, "t:", {"title:"})) {
|
||||
switch (c) {
|
||||
case "t":
|
||||
case "title":
|
||||
title = optarg;
|
||||
break;
|
||||
}
|
||||
}
|
||||
unless (av[optind] && (f = fopen(av[optind], "r"))) {
|
||||
die("usage: ${av[0]} filename");
|
||||
}
|
||||
unless (title) title = av[optind];
|
||||
|
||||
header(title);
|
||||
|
||||
/*
|
||||
* Load up the whole file in all[] and spit out the index.
|
||||
*/
|
||||
puts("<ul>");
|
||||
ul = 1;
|
||||
while (buf = <f>) {
|
||||
push(&all, buf);
|
||||
if (buf =~ /^=head(\d+)\s+(.*)/) {
|
||||
i = (int)$1;
|
||||
while (ul > i) {
|
||||
puts("</ul>");
|
||||
ul--;
|
||||
}
|
||||
while (i > ul) {
|
||||
puts("<ul>");
|
||||
ul++;
|
||||
}
|
||||
tmp = $2;
|
||||
tmp =~ s/\s+/_/g;
|
||||
buf =~ s/^=head(\d+)\s+//;
|
||||
puts("<li><a href=\"#${tmp}\">${buf}</a></li>");
|
||||
}
|
||||
}
|
||||
while (ul--) puts("</ul>");
|
||||
fclose(f);
|
||||
|
||||
/*
|
||||
* Now walk all[] and process the markup. We currently handle:
|
||||
* =head%d title
|
||||
* =over
|
||||
* =item name
|
||||
* =proto return_type func(args)
|
||||
* =back
|
||||
* <blank line>
|
||||
* B<bold this>
|
||||
* C<some code>
|
||||
* I<italics>
|
||||
*/
|
||||
// The <= is intentional to run an empty string through at the end
|
||||
// to kick out any final </pre> etc.
|
||||
for (i = 0; i <= length(all); i++) {
|
||||
buf = inline(all[i]);
|
||||
if (buf =~ /^=head(\d+)\s+(.*)/) {
|
||||
if ((int)$1 == 1) puts("<HR>");
|
||||
tmp = $2;
|
||||
tmp =~ s/\s+/_/g;
|
||||
printf("<H%d><a name=\"%s\">%s</a></H%d>\n",
|
||||
$1, tmp, $2, $1);
|
||||
} else if (buf =~ /^=over/) {
|
||||
puts("<dl>");
|
||||
} else if (buf =~ /^=item\s+(.*)/) {
|
||||
if (dd) {
|
||||
puts("</dd>");
|
||||
dd--;
|
||||
}
|
||||
puts("<dt><strong>${$1}</strong></dt><dd>");
|
||||
dd++;
|
||||
} else if (buf =~ /^=proto\s+([^ \t]+)\s+(.*)/) {
|
||||
if (dd) {
|
||||
puts("</dd>");
|
||||
dd--;
|
||||
}
|
||||
puts("<dt><b>${$1} ${$2}</b></dt><dd>");
|
||||
dd++;
|
||||
} else if (buf =~ /^=back/) {
|
||||
if (dd) {
|
||||
puts("</dd>");
|
||||
dd--;
|
||||
}
|
||||
puts("</dl>");
|
||||
} else if (buf =~ /^\s*$/) {
|
||||
if (p) {
|
||||
puts("</p>");
|
||||
p = 0;
|
||||
}
|
||||
if (pre) {
|
||||
/*
|
||||
* If we see a blank line in a preformatted
|
||||
* block, we don't want to stop the pre
|
||||
* unless the next line is not indented.
|
||||
* So peek ahead.
|
||||
*/
|
||||
if (defined(buf = all[i+1]) && (buf =~ /^\s/)) {
|
||||
puts("");
|
||||
continue;
|
||||
}
|
||||
puts("</pre>");
|
||||
pre = 0;
|
||||
trim = undef;
|
||||
}
|
||||
space = 1;
|
||||
} else {
|
||||
if (space) {
|
||||
if (buf =~ /^(\s+)[^ \t]+/) {
|
||||
trim = $1;
|
||||
puts("<pre>");
|
||||
pre = 1;
|
||||
} else {
|
||||
puts("<p>");
|
||||
p = 1;
|
||||
}
|
||||
space = 0;
|
||||
}
|
||||
if (defined(trim)) buf =~ s/^${trim}//;
|
||||
puts(buf);
|
||||
}
|
||||
}
|
||||
puts("</body></html>");
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* header and style sheet
|
||||
*/
|
||||
void
|
||||
header(string title)
|
||||
{
|
||||
string head = <<EOF
|
||||
<html>
|
||||
<head>
|
||||
<title>${title}</title>
|
||||
<style>
|
||||
pre {
|
||||
background: #eeeedd;
|
||||
border-width: 1px;
|
||||
border-style: solid solid solid solid;
|
||||
border-color: #ccc;
|
||||
padding: 5px 5px 5px 5px;
|
||||
font-family: monospace;
|
||||
font-weight: bolder;
|
||||
}
|
||||
body {
|
||||
padding-left: 10px;
|
||||
}
|
||||
dt {
|
||||
font-size: large;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
EOF
|
||||
puts(head);
|
||||
puts("<h1>${title}</h1>");
|
||||
}
|
||||
|
||||
/*
|
||||
* Process B<bold>, C<code>, I<italic>, F<italic>, L<link>, S<non-breaking>.
|
||||
* This will handle nested stuff like C<if (!I<condition>)>
|
||||
* but dies if there are nested ones of the same type, i.e.,
|
||||
* C<whatever C<some more>>
|
||||
*/
|
||||
string
|
||||
inline(string buf)
|
||||
{
|
||||
string c, prev, result = "", link, stack[];
|
||||
int B = 0, C = 0, I = 0, L = 0, S = 0;
|
||||
|
||||
unless (buf) buf = "";
|
||||
foreach (c in buf) {
|
||||
if ((c == "<") && prev) {
|
||||
if (prev == "B") {
|
||||
if (B++) die("Nested B<> unsupported: ${buf}");
|
||||
result[END] = "";
|
||||
result .= "<B>";
|
||||
push(&stack, "B");
|
||||
} else if (prev == "C") {
|
||||
if (C++) die("Nested C<> unsupported: ${buf}");
|
||||
result[END] = "";
|
||||
result .= "<CODE>";
|
||||
push(&stack, "CODE");
|
||||
} else if (prev == "I" || prev == "F") {
|
||||
if (I++) die("Nested I<> unsupported: ${buf}");
|
||||
result[END] = "";
|
||||
result .= "<I>";
|
||||
push(&stack, "I");
|
||||
} else if (prev == "L") {
|
||||
if (L++) die("Nested L<> unsupported: ${buf}");
|
||||
result[END] = "";
|
||||
result .= "<a href=\"";
|
||||
link = "";
|
||||
push(&stack, "L");
|
||||
} else if (prev == "S") {
|
||||
if (S++) die("Nested S<> unsupported: ${buf}");
|
||||
result[END] = "";
|
||||
push(&stack, "S");
|
||||
} else {
|
||||
result .= "<";
|
||||
prev = c;
|
||||
}
|
||||
} else if ((c == ">") && length(stack)) {
|
||||
c = pop(&stack);
|
||||
if (c == "B") {
|
||||
B--;
|
||||
} else if (c == "CODE") {
|
||||
C--;
|
||||
} else if (c == "I") {
|
||||
I--;
|
||||
} else if (c == "L") {
|
||||
L--;
|
||||
result .= "\">${link}</a>";
|
||||
c = undef;
|
||||
} else {
|
||||
S--;
|
||||
c = undef;
|
||||
}
|
||||
if (c) {
|
||||
result .= "</" . c . ">";
|
||||
}
|
||||
prev = undef;
|
||||
} else {
|
||||
if (S && isspace(c)) {
|
||||
result .= " ";
|
||||
} else if (c == "<") {
|
||||
result .= "<";
|
||||
} else if (c == ">") {
|
||||
result .= ">";
|
||||
} else {
|
||||
result .= c;
|
||||
}
|
||||
if (L) link .= c;
|
||||
prev = c;
|
||||
}
|
||||
}
|
||||
return (result);
|
||||
}
|
||||
Executable
+513
@@ -0,0 +1,513 @@
|
||||
#!/usr/bin/perl
|
||||
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
|
||||
if $running_under_some_shell;
|
||||
|
||||
# pod2man -- Convert POD data to formatted *roff input.
|
||||
# $Id: pod2man.PL,v 1.10 2002/07/15 05:45:56 eagle Exp $
|
||||
#
|
||||
# Copyright 1999, 2000, 2001 by Russ Allbery <rra@stanford.edu>
|
||||
#
|
||||
# This program is free software; you may redistribute it and/or modify it
|
||||
# under the same terms as Perl itself.
|
||||
|
||||
require 5.004;
|
||||
|
||||
use Getopt::Long qw(GetOptions);
|
||||
use Pod::Man ();
|
||||
use Pod::Usage qw(pod2usage);
|
||||
|
||||
use strict;
|
||||
|
||||
# Silence -w warnings.
|
||||
use vars qw($running_under_some_shell);
|
||||
|
||||
# Insert -- into @ARGV before any single dash argument to hide it from
|
||||
# Getopt::Long; we want to interpret it as meaning stdin (which Pod::Parser
|
||||
# does correctly).
|
||||
my $stdin;
|
||||
@ARGV = map { $_ eq '-' && !$stdin++ ? ('--', $_) : $_ } @ARGV;
|
||||
|
||||
# Parse our options, trying to retain backwards compatibility with pod2man but
|
||||
# allowing short forms as well. --lax is currently ignored.
|
||||
my %options;
|
||||
Getopt::Long::config ('bundling_override');
|
||||
GetOptions (\%options, 'section|s=s', 'release|r:s', 'center|c=s',
|
||||
'date|d=s', 'fixed=s', 'fixedbold=s', 'fixeditalic=s',
|
||||
'fixedbolditalic=s', 'name|n=s', 'official|o', 'quotes|q=s',
|
||||
'lax|l', 'help|h', 'verbose|v') or exit 1;
|
||||
pod2usage (0) if $options{help};
|
||||
|
||||
# Official sets --center, but don't override things explicitly set.
|
||||
if ($options{official} && !defined $options{center}) {
|
||||
$options{center} = 'Perl Programmers Reference Guide';
|
||||
}
|
||||
|
||||
# Verbose is only our flag, not a Pod::Man flag.
|
||||
my $verbose = $options{verbose};
|
||||
delete $options{verbose};
|
||||
|
||||
# This isn't a valid Pod::Man option and is only accepted for backwards
|
||||
# compatibility.
|
||||
delete $options{lax};
|
||||
|
||||
# Initialize and run the formatter, pulling a pair of input and output off at
|
||||
# a time.
|
||||
my $parser = Pod::Man->new (%options);
|
||||
my @files;
|
||||
do {
|
||||
@files = splice (@ARGV, 0, 2);
|
||||
print " $files[1]\n" if $verbose;
|
||||
$parser->parse_from_file (@files);
|
||||
} while (@ARGV);
|
||||
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
pod2man - Convert POD data to formatted *roff input
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
pod2man [B<--section>=I<manext>] [B<--release>=I<version>]
|
||||
[B<--center>=I<string>] [B<--date>=I<string>] [B<--fixed>=I<font>]
|
||||
[B<--fixedbold>=I<font>] [B<--fixeditalic>=I<font>]
|
||||
[B<--fixedbolditalic>=I<font>] [B<--name>=I<name>] [B<--official>]
|
||||
[B<--lax>] [B<--quotes>=I<quotes>] [B<--verbose>]
|
||||
[I<input> [I<output>] ...]
|
||||
|
||||
pod2man B<--help>
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
B<pod2man> is a front-end for Pod::Man, using it to generate *roff input
|
||||
from POD source. The resulting *roff code is suitable for display on a
|
||||
terminal using nroff(1), normally via man(1), or printing using troff(1).
|
||||
|
||||
I<input> is the file to read for POD source (the POD can be embedded in
|
||||
code). If I<input> isn't given, it defaults to STDIN. I<output>, if given,
|
||||
is the file to which to write the formatted output. If I<output> isn't
|
||||
given, the formatted output is written to STDOUT. Several POD files can be
|
||||
processed in the same B<pod2man> invocation (saving module load and compile
|
||||
times) by providing multiple pairs of I<input> and I<output> files on the
|
||||
command line.
|
||||
|
||||
B<--section>, B<--release>, B<--center>, B<--date>, and B<--official> can be
|
||||
used to set the headers and footers to use; if not given, Pod::Man will
|
||||
assume various defaults. See below or L<Pod::Man> for details.
|
||||
|
||||
B<pod2man> assumes that your *roff formatters have a fixed-width font named
|
||||
CW. If yours is called something else (like CR), use B<--fixed> to specify
|
||||
it. This generally only matters for troff output for printing. Similarly,
|
||||
you can set the fonts used for bold, italic, and bold italic fixed-width
|
||||
output.
|
||||
|
||||
Besides the obvious pod conversions, Pod::Man, and therefore pod2man also
|
||||
takes care of formatting func(), func(n), and simple variable references
|
||||
like $foo or @bar so you don't have to use code escapes for them; complex
|
||||
expressions like C<$fred{'stuff'}> will still need to be escaped, though.
|
||||
It also translates dashes that aren't used as hyphens into en dashes, makes
|
||||
long dashes--like this--into proper em dashes, fixes "paired quotes," and
|
||||
takes care of several other troff-specific tweaks. See L<Pod::Man> for
|
||||
complete information.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<-c> I<string>, B<--center>=I<string>
|
||||
|
||||
Sets the centered page header to I<string>. The default is "User
|
||||
Contributed Perl Documentation", but also see B<--official> below.
|
||||
|
||||
=item B<-d> I<string>, B<--date>=I<string>
|
||||
|
||||
Set the left-hand footer string to this value. By default, the modification
|
||||
date of the input file will be used, or the current date if input comes from
|
||||
STDIN.
|
||||
|
||||
=item B<--fixed>=I<font>
|
||||
|
||||
The fixed-width font to use for vertabim text and code. Defaults to CW.
|
||||
Some systems may want CR instead. Only matters for troff(1) output.
|
||||
|
||||
=item B<--fixedbold>=I<font>
|
||||
|
||||
Bold version of the fixed-width font. Defaults to CB. Only matters for
|
||||
troff(1) output.
|
||||
|
||||
=item B<--fixeditalic>=I<font>
|
||||
|
||||
Italic version of the fixed-width font (actually, something of a misnomer,
|
||||
since most fixed-width fonts only have an oblique version, not an italic
|
||||
version). Defaults to CI. Only matters for troff(1) output.
|
||||
|
||||
=item B<--fixedbolditalic>=I<font>
|
||||
|
||||
Bold italic (probably actually oblique) version of the fixed-width font.
|
||||
Pod::Man doesn't assume you have this, and defaults to CB. Some systems
|
||||
(such as Solaris) have this font available as CX. Only matters for troff(1)
|
||||
output.
|
||||
|
||||
=item B<-h>, B<--help>
|
||||
|
||||
Print out usage information.
|
||||
|
||||
=item B<-l>, B<--lax>
|
||||
|
||||
No longer used. B<pod2man> used to check its input for validity as a manual
|
||||
page, but this should now be done by L<podchecker(1)> instead. Accepted for
|
||||
backwards compatibility; this option no longer does anything.
|
||||
|
||||
=item B<-n> I<name>, B<--name>=I<name>
|
||||
|
||||
Set the name of the manual page to I<name>. Without this option, the manual
|
||||
name is set to the uppercased base name of the file being converted unless
|
||||
the manual section is 3, in which case the path is parsed to see if it is a
|
||||
Perl module path. If it is, a path like C<.../lib/Pod/Man.pm> is converted
|
||||
into a name like C<Pod::Man>. This option, if given, overrides any
|
||||
automatic determination of the name.
|
||||
|
||||
Note that this option is probably not useful when converting multiple POD
|
||||
files at once. The convention for Unix man pages for commands is for the
|
||||
man page title to be in all-uppercase even if the command isn't.
|
||||
|
||||
=item B<-o>, B<--official>
|
||||
|
||||
Set the default header to indicate that this page is part of the standard
|
||||
Perl release, if B<--center> is not also given.
|
||||
|
||||
=item B<-q> I<quotes>, B<--quotes>=I<quotes>
|
||||
|
||||
Sets the quote marks used to surround CE<lt>> text to I<quotes>. If
|
||||
I<quotes> is a single character, it is used as both the left and right
|
||||
quote; if I<quotes> is two characters, the first character is used as the
|
||||
left quote and the second as the right quoted; and if I<quotes> is four
|
||||
characters, the first two are used as the left quote and the second two as
|
||||
the right quote.
|
||||
|
||||
I<quotes> may also be set to the special value C<none>, in which case no
|
||||
quote marks are added around CE<lt>> text (but the font is still changed for
|
||||
troff output).
|
||||
|
||||
=item B<-r>, B<--release>
|
||||
|
||||
Set the centered footer. By default, this is the version of Perl you run
|
||||
B<pod2man> under. Note that some system an macro sets assume that the
|
||||
centered footer will be a modification date and will prepend something like
|
||||
"Last modified: "; if this is the case, you may want to set B<--release> to
|
||||
the last modified date and B<--date> to the version number.
|
||||
|
||||
=item B<-s>, B<--section>
|
||||
|
||||
Set the section for the C<.TH> macro. The standard section numbering
|
||||
convention is to use 1 for user commands, 2 for system calls, 3 for
|
||||
functions, 4 for devices, 5 for file formats, 6 for games, 7 for
|
||||
miscellaneous information, and 8 for administrator commands. There is a lot
|
||||
of variation here, however; some systems (like Solaris) use 4 for file
|
||||
formats, 5 for miscellaneous information, and 7 for devices. Still others
|
||||
use 1m instead of 8, or some mix of both. About the only section numbers
|
||||
that are reliably consistent are 1, 2, and 3.
|
||||
|
||||
By default, section 1 will be used unless the file ends in .pm in which case
|
||||
section 3 will be selected.
|
||||
|
||||
=item B<-v>, B<--verbose>
|
||||
|
||||
Print out the name of each output file as it is being generated.
|
||||
|
||||
=back
|
||||
|
||||
=head1 DIAGNOSTICS
|
||||
|
||||
If B<pod2man> fails with errors, see L<Pod::Man> and L<Pod::Parser> for
|
||||
information about what those errors might mean.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
pod2man program > program.1
|
||||
pod2man SomeModule.pm /usr/perl/man/man3/SomeModule.3
|
||||
pod2man --section=7 note.pod > note.7
|
||||
|
||||
If you would like to print out a lot of man page continuously, you probably
|
||||
want to set the C and D registers to set contiguous page numbering and
|
||||
even/odd paging, at least on some versions of man(7).
|
||||
|
||||
troff -man -rC1 -rD1 perl.1 perldata.1 perlsyn.1 ...
|
||||
|
||||
To get index entries on stderr, turn on the F register, as in:
|
||||
|
||||
troff -man -rF1 perl.1
|
||||
|
||||
The indexing merely outputs messages via C<.tm> for each major page,
|
||||
section, subsection, item, and any C<XE<lt>E<gt>> directives. See
|
||||
L<Pod::Man> for more details.
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
Lots of this documentation is duplicated from L<Pod::Man>.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
For those not sure of the proper layout of a man page, here are some notes
|
||||
on writing a proper man page.
|
||||
|
||||
The name of the program being documented is conventionally written in bold
|
||||
(using BE<lt>E<gt>) wherever it occurs, as are all program options.
|
||||
Arguments should be written in italics (IE<lt>E<gt>). Functions are
|
||||
traditionally written in italics; if you write a function as function(),
|
||||
Pod::Man will take care of this for you. Literal code or commands should
|
||||
be in CE<lt>E<gt>. References to other man pages should be in the form
|
||||
C<manpage(section)>, and Pod::Man will automatically format those
|
||||
appropriately. As an exception, it's traditional not to use this form when
|
||||
referring to module documentation; use C<LE<lt>Module::NameE<gt>> instead.
|
||||
|
||||
References to other programs or functions are normally in the form of man
|
||||
page references so that cross-referencing tools can provide the user with
|
||||
links and the like. It's possible to overdo this, though, so be careful not
|
||||
to clutter your documentation with too much markup.
|
||||
|
||||
The major headers should be set out using a C<=head1> directive, and are
|
||||
historically written in the rather startling ALL UPPER CASE format, although
|
||||
this is not mandatory. Minor headers may be included using C<=head2>, and
|
||||
are typically in mixed case.
|
||||
|
||||
The standard sections of a manual page are:
|
||||
|
||||
=over 4
|
||||
|
||||
=item NAME
|
||||
|
||||
Mandatory section; should be a comma-separated list of programs or functions
|
||||
documented by this podpage, such as:
|
||||
|
||||
foo, bar - programs to do something
|
||||
|
||||
Manual page indexers are often extremely picky about the format of this
|
||||
section, so don't put anything in it except this line. A single dash, and
|
||||
only a single dash, should separate the list of programs or functions from
|
||||
the description. Functions should not be qualified with C<()> or the like.
|
||||
The description should ideally fit on a single line, even if a man program
|
||||
replaces the dash with a few tabs.
|
||||
|
||||
=item SYNOPSIS
|
||||
|
||||
A short usage summary for programs and functions. This section is mandatory
|
||||
for section 3 pages.
|
||||
|
||||
=item DESCRIPTION
|
||||
|
||||
Extended description and discussion of the program or functions, or the body
|
||||
of the documentation for man pages that document something else. If
|
||||
particularly long, it's a good idea to break this up into subsections
|
||||
C<=head2> directives like:
|
||||
|
||||
=head2 Normal Usage
|
||||
|
||||
=head2 Advanced Features
|
||||
|
||||
=head2 Writing Configuration Files
|
||||
|
||||
or whatever is appropriate for your documentation.
|
||||
|
||||
=item OPTIONS
|
||||
|
||||
Detailed description of each of the command-line options taken by the
|
||||
program. This should be separate from the description for the use of things
|
||||
like L<Pod::Usage|Pod::Usage>. This is normally presented as a list, with
|
||||
each option as a separate C<=item>. The specific option string should be
|
||||
enclosed in BE<lt>E<gt>. Any values that the option takes should be
|
||||
enclosed in IE<lt>E<gt>. For example, the section for the option
|
||||
B<--section>=I<manext> would be introduced with:
|
||||
|
||||
=item B<--section>=I<manext>
|
||||
|
||||
Synonymous options (like both the short and long forms) are separated by a
|
||||
comma and a space on the same C<=item> line, or optionally listed as their
|
||||
own item with a reference to the canonical name. For example, since
|
||||
B<--section> can also be written as B<-s>, the above would be:
|
||||
|
||||
=item B<-s> I<manext>, B<--section>=I<manext>
|
||||
|
||||
(Writing the short option first is arguably easier to read, since the long
|
||||
option is long enough to draw the eye to it anyway and the short option can
|
||||
otherwise get lost in visual noise.)
|
||||
|
||||
=item RETURN VALUE
|
||||
|
||||
What the program or function returns, if successful. This section can be
|
||||
omitted for programs whose precise exit codes aren't important, provided
|
||||
they return 0 on success as is standard. It should always be present for
|
||||
functions.
|
||||
|
||||
=item ERRORS
|
||||
|
||||
Exceptions, error return codes, exit statuses, and errno settings.
|
||||
Typically used for function documentation; program documentation uses
|
||||
DIAGNOSTICS instead. The general rule of thumb is that errors printed to
|
||||
STDOUT or STDERR and intended for the end user are documented in DIAGNOSTICS
|
||||
while errors passed internal to the calling program and intended for other
|
||||
programmers are documented in ERRORS. When documenting a function that sets
|
||||
errno, a full list of the possible errno values should be given here.
|
||||
|
||||
=item DIAGNOSTICS
|
||||
|
||||
All possible messages the program can print out--and what they mean. You
|
||||
may wish to follow the same documentation style as the Perl documentation;
|
||||
see perldiag(1) for more details (and look at the POD source as well).
|
||||
|
||||
If applicable, please include details on what the user should do to correct
|
||||
the error; documenting an error as indicating "the input buffer is too
|
||||
small" without telling the user how to increase the size of the input buffer
|
||||
(or at least telling them that it isn't possible) aren't very useful.
|
||||
|
||||
=item EXAMPLES
|
||||
|
||||
Give some example uses of the program or function. Don't skimp; users often
|
||||
find this the most useful part of the documentation. The examples are
|
||||
generally given as verbatim paragraphs.
|
||||
|
||||
Don't just present an example without explaining what it does. Adding a
|
||||
short paragraph saying what the example will do can increase the value of
|
||||
the example immensely.
|
||||
|
||||
=item ENVIRONMENT
|
||||
|
||||
Environment variables that the program cares about, normally presented as a
|
||||
list using C<=over>, C<=item>, and C<=back>. For example:
|
||||
|
||||
=over 6
|
||||
|
||||
=item HOME
|
||||
|
||||
Used to determine the user's home directory. F<.foorc> in this
|
||||
directory is read for configuration details, if it exists.
|
||||
|
||||
=back
|
||||
|
||||
Since environment variables are normally in all uppercase, no additional
|
||||
special formatting is generally needed; they're glaring enough as it is.
|
||||
|
||||
=item FILES
|
||||
|
||||
All files used by the program or function, normally presented as a list, and
|
||||
what it uses them for. File names should be enclosed in FE<lt>E<gt>. It's
|
||||
particularly important to document files that will be potentially modified.
|
||||
|
||||
=item CAVEATS
|
||||
|
||||
Things to take special care with, sometimes called WARNINGS.
|
||||
|
||||
=item BUGS
|
||||
|
||||
Things that are broken or just don't work quite right.
|
||||
|
||||
=item RESTRICTIONS
|
||||
|
||||
Bugs you don't plan to fix. :-)
|
||||
|
||||
=item NOTES
|
||||
|
||||
Miscellaneous commentary.
|
||||
|
||||
=item SEE ALSO
|
||||
|
||||
Other man pages to check out, like man(1), man(7), makewhatis(8), or
|
||||
catman(8). Normally a simple list of man pages separated by commas, or a
|
||||
paragraph giving the name of a reference work. Man page references, if they
|
||||
use the standard C<name(section)> form, don't have to be enclosed in
|
||||
LE<lt>E<gt> (although it's recommended), but other things in this section
|
||||
probably should be when appropriate.
|
||||
|
||||
If the package has a mailing list, include a URL or subscription
|
||||
instructions here.
|
||||
|
||||
If the package has a web site, include a URL here.
|
||||
|
||||
=item AUTHOR
|
||||
|
||||
Who wrote it (use AUTHORS for multiple people). Including your current
|
||||
e-mail address (or some e-mail address to which bug reports should be sent)
|
||||
so that users have a way of contacting you is a good idea. Remember that
|
||||
program documentation tends to roam the wild for far longer than you expect
|
||||
and pick an e-mail address that's likely to last if possible.
|
||||
|
||||
=item COPYRIGHT AND LICENSE
|
||||
|
||||
For copyright
|
||||
|
||||
Copyright YEAR(s) by YOUR NAME(s)
|
||||
|
||||
(No, (C) is not needed. No, "all rights reserved" is not needed.)
|
||||
|
||||
For licensing the easiest way is to use the same licensing as Perl itself:
|
||||
|
||||
This library is free software; you may redistribute it and/or modify
|
||||
it under the same terms as Perl itself.
|
||||
|
||||
This makes it easy for people to use your module with Perl. Note that
|
||||
this licensing is neither an endorsement or a requirement, you are of
|
||||
course free to choose any licensing.
|
||||
|
||||
=item HISTORY
|
||||
|
||||
Programs derived from other sources sometimes have this, or you might keep
|
||||
a modification log here. If the log gets overly long or detailed,
|
||||
consider maintaining it in a separate file, though.
|
||||
|
||||
=back
|
||||
|
||||
In addition, some systems use CONFORMING TO to note conformance to relevant
|
||||
standards and MT-LEVEL to note safeness for use in threaded programs or
|
||||
signal handlers. These headings are primarily useful when documenting parts
|
||||
of a C library. Documentation of object-oriented libraries or modules may
|
||||
use CONSTRUCTORS and METHODS sections for detailed documentation of the
|
||||
parts of the library and save the DESCRIPTION section for an overview; other
|
||||
large modules may use FUNCTIONS for similar reasons. Some people use
|
||||
OVERVIEW to summarize the description if it's quite long.
|
||||
|
||||
Section ordering varies, although NAME should I<always> be the first section
|
||||
(you'll break some man page systems otherwise), and NAME, SYNOPSIS,
|
||||
DESCRIPTION, and OPTIONS generally always occur first and in that order if
|
||||
present. In general, SEE ALSO, AUTHOR, and similar material should be left
|
||||
for last. Some systems also move WARNINGS and NOTES to last. The order
|
||||
given above should be reasonable for most purposes.
|
||||
|
||||
Finally, as a general note, try not to use an excessive amount of markup.
|
||||
As documented here and in L<Pod::Man>, you can safely leave Perl variables,
|
||||
function names, man page references, and the like unadorned by markup and
|
||||
the POD translators will figure it out for you. This makes it much easier
|
||||
to later edit the documentation. Note that many existing translators
|
||||
(including this one currently) will do the wrong thing with e-mail addresses
|
||||
or URLs when wrapped in LE<lt>E<gt>, so don't do that.
|
||||
|
||||
For additional information that may be more accurate for your specific
|
||||
system, see either L<man(5)> or L<man(7)> depending on your system manual
|
||||
section numbering conventions.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<Pod::Man>, L<Pod::Parser>, L<man(1)>, L<nroff(1)>, L<podchecker(1)>,
|
||||
L<troff(1)>, L<man(7)>
|
||||
|
||||
The man page documenting the an macro set may be L<man(5)> instead of
|
||||
L<man(7)> on your system.
|
||||
|
||||
The current version of this script is always available from its web site at
|
||||
L<http://www.eyrie.org/~eagle/software/podlators/>. It is also part of the
|
||||
Perl core distribution as of 5.6.0.
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Russ Allbery <rra@stanford.edu>, based I<very> heavily on the original
|
||||
B<pod2man> by Larry Wall and Tom Christiansen. Large portions of this
|
||||
documentation, particularly the sections on the anatomy of a proper man
|
||||
page, are taken from the B<pod2man> documentation by Tom.
|
||||
|
||||
=head1 COPYRIGHT AND LICENSE
|
||||
|
||||
Copyright 1999, 2000, 2001 by Russ Allbery <rra@stanford.edu>.
|
||||
|
||||
This program is free software; you may redistribute it and/or modify it
|
||||
under the same terms as Perl itself.
|
||||
|
||||
=cut
|
||||
+4
-4
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_ListObj 3 8.0 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -64,7 +64,7 @@ Points to location where \fBTcl_ListObjGetElements\fR
|
||||
stores the number of element values in \fIlistPtr\fR.
|
||||
.AP Tcl_Obj ***objvPtr out
|
||||
A location where \fBTcl_ListObjGetElements\fR stores a pointer to an array
|
||||
of pointers to the element values of \fIlistPtr\fR.
|
||||
of pointers to the element values of \fIlistPtr\fR.
|
||||
.AP int objc in
|
||||
The number of Tcl values that \fBTcl_NewListObj\fR
|
||||
will insert into a new list value,
|
||||
@@ -75,7 +75,7 @@ the number of Tcl values to insert into \fIobjPtr\fR.
|
||||
An array of pointers to values.
|
||||
\fBTcl_NewListObj\fR will insert these values into a new list value
|
||||
and \fBTcl_ListObjReplace\fR will insert them into an existing \fIlistPtr\fR.
|
||||
Each value will become a separate list element.
|
||||
Each value will become a separate list element.
|
||||
.AP int *intPtr out
|
||||
Points to location where \fBTcl_ListObjLength\fR
|
||||
stores the length of the list.
|
||||
@@ -134,7 +134,7 @@ If no error occurs,
|
||||
the two procedures return \fBTCL_OK\fR after appending the values.
|
||||
.PP
|
||||
\fBTcl_NewListObj\fR and \fBTcl_SetListObj\fR
|
||||
create a new value or modify an existing value to hold
|
||||
create a new value or modify an existing value to hold
|
||||
the \fIobjc\fR elements of the array referenced by \fIobjv\fR
|
||||
where each element is a pointer to a Tcl value.
|
||||
If \fIobjc\fR is less than or equal to zero,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
.\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH NRE 3 8.6 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -45,7 +45,7 @@ Name of a new command to create.
|
||||
Implementation of a command that will be called whenever \fIcmdName\fR
|
||||
is invoked as a command in the unoptimized way.
|
||||
.AP Tcl_ObjCmdProc *nreProc in
|
||||
Implementation of a command that will be called whenever \fIcmdName\fR
|
||||
Implementation of a command that will be called whenever \fIcmdName\fR
|
||||
is invoked and requested to conserve the C stack.
|
||||
.AP ClientData clientData in
|
||||
Arbitrary one-word value that will be passed to \fIproc\fR, \fInreProc\fR,
|
||||
@@ -83,13 +83,13 @@ executing in the interpreter designated by \fIinterp\fR completes.
|
||||
to the function designated by \fIpostProcPtr\fR when it is invoked.
|
||||
.BE
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.PP
|
||||
This series of C functions provides an interface whereby commands that
|
||||
are implemented in C can be evaluated, and invoke Tcl commands scripts
|
||||
and scripts, without consuming space on the C stack. The non-recursive
|
||||
evaluation is done by installing a \fItrampoline\fR, a small piece of
|
||||
code that invokes a command or script, and then executes a series of
|
||||
callbacks when the command or script returns.
|
||||
callbacks when the command or script returns.
|
||||
.PP
|
||||
The \fBTcl_NRCreateCommand\fR function creates a Tcl command in the
|
||||
interpreter designated by \fIinterp\fR that is prepared to handle
|
||||
@@ -149,7 +149,7 @@ The remaining arguments are as for \fBTcl_NREvalObjv\fR.
|
||||
\fBTcl_NREvalObj\fR, \fBTcl_NREvalObjv\fR and \fBTcl_NRCmdSwap\fR
|
||||
all accept a \fIflags\fR parameter, which is an OR-ed-together set of
|
||||
bits to control evaluation. At the present time, the only supported flag
|
||||
available to callers is \fBTCL_EVAL_GLOBAL\fR.
|
||||
available to callers is \fBTCL_EVAL_GLOBAL\fR.
|
||||
.\" TODO: Again, this is a lie. Do we want to explain TCL_EVAL_INVOKE
|
||||
.\" and TCL_EVAL_NOERR?
|
||||
If the \fBTCL_EVAL_GLOBAL\fR flag is set, the script or command is
|
||||
@@ -255,7 +255,7 @@ int
|
||||
int objc,
|
||||
Tcl_Obj *const objv[])
|
||||
{
|
||||
return \fBTcl_NRCallObjProc\fR(interp, \fITheCmdNRObjProc\fR,
|
||||
return \fBTcl_NRCallObjProc\fR(interp, \fITheCmdNRObjProc\fR,
|
||||
clientData, objc, objv);
|
||||
}
|
||||
.CE
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Notifier 3 8.1 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -143,7 +143,7 @@ servicing at a future time. Threaded applications work in a
|
||||
similar manner, except that there is a separate event queue for
|
||||
each thread containing a Tcl interpreter.
|
||||
\fBTcl_QueueEvent\fR is used (primarily
|
||||
by event sources) to add events to the event queue and
|
||||
by event sources) to add events to the event queue and
|
||||
\fBTcl_DeleteEvents\fR is used to remove events from the queue without
|
||||
processing them. In a threaded application, \fBTcl_QueueEvent\fR adds
|
||||
an event to the current thread's queue, and \fBTcl_ThreadQueueEvent\fR
|
||||
|
||||
+4
-4
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_ObjType 3 8.0 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -76,8 +76,8 @@ in that case \fBTCL_ERROR\fR is returned.
|
||||
if possible.
|
||||
It creates a new internal representation for \fIobjPtr\fR
|
||||
appropriate for the target type \fItypePtr\fR
|
||||
and sets its \fItypePtr\fR member as determined by calling the
|
||||
\fItypePtr->setFromAnyProc\fR routine.
|
||||
and sets its \fItypePtr\fR member as determined by calling the
|
||||
\fItypePtr->setFromAnyProc\fR routine.
|
||||
Any internal representation for \fIobjPtr\fR's old type is freed.
|
||||
If an error occurs during conversion, it returns \fBTCL_ERROR\fR
|
||||
and leaves an error message in the result value for \fIinterp\fR
|
||||
@@ -181,7 +181,7 @@ typedef void \fBTcl_UpdateStringProc\fR(
|
||||
It must always set \fIbytes\fR non-NULL before returning.
|
||||
We require the string representation's byte array
|
||||
to have a null after the last byte, at offset \fIlength\fR,
|
||||
and to have no null bytes before that; this allows string representations
|
||||
and to have no null bytes before that; this allows string representations
|
||||
to be treated as conventional null character-terminated C strings.
|
||||
These restrictions are easily met by using Tcl's internal UTF encoding
|
||||
for the string representation, same as one would do for other
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_Panic 3 8.4 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -69,7 +69,7 @@ After \fBTcl_SetPanicProc\fR returns, any future calls to
|
||||
\fIformat\fR and \fIarg\fR arguments. \fIpanicProc\fR should avoid
|
||||
making calls into the Tcl library, or into other libraries that may
|
||||
call the Tcl library, since the original call to \fBTcl_Panic\fR
|
||||
indicates the Tcl library is not in a state of reliable operation.
|
||||
indicates the Tcl library is not in a state of reliable operation.
|
||||
.PP
|
||||
The typical use of \fBTcl_SetPanicProc\fR arranges for the error message
|
||||
to be displayed or reported in a manner more suitable for the
|
||||
|
||||
+3
-3
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_PkgRequire 3 7.5 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -75,8 +75,8 @@ procedures do.
|
||||
.PP
|
||||
If \fBTcl_PkgPresent\fR or \fBTcl_PkgRequire\fR complete successfully
|
||||
they return a pointer to the version string for the version of the package
|
||||
that is provided in the interpreter (which may be different than
|
||||
\fIversion\fR); if an error occurs they return NULL and leave an error
|
||||
that is provided in the interpreter (which may be different than
|
||||
\fIversion\fR); if an error occurs they return NULL and leave an error
|
||||
message in the interpreter's result.
|
||||
.PP
|
||||
\fBTcl_PkgProvide\fR returns \fBTCL_OK\fR if it completes successfully;
|
||||
|
||||
+5
-5
@@ -5,7 +5,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_RegExpMatch 3 8.1 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -103,7 +103,7 @@ should be stored by \fBTcl_RegExpGetInfo\fR.
|
||||
\fBTcl_RegExpMatch\fR determines whether its \fIpattern\fR argument
|
||||
matches \fIregexp\fR, where \fIregexp\fR is interpreted
|
||||
as a regular expression using the rules in the \fBre_syntax\fR
|
||||
reference page.
|
||||
reference page.
|
||||
If there is a match then \fBTcl_RegExpMatch\fR returns 1.
|
||||
If there is no match then \fBTcl_RegExpMatch\fR returns 0.
|
||||
If an error occurs in the matching process (e.g. \fIpattern\fR
|
||||
@@ -111,7 +111,7 @@ is not a valid regular expression) then \fBTcl_RegExpMatch\fR
|
||||
returns \-1 and leaves an error message in the interpreter result.
|
||||
\fBTcl_RegExpMatchObj\fR is similar to \fBTcl_RegExpMatch\fR except it
|
||||
operates on the Tcl values \fItextObj\fR and \fIpatObj\fR instead of
|
||||
UTF strings.
|
||||
UTF strings.
|
||||
\fBTcl_RegExpMatchObj\fR is generally more efficient than
|
||||
\fBTcl_RegExpMatch\fR, so it is the preferred interface.
|
||||
.PP
|
||||
@@ -201,7 +201,7 @@ Compile extended regular expressions
|
||||
.PQ ERE s .
|
||||
This mode corresponds
|
||||
to the regular expression syntax recognized by Tcl 8.0 and earlier
|
||||
versions.
|
||||
versions.
|
||||
.TP
|
||||
\fBTCL_REG_BASIC\fR
|
||||
Compile basic regular expressions
|
||||
@@ -375,7 +375,7 @@ character in the string where a match could occur. If a match was
|
||||
found, this will be the same as the beginning of the current match.
|
||||
If no match was found, then it indicates the earliest point at which a
|
||||
match might occur if additional text is appended to the string. If it
|
||||
is no match is possible even with further text, this field will be set
|
||||
is no match is possible even with further text, this field will be set
|
||||
to \-1.
|
||||
.SH "SEE ALSO"
|
||||
re_syntax(n)
|
||||
|
||||
+3
-3
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_SaveResult 3 8.1 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -67,7 +67,7 @@ a superset of the functions provided by the other routines,
|
||||
any new code should only make use of the more powerful routines.
|
||||
The older, weaker routines \fBTcl_SaveResult\fR, \fBTcl_RestoreResult\fR,
|
||||
and \fBTcl_DiscardResult\fR continue to exist only for the sake
|
||||
of existing programs that may already be using them.
|
||||
of existing programs that may already be using them.
|
||||
.PP
|
||||
\fBTcl_SaveInterpState\fR takes a snapshot of those portions of
|
||||
interpreter state that make up the full result of script evaluation.
|
||||
@@ -115,6 +115,6 @@ uninitialized state and cannot be used until another call to
|
||||
Once \fBTcl_SaveResult\fR is called to save the interpreter
|
||||
result, either \fBTcl_RestoreResult\fR or
|
||||
\fBTcl_DiscardResult\fR must be called to properly clean up the
|
||||
memory associated with the saved state.
|
||||
memory associated with the saved state.
|
||||
.SH KEYWORDS
|
||||
result, state, interp
|
||||
|
||||
+3
-3
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_SetResult 3 8.0 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -164,7 +164,7 @@ The source interpreter will have its result reset by this operation.
|
||||
.SH "DEPRECATED INTERFACES"
|
||||
.SS "OLD STRING PROCEDURES"
|
||||
.PP
|
||||
Use of the following procedures is deprecated
|
||||
Use of the following procedures (is deprecated
|
||||
since they manipulate the Tcl result as a string.
|
||||
Procedures such as \fBTcl_SetObjResult\fR
|
||||
that manipulate the result as a value
|
||||
@@ -212,7 +212,7 @@ As a migration aid, access can be restored with the compiler directive
|
||||
but this is meant only to offer life support to otherwise dead code.
|
||||
.SH "THE TCL_FREEPROC ARGUMENT TO TCL_SETRESULT"
|
||||
.PP
|
||||
\fBTcl_SetResult\fR's \fIfreeProc\fR argument specifies how
|
||||
\fBTcl_SetResult\fR's \fIfreeProc\fR argument specifies how
|
||||
the Tcl system is to manage the storage for the \fIresult\fR argument.
|
||||
If \fBTcl_SetResult\fR or \fBTcl_SetObjResult\fR are called
|
||||
at a time when \fIinterp\fR holds a string result,
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_SetVar 3 8.1 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -86,7 +86,7 @@ These procedures are used to create, modify, read, and delete
|
||||
Tcl variables from C code.
|
||||
.PP
|
||||
\fBTcl_SetVar2Ex\fR, \fBTcl_SetVar\fR, \fBTcl_SetVar2\fR, and
|
||||
\fBTcl_ObjSetVar2\fR
|
||||
\fBTcl_ObjSetVar2\fR
|
||||
will create a new variable or modify an existing one.
|
||||
These procedures set the given variable to the value
|
||||
given by \fInewValuePtr\fR or \fInewValue\fR and return a
|
||||
|
||||
@@ -191,30 +191,30 @@ in braces or quotes.
|
||||
Backslash
|
||||
.PQ \e "" .
|
||||
.TP 7
|
||||
\e\fIooo\fR
|
||||
\e\fIooo\fR
|
||||
.
|
||||
The digits \fIooo\fR (one, two, or three of them) give a eight-bit octal
|
||||
The digits \fIooo\fR (one, two, or three of them) give a eight-bit octal
|
||||
value for the Unicode character that will be inserted, in the range
|
||||
\fI000\fR\(en\fI377\fR (i.e., the range U+000000\(enU+0000FF).
|
||||
The parser will stop just before this range overflows, or when
|
||||
the maximum of three digits is reached. The upper bits of the Unicode
|
||||
character will be 0.
|
||||
.TP 7
|
||||
\e\fBx\fIhh\fR
|
||||
\e\fBx\fIhh\fR
|
||||
.
|
||||
The hexadecimal digits \fIhh\fR (one or two of them) give an eight-bit
|
||||
hexadecimal value for the Unicode character that will be inserted. The upper
|
||||
bits of the Unicode character will be 0 (i.e., the character will be in the
|
||||
range U+000000\(enU+0000FF).
|
||||
.TP 7
|
||||
\e\fBu\fIhhhh\fR
|
||||
\e\fBu\fIhhhh\fR
|
||||
.
|
||||
The hexadecimal digits \fIhhhh\fR (one, two, three, or four of them) give a
|
||||
sixteen-bit hexadecimal value for the Unicode character that will be
|
||||
inserted. The upper bits of the Unicode character will be 0 (i.e., the
|
||||
character will be in the range U+000000\(enU+00FFFF).
|
||||
.TP 7
|
||||
\e\fBU\fIhhhhhhhh\fR
|
||||
\e\fBU\fIhhhhhhhh\fR
|
||||
.
|
||||
The hexadecimal digits \fIhhhhhhhh\fR (one up to eight of them) give a
|
||||
twenty-one-bit hexadecimal value for the Unicode character that will be
|
||||
|
||||
+4
-4
@@ -5,7 +5,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_Main 3 8.4 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -52,7 +52,7 @@ is a program
|
||||
like tclsh or wish that supports both interactive interpretation
|
||||
of Tcl and evaluation of a script contained in a file given as
|
||||
a command line argument. \fBTcl_Main\fR is offered as a convenience
|
||||
to developers of shell applications, so they do not have to
|
||||
to developers of shell applications, so they do not have to
|
||||
reproduce all of the code for proper initialization of the Tcl
|
||||
library and interactive shell operation. Other styles of embedding
|
||||
Tcl in an application are not supported by \fBTcl_Main\fR. Those
|
||||
@@ -106,7 +106,7 @@ will not evaluate any startup script.
|
||||
and encoding set by the most recent \fBTcl_SetStartupScript\fR
|
||||
call in the same thread. The stored file name is returned,
|
||||
and the stored encoding name is written to space pointed to
|
||||
by \fIencodingPtr\fR, when that is not NULL.
|
||||
by \fIencodingPtr\fR, when that is not NULL.
|
||||
.PP
|
||||
The file name and encoding values managed by the routines
|
||||
\fBTcl_SetStartupScript\fR and \fBTcl_GetStartupScript\fR
|
||||
@@ -136,7 +136,7 @@ commands, \fBTcl_Main\fR calls the procedure given by the
|
||||
.QW hook
|
||||
for the application to perform its own initialization of the interpreter
|
||||
created by \fBTcl_Main\fR, such as defining application-specific
|
||||
commands. The application initialization routine might also
|
||||
commands. The application initialization routine might also
|
||||
call \fBTcl_SetStartupScript\fR to (re-)set the file and encoding
|
||||
to be used as a startup script. The procedure must have an interface
|
||||
that matches the type \fBTcl_AppInitProc\fR:
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_TraceCommand 3 7.4 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
|
||||
+3
-3
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_TraceVar 3 7.4 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -203,7 +203,7 @@ The procedures \fBTcl_TraceVar2\fR, \fBTcl_UntraceVar2\fR, and
|
||||
except that the name of the variable consists of two parts.
|
||||
\fIName1\fR gives the name of a scalar variable or array,
|
||||
and \fIname2\fR gives the name of an element within an array.
|
||||
When \fIname2\fR is NULL,
|
||||
When \fIname2\fR is NULL,
|
||||
\fIname1\fR may contain both an array and an element name:
|
||||
if the name contains an open parenthesis and ends with a
|
||||
close parenthesis, then the value between the parentheses is
|
||||
@@ -214,7 +214,7 @@ If \fIname2\fR is NULL and \fIname1\fR does not refer
|
||||
to an array element it means that either the variable is
|
||||
a scalar or the trace is to be set on the entire array rather
|
||||
than an individual element (see WHOLE-ARRAY TRACES below for
|
||||
more information).
|
||||
more information).
|
||||
.SH "ACCESSING VARIABLES DURING TRACES"
|
||||
.PP
|
||||
During read, write, and array traces, the
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_TranslateFileName 3 8.1 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -34,7 +34,7 @@ anything stored here.
|
||||
This utility procedure translates a file name to a platform-specific form
|
||||
which, after being converted to the appropriate encoding, is suitable for
|
||||
passing to the local operating system. In particular, it converts
|
||||
network names into native form and does tilde substitution.
|
||||
network names into native form and does tilde substitution.
|
||||
.PP
|
||||
However, with the advent of the newer \fBTcl_FSGetNormalizedPath\fR and
|
||||
\fBTcl_FSGetNativePath\fR, there is no longer any need to use this
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_UniCharIsAlpha 3 "8.1" Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_UpVar 3 7.4 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -40,7 +40,7 @@ an upvar-ed variable.
|
||||
One of \fBTCL_GLOBAL_ONLY\fR, \fBTCL_NAMESPACE_ONLY\fR or 0; if non-zero,
|
||||
then \fIdestName\fR is a global or namespace variable; otherwise it is
|
||||
local to the current procedure (or current namespace if no procedure is
|
||||
active).
|
||||
active).
|
||||
.AP "const char" *name1 in
|
||||
First part of source variable's name (scalar name, or name of array
|
||||
without array index).
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH Tcl_WrongNumArgs 3 8.0 Tcl "Tcl Library Procedures"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -55,7 +55,7 @@ wrong # args: should be "foo bar fileName count"
|
||||
.PP
|
||||
\fIObjc\fR is usually 1, but may be 2 or more for commands like
|
||||
\fBstring\fR and the Tk widget commands, which use the first argument
|
||||
as a subcommand.
|
||||
as a subcommand.
|
||||
.PP
|
||||
Some of the values in the \fIobjv\fR array may be abbreviations for
|
||||
a subcommand. The command
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH after n 7.5 Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -47,7 +47,7 @@ The delayed command is formed by concatenating all the \fIscript\fR
|
||||
arguments in the same fashion as the \fBconcat\fR command.
|
||||
The command will be executed at global level (outside the context
|
||||
of any Tcl procedure).
|
||||
If an error occurs while executing the delayed command then
|
||||
If an error occurs while executing the delayed command then
|
||||
the background error will be reported by the command
|
||||
registered with \fBinterp bgerror\fR.
|
||||
The \fBafter\fR command returns an identifier that can be used
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH append n "" Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
|
||||
+3
-3
@@ -14,11 +14,11 @@ apply \- Apply an anonymous function
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The command \fBapply\fR applies the function \fIfunc\fR to the arguments
|
||||
\fIarg1 arg2 ...\fR and returns the result.
|
||||
\fIarg1 arg2 ...\fR and returns the result.
|
||||
.PP
|
||||
The function \fIfunc\fR is a two element list \fI{args body}\fR or a three
|
||||
element list \fI{args body namespace}\fR (as if the
|
||||
\fBlist\fR command had been used).
|
||||
\fBlist\fR command had been used).
|
||||
The first element \fIargs\fR specifies the formal arguments to
|
||||
\fIfunc\fR. The specification of the formal arguments \fIargs\fR
|
||||
is shared with the \fBproc\fR command, and is described in detail in the
|
||||
@@ -96,7 +96,7 @@ set vbl abc
|
||||
.SH "SEE ALSO"
|
||||
proc(n), uplevel(n)
|
||||
.SH KEYWORDS
|
||||
anonymous function, argument, lambda, procedure,
|
||||
anonymous function, argument, lambda, procedure,
|
||||
'\" Local Variables:
|
||||
'\" mode: nroff
|
||||
'\" End:
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH array n 8.3 Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH bgerror n 7.5 Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
|
||||
+8
-8
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH binary n 8.0 Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -300,7 +300,7 @@ example,
|
||||
.CS
|
||||
\fBbinary format\fR s3 {3 -3 258 1}
|
||||
.CE
|
||||
will return a string equivalent to
|
||||
will return a string equivalent to
|
||||
\fB\ex03\ex00\exfd\exff\ex02\ex01\fR.
|
||||
.RE
|
||||
.IP \fBS\fR 5
|
||||
@@ -311,7 +311,7 @@ example,
|
||||
.CS
|
||||
\fBbinary format\fR S3 {3 -3 258 1}
|
||||
.CE
|
||||
will return a string equivalent to
|
||||
will return a string equivalent to
|
||||
\fB\ex00\ex03\exff\exfd\ex01\ex02\fR.
|
||||
.RE
|
||||
.IP \fBt\fR 5
|
||||
@@ -330,7 +330,7 @@ example,
|
||||
.CS
|
||||
\fBbinary format\fR i3 {3 -3 65536 1}
|
||||
.CE
|
||||
will return a string equivalent to
|
||||
will return a string equivalent to
|
||||
\fB\ex03\ex00\ex00\ex00\exfd\exff\exff\exff\ex00\ex00\ex01\ex00\fR
|
||||
.RE
|
||||
.IP \fBI\fR 5
|
||||
@@ -341,7 +341,7 @@ For example,
|
||||
.CS
|
||||
\fBbinary format\fR I3 {3 -3 65536 1}
|
||||
.CE
|
||||
will return a string equivalent to
|
||||
will return a string equivalent to
|
||||
\fB\ex00\ex00\ex00\ex03\exff\exff\exff\exfd\ex00\ex01\ex00\ex00\fR
|
||||
.RE
|
||||
.IP \fBn\fR 5
|
||||
@@ -397,7 +397,7 @@ on a Windows system running on an Intel Pentium processor,
|
||||
.CS
|
||||
\fBbinary format\fR f2 {1.6 3.4}
|
||||
.CE
|
||||
will return a string equivalent to
|
||||
will return a string equivalent to
|
||||
\fB\excd\excc\excc\ex3f\ex9a\ex99\ex59\ex40\fR.
|
||||
.RE
|
||||
.IP \fBr\fR 5
|
||||
@@ -418,7 +418,7 @@ Windows system running on an Intel Pentium processor,
|
||||
.CS
|
||||
\fBbinary format\fR d1 {1.6}
|
||||
.CE
|
||||
will return a string equivalent to
|
||||
will return a string equivalent to
|
||||
\fB\ex9a\ex99\ex99\ex99\ex99\ex99\exf9\ex3f\fR.
|
||||
.RE
|
||||
.IP \fBq\fR 5
|
||||
@@ -684,7 +684,7 @@ order. For example,
|
||||
\fBbinary scan\fR \ex00\ex05\ex00\ex07\exff\exf0 S2S* var1 var2
|
||||
.CE
|
||||
will return \fB2\fR with \fB5 7\fR stored in \fIvar1\fR and \fB\-16\fR
|
||||
stored in \fIvar2\fR.
|
||||
stored in \fIvar2\fR.
|
||||
.RE
|
||||
.IP \fBt\fR 5
|
||||
The data is interpreted as \fIcount\fR 16-bit signed integers
|
||||
|
||||
+3
-3
@@ -5,7 +5,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH catch n "8.5" Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -43,7 +43,7 @@ value stored in \fIresultVarName\fR is the value returned from \fIscript\fR.
|
||||
.PP
|
||||
If the \fIoptionsVarName\fR argument is given, then the variable it
|
||||
names is set to a dictionary of return options returned by evaluation
|
||||
of \fIscript\fR. Tcl specifies two entries that are always
|
||||
of \fIscript\fR. Tcl specifies two entries that are always
|
||||
defined in the dictionary: \fB\-code\fR and \fB\-level\fR. When
|
||||
the return code from evaluation of \fIscript\fR is not \fBTCL_RETURN\fR,
|
||||
the value of the \fB\-level\fR entry will be 0, and the value
|
||||
@@ -114,7 +114,7 @@ if { [\fBcatch\fR {open $someFile w} fid] } {
|
||||
.PP
|
||||
There are more complex examples of \fBcatch\fR usage in the
|
||||
documentation for the \fBreturn\fR command.
|
||||
.SH "SEE ALSO"
|
||||
.SH "SEE ALSO"
|
||||
break(n), continue(n), dict(n), error(n), errorCode(n), errorInfo(n), info(n),
|
||||
return(n)
|
||||
.SH KEYWORDS
|
||||
|
||||
+12
-26
@@ -1,4 +1,4 @@
|
||||
'\"
|
||||
'\"
|
||||
'\" Copyright (c) 2005-2006 Donal K. Fellows
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
@@ -200,7 +200,7 @@ generate an error.
|
||||
.TP
|
||||
\fB\-translation\fR \fImode\fR
|
||||
.TP
|
||||
\fB\-translation\fR \fB{\fIinMode outMode\fB}\fR
|
||||
\fB\-translation\fR \fB{\fIinMode outMode\fB}\fR
|
||||
.
|
||||
In Tcl scripts the end of a line is always represented using a single
|
||||
newline character (\en). However, in actual files and devices the end
|
||||
@@ -240,7 +240,7 @@ all platforms Tcl chooses \fBcrlf\fR, for all Unix flavors, it chooses
|
||||
\fBcrlf\fR. The default setting for \fB\-translation\fR is \fBauto\fR
|
||||
for both input and output.
|
||||
.TP
|
||||
\fBbinary\fR
|
||||
\fBbinary\fR
|
||||
.
|
||||
No end-of-line translations are performed. This is nearly identical
|
||||
to \fBlf\fR mode, except that in addition \fBbinary\fR mode also sets
|
||||
@@ -287,14 +287,12 @@ slow destinations like network sockets.
|
||||
.RS
|
||||
.PP
|
||||
The \fBchan copy\fR command transfers data from \fIinputChan\fR until
|
||||
end of file or \fIsize\fR bytes or characters have been transferred;
|
||||
\fIsize\fR is in bytes if the two channels are using the same encoding,
|
||||
and is in characters otherwise. If no \fB\-size\fR argument is given,
|
||||
then the copy goes until end of file. All the data read from
|
||||
\fIinputChan\fR is copied to \fIoutputChan\fR. Without the
|
||||
\fB\-command\fR option, \fBchan copy\fR blocks until the copy is
|
||||
complete and returns the number of bytes or characters (using the same
|
||||
rules as for the \fB\-size\fR option) written to \fIoutputChan\fR.
|
||||
end of file or \fIsize\fR bytes have been transferred. If no
|
||||
\fB\-size\fR argument is given, then the copy goes until end of file.
|
||||
All the data read from \fIinputChan\fR is copied to \fIoutputChan\fR.
|
||||
Without the \fB\-command\fR option, \fBchan copy\fR blocks until the
|
||||
copy is complete and returns the number of bytes written to
|
||||
\fIoutputChan\fR.
|
||||
.PP
|
||||
The \fB\-command\fR argument makes \fBchan copy\fR work in the
|
||||
background. In this case it returns immediately and the
|
||||
@@ -532,8 +530,8 @@ only those channel names that match it (according to the rules of
|
||||
.
|
||||
Depending on whether \fImode\fR is \fBinput\fR or \fBoutput\fR,
|
||||
returns the number of
|
||||
bytes of input or output (respectively) currently buffered
|
||||
internally for \fIchannelId\fR (especially useful in a readable event
|
||||
bytes of input or output (respectively) currently buffered
|
||||
internally for \fIchannelId\fR (especially useful in a readable event
|
||||
callback to impose application-specific limits on input line lengths to avoid
|
||||
a potential denial-of-service attack where a hostile user crafts
|
||||
an extremely long line that exceeds the available memory to buffer it).
|
||||
@@ -548,19 +546,7 @@ separately \fBstderr\fR and \fBstdout\fR from a subprocess. To do
|
||||
this, spawn with "2>@" or
|
||||
">@" redirection operators onto the write side of a pipe, and then
|
||||
immediately close it in the parent. This is necessary to get an EOF on
|
||||
the read side once the child has exited or otherwise closed its output.
|
||||
.RS
|
||||
.PP
|
||||
Note that the pipe buffering semantics can vary at the operating system level
|
||||
substantially; it is not safe to assume that a write performed on the output
|
||||
side of the pipe will appear instantly to the input side. This is a
|
||||
fundamental difference and Tcl cannot conceal it. The overall stream semantics
|
||||
\fIare\fR compatible, so blocking reads and writes will not see most of the
|
||||
differences, but the details of what exactly gets written when are not. This
|
||||
is most likely to show up when using pipelines for testing; care should be
|
||||
taken to ensure that deadlocks do not occur and that potential short reads are
|
||||
allowed for.
|
||||
.RE
|
||||
the read side once the child has exited or otherwise closed its output.
|
||||
.VE 8.6
|
||||
.TP
|
||||
\fBchan pop \fIchannelId\fR
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH dde n 1.4 dde "Tcl Bundled Packages"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -85,7 +85,7 @@ the command returns immediately with no error.
|
||||
.VS 8.6
|
||||
Without the \fB\-binary\fR option all data will be sent in unicode. For
|
||||
dde clients which don't implement the CF_UNICODE clipboard format, this
|
||||
will automatically be translated to the system encoding. You can use
|
||||
will automatically be translated to the system encoding. You can use
|
||||
the \fB\-binary\fR option in combination with the result of
|
||||
\fBencoding convertto\fR to send data in any other encoding.
|
||||
.VE 8.6
|
||||
@@ -102,7 +102,7 @@ application.
|
||||
.VS 8.6
|
||||
Without the \fB\-binary\fR option all data will be sent in unicode. For
|
||||
dde clients which don't implement the CF_UNICODE clipboard format, this
|
||||
will automatically be translated to the system encoding. You can use
|
||||
will automatically be translated to the system encoding. You can use
|
||||
the \fB\-binary\fR option in combination with the result of
|
||||
\fBencoding convertto\fR to send data in any other encoding.
|
||||
.VE 8.6
|
||||
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
'\"
|
||||
'\" Copyright (c) 1998 by Scriptics Corporation.
|
||||
'\"
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH encoding n "8.1" Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -67,7 +67,7 @@ searchable directory, that element is ignored.
|
||||
\fBencoding names\fR
|
||||
.
|
||||
Returns a list containing the names of all of the encodings that are
|
||||
currently available.
|
||||
currently available.
|
||||
The encodings
|
||||
.QW utf-8
|
||||
and
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH error n "" Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -28,7 +28,7 @@ the Tcl interpreter adds information to the \fB\-errorinfo\fR
|
||||
return option. If the \fIinfo\fR argument is present, it is
|
||||
used to initialize the \fB\-errorinfo\fR return options and
|
||||
the first increment of unwind information
|
||||
will not be added by the Tcl interpreter.
|
||||
will not be added by the Tcl interpreter.
|
||||
In other
|
||||
words, the command containing the \fBerror\fR command will not appear
|
||||
in the stack trace; in its place will be \fIinfo\fR.
|
||||
|
||||
+5
-6
@@ -5,7 +5,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH exec n 8.5 Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -220,7 +220,7 @@ discarded.
|
||||
The Tk console text widget does not provide real standard IO capabilities.
|
||||
Under Tk, when redirecting from standard input, all applications will see an
|
||||
immediate end-of-file; information redirected to standard output or standard
|
||||
error will be discarded.
|
||||
error will be discarded.
|
||||
.PP
|
||||
Either forward or backward slashes are accepted as path separators for
|
||||
arguments to Tcl commands. When executing an application, the path name
|
||||
@@ -231,7 +231,7 @@ backslashes only in paths. Any arguments to an application that specify a
|
||||
path name with forward slashes will not automatically be converted to use
|
||||
the backslash character. If an argument contains forward slashes as the
|
||||
path separator, it may or may not be recognized as a path name, depending on
|
||||
the program.
|
||||
the program.
|
||||
.PP
|
||||
Additionally, when calling a 16-bit DOS or Windows 3.X application, all path
|
||||
names must use the short, cryptic, path format (e.g., using
|
||||
@@ -271,9 +271,8 @@ limitation as \fBexec\fR wants to communicate over pipes. The Expect
|
||||
extension addresses this issue when communicating with a TUI application.
|
||||
.PP
|
||||
When attempting to execute an application, \fBexec\fR first searches for
|
||||
the name as it was specified. Then, in order,
|
||||
\fB.com\fR, \fB.exe\fR, \fB.bat\fR and \fB.cmd\fR
|
||||
are appended to the end of the specified name and it searches
|
||||
the name as it was specified. Then, in order, \fB.com\fR, \fB.exe\fR, and
|
||||
\fB.bat\fR are appended to the end of the specified name and it searches
|
||||
for the longer name. If a directory name was not specified as part of the
|
||||
application name, the following directories are automatically searched in
|
||||
order when attempting to locate the application:
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH expr n 8.5 Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -398,7 +398,7 @@ Most expressions do not require a second round of substitutions.
|
||||
Either they are enclosed in braces or, if not,
|
||||
their variable and command substitutions yield numbers or strings
|
||||
that do not themselves require substitutions.
|
||||
However, because a few unbraced expressions
|
||||
However, because a few unbraced expressions
|
||||
need two rounds of substitutions,
|
||||
the bytecode compiler must emit
|
||||
additional instructions to handle this situation.
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
'\"
|
||||
'\"
|
||||
'\" Copyright (c) 1995-1996 Sun Microsystems, Inc.
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
@@ -125,7 +125,7 @@ generate an error.
|
||||
.TP
|
||||
\fB\-translation\fR \fImode\fR
|
||||
.TP
|
||||
\fB\-translation\fR \fB{\fIinMode outMode\fB}\fR
|
||||
\fB\-translation\fR \fB{\fIinMode outMode\fB}\fR
|
||||
.
|
||||
In Tcl scripts the end of a line is always represented using a single
|
||||
newline character (\en). However, in actual files and devices the end of
|
||||
@@ -163,7 +163,7 @@ 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
|
||||
\fBbinary\fR
|
||||
.
|
||||
No end-of-line translations are performed. This is nearly identical to
|
||||
\fBlf\fR mode, except that in addition \fBbinary\fR mode also sets the
|
||||
|
||||
+7
-13
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH fcopy n 8.0 Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -23,23 +23,20 @@ avoid extra copies and to avoid buffering too much data in
|
||||
main memory when copying large files to slow destinations like
|
||||
network sockets.
|
||||
.PP
|
||||
The \fBfcopy\fR
|
||||
The \fBfcopy\fR
|
||||
command transfers data from \fIinchan\fR until end of file
|
||||
or \fIsize\fR bytes or characters have been
|
||||
transferred; \fIsize\fR is in bytes if the two channels are using the
|
||||
same encoding, and is in characters otherwise.
|
||||
If no \fB\-size\fR argument is given,
|
||||
or \fIsize\fR bytes have been
|
||||
transferred. If no \fB\-size\fR argument is given,
|
||||
then the copy goes until end of file.
|
||||
All the data read from \fIinchan\fR is copied to \fIoutchan\fR.
|
||||
Without the \fB\-command\fR option, \fBfcopy\fR blocks until the copy is complete
|
||||
and returns the number of bytes or characters (using the same rules as
|
||||
for the \fB\-size\fR option) written to \fIoutchan\fR.
|
||||
and returns the number of bytes written to \fIoutchan\fR.
|
||||
.PP
|
||||
The \fB\-command\fR argument makes \fBfcopy\fR work in the background.
|
||||
In this case it returns immediately and the \fIcallback\fR is invoked
|
||||
later when the copy completes.
|
||||
The \fIcallback\fR is called with
|
||||
one or two additional
|
||||
one or two additional
|
||||
arguments that indicates how many bytes were written to \fIoutchan\fR.
|
||||
If an error occurred during the background copy, the second argument is the
|
||||
error string associated with the error.
|
||||
@@ -112,7 +109,7 @@ fconfigure $out -translation binary
|
||||
This second example shows how the callback gets
|
||||
passed the number of bytes transferred.
|
||||
It also uses vwait to put the application into the event loop.
|
||||
Of course, this simplified example could be done without the command
|
||||
Of course, this simplified example could be done without the command
|
||||
callback.
|
||||
.PP
|
||||
.CS
|
||||
@@ -177,6 +174,3 @@ vwait done
|
||||
eof(n), fblocked(n), fconfigure(n), file(n)
|
||||
.SH KEYWORDS
|
||||
blocking, channel, end of line, end of file, nonblocking, read, translation
|
||||
'\" Local Variables:
|
||||
'\" mode: nroff
|
||||
'\" End:
|
||||
|
||||
+13
-14
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH file n 8.3 Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -141,7 +141,7 @@ returned. For example,
|
||||
\fBfile dirname\fR c:/
|
||||
.CE
|
||||
.PP
|
||||
returns \fBc:/\fR.
|
||||
returns \fBc:/\fR.
|
||||
.PP
|
||||
Note that tilde substitution will only be
|
||||
performed if it is necessary to complete the command. For example,
|
||||
@@ -162,9 +162,7 @@ returns \fB/home\fR (or something similar).
|
||||
\fBfile executable \fIname\fR
|
||||
.
|
||||
Returns \fB1\fR if file \fIname\fR is executable by the current user,
|
||||
\fB0\fR otherwise. On Windows, which does not have an executable attribute,
|
||||
the command treats all directories and any files with extensions
|
||||
\fBexe\fR, \fBcom\fR, \fBcmd\fR or \fBbat\fR as executable.
|
||||
\fB0\fR otherwise.
|
||||
.TP
|
||||
\fBfile exists \fIname\fR
|
||||
.
|
||||
@@ -302,7 +300,7 @@ operate on the actual symbolic link itself (for example \fBfile delete\fR,
|
||||
\fBfile rename\fR, \fBfile copy\fR are defined to operate on symbolic
|
||||
links, not on the things that they point to).
|
||||
.TP
|
||||
\fBfile owned \fIname\fR
|
||||
\fBfile owned \fIname\fR
|
||||
.
|
||||
Returns \fB1\fR if file \fIname\fR is owned by the current user, \fB0\fR
|
||||
otherwise.
|
||||
@@ -320,7 +318,7 @@ type is \fBvolumerelative\fR.
|
||||
\fBfile readable \fIname\fR
|
||||
.
|
||||
Returns \fB1\fR if file \fIname\fR is readable by the current user,
|
||||
\fB0\fR otherwise.
|
||||
\fB0\fR otherwise.
|
||||
.TP
|
||||
\fBfile readlink \fIname\fR
|
||||
.
|
||||
@@ -358,7 +356,7 @@ component of \fIname\fR does not contain a dot, then returns \fIname\fR.
|
||||
.TP
|
||||
\fBfile separator\fR ?\fIname\fR?
|
||||
.
|
||||
If no argument is given, returns the character which is used to separate
|
||||
If no argument is given, returns the character which is used to separate
|
||||
path segments for native files on this platform. If a path is given,
|
||||
the filesystem responsible for that path is asked to return its
|
||||
separator character. If no file system accepts \fIname\fR, an error
|
||||
@@ -429,7 +427,7 @@ If the file does not belong to any filesystem, an error is generated.
|
||||
.
|
||||
Returns all of the characters in the last filesystem component of
|
||||
\fIname\fR. Any trailing directory separator in \fIname\fR is ignored.
|
||||
If \fIname\fR contains no separators then returns \fIname\fR. So,
|
||||
If \fIname\fR contains no separators then returns \fIname\fR. So,
|
||||
\fBfile tail a/b\fR, \fBfile tail a/b/\fR and \fBfile tail b\fR all
|
||||
return \fBb\fR.
|
||||
.TP
|
||||
@@ -459,7 +457,7 @@ Returns a string giving the type of file \fIname\fR, which will be one of
|
||||
\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. Without any virtual filesystems mounted as root
|
||||
volumes, on UNIX, the command will always return
|
||||
@@ -480,13 +478,14 @@ Returns \fB1\fR if file \fIname\fR is writable by the current user,
|
||||
\fBUnix\fR\0\0\0\0\0\0\0
|
||||
.
|
||||
These commands always operate using the real user and group identifiers,
|
||||
not the effective ones.
|
||||
not the effective ones.
|
||||
.TP
|
||||
\fBWindows\fR\0\0\0\0
|
||||
.
|
||||
The \fBfile owned\fR subcommand uses the user identifier (SID) of
|
||||
the process token, not the thread token which may be impersonating
|
||||
some other user.
|
||||
The \fBfile owned\fR subcommand currently always reports that the current user
|
||||
is the owner of the file, without regard for what the operating system
|
||||
believes to be true, making an ownership test useless. This issue (#3613671)
|
||||
may be fixed in a future release of Tcl.
|
||||
.SH EXAMPLES
|
||||
.PP
|
||||
This procedure shows how to search for C files in a given directory
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH fileevent n 7.5 Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -112,7 +112,7 @@ buggy handlers.
|
||||
In this setup \fBGetData\fR will be called with the channel as an
|
||||
argument whenever $chan becomes readable. The \fBread\fR call will
|
||||
read whatever binary data is currently available without blocking.
|
||||
Here the channel has the fileevent removed when an end of file
|
||||
Here the channel has the fileevent removed when an end of file
|
||||
occurs to avoid being continually called (see above). Alternatively
|
||||
the channel may be closed on this condition.
|
||||
.PP
|
||||
|
||||
+5
-5
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH filename n 7.5 Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -29,7 +29,7 @@ File names are grouped into three general types based on the starting point
|
||||
for the path used to specify the file: absolute, relative, and
|
||||
volume-relative. Absolute names are completely qualified, giving a path to
|
||||
the file relative to a particular volume and the root directory on that
|
||||
volume. Relative names are unqualified, giving a path to the file relative
|
||||
volume. Relative names are unqualified, giving a path to the file relative
|
||||
to the current working directory. Volume-relative names are partially
|
||||
qualified, either giving the path relative to the root directory on the
|
||||
current volume, or relative to the current directory of the specified
|
||||
@@ -75,7 +75,7 @@ current directory.
|
||||
.TP 15
|
||||
\fB\&../foo\fR
|
||||
Relative path to the file \fBfoo\fR in the directory above the current
|
||||
directory.
|
||||
directory.
|
||||
.RE
|
||||
.TP
|
||||
\fBWindows\fR
|
||||
@@ -84,7 +84,7 @@ style names. Both \fB/\fR and \fB\e\fR may be used as directory separators
|
||||
in either type of name. Drive-relative names consist of an optional drive
|
||||
specifier followed by an absolute or relative path. UNC paths follow the
|
||||
general form \fB\e\eservername\esharename\epath\efile\fR, but must at
|
||||
the very least contain the server and share components, i.e.
|
||||
the very least contain the server and share components, i.e.
|
||||
\fB\e\eservername\esharename\fR. In both forms,
|
||||
the file names \fB.\fR and \fB..\fR are special and refer to the current
|
||||
directory and the parent of the current directory respectively. The
|
||||
@@ -154,7 +154,7 @@ native path names). Also Windows 3.1 only supports file
|
||||
names with a root of no more than 8 characters and an extension of no
|
||||
more than 3 characters.
|
||||
.PP
|
||||
On Windows platforms there are file and path length restrictions.
|
||||
On Windows platforms there are file and path length restrictions.
|
||||
Complete paths or filenames longer than about 260 characters will lead
|
||||
to errors in most file operations.
|
||||
.PP
|
||||
|
||||
+19
-19
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH format n 8.1 Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -25,14 +25,14 @@ arguments, if any, provide values to be substituted into the result.
|
||||
The return value from \fBformat\fR is the formatted string.
|
||||
.SH "DETAILS ON FORMATTING"
|
||||
.PP
|
||||
The command operates by scanning \fIformatString\fR from left to right.
|
||||
The command operates by scanning \fIformatString\fR from left to right.
|
||||
Each character from the format string is appended to the result
|
||||
string unless it is a percent sign.
|
||||
If the character is a \fB%\fR then it is not copied to the result string.
|
||||
Instead, the characters following the \fB%\fR character are treated as
|
||||
a conversion specifier.
|
||||
The conversion specifier controls the conversion of the next successive
|
||||
\fIarg\fR to a particular format and the result is appended to
|
||||
\fIarg\fR to a particular format and the result is appended to
|
||||
the result string in place of the conversion specifier.
|
||||
If there are multiple conversion specifiers in the format string,
|
||||
then each one controls the conversion of one additional \fIarg\fR.
|
||||
@@ -66,12 +66,12 @@ The second portion of a conversion specifier may contain any of the
|
||||
following flag characters, in any order:
|
||||
.TP 10
|
||||
\fB\-\fR
|
||||
Specifies that the converted argument should be left-justified
|
||||
in its field (numbers are normally right-justified with leading
|
||||
Specifies that the converted argument should be left-justified
|
||||
in its field (numbers are normally right-justified with leading
|
||||
spaces if needed).
|
||||
.TP 10
|
||||
\fB+\fR
|
||||
Specifies that a number should always be printed with a sign,
|
||||
Specifies that a number should always be printed with a sign,
|
||||
even if positive.
|
||||
.TP 10
|
||||
\fIspace\fR
|
||||
@@ -79,7 +79,7 @@ Specifies that a space should be added to the beginning of the
|
||||
number if the first character is not a sign.
|
||||
.TP 10
|
||||
\fB0\fR
|
||||
Specifies that the number should be padded on the left with
|
||||
Specifies that the number should be padded on the left with
|
||||
zeroes instead of spaces.
|
||||
.TP 10
|
||||
\fB#\fR
|
||||
@@ -90,9 +90,9 @@ will be added to the beginning of the result unless it is zero.
|
||||
For \fBb\fR conversions, \fB0b\fR
|
||||
will be added to the beginning of the result unless it is zero.
|
||||
For all floating-point conversions (\fBe\fR, \fBE\fR, \fBf\fR,
|
||||
\fBg\fR, and \fBG\fR) it guarantees that the result always
|
||||
\fBg\fR, and \fBG\fR) it guarantees that the result always
|
||||
has a decimal point.
|
||||
For \fBg\fR and \fBG\fR conversions it specifies that
|
||||
For \fBg\fR and \fBG\fR conversions it specifies that
|
||||
trailing zeroes should not be removed.
|
||||
.SS "OPTIONAL FIELD WIDTH"
|
||||
.PP
|
||||
@@ -103,7 +103,7 @@ If the converted argument contains fewer characters than the
|
||||
minimum field width then it will be padded so that it is as wide
|
||||
as the minimum field width.
|
||||
Padding normally occurs by adding extra spaces on the left of the
|
||||
converted argument, but the \fB0\fR and \fB\-\fR flags
|
||||
converted argument, but the \fB0\fR and \fB\-\fR flags
|
||||
may be used to specify padding with zeroes on the left or with
|
||||
spaces on the right, respectively.
|
||||
If the minimum field width is specified as \fB*\fR rather than
|
||||
@@ -122,7 +122,7 @@ point (however, trailing zeroes after the decimal point will still
|
||||
be omitted unless the \fB#\fR flag has been specified).
|
||||
For integer conversions, it specifies a minimum number of digits
|
||||
to print (leading zeroes will be added if necessary).
|
||||
For \fBs\fR conversions it specifies the maximum number of characters to be
|
||||
For \fBs\fR conversions it specifies the maximum number of characters to be
|
||||
printed; if the string is longer than this then the trailing characters will be dropped.
|
||||
If the precision is specified with \fB*\fR rather than a number
|
||||
then the next argument to the \fBformat\fR command determines the precision;
|
||||
@@ -135,7 +135,7 @@ If it is \fBll\fR it specifies that an integer value is taken
|
||||
without truncation for conversion to a formatted substring.
|
||||
If it is \fBh\fR it specifies that an integer value is
|
||||
truncated to a 16-bit range before converting. This option is rarely useful.
|
||||
If it is \fBl\fR it specifies that the integer value is
|
||||
If it is \fBl\fR it specifies that the integer value is
|
||||
truncated to the same range as that produced by the \fBwide()\fR
|
||||
function of the \fBexpr\fR command (at least a 64-bit range).
|
||||
If neither \fBh\fR nor \fBl\fR are present, the integer value is
|
||||
@@ -178,22 +178,22 @@ Convert integer to the Unicode character it represents.
|
||||
No conversion; just insert string.
|
||||
.TP 10
|
||||
\fBf\fR
|
||||
Convert number to signed decimal string of
|
||||
the form \fIxx.yyy\fR, where the number of \fIy\fR's is determined by
|
||||
Convert number to signed decimal string of
|
||||
the form \fIxx.yyy\fR, where the number of \fIy\fR's is determined by
|
||||
the precision (default: 6).
|
||||
If the precision is 0 then no decimal point is output.
|
||||
.TP 10
|
||||
\fBe\fR or \fBE\fR
|
||||
Convert number to scientific notation in the
|
||||
form \fIx.yyy\fBe\(+-\fIzz\fR, where the number of \fIy\fR's is determined
|
||||
Convert number to scientific notation in the
|
||||
form \fIx.yyy\fBe\(+-\fIzz\fR, where the number of \fIy\fR's is determined
|
||||
by the precision (default: 6).
|
||||
If the precision is 0 then no decimal point is output.
|
||||
If the \fBE\fR form is used then \fBE\fR is
|
||||
If the \fBE\fR form is used then \fBE\fR is
|
||||
printed instead of \fBe\fR.
|
||||
.TP 10
|
||||
\fBg\fR or \fBG\fR
|
||||
If the exponent is less than \-4 or greater than or equal to the
|
||||
precision, then convert number as for \fB%e\fR or
|
||||
If the exponent is less than \-4 or greater than or equal to the
|
||||
precision, then convert number as for \fB%e\fR or
|
||||
\fB%E\fR.
|
||||
Otherwise convert as for \fB%f\fR.
|
||||
Trailing zeroes and a trailing decimal point are omitted.
|
||||
|
||||
+2
-2
@@ -4,7 +4,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH global n "" Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -24,7 +24,7 @@ in the list returned by \fBinfo locals\fR).
|
||||
.PP
|
||||
If \fIvarname\fR contains namespace qualifiers, the local variable's name is
|
||||
the unqualified name of the global variable, as determined by the
|
||||
\fBnamespace tail\fR command.
|
||||
\fBnamespace tail\fR command.
|
||||
.PP
|
||||
\fIvarname\fR is always treated as the name of a variable, not an
|
||||
array element. An error is returned if the name looks like an array element,
|
||||
|
||||
+5
-5
@@ -5,7 +5,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH "http" n 2.7 http "Tcl Bundled Packages"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -60,7 +60,7 @@ a custom \fBsocket\fR command, via \fB::http::register\fR.
|
||||
.PP
|
||||
The \fB::http::geturl\fR procedure does a HTTP transaction.
|
||||
Its \fIoptions \fR determine whether a GET, POST, or HEAD transaction
|
||||
is performed.
|
||||
is performed.
|
||||
The return value of \fB::http::geturl\fR is a token for the transaction.
|
||||
The value is also the name of an array in the ::http namespace
|
||||
that contains state information about the transaction. The elements
|
||||
@@ -90,7 +90,7 @@ flags and values that define the configuration:
|
||||
\fB\-accept\fR \fImimetypes\fR
|
||||
.
|
||||
The Accept header of the request. The default is */*, which means that
|
||||
all types of documents are accepted. Otherwise you can supply a
|
||||
all types of documents are accepted. Otherwise you can supply a
|
||||
comma-separated list of mime type patterns that you are
|
||||
willing to receive. For example,
|
||||
.QW "image/gif, image/jpeg, text/*" .
|
||||
@@ -132,7 +132,7 @@ The value of the User-Agent header in the HTTP request. The default is
|
||||
.QW "\fBTcl http client package 2.7\fR" .
|
||||
.RE
|
||||
.TP
|
||||
\fB::http::geturl\fR \fIurl\fR ?\fIoptions\fR?
|
||||
\fB::http::geturl\fR \fIurl\fR ?\fIoptions\fR?
|
||||
.
|
||||
The \fB::http::geturl\fR command is the main procedure in the package.
|
||||
The \fB\-query\fR option causes a POST operation and
|
||||
@@ -275,7 +275,7 @@ do the formatting.
|
||||
\fB\-queryblocksize\fR \fIsize\fR
|
||||
.
|
||||
The block size used when posting query data to the URL.
|
||||
At most
|
||||
At most
|
||||
\fIsize\fR
|
||||
bytes are written at once. After each block, a call to the
|
||||
\fB\-queryprogress\fR
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
[Fri Sep 22 16:07:30 PDT 2006]
|
||||
|
||||
The problem is pass by reference vs value. There isn't a nice way to do it
|
||||
like C so we're inventing a different way, trying to keep it readable.
|
||||
|
||||
proc tcl_ref {setme} {
|
||||
upvar $setme ptr
|
||||
set ptr "some string"
|
||||
}
|
||||
|
||||
/*
|
||||
* how this works is that the compiler sees the &setme and generates code like:
|
||||
* upvar ${&setme} setme
|
||||
*/
|
||||
void
|
||||
L_ref(string &setme)
|
||||
{
|
||||
setme = "some string";
|
||||
}
|
||||
|
||||
It does mean that if I want to call gets() from L I need to do
|
||||
|
||||
while (gets(fd, &buf) > 0) {
|
||||
...
|
||||
}
|
||||
|
||||
which isn't very C like. That's OK, L isn't C because strings are first
|
||||
class in L and they aren't in C. Oscar wacked that into my head. Slowly.
|
||||
|
||||
The next issue is compound types like arrays / hashes. I want those to be
|
||||
implicit references, like C. So no &my_array in args, it's just my_array.
|
||||
|
||||
/*
|
||||
* as above, the compiler sees foo[] and subs in &foo as the parameter
|
||||
* and does the upvar ${&foo} foo
|
||||
*/
|
||||
void
|
||||
L_array_ref(int foo[])
|
||||
{
|
||||
foo[3] = 3;
|
||||
}
|
||||
|
||||
/*
|
||||
* as above, the compiler sees foo{} and does the code like
|
||||
* upvar $foo 0foo
|
||||
*
|
||||
* Note also the new full specified syntax for a hash declaration.
|
||||
* The following are the same thing and for 1.0 we implement the
|
||||
* first one only. But the second form allows us to have var/poly/int
|
||||
* etc. as keys or indices. The syntax is "value" varname{"key"} where
|
||||
* value is the type of the value and key is the type of the key. Nifty.
|
||||
* hash foo{};
|
||||
* string foo{string};
|
||||
*
|
||||
* For 1.0 this is just
|
||||
* L_hash_ref(hash foo)
|
||||
* and I do want to insist on the {} in declarations (args and formal) because
|
||||
* it gets people used to the foo{"string"} syntax.
|
||||
*/
|
||||
void
|
||||
L_hash_ref(string foo{string})
|
||||
{
|
||||
int mine{};
|
||||
|
||||
foo{"some key"} = "some value";
|
||||
}
|
||||
|
||||
A calling wrinkle.
|
||||
|
||||
When calling an L function/tcl proc which expects a reference, i.e.,
|
||||
func(string &buf) or proc foo {bufname} { upvar $bufname buf ... },
|
||||
from an L context, there is a question as to whether or not the
|
||||
L variable needs a leading &. And the answer is: depends on what you
|
||||
want. All the leading ampersand does is to push the name of the
|
||||
variable on the stack instead of the value of the variable (w/ all
|
||||
the COW semantics). So consider this
|
||||
|
||||
void
|
||||
stomp(string &buf)
|
||||
{
|
||||
buf = "stomped";
|
||||
}
|
||||
|
||||
void
|
||||
L_caller()
|
||||
{
|
||||
string foo = "bar";
|
||||
string fooname = "foo";
|
||||
|
||||
if (what_I_would_expect) {
|
||||
stomp(&foo); // foo will get "stomped"
|
||||
} else {
|
||||
stomp(fooname); // foo will get "stomped" this way too
|
||||
}
|
||||
}
|
||||
|
||||
The stomp(fooname) could work but we should disallow it in L 1.0 - we
|
||||
can allow it in the future. Tim points out that we can throw a syntax
|
||||
error for L calling L and the type mismatch but not for L calling tcl,
|
||||
i.e., calling gets, unless we have some sort of extern int gets(FILE fd,
|
||||
string &buf) that we use to load the function signature table (what is
|
||||
that called?)
|
||||
|
||||
Tcl calling L
|
||||
|
||||
Suppose we had an L procedure that implemented puts, maybe it's written
|
||||
in C, but it would be declared like
|
||||
|
||||
void
|
||||
L_puts(string stuff_to_print[])
|
||||
{
|
||||
print it
|
||||
}
|
||||
|
||||
If we are in tcl and we do
|
||||
|
||||
set stuff [list a b c]
|
||||
|
||||
and we want to print it it would look like
|
||||
|
||||
puts $stuff
|
||||
|
||||
but if we're calling L that won't work, it should be an arg miss match because
|
||||
|
||||
L_puts $stuff
|
||||
|
||||
is like calling
|
||||
|
||||
L_puts("a", "b", "c")
|
||||
|
||||
and L_puts wants a single arg.
|
||||
|
||||
We get around this by noting that L implements pass by reference by passing
|
||||
by name and doing an upvar so the calling syntax is:
|
||||
|
||||
L_puts stuff
|
||||
|
||||
Kind of annoying but that's a ramification of the impedance mismatch between
|
||||
L and tcl. If you want to make breakfast you have to break some eggs.
|
||||
|
||||
============================================================================
|
||||
|
||||
Structs
|
||||
|
||||
struct foo {
|
||||
int a; /* I am A */
|
||||
string b; /* oh, love those strings */
|
||||
}
|
||||
|
||||
results in the creation of a list in ::L like
|
||||
|
||||
# Note the offset into the list is the index into the struct "list"
|
||||
set ::L::{struct foo} [list \
|
||||
[list int a {I am A}] \
|
||||
[list string b {oh, love those strings}] \
|
||||
]
|
||||
|
||||
and now I can pass a struct to tcl just like an other COW thingy and I
|
||||
can make a little struct command that gets me fields, sets them, does
|
||||
introspection, etc.
|
||||
|
||||
And the cool thing is L can do the introspection which means I can write
|
||||
my little preferences struct and call some wacky code that takes the
|
||||
struct and con's up the code to make a preference dialogue.
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
struct node {
|
||||
double i;
|
||||
};
|
||||
|
||||
struct node tree[100000];
|
||||
|
||||
int
|
||||
insert(int node, struct node element)
|
||||
{
|
||||
/* using Tcl's {} as NULL */
|
||||
if (tree[node] == "{}") {
|
||||
tree[node] = element;
|
||||
} else if (tree[node].i > element.i) {
|
||||
insert(2*node+1, element);
|
||||
} else {
|
||||
insert(2*node+2, element);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
print(int node)
|
||||
{
|
||||
if (tree[node] == "{}") {
|
||||
return;
|
||||
}
|
||||
print(2*node+1);
|
||||
puts(tree[node].i);
|
||||
print(2*node+2);
|
||||
}
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
struct node tmp;
|
||||
int i;
|
||||
|
||||
namespace("import", "::tcl::mathfunc::*");
|
||||
for (i = 0; i < 100; i++) {
|
||||
tmp.i = floor(rand()*100);
|
||||
insert(0, tmp);
|
||||
}
|
||||
print(0);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
typedef string FILE;
|
||||
|
||||
main(int ac, string av[])
|
||||
{
|
||||
int i;
|
||||
FILE fd;
|
||||
|
||||
if (ac == 1) {
|
||||
puts("-nonewline", read("stdin"));
|
||||
} else {
|
||||
for (i = 1; defined(av[i]); i++) {
|
||||
fd = open(av[i], "r");
|
||||
puts("-nonewline", read(fd));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
main(int argc, string argv[])
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; defined(argv[i]); i++) {
|
||||
printf("[%d] = %s\n", i, argv[i]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
typedef string FILE;
|
||||
|
||||
main(int ac, string av[], hash env)
|
||||
{
|
||||
int i;
|
||||
string regex;
|
||||
FILE fd;
|
||||
|
||||
if (ac < 2) {
|
||||
error("Not enough arguments.");
|
||||
}
|
||||
regex = av[1];
|
||||
ac--;
|
||||
if (ac == 1) {
|
||||
grep(regex, "stdin");
|
||||
} else {
|
||||
for (i = 2; defined(av[i]); i++) {
|
||||
fd = open(av[i], "r");
|
||||
grep(regex, fd);
|
||||
close(fd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
grep(string regex, FILE in)
|
||||
{
|
||||
string buf;
|
||||
|
||||
while (gets(in, &buf) >= 0) {
|
||||
if (buf =~ /${regex}/) {
|
||||
printf("%s\n", buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
#lang(L)
|
||||
|
||||
/*
|
||||
* Demonstrate interop between L and tcl.
|
||||
* We want to show that you can pass any data structure between L and tcl.
|
||||
*
|
||||
* Base types, pass them, modify them.
|
||||
* Structures, pass them, iterate over the fields.
|
||||
* Arrays & hashes.
|
||||
* Pointers to base types.
|
||||
*/
|
||||
main(int ac, string av[])
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* L calling tcl functions
|
||||
*/
|
||||
L_to_tcl()
|
||||
{
|
||||
string s = "Hi there mom";
|
||||
int a = 1234;
|
||||
|
||||
puts(a); // prints 1234\n
|
||||
puts(s); // prints Hi there mom\n
|
||||
set(&s, "Hi yourself");
|
||||
puts(s); // prints Hi yourself\n
|
||||
puts(:nonewline, "Hi "); // prints Hi
|
||||
puts("there"); // prints there\n
|
||||
}
|
||||
|
||||
set(string &out, string value)
|
||||
{
|
||||
out = value;
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
#pragma language L
|
||||
|
||||
julia(int size, int depth, double zreal, double zimag)
|
||||
{
|
||||
double z[2];
|
||||
double real_min = -1.2, real_max = 1.2, imag_min = -1.2;
|
||||
double xreal, ximag;
|
||||
double delta = (real_max - real_min) / size;
|
||||
int i = 0, j = 0;
|
||||
|
||||
wm("title", ".", "Pretty Julia");
|
||||
wm("geometry", ".", "+1+1");
|
||||
canvas(".c1", "-width", size, "-height", size);
|
||||
pack(".c1");
|
||||
update();
|
||||
z[0] = zreal;
|
||||
z[1] = zimag;
|
||||
xreal = real_min;
|
||||
while (i < size) {
|
||||
j = 0;
|
||||
ximag = imag_min;
|
||||
while (j < size) {
|
||||
double count = 0.0;
|
||||
double x[2];
|
||||
|
||||
x[0] = xreal;
|
||||
x[1] = ximag;
|
||||
while ((count < depth) && (complex_abs(x) < 2.0)) {
|
||||
count = count + 1;
|
||||
x = complex_add(complex_multiply(x, x), z);
|
||||
}
|
||||
if (complex_abs(x) <= 2.0) {
|
||||
.c1("create", "rectangle", i, j, i, j,
|
||||
"-outline", make_color(0, 0, 0));
|
||||
} else {
|
||||
double intensity = count / depth;
|
||||
|
||||
if (intensity > 0.001) {
|
||||
.c1("create", "rectangle", i, j, i, j,
|
||||
"-outline",
|
||||
make_color(round(255.0 / depth *
|
||||
(depth -
|
||||
depth * intensity)),
|
||||
round(255.0 / depth * (depth -
|
||||
depth * intensity)),
|
||||
round(255.0 / depth * depth)));
|
||||
}
|
||||
}
|
||||
j++;
|
||||
ximag = ximag + delta;
|
||||
} i++;
|
||||
puts("-nonewline", format("%d .. ", i));
|
||||
flush("stdout");
|
||||
update();
|
||||
xreal = xreal + delta;
|
||||
} z[0] = zreal;
|
||||
z[1] = zimag;
|
||||
puts("\nDONE");
|
||||
}
|
||||
|
||||
string
|
||||
make_color(int r, int g, int b)
|
||||
{
|
||||
return format("#%02X%02X%02X", r, g, b);
|
||||
}
|
||||
|
||||
double
|
||||
complex_multiply(double c1[2], double c2[2])
|
||||
{
|
||||
double c3[2];
|
||||
|
||||
c3[0] = c1[0] * c2[0] - c1[1] * c2[1];
|
||||
c3[1] = c1[0] * c2[1] + c1[1] * c2[0];
|
||||
return c3;
|
||||
}
|
||||
|
||||
double
|
||||
complex_add(double c1[2], double c2[2])
|
||||
{
|
||||
double c3[2];
|
||||
|
||||
c3[0] = c1[0] + c2[0];
|
||||
c3[1] = c1[1] + c2[1];
|
||||
return c3;
|
||||
}
|
||||
|
||||
#pragma end
|
||||
|
||||
interp alias {} sqrt {} tcl::mathfunc::sqrt
|
||||
interp alias {} round {} tcl::mathfunc::round
|
||||
proc complex_abs {x} {
|
||||
puts "complex_abs $x"
|
||||
set a [lindex $x 0]
|
||||
set b [lindex $x 1]
|
||||
expr {sqrt(($a * $a)+($b * $b))}
|
||||
}
|
||||
#puts [time {julia 100 25 -0.74543 0.11302}]
|
||||
puts [time {julia 300 25 -0.84543 0.21302}]
|
||||
# bigger, different coords:
|
||||
#julia 256 25 -0.84543 0.21302
|
||||
# if you raise the depth, the islands get smaller:
|
||||
#julia 256 50 -0.84543 0.21302
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
.\" The L Programming Language
|
||||
.\" Copyright (c) 2006 BitMover, Inc.
|
||||
.\"
|
||||
.\" process with
|
||||
.\" groff -R -me l-language.me > l-language.ps
|
||||
.\"
|
||||
.\" Commands for refer
|
||||
.R1
|
||||
database references
|
||||
accumulate
|
||||
.R2
|
||||
.\" Title, authors, etc.
|
||||
.+c
|
||||
.(l C
|
||||
.sz 16
|
||||
.b "The L Programming Language"
|
||||
.sz
|
||||
or
|
||||
.sz 12
|
||||
Tcl for C Programmers
|
||||
.sz
|
||||
.sp 3
|
||||
.i "Oscar Bonilla, Tim Daly, Jr., Jeff Hobbs, Larry McVoy"
|
||||
.sp
|
||||
BitMover, Inc.
|
||||
300 Orchard City Drive, Suite 132
|
||||
Campbell, CA 95008
|
||||
\f(CR
|
||||
l@bitmover.com
|
||||
\fP
|
||||
.)l
|
||||
.sp 3
|
||||
.\" Abstract
|
||||
.(l F
|
||||
.b Abstract.
|
||||
This paper describes a new programming language called L. The goal of
|
||||
L is to make it easy for C programmers to take full advantage of
|
||||
Tcl/Tk without requiring them to be proficient in Tcl. L is a new
|
||||
programming language that shares most of its syntax and semantics with
|
||||
C, including pointers and a weak static type system. We have modified
|
||||
the Tcl parser to add a special command which can be used to switch
|
||||
between L and Tcl syntax. Source code written in L syntax is passed to
|
||||
a simple compiler which emits Tcl bytecode. So L source code can be
|
||||
mixed freely with Tcl source code, and Tcl and L can share data and
|
||||
functions transparently. L is free and open source, and the authors
|
||||
hope it will bring many new people to the Tcl community.
|
||||
.)l
|
||||
.\" Main text
|
||||
.sh 1 "Introduction"
|
||||
.lp
|
||||
At BitMover, we are great fans of code reading. We spend much more
|
||||
time reading our source code than writing it. Most of our source base
|
||||
is written in C, but our GUI is written in Tcl. It would greatly
|
||||
simplify things for us if everything was in a common language.
|
||||
However, using Tk from C would be difficult and error-prone.
|
||||
.pp
|
||||
For that reason, we've decided to implement a new language that shares
|
||||
the Tcl runtime. By keeping the language similar to C we can use the
|
||||
same idioms as we would in C, avoiding confusion. To make access to Tk
|
||||
and other Tcl libraries seamless, the language runs right in the Tcl
|
||||
runtime. Its functions are Tcl functions, and its types are Tcl types.
|
||||
.pp
|
||||
In keeping with the grand tradition of one letter language names, this
|
||||
new language is called L. In the next section, we will go into more
|
||||
detail about some interesting aspects of the language. After that we
|
||||
discuss its implementation as a front-end for Tcl. Finally we touch
|
||||
on our plans for the future of L, and tell you where you can get a
|
||||
copy.
|
||||
.sh 1 "The L Language"
|
||||
.lp
|
||||
Say that we're mostly like C and then go on to describe where we're
|
||||
different. Explain how L types correspond to Tcl types, and give an
|
||||
example of the interaction between the two languages.
|
||||
.\" This is an example reference so that I don't forget how to make one
|
||||
.[
|
||||
kernighan cherry eqn
|
||||
.]
|
||||
.sh 1 "The Implementation"
|
||||
.lp
|
||||
The first step in processing an L program is to read in the source
|
||||
code. L source code can be in its own file, or it can be in a mixed
|
||||
file together with Tcl source code.
|
||||
.sh 2 "Parsing Mixed Languages"
|
||||
.lp
|
||||
The most obvious approach to embedding L code within a Tcl program
|
||||
would be to pass the L code as an argument to a new Tcl command which
|
||||
implements L. However, the Tcl syntax rule that "braces nest within a
|
||||
word" [cite endekalogue/tcl book?] means that we would still be
|
||||
required to match (or escape) braces within the L code. This would be
|
||||
an unpleasant wrinkle for the L programmer to deal with.
|
||||
.pp
|
||||
In order to free the brace characters from the reign of Tcl, it was
|
||||
necessary to modify the Tcl parser. We added support for special
|
||||
comments that start with the word "pragma". The parser consumes the
|
||||
input from an opening pragma to a closing pragma, and packages it as a
|
||||
pair of Tcl words -- the name of the command that implements L,
|
||||
followed by the source code between the pragmas. In this way, the
|
||||
result of parsing embedded L code is the same as if the L code had
|
||||
been properly escaped.
|
||||
.sh 1 "..."
|
||||
.lp
|
||||
Mention using Tcl to generate C code, and explain how L pointers work.
|
||||
Take opportunity to release bile about Tcl being a bizarre backend for
|
||||
a C compiler.
|
||||
.sh 1 "Current Status, Availability"
|
||||
.lp
|
||||
L is completely finished and golden, and has a magic shield of +2
|
||||
anti-bitrot. You can get it from sunsite, tsx-11, or wuarchive.
|
||||
Build instructions are for sissies.
|
||||
.\" All done, print the references
|
||||
.[
|
||||
$LIST$
|
||||
.]
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,129 @@
|
||||
Outline
|
||||
What is it?
|
||||
Why is that interesting?
|
||||
Why not some other runtime?
|
||||
Why not just tcl?
|
||||
Language details
|
||||
Code examples
|
||||
Status or what doesn't work yet
|
||||
Future directions
|
||||
License and Availability
|
||||
What people are saying
|
||||
What is it?
|
||||
C-like syntax on top of the Tcl runtime
|
||||
Alternate compiler that generates tcl byte codes
|
||||
Does not change tcl system
|
||||
Interoperates with the tcl system
|
||||
Leverages the tcl runtime
|
||||
An example of a multi-syntax system (can have tcl & L in same file)
|
||||
Why not some other runtime?
|
||||
Lotso good stuff about the tcl runtime
|
||||
Why not pure tcl?
|
||||
Tcl cons from below
|
||||
Why did we do it?
|
||||
Already comitted to tcl/tk
|
||||
Tcl pros
|
||||
Stable runtime
|
||||
Easy to extend in C
|
||||
Powerful, dynamic language
|
||||
Tcl cons
|
||||
Hard to read (for us)
|
||||
No structs - probably the single biggest reason
|
||||
Lots of missing syntactic sugar
|
||||
foo[3] or [lindex foo 3]
|
||||
if (buf =~ /blah.*blech/)
|
||||
or
|
||||
if {[regexp blah.*blah buf]}
|
||||
etc.
|
||||
Pass by reference with upvar is annoying
|
||||
We're a conservative development organization. We sell
|
||||
to enterprise customers and we support releases going back
|
||||
indefinitely in some cases. All code goes through peer review and
|
||||
is optimized for ease of reading more than for ease of writing.
|
||||
We found tcl to be suboptimal in this environment, particularly
|
||||
because of the lack of structs but also because of the lack of
|
||||
syntactic sugar - calling procs to do array indexing is way over
|
||||
our threshold of pain for readability.
|
||||
Language details
|
||||
C-like syntax compiled to tcl byte code
|
||||
L can call tcl, tcl can call L
|
||||
Additions over C
|
||||
perl like regex in statements
|
||||
associative arrays
|
||||
defined() for variables, hashes, arrays
|
||||
defined(foo) [info exists] or winfo ???
|
||||
defined(foo{"bar"})
|
||||
defined(blech[2])
|
||||
strings are a basic type like int/float
|
||||
Additions over tcl
|
||||
structs
|
||||
type checking
|
||||
pass by reference improvements
|
||||
function fingerprints
|
||||
Types
|
||||
string (same as tcl string)
|
||||
int, float (type checked)
|
||||
var (unknown type, strongly typed on first assignment)
|
||||
poly (like tcl variable, no type checking)
|
||||
hash (associative array, currently string types for key/val)
|
||||
Implemented as dicts
|
||||
string types as key/values
|
||||
We could allow
|
||||
hash poly foo{poly}
|
||||
if we ever want that fucked up syntax.
|
||||
structs
|
||||
like C structs
|
||||
implemented as lists
|
||||
fields are in ::L::{struct name} as a list of lists,
|
||||
each list is {type name comments}
|
||||
struct struct {
|
||||
string type;
|
||||
string name;
|
||||
string comments;
|
||||
}
|
||||
Pass by reference or value?
|
||||
base types are all by value, COW, like tcl
|
||||
arrays and hashes are implicit references
|
||||
pass an array to a proc, modify array[3], caller sees
|
||||
base types and structures may be passed by reference
|
||||
pass by reference is done with &variable in the
|
||||
caller which is an alias for "variable", i.e.,
|
||||
we pass by name.
|
||||
In the callee the argument also wants a & and it means
|
||||
do an automagic upvar to get the real variable
|
||||
Returns
|
||||
All returns are by value
|
||||
all types just work as expected
|
||||
push the object onto the stack
|
||||
the other end gets the object into it's
|
||||
variable name.
|
||||
Code examples
|
||||
printenv.l
|
||||
Status or what doesn't work yet
|
||||
Well there are issues
|
||||
Future directions
|
||||
Scoping so you can do modules
|
||||
Precompiled modules (and byte code loader)
|
||||
Optimizations
|
||||
Debugging support
|
||||
Having an L contest for the best ($10K seem right?)
|
||||
License and Availability
|
||||
Same license as Tcl
|
||||
Exported as tarballs nightly
|
||||
What people are saying
|
||||
"It'll make your jaw drop"
|
||||
-- Steve Jobs
|
||||
"It's an amazing, amazing innovation."
|
||||
-- Steve Ballmer
|
||||
"I want to thank Larry McVoy"
|
||||
-- Richard Stallman
|
||||
"L == Tcl 9.0"
|
||||
-- Jeff Hobbs
|
||||
"L? Of course I like it. It's named for me. Right?"
|
||||
-- Linus Torvalds
|
||||
"It's like perl without the nastiest bits"
|
||||
-- Donal K Fellows
|
||||
"I think that's easier to read."
|
||||
-- Larry Wall
|
||||
"L is the coolest thing I've ever seen"
|
||||
-- Vadim Gelfer
|
||||
@@ -0,0 +1,9 @@
|
||||
main(int argc, string argv[], hash env)
|
||||
{
|
||||
string key, val;
|
||||
|
||||
foreach (env as key => val) {
|
||||
printf("env{%s} = %s\n", key, val);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
%A Brian W. Kernighan
|
||||
%A Lorinda L. Cherry
|
||||
%T A System for Typesetting Mathematics
|
||||
%J J. Comm. ACM
|
||||
%V 18
|
||||
%N 3
|
||||
%D March 1978
|
||||
%P 151-157
|
||||
%K eqn
|
||||
|
||||
%A Fred Brooks
|
||||
%T The Mythical Man Month
|
||||
%D 1975
|
||||
%K mythical man month
|
||||
|
||||
%A The Tcler's Wiki
|
||||
%T shimmering
|
||||
%J http://wiki.tcl.tk/3033
|
||||
%D Dec 2005
|
||||
%K shimmering
|
||||
|
||||
%A The Tcler's Wiki
|
||||
%T use_ref
|
||||
%J http://wiki.tcl.tk/15120
|
||||
%D Dec 2005
|
||||
%K pass by reference
|
||||
|
||||
%A Michael Hind
|
||||
%T Pointer Analysis: Haven't We Solved This Problem Yet?"
|
||||
%D 2001
|
||||
%K aliasing1
|
||||
|
||||
%A Steven S. Muchnick
|
||||
%T Advanced Compiler Design and Implementation
|
||||
%D 1997
|
||||
%I Morgan Kaufmann
|
||||
%K optimization
|
||||
|
||||
%A Brian W. Kernighan
|
||||
%A Dennis M. Ritchie
|
||||
%I Prentice-Hall, Inc.
|
||||
%T The C Programming Language
|
||||
%D 1978
|
||||
%K C
|
||||
|
||||
%T Pointer-Induced Aliasing: A Clarification
|
||||
%A Thomas J. Marlowe
|
||||
%A Jong-Deok Choi
|
||||
%A William G. Landi
|
||||
%A Michael G. Burke
|
||||
%A Barbara G. Ryder
|
||||
%A Paul Carini
|
||||
%J ACM SIGPLAN Notices
|
||||
%D September 1993
|
||||
%N Volume 28, No. 9
|
||||
%K aliasing2
|
||||
+3
-3
@@ -5,7 +5,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH lindex n 8.4 Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -48,7 +48,7 @@ substitution and command substitution do not occur.
|
||||
If \fIindex\fR is negative or greater than or equal to the number
|
||||
of elements in \fIvalue\fR, then an empty
|
||||
string is returned.
|
||||
The interpretation of each simple \fIindex\fR value is the same as
|
||||
The interpretation of each simple \fIindex\fR value is the same as
|
||||
for the command \fBstring index\fR, supporting simple index
|
||||
arithmetic and indices relative to the end of the list.
|
||||
.PP
|
||||
@@ -115,7 +115,7 @@ set idx 3
|
||||
\fI\(-> f\fR
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
list(n), lappend(n), linsert(n), llength(n), lsearch(n),
|
||||
list(n), lappend(n), linsert(n), llength(n), lsearch(n),
|
||||
lset(n), lsort(n), lrange(n), lreplace(n),
|
||||
string(n)
|
||||
.SH KEYWORDS
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH linsert n 8.2 Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -45,7 +45,7 @@ set newList [\fBlinsert\fR $midList end-1 lazy]
|
||||
set newerList [\fBlinsert\fR [\fBlinsert\fR $oldList end-1 quick] 1 lazy]
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
list(n), lappend(n), lindex(n), llength(n), lsearch(n),
|
||||
list(n), lappend(n), lindex(n), llength(n), lsearch(n),
|
||||
lset(n), lsort(n), lrange(n), lreplace(n),
|
||||
string(n)
|
||||
.SH KEYWORDS
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH llength n "" Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -49,7 +49,7 @@ An empty list is not necessarily an empty string:
|
||||
1,0
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
list(n), lappend(n), lindex(n), linsert(n), lsearch(n),
|
||||
list(n), lappend(n), lindex(n), linsert(n), lsearch(n),
|
||||
lset(n), lsort(n), lrange(n), lreplace(n)
|
||||
.SH KEYWORDS
|
||||
element, list, length
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH lmap n "" Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -51,7 +51,7 @@ Zip lists together:
|
||||
.CS
|
||||
set list1 {a b c d}
|
||||
set list2 {1 2 3 4}
|
||||
set zipped [\fBlmap\fR a $list1 b $list2 {list $a $b}]
|
||||
set zipped [\fBlmap\fR a $list1 b $list2 {list $a $b}]
|
||||
# The value of zipped is "{a 1} {b 2} {c 3} {d 4}"
|
||||
.CE
|
||||
.PP
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH lrange n 7.4 Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -71,7 +71,7 @@ elements to
|
||||
{elements to}
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n),
|
||||
list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n),
|
||||
lset(n), lreplace(n), lsort(n),
|
||||
string(n)
|
||||
.SH KEYWORDS
|
||||
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
'\"
|
||||
'\"
|
||||
'\" Copyright (c) 1993 The Regents of the University of California.
|
||||
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
|
||||
'\" Copyright (c) 2001 Kevin B. Kenny <kennykb@acm.org>. All rights reserved.
|
||||
@@ -6,7 +6,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH lsearch n 8.6 Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -111,7 +111,7 @@ The list elements are to be compared as integers.
|
||||
\fB\-nocase\fR
|
||||
.
|
||||
Causes comparisons to be handled in a case-insensitive manner. Has no
|
||||
effect if combined with the \fB\-dictionary\fR, \fB\-integer\fR, or
|
||||
effect if combined with the \fB\-dictionary\fR, \fB\-integer\fR, or
|
||||
\fB\-real\fR options.
|
||||
.TP
|
||||
\fB\-real\fR
|
||||
@@ -209,7 +209,7 @@ It is also possible to search inside elements:
|
||||
\fI\(-> {a abc} {b bcd}\fR
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
foreach(n), list(n), lappend(n), lindex(n), linsert(n), llength(n),
|
||||
foreach(n), list(n), lappend(n), lindex(n), linsert(n), llength(n),
|
||||
lset(n), lsort(n), lrange(n), lreplace(n),
|
||||
string(n)
|
||||
.SH KEYWORDS
|
||||
|
||||
+4
-4
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH lset n 8.4 Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -16,7 +16,7 @@ lset \- Change an element in a list
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
The \fBlset\fR command accepts a parameter, \fIvarName\fR, which
|
||||
it interprets as the name of a variable containing a Tcl list.
|
||||
it interprets as the name of a variable containing a Tcl list.
|
||||
It also accepts zero or more \fIindices\fR into
|
||||
the list. The indices may be presented either consecutively on the
|
||||
command line, or grouped in a
|
||||
@@ -40,7 +40,7 @@ In this case, \fInewValue\fR replaces the old value of the variable
|
||||
.PP
|
||||
When presented with a single index, the \fBlset\fR command
|
||||
treats the content of the \fIvarName\fR variable as a Tcl list.
|
||||
It addresses the \fIindex\fR'th element in it
|
||||
It addresses the \fIindex\fR'th element in it
|
||||
(0 refers to the first element of the list).
|
||||
When interpreting the list, \fBlset\fR observes the same rules
|
||||
concerning braces and quotes and backslashes as the Tcl command
|
||||
@@ -136,7 +136,7 @@ The indicated return value also becomes the new value of \fIx\fR.
|
||||
\fI\(-> {{a b} {c d}} {{e f} {j h}}\fR
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n),
|
||||
list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n),
|
||||
lsort(n), lrange(n), lreplace(n),
|
||||
string(n)
|
||||
.SH KEYWORDS
|
||||
|
||||
+4
-4
@@ -6,7 +6,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH lsort n 8.5 Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -153,14 +153,14 @@ returns
|
||||
\fB\-nocase\fR
|
||||
.
|
||||
Causes comparisons to be handled in a case-insensitive manner. Has no
|
||||
effect if combined with the \fB\-dictionary\fR, \fB\-integer\fR, or
|
||||
effect if combined with the \fB\-dictionary\fR, \fB\-integer\fR, or
|
||||
\fB\-real\fR options.
|
||||
.TP
|
||||
\fB\-unique\fR
|
||||
.
|
||||
If this option is specified, then only the last set of duplicate
|
||||
elements found in the list will be retained. Note that duplicates are
|
||||
determined relative to the comparison used in the sort. Thus if
|
||||
determined relative to the comparison used in the sort. Thus if
|
||||
\fB\-index 0\fR is used, \fB{1 a}\fR and \fB{1 b}\fR would be
|
||||
considered duplicates and only the second element, \fB{1 b}\fR, would
|
||||
be retained.
|
||||
@@ -265,7 +265,7 @@ More complex sorting using a comparison function:
|
||||
{1 dingo} {2 banana} {0x2 carrot} {3 apple}
|
||||
.CE
|
||||
.SH "SEE ALSO"
|
||||
list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n),
|
||||
list(n), lappend(n), lindex(n), linsert(n), llength(n), lsearch(n),
|
||||
lset(n), lrange(n), lreplace(n)
|
||||
.SH KEYWORDS
|
||||
element, list, order, sort
|
||||
|
||||
+4
-4
@@ -5,7 +5,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH mathfunc n 8.5 Tcl "Tcl Mathematical Functions"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -142,7 +142,7 @@ than \fI0\fR, this is equivalent to
|
||||
\fBbool \fIarg\fR
|
||||
.
|
||||
Accepts any numeric value, or any string acceptable to
|
||||
\fBstring is boolean\fR, and returns the corresponding
|
||||
\fBstring is boolean\fR, and returns the corresponding
|
||||
boolean value \fB0\fR or \fB1\fR. Non-zero numbers are true.
|
||||
Other numbers are false. Non-numeric strings produce boolean value in
|
||||
agreement with \fBstring is true\fR and \fBstring is false\fR.
|
||||
@@ -243,7 +243,7 @@ is negative, \fIy\fR must be an integer value.
|
||||
.TP
|
||||
\fBrand\fR
|
||||
.
|
||||
Returns a pseudo-random floating-point value in the range (\fI0\fR,\fI1\fR).
|
||||
Returns a pseudo-random floating-point value in the range (\fI0\fR,\fI1\fR).
|
||||
The generator algorithm is a simple linear congruential generator that
|
||||
is not cryptographically secure. Each result from \fBrand\fR completely
|
||||
determines all future results from subsequent calls to \fBrand\fR, so
|
||||
@@ -290,7 +290,7 @@ Returns the hyperbolic tangent of \fIarg\fR.
|
||||
.
|
||||
The argument may be any numeric value. The integer part of \fIarg\fR
|
||||
is determined, and then the low order 64 bits of that integer value
|
||||
are returned as an integer value.
|
||||
are returned as an integer value.
|
||||
.SH "SEE ALSO"
|
||||
expr(n), mathop(n), namespace(n)
|
||||
.SH "COPYRIGHT"
|
||||
|
||||
+5
-5
@@ -2,7 +2,7 @@
|
||||
'\" Copyright (c) 1992-1999 by Karl Lehenbauer and Mark Diekhans
|
||||
'\" Copyright (c) 2000 by Scriptics Corporation.
|
||||
'\" All rights reserved.
|
||||
'\"
|
||||
'\"
|
||||
.TH memory n 8.1 Tcl "Tcl Built-In Commands"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -33,9 +33,9 @@ command mode.
|
||||
.TP
|
||||
\fBmemory info\fR
|
||||
.
|
||||
Returns a report containing the total allocations and frees since
|
||||
Returns a report containing the total allocations and frees since
|
||||
Tcl began, the current packets allocated (the current
|
||||
number of calls to \fBckalloc\fR not met by a corresponding call
|
||||
number of calls to \fBckalloc\fR not met by a corresponding call
|
||||
to \fBckfree\fR), the current bytes allocated, and the maximum number
|
||||
of packets and bytes allocated.
|
||||
.TP
|
||||
@@ -64,7 +64,7 @@ with it a string-valued tag. In the lists of allocated memory generated
|
||||
by \fBmemory active\fR and \fBmemory onexit\fR, the tag for each packet
|
||||
is printed along with other information about the packet. The
|
||||
\fBmemory tag\fR command sets the tag value for subsequent calls
|
||||
to \fBckalloc\fR to be \fIstring\fR.
|
||||
to \fBckalloc\fR to be \fIstring\fR.
|
||||
.TP
|
||||
\fBmemory trace \fR[\fBon\fR|\fBoff\fR]
|
||||
.
|
||||
@@ -91,7 +91,7 @@ being displayed for all allocations and frees. Since there can be a lot
|
||||
of memory activity before a problem occurs, judicious use of this option
|
||||
can reduce the slowdown caused by tracing (and the amount of trace information
|
||||
produced), if you can identify a number of allocations that occur before
|
||||
the problem sets in. The current number of memory allocations that have
|
||||
the problem sets in. The current number of memory allocations that have
|
||||
occurred since Tcl started is printed on a guard zone failure.
|
||||
.TP
|
||||
\fBmemory validate \fR[\fBon\fR|\fBoff\fR]
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
'\"
|
||||
'\" See the file "license.terms" for information on usage and redistribution
|
||||
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
'\"
|
||||
'\"
|
||||
.TH "msgcat" n 1.5 msgcat "Tcl Bundled Packages"
|
||||
.so man.macros
|
||||
.BS
|
||||
@@ -259,7 +259,7 @@ language[_country][.codeset][@modifier]
|
||||
.CE
|
||||
.PP
|
||||
to extract its parts. The initial locale is then set by calling
|
||||
\fB::msgcat::mclocale\fR with the argument
|
||||
\fB::msgcat::mclocale\fR with the argument
|
||||
.PP
|
||||
.CS
|
||||
language[_country][_modifier]
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user