diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/Access.3 | 7 | ||||
-rw-r--r-- | doc/FileSystem.3 | 25 | ||||
-rw-r--r-- | doc/GetIndex.3 | 4 | ||||
-rw-r--r-- | doc/IntObj.3 | 91 | ||||
-rw-r--r-- | doc/LinkVar.3 | 21 | ||||
-rw-r--r-- | doc/binary.n | 54 | ||||
-rw-r--r-- | doc/expr.n | 23 | ||||
-rw-r--r-- | doc/format.n | 7 | ||||
-rw-r--r-- | doc/scan.n | 56 | ||||
-rw-r--r-- | doc/tclvars.n | 12 |
10 files changed, 233 insertions, 67 deletions
diff --git a/doc/Access.3 b/doc/Access.3 index c603a1c..6830694 100644 --- a/doc/Access.3 +++ b/doc/Access.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. '\" -'\" RCS: @(#) $Id: Access.3,v 1.6 2002/01/29 02:28:20 hobbs Exp $ +'\" RCS: @(#) $Id: Access.3,v 1.7 2002/02/15 14:28:47 dkf Exp $ '\" .so man.macros .TH Tcl_Access 3 8.1 Tcl "Tcl Library Procedures" @@ -21,7 +21,7 @@ int int \fBTcl_Stat\fR(\fIpath\fR, \fIstatPtr\fR) .SH ARGUMENTS -.AS stat *statPtr in +.AS "struct stat" *statPtr in .AP char *path in Native name of the file to check the attributes of. .AP int mode in @@ -29,7 +29,7 @@ Mask consisting of one or more of R_OK, W_OK, X_OK and F_OK. R_OK, W_OK and X_OK request checking whether the file exists and has read, write and execute permissions, respectively. F_OK just requests checking for the existence of the file. -.AP stat *statPtr out +.AP "struct stat" *statPtr out The structure that contains the result. .BE @@ -73,3 +73,4 @@ given. .SH KEYWORDS stat, access + diff --git a/doc/FileSystem.3 b/doc/FileSystem.3 index 21ef533..cbfa25b 100644 --- a/doc/FileSystem.3 +++ b/doc/FileSystem.3 @@ -4,13 +4,13 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: FileSystem.3,v 1.18 2002/01/30 17:33:48 vincentdarley Exp $ +'\" RCS: @(#) $Id: FileSystem.3,v 1.19 2002/02/15 14:28:47 dkf Exp $ '\" .so man.macros .TH Filesystem 3 8.4 Tcl "Tcl Library Procedures" .BS .SH NAME -Tcl_FSRegister, Tcl_FSUnregister, Tcl_FSData, Tcl_FSMountsChanged, Tcl_FSGetFileSystemForPath, Tcl_FSGetPathType, Tcl_FSCopyFile, Tcl_FSCopyDirectory, Tcl_FSCreateDirectory, Tcl_FSDeleteFile, Tcl_FSRemoveDirectory, Tcl_FSRenameFile, Tcl_FSListVolumes, Tcl_FSEvalFile, Tcl_FSLoadFile, Tcl_FSMatchInDirectory, Tcl_FSLink, Tcl_FSLstat, Tcl_FSUtime, Tcl_FSFileAttrsGet, Tcl_FSFileAttrsSet, Tcl_FSFileAttrStrings, Tcl_FSStat, Tcl_FSAccess, Tcl_FSOpenFileChannel, Tcl_FSGetCwd, Tcl_FSChdir, Tcl_FSPathSeparator, Tcl_FSJoinPath, Tcl_FSSplitPath, Tcl_FSEqualPaths, Tcl_FSGetNormalizedPath, Tcl_FSJoinToPath, Tcl_FSConvertToPathType, Tcl_FSGetInternalRep, Tcl_FSGetTranslatedPath, Tcl_FSGetTranslatedStringPath, Tcl_FSNewNativePath, Tcl_FSGetNativePath, Tcl_FSFileSystemInfo \- procedures to interact with any filesystem +Tcl_FSRegister, Tcl_FSUnregister, Tcl_FSData, Tcl_FSMountsChanged, Tcl_FSGetFileSystemForPath, Tcl_FSGetPathType, Tcl_FSCopyFile, Tcl_FSCopyDirectory, Tcl_FSCreateDirectory, Tcl_FSDeleteFile, Tcl_FSRemoveDirectory, Tcl_FSRenameFile, Tcl_FSListVolumes, Tcl_FSEvalFile, Tcl_FSLoadFile, Tcl_FSMatchInDirectory, Tcl_FSLink, Tcl_FSLstat, Tcl_FSUtime, Tcl_FSFileAttrsGet, Tcl_FSFileAttrsSet, Tcl_FSFileAttrStrings, Tcl_FSStat, Tcl_FSAccess, Tcl_FSOpenFileChannel, Tcl_FSGetCwd, Tcl_FSChdir, Tcl_FSPathSeparator, Tcl_FSJoinPath, Tcl_FSSplitPath, Tcl_FSEqualPaths, Tcl_FSGetNormalizedPath, Tcl_FSJoinToPath, Tcl_FSConvertToPathType, Tcl_FSGetInternalRep, Tcl_FSGetTranslatedPath, Tcl_FSGetTranslatedStringPath, Tcl_FSNewNativePath, Tcl_FSGetNativePath, Tcl_FSFileSystemInfo, Tcl_AllocStatBuf \- procedures to interact with any filesystem .SH SYNOPSIS .nf \fB#include <tcl.h>\fR @@ -134,6 +134,9 @@ CONST char* .sp Tcl_Obj* \fBTcl_FSFileSystemInfo\fR(\fIpathPtr\fR) +.sp +Tcl_StatBuf* +\fBTcl_AllocStatBuf\fR() .SH ARGUMENTS .AS Tcl_Filesystem *fsPtr in .AP Tcl_Filesystem *fsPtr in @@ -187,7 +190,7 @@ Mask consisting of one or more of R_OK, W_OK, X_OK and F_OK. R_OK, W_OK and X_OK request checking whether the file exists and has read, write and execute permissions, respectively. F_OK just requests checking for the existence of the file. -.AP stat *statPtr out +.AP Tcl_StatBuf *statPtr out The structure that contains the result of a stat or lstat operation. .AP "CONST char" *sym1 in Name of a procedure to look up in the file's symbol table @@ -243,6 +246,10 @@ registered, the 'files' may, to give two examples, be remote (e.g. situated on a remote ftp server) or archived (e.g. lying inside a .zip archive). Such registered filesystems provide a lookup table of functions to implement all or some of the functionality listed here. +Finally, the \fBTcl_FSStat\fR and \fBTcl_FSLstat\fR calls abstract +away from what the 'struct stat' buffer buffer is actually declared to +be, allowing the same code to be used both on systems with and systems +without support for files larger than 2GB in size. .PP The \fBTcl_FS...\fR are objectified and may cache internal representations and other path-related strings (e.g. the current @@ -565,6 +572,12 @@ absolute. It returns one of TCL_PATH_ABSOLUTE, TCL_PATH_RELATIVE, or TCL_PATH_VOLUME_RELATIVE .PP +\fBTcl_AllocStatBuf\fR allocates a \fITcl_StatBuf\fR on the system +heap (which may be deallocated by being passed to \fBckfree\fR.) This +allows extensions to invoke \fBTcl_FSStat\fR and \fBTcl_FSLStat\fR +without being dependent on the size of the buffer. That in turn +depends on the flags used to build Tcl. +.PP .SH TCL_FILESYSTEM .PP A filesystem provides a \fBTcl_Filesystem\fR structure that contains @@ -809,7 +822,7 @@ upon it (e.g. \fBfile atime\fR, \fBfile isdirectory\fR, \fBfile size\fR, .CS typedef int Tcl_FSStatProc( Tcl_Obj *\fIpathPtr\fR, - struct stat *\fIstatPtr\fR); + Tcl_StatBuf *\fIstatPtr\fR); .CE .PP The \fBTcl_FSStatProc\fR fills the stat structure \fIstatPtr\fR with @@ -1082,7 +1095,7 @@ it need only be implemented if a filesystem can differentiate between .CS typedef int Tcl_FSLstatProc( Tcl_Obj *\fIpathPtr\fR, - struct stat *\fIstatPtr\fR); + Tcl_StatBuf *\fIstatPtr\fR); .CE .PP The behavior of this function is very similar to that of the @@ -1225,5 +1238,3 @@ directory to the value specified in \fIpathPtr\fR. The function returns -1 on error or 0 on success. .SH KEYWORDS stat access filesystem vfs - - diff --git a/doc/GetIndex.3 b/doc/GetIndex.3 index 06b5ed7..79d3a1e 100644 --- a/doc/GetIndex.3 +++ b/doc/GetIndex.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. '\" -'\" RCS: @(#) $Id: GetIndex.3,v 1.8 2002/01/17 04:37:32 dgp Exp $ +'\" RCS: @(#) $Id: GetIndex.3,v 1.9 2002/02/15 14:28:47 dkf Exp $ '\" .so man.macros .TH Tcl_GetIndexFromObj 3 8.1 Tcl "Tcl Library Procedures" @@ -34,7 +34,7 @@ The string value of this object is used to search through \fItablePtr\fR. The internal representation is modified to hold the index of the matching table entry. .AP "CONST char" **tablePtr in -An array of null-terminated strings. The end of the array is marked +An array of null-terminated ASCII strings. The end of the array is marked by a NULL string pointer. .VS .AP int offset in diff --git a/doc/IntObj.3 b/doc/IntObj.3 index 6222498..1dc5b0e 100644 --- a/doc/IntObj.3 +++ b/doc/IntObj.3 @@ -4,13 +4,13 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: IntObj.3,v 1.2 1998/09/14 18:39:49 stanton Exp $ +'\" RCS: @(#) $Id: IntObj.3,v 1.3 2002/02/15 14:28:47 dkf Exp $ '\" .so man.macros .TH Tcl_IntObj 3 8.0 Tcl "Tcl Library Procedures" .BS .SH NAME -Tcl_NewIntObj, Tcl_NewLongObj, Tcl_SetIntObj, Tcl_SetLongObj, Tcl_GetIntFromObj, Tcl_GetLongFromObj \- manipulate Tcl objects as integers +Tcl_NewIntObj, Tcl_NewLongObj, Tcl_NewWideIntObj, Tcl_SetIntObj, Tcl_SetLongObj, Tcl_SetWideIntObj, Tcl_GetIntFromObj, Tcl_GetLongFromObj, Tcl_GetWideIntFromObj \- manipulate Tcl objects as integers and wide integers .SH SYNOPSIS .nf \fB#include <tcl.h>\fR @@ -21,29 +21,51 @@ Tcl_Obj * Tcl_Obj * \fBTcl_NewLongObj\fR(\fIlongValue\fR) .sp +.VS 8.4 +Tcl_Obj * +\fBTcl_NewWideIntObj\fR(\fIwideValue\fR) +.VE 8.4 +.sp \fBTcl_SetIntObj\fR(\fIobjPtr, intValue\fR) .sp \fBTcl_SetLongObj\fR(\fIobjPtr, longValue\fR) .sp +.VS 8.4 +\fBTcl_SetWideIntObj\fR(\fIobjPtr, wideValue\fR) +.VE 8.4 +.sp int \fBTcl_GetIntFromObj\fR(\fIinterp, objPtr, intPtr\fR) .sp int \fBTcl_GetLongFromObj\fR(\fIinterp, objPtr, longPtr\fR) +.sp +.VS 8.4 +int +\fBTcl_GetWideIntFromObj\fR(\fIinterp, objPtr, widePtr\fR) +.VE 8.4 .SH ARGUMENTS -.AS Tcl_Interp *interp +.AS Tcl_WideInt *interp .AP int intValue in Integer value used to initialize or set an integer object. .AP long longValue in Long integer value used to initialize or set an integer object. +.AP Tcl_WideInt wideValue in +.VS 8.4 +Wide integer value (minimum 64-bits wide where supported by the +compiler) used to initialize or set a wide integer object. +.VE 8.4 .AP Tcl_Obj *objPtr in/out -For \fBTcl_SetIntObj\fR and \fBTcl_SetLongObj\fR, -this points to the object to be converted to integer type. -For \fBTcl_GetIntFromObj\fR and \fBTcl_GetLongFromObj\fR, -this refers to the object -from which to get an integer or long integer value; -if \fIobjPtr\fR does not already point to an integer object, -an attempt will be made to convert it to one. +For \fBTcl_SetIntObj\fR, \fBTcl_SetLongObj\fR, and +.VS 8.4 +\fBTcl_SetWideIntObj\fR, this points to the object to be converted to +integer type. For \fBTcl_GetIntFromObj\fR, \fBTcl_GetLongFromObj\fR, +and \fBTcl_GetWideIntFromObj\fR, this refers to the object from which +to get an integer or long integer value; if \fIobjPtr\fR does not +already point to an integer object (or a wide integer object in the +case of \fBTcl_SetWideIntObj\fR and \fBTcl_GetWideIntFromObj\fR,) an +.VE 8.4 +attempt will be made to convert it to one. .AP Tcl_Interp *interp in/out If an error occurs during conversion, an error message is left in the interpreter's result object @@ -54,34 +76,54 @@ obtained by \fBTcl_GetIntFromObj\fR from \fIobjPtr\fR. .AP long *longPtr out Points to place to store the long integer value obtained by \fBTcl_GetLongFromObj\fR from \fIobjPtr\fR. +.AP Tcl_WideInt *widePtr out +.VS 8.4 +Points to place to store the wide integer value +obtained by \fBTcl_GetWideIntFromObj\fR from \fIobjPtr\fR. +.VE 8.4 .BE .SH DESCRIPTION .PP These procedures are used to create, modify, and read -integer Tcl objects from C code. +integer and wide integer Tcl objects from C code. \fBTcl_NewIntObj\fR, \fBTcl_NewLongObj\fR, \fBTcl_SetIntObj\fR, and \fBTcl_SetLongObj\fR create a new object of integer type -or modify an existing object to have integer type. +or modify an existing object to have integer type, +.VS 8.4 +and \fBTcl_NewWideIntObj\fR and \fBTcl_SetWideIntObj\fR create a new +object of wide integer type or modify an existing object to have wide +integer type. +.VE 8.4 \fBTcl_NewIntObj\fR and \fBTcl_SetIntObj\fR set the object to have the integer value given by \fIintValue\fR, -while \fBTcl_NewLongObj\fR and \fBTcl_SetLongObj\fR +\fBTcl_NewLongObj\fR and \fBTcl_SetLongObj\fR set the object to have the -long integer value given by \fIlongValue\fR. -\fBTcl_NewIntObj\fR and \fBTcl_NewLongObj\fR +long integer value given by \fIlongValue\fR, +.VS 8.4 +and \fBTcl_NewWideIntObj\fR and \fBTcl_SetWideIntObj\fR set the object +to have the wide integer value given by \fIwideValue\fR. +\fBTcl_NewIntObj\fR, \fBTcl_NewLongObj\fR and \fBTcl_NewWideIntObj\fR return a pointer to a newly created object with reference count zero. These procedures set the object's type to be integer and assign the integer value to the object's internal representation -\fIlongValue\fR member. -\fBTcl_SetIntObj\fR and \fBTcl_SetLongObj\fR +\fIlongValue\fR or \fIwideValue\fR member (as appropriate). +\fBTcl_SetIntObj\fR, \fBTcl_SetLongObj\fR +and \fBTcl_SetWideIntObj\fR +.VE 8.4 invalidate any old string representation and, if the object is not already an integer object, free any old internal representation. .PP \fBTcl_GetIntFromObj\fR and \fBTcl_GetLongFromObj\fR -attempt to return an integer value from the Tcl object \fIobjPtr\fR. +attempt to return an integer value from the Tcl object \fIobjPtr\fR, +.VS 8.4 +and \fBTcl_GetWideIntFromObj\fR attempts to return a wide integer +value from the Tcl object \fIobjPtr\fR. If the object is not already an integer object, +or a wide integer object in the case of \fBTcl_GetWideIntFromObj\fR +.VE 8.4 they will attempt to convert it to one. If an error occurs during conversion, they return \fBTCL_ERROR\fR and leave an error message in the interpreter's result object @@ -91,11 +133,14 @@ Also, if the long integer held in the object's internal representation \fBTcl_GetIntFromObj\fR returns \fBTCL_ERROR\fR and leaves an error message in the interpreter's result object unless \fIinterp\fR is NULL. -Otherwise, both procedures return \fBTCL_OK\fR and -store the integer or the long integer value -in the address given by \fIintPtr\fR and \fIlongPtr\fR respectively. -If the object is not already an integer object, -the conversion will free any old internal representation. +Otherwise, all three procedures return \fBTCL_OK\fR and +store the integer, long integer value +.VS 8.4 +or wide integer in the address given by \fIintPtr\fR, \fIlongPtr\fR +and \fIwidePtr\fR +.VE 8.4 +respectively. If the object is not already an integer or wide integer +object, the conversion will free any old internal representation. .SH "SEE ALSO" Tcl_NewObj, Tcl_DecrRefCount, Tcl_IncrRefCount, Tcl_GetObjResult diff --git a/doc/LinkVar.3 b/doc/LinkVar.3 index 0a4a58f..48d4f9e 100644 --- a/doc/LinkVar.3 +++ b/doc/LinkVar.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. '\" -'\" RCS: @(#) $Id: LinkVar.3,v 1.3 2000/04/14 23:01:51 hobbs Exp $ +'\" RCS: @(#) $Id: LinkVar.3,v 1.4 2002/02/15 14:28:47 dkf Exp $ '\" .so man.macros .TH Tcl_LinkVar 3 7.5 Tcl "Tcl Library Procedures" @@ -34,6 +34,9 @@ temporary modifications to it while parsing the variable name. Address of C variable that is to be linked to \fIvarName\fR. .AP int type in Type of C variable. Must be one of TCL_LINK_INT, TCL_LINK_DOUBLE, +.VS 8.4 +TCL_LINK_WIDE_INT, +.VE 8.4 TCL_LINK_BOOLEAN, or TCL_LINK_STRING, optionally OR'ed with TCL_LINK_READ_ONLY to make Tcl variable read-only. .BE @@ -58,17 +61,27 @@ TCL_LINK_READ_ONLY: \fBTCL_LINK_INT\fR The C variable is of type \fBint\fR. Any value written into the Tcl variable must have a proper integer -form acceptable to \fBTcl_GetInt\fR; attempts to write +form acceptable to \fBTcl_GetIntFromObj\fR; attempts to write non-integer values into \fIvarName\fR will be rejected with Tcl errors. .TP \fBTCL_LINK_DOUBLE\fR The C variable is of type \fBdouble\fR. Any value written into the Tcl variable must have a proper real -form acceptable to \fBTcl_GetDouble\fR; attempts to write +form acceptable to \fBTcl_GetDoubleFromObj\fR; attempts to write non-real values into \fIvarName\fR will be rejected with Tcl errors. .TP +\fBTCL_LINK_WIDE_INT\fR +.VS 8.4 +The C variable is of type \fBTcl_WideInt\fR (which is an integer type +at least 64-bits wide on all platforms that can support it.) +Any value written into the Tcl variable must have a proper integer +form acceptable to \fBTcl_GetWideIntFromObj\fR; attempts to write +non-integer values into \fIvarName\fR will be rejected with +Tcl errors. +.VE 8.4 +.TP \fBTCL_LINK_BOOLEAN\fR The C variable is of type \fBint\fR. If its value is zero then it will read from Tcl as ``0''; @@ -76,7 +89,7 @@ otherwise it will read from Tcl as ``1''. Whenever \fIvarName\fR is modified, the C variable will be set to a 0 or 1 value. Any value written into the Tcl variable must have a proper boolean -form acceptable to \fBTcl_GetBoolean\fR; attempts to write +form acceptable to \fBTcl_GetBooleanFromObj\fR; attempts to write non-boolean values into \fIvarName\fR will be rejected with Tcl errors. .TP diff --git a/doc/binary.n b/doc/binary.n index 0369457..19fed15 100644 --- a/doc/binary.n +++ b/doc/binary.n @@ -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. '\" -'\" RCS: @(#) $Id: binary.n,v 1.7 2001/10/04 08:31:52 dkf Exp $ +'\" RCS: @(#) $Id: binary.n,v 1.8 2002/02/15 14:28:47 dkf Exp $ '\" .so man.macros .TH binary n 8.0 Tcl "Tcl Built-In Commands" @@ -199,6 +199,30 @@ For example, will return a string equivalent to \fB\\x00\\x00\\x00\\x03\\xff\\xff\\xff\\xfd\\x00\\x01\\x00\\x00\fR .RE +.IP \fBw\fR 5 +.VS 8.4 +This form is the same as \fBw\fR except that it stores one or more +64-bit integers in little-endian byte order in the output string. The +low-order 64-bits of each integer are stored as an eight-byte value at +the cursor position with the least significant byte stored first. For +example, +.RS +.CS +\fBbinary format w 7810179016327718216\fR +.CE +will return the string \fBHelloTcl\fR +.RE +.IP \fBW\fR 5 +This form is the same as \fBw\fR except that it stores one or more one +or more 64-bit integers in big-endian byte order in the output string. +For example, +.RS +.CS +\fBbinary format W 4785469626960341345\fR +.CE +will return the string \fBBigEndian\fR +.VE +.RE .IP \fBf\fR 5 This form is the same as \fBc\fR except that it stores one or more one or more single-precision floating in the machine's native @@ -463,6 +487,34 @@ order. For example, will return \fB2\fR with \fB5 7\fR stored in \fBvar1\fR and \fB-16\fR stored in \fBvar2\fR. .RE +.IP \fBw\fR 5 +.VS 8.4 +The data is interpreted as \fIcount\fR 64-bit signed integers +represented in little-endian byte order. The integers are stored in +the corresponding variable as a list. If \fIcount\fR is \fB*\fR, then +all of the remaining bytes in \fBstring\fR will be scanned. If +\fIcount\fR is omitted, then one 64-bit integer will be scanned. For +example, +.RS +.CS +\fBbinary scan \\x05\\x00\\x00\\x00\\x07\\x00\\x00\\x00\\xf0\\xff\\xff\\xff wi* var1 var2\fR +.CE +will return \fB2\fR with \fB30064771077\fR stored in \fBvar1\fR and +\fB-16\fR stored in \fBvar2\fR. Note that the integers returned are +signed and cannot be represented by Tcl as unsigned values. +.RE +.IP \fBW\fR 5 +This form is the same as \fBw\fR except that the data is interpreted +as \fIcount\fR 64-bit signed integers represented in big-endian byte +order. For example, +.RS +.CS +\fBbinary scan \\x00\\x00\\x00\\x05\\x00\\x00\\x00\\x07\\xff\\xff\\xff\\xf0 WI* var1 var2\fR +.CE +will return \fB2\fR with \fB21474836487\fR stored in \fBvar1\fR and \fB-16\fR +stored in \fBvar2\fR. +.VE +.RE .IP \fBf\fR 5 The data is interpreted as \fIcount\fR single-precision floating point numbers in the machine's native representation. The floating point @@ -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. '\" -'\" RCS: @(#) $Id: expr.n,v 1.6 2001/12/03 10:42:47 dkf Exp $ +'\" RCS: @(#) $Id: expr.n,v 1.7 2002/02/15 14:28:47 dkf Exp $ '\" .so man.macros .TH expr n 8.4 Tcl "Tcl Built-In Commands" @@ -55,6 +55,13 @@ If no numeric interpretation is possible, then an operand is left as a string (and only a limited set of operators may be applied to it). .PP +.VS 8.4 +On 32-bit systems, integer values MAX_INT (0x7FFFFFFF) and MIN_INT +(-0x80000000) will be represented as 32-bit values, and integer values +outside that range will be represented as 64-bit values (if that is +possible at all.) +.VE 8.4 +.PP Operands may be specified in any of the following ways: .IP [1] As an numeric value, either integer or floating-point. @@ -251,8 +258,12 @@ Computes the length of the hypotenuse of a right-angled triangle \fBsqrt(\fIx\fR*\fIx\fR+\fIy\fR*\fIy\fB)\fR. .TP \fBint(\fIarg\fB)\fR -If \fIarg\fR is an integer value, returns \fIarg\fR, otherwise converts -\fIarg\fR to integer by truncation and returns the converted value. +.VS 8.4 +If \fIarg\fR is an integer value, returns \fIarg\fR, otherwise +converts \fIarg\fR to an integer (of the same size as a machine word, +i.e. 32-bits on 32-bit systems, and 64-bits on 64-bit systems) by +truncation and returns the converted value. +.VE 8.4 .TP \fBlog(\fIarg\fB)\fR Returns the natural logarithm of \fIarg\fR. \fIArg\fR must be a @@ -296,6 +307,12 @@ Returns the tangent of \fIarg\fR, measured in radians. .TP \fBtanh(\fIarg\fB)\fR Returns the hyperbolic tangent of \fIarg\fR. +.TP +\fBwide(\fIarg\fB)\fR +.VS 8.4 +Converts \fIarg\fR to a value at least 64-bits wide (by sign-extension +if \fIarg\fR is a 32-bit number.) +.VE 8.4 .PP In addition to these predefined functions, applications may define additional functions using \fBTcl_CreateMathFunc\fR(). diff --git a/doc/format.n b/doc/format.n index 736840e..db72688 100644 --- a/doc/format.n +++ b/doc/format.n @@ -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. '\" -'\" RCS: @(#) $Id: format.n,v 1.5 2000/09/07 14:27:48 poenitz Exp $ +'\" RCS: @(#) $Id: format.n,v 1.6 2002/02/15 14:28:47 dkf Exp $ '\" .so man.macros .TH format n 8.1 Tcl "Tcl Built-In Commands" @@ -131,7 +131,10 @@ which must be \fBh\fR or \fBl\fR. If it is \fBh\fR it specifies that the numeric value should be truncated to a 16-bit value before converting. This option is rarely useful. -The \fBl\fR modifier is ignored. +.VS 8.4 +If it is \fBl\fR it specifies that the numeric value should be (at +least) a 64-bit value. +.VE .PP The last thing in a conversion specifier is an alphabetic character that determines what kind of conversion to perform. @@ -6,10 +6,10 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: scan.n,v 1.7 2000/12/10 03:27:03 hobbs Exp $ +'\" RCS: @(#) $Id: scan.n,v 1.8 2002/02/15 14:28:48 dkf Exp $ '\" .so man.macros -.TH scan n 8.3 Tcl "Tcl Built-In Commands" +.TH scan n 8.4 Tcl "Tcl Built-In Commands" .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME @@ -28,13 +28,11 @@ to be parsed and \fIformat\fR indicates how to parse it, using \fB%\fR conversion specifiers as in \fBsscanf\fR. Each \fIvarName\fR gives the name of a variable; when a field is scanned from \fIstring\fR the result is converted back into a string and assigned to the corresponding variable. -.VS 8.3 If no \fIvarName\fR variables are specified, then \fBscan\fR works in an inline manner, returning the data that would otherwise be stored in the variables as a list. In the inline case, an empty string is returned when the end of the input string is reached before any conversions have been performed. -.VE 8.3 .SH "DETAILS ON SCANNING" .PP @@ -46,10 +44,13 @@ Otherwise, if it isn't a \fB%\fR character then it must match the next character of \fIstring\fR. When a \fB%\fR is encountered in \fIformat\fR, it indicates the start of a conversion specifier. +.VS 8.4 A conversion specifier contains up to four fields after the \fB%\fR: a \fB*\fR, which indicates that the converted value is to be discarded instead of assigned to a variable; a XPG3 position specifier; a number -indicating a maximum field width; and a conversion character. +indicating a maximum field width; a field size modifier; and a +conversion character. +.VE 8.4 All of these fields are optional except for the conversion character. The fields that are present must appear in the order given above. .PP @@ -75,33 +76,56 @@ The following conversion characters are supported: \fBd\fR The input field must be a decimal integer. It is read in and the value is stored in the variable as a decimal string. +.VS 8.4 +If the \fBl\fR or \fBL\fR field size modifier is given, the scanned +value will have an internal representation that is at least 64-bits in +size. +.VE 8.4 .TP 10 \fBo\fR The input field must be an octal integer. It is read in and the value is stored in the variable as a decimal string. .VS 8.4 +If the \fBl\fR or \fBL\fR field size modifier is given, the scanned +value will have an internal representation that is at least 64-bits in +size. If the value exceeds MAX_INT (017777777777 on platforms using 32-bit -integers), it will be truncated to a signed integer. Hence, 037777777777 -will appear as -1 on a 32-bit machine. +integers when the \fBl\fR and \fBL\fR modifiers are not given), it +will be truncated to a signed integer. Hence, 037777777777 will +appear as -1 on a 32-bit machine by default. .VE 8.4 .TP 10 \fBx\fR The input field must be a hexadecimal integer. It is read in and the value is stored in the variable as a decimal string. .VS 8.4 +If the \fBl\fR or \fBL\fR field size modifier is given, the scanned +value will have an internal representation that is at least 64-bits in +size. If the value exceeds MAX_INT (0x7FFFFFFF on platforms using 32-bit -integers), it will be truncated to a signed integer. Hence, 0xFFFFFFFF -will appear as -1 on a 32-bit machine. +integers when the \fBl\fR and \fBL\fR modifiers are not given), it +will be truncated to a signed integer. Hence, 0xFFFFFFFF will appear +as -1 on a 32-bit machine. .VE 8.4 .TP 10 \fBu\fR The input field must be a decimal integer. The value is stored in the variable as an unsigned decimal integer string. +.VS 8.4 +If the \fBl\fR or \fBL\fR field size modifier is given, the scanned +value will have an internal representation that is at least 64-bits in +size. +.VE 8.4 .TP 10 \fBi\fR The input field must be an integer. The base (i.e. decimal, octal, or hexadecimal) is determined in the same fashion as described in \fBexpr\fR. The value is stored in the variable as a decimal string. +.VS 8.4 +If the \fBl\fR or \fBL\fR field size modifier is given, the scanned +value will have an internal representation that is at least 64-bits in +size. +.VE 8.4 .TP 10 \fBc\fR A single character is read in and its binary value is stored in @@ -177,16 +201,14 @@ converted to a decimal string, which is then assigned to the corresponding \fIvarName\fR; no field width may be specified for this conversion. .IP [3] -The \fBl\fR, \fBh\fR, and \fBL\fR modifiers are ignored; integer -values are always converted as if there were no modifier present -and real values are always converted as if the \fBl\fR modifier -were present (i.e. type \fBdouble\fR is used for the internal -representation). +.VS 8.4 +The \fBh\fR modifier is always ignored and the \fBl\fR and \fBL\fR +modifiers are ignored when converting real values (i.e. type +\fBdouble\fR is used for the internal representation). +.VE 8.4 .IP [4] -.VS 8.3 If the end of the input string is reached before any conversions have been -performed and no variables are given, and empty string is returned. -.VE 8.3 +performed and no variables are given, an empty string is returned. .SH "SEE ALSO" format(n), sscanf(3) diff --git a/doc/tclvars.n b/doc/tclvars.n index 7c88903..4503add 100644 --- a/doc/tclvars.n +++ b/doc/tclvars.n @@ -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. '\" -'\" RCS: @(#) $Id: tclvars.n,v 1.10 2001/11/23 01:29:19 das Exp $ +'\" RCS: @(#) $Id: tclvars.n,v 1.11 2002/02/15 14:28:48 dkf Exp $ '\" .so man.macros .TH tclvars n 8.0 Tcl "Tcl Built-In Commands" @@ -245,10 +245,6 @@ retrieve any relevant information. In addition, extensions and applications may add additional values to the array. The predefined elements are: - - - - .RS .VS .TP @@ -295,6 +291,12 @@ This identifies the current user based on the login information available on the platform. This comes from the USER or LOGNAME environment variable on Unix, and the value from GetUserName on Windows and Macintosh. +.TP +\fBwordSize\fR +.VS 8.4 +This gives the size of the native-machine word in bytes (strictly, it +is same as the result of evaluating \fIsizeof(long)\fR in C.) +.VE 8.4 .RE .TP \fBtcl_precision\fR |