diff options
Diffstat (limited to 'doc/GetInt.3')
| -rw-r--r-- | doc/GetInt.3 | 63 |
1 files changed, 17 insertions, 46 deletions
diff --git a/doc/GetInt.3 b/doc/GetInt.3 index f15c12d..4e9d636 100644 --- a/doc/GetInt.3 +++ b/doc/GetInt.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_GetInt 3 "" Tcl "Tcl Library Procedures" .so man.macros .BS @@ -21,10 +21,7 @@ int \fBTcl_GetDouble\fR(\fIinterp, src, doublePtr\fR) .sp int -\fBTcl_GetBoolean\fR(\fIinterp, src, intPtr\fR) -.sp -int -\fBTcl_GetBool\fR(\fIinterp, src, flags, charPtr\fR) +\fBTcl_GetBoolean\fR(\fIinterp, src, boolPtr\fR) .SH ARGUMENTS .AS Tcl_Interp *doublePtr out .AP Tcl_Interp *interp in @@ -36,12 +33,8 @@ Points to place to store integer value converted from \fIsrc\fR. .AP double *doublePtr out Points to place to store double-precision floating-point value converted from \fIsrc\fR. -.AP char *charPtr out -Points to place to store boolean value (0 or 1) value converted from \fIsrc\fR. -.AP int flags in -0 or TCL_NULL_OK. If TCL_NULL_OK -is used, then the empty string or NULL will result in \fBTcl_GetBool\fR -return TCL_OK, the *charPtr filled with the value \fB'\exFF'\fR; +.AP int *boolPtr out +Points to place to store boolean value (0 or 1) converted from \fIsrc\fR. .BE .SH DESCRIPTION @@ -55,61 +48,39 @@ third argument. If all goes well, each of the procedures returns \fBTCL_OK\fR. If \fIsrc\fR does not have the proper syntax for the desired type then \fBTCL_ERROR\fR is returned, an error message is left in the interpreter's result, and nothing is stored at *\fIintPtr\fR -or *\fIdoublePtr\fR. +or *\fIdoublePtr\fR or *\fIboolPtr\fR. .PP \fBTcl_GetInt\fR expects \fIsrc\fR to consist of a collection -of integer digits, optionally signed and optionally preceded and -followed by white space. If the first two characters of \fIsrc\fR +of integer digits, optionally signed and optionally preceded by +white space. If the first two characters of \fIsrc\fR after the optional white space and sign are -.QW \fB0x\fR +.QW 0x then \fIsrc\fR is expected to be in hexadecimal form; otherwise, -if the first such characters are -.QW \fB0d\fR -then \fIsrc\fR is expected to be in decimal form; otherwise, -if the first such characters are -.QW \fB0o\fR -then \fIsrc\fR is expected to be in octal form; otherwise, -if the first such characters are -.QW \fB0b\fR -then \fIsrc\fR is expected to be in binary form; otherwise, if the first such character is -.QW \fB0\fR +.QW 0 then \fIsrc\fR -is expected to be in octal form; otherwise, \fIsrc\fR -is expected to be in decimal form. +is expected to be in octal form; otherwise, \fIsrc\fR is +expected to be in decimal form. .PP \fBTcl_GetDouble\fR expects \fIsrc\fR to consist of a floating-point number, which is: white space; a sign; a sequence of digits; a -decimal point -.QW \fB.\fR ; -a sequence of digits; the letter -.QW \fBe\fR ; +decimal point; a sequence of digits; the letter +.QW e ; a signed decimal exponent; and more white space. Any of the fields may be omitted, except that the digits either before or after the decimal point must be present and if the -.QW \fBe\fR -is present then it must be followed by the exponent number. If there -are no fields apart from the sign and initial sequence of digits -(i.e., no decimal point or exponent indicator), that -initial sequence of digits should take one of the forms that -\fBTcl_GetInt\fR supports, described above. The use of -.QW \fB,\fR -as a decimal point is not supported nor should any other sort of -inter-digit separator be present. +.QW e +is present then it must be followed by the exponent number. .PP \fBTcl_GetBoolean\fR expects \fIsrc\fR to specify a boolean value. If \fIsrc\fR is any of \fB0\fR, \fBfalse\fR, \fBno\fR, or \fBoff\fR, then \fBTcl_GetBoolean\fR stores a zero -value at \fI*intPtr\fR. +value at \fI*boolPtr\fR. If \fIsrc\fR is any of \fB1\fR, \fBtrue\fR, \fByes\fR, or \fBon\fR, -then 1 is stored at \fI*intPtr\fR. +then 1 is stored at \fI*boolPtr\fR. Any of these values may be abbreviated, and upper-case spellings are also acceptable. -.PP -\fBTcl_GetBool\fR functions almost the same as \fBTcl_GetBoolean\fR, -but it has an additional parameter \fBflags\fR, which can be used -to specify whether the empty string or NULL is accepted as valid. .SH KEYWORDS boolean, conversion, double, floating-point, integer |
