'\"
|
'\"
|
'\" Copyright (c) 1996-1997 Sun Microsystems, Inc.
|
'\" Copyright (c) 1996-1997 Sun Microsystems, Inc.
|
'\"
|
'\"
|
'\" See the file "license.terms" for information on usage and redistribution
|
'\" See the file "license.terms" for information on usage and redistribution
|
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
'\"
|
'\"
|
'\" RCS: @(#) $Id: BoolObj.3,v 1.1.1.1 2002-01-16 10:25:23 markom Exp $
|
'\" RCS: @(#) $Id: BoolObj.3,v 1.1.1.1 2002-01-16 10:25:23 markom Exp $
|
'\"
|
'\"
|
.so man.macros
|
.so man.macros
|
.TH Tcl_BooleanObj 3 8.0 Tcl "Tcl Library Procedures"
|
.TH Tcl_BooleanObj 3 8.0 Tcl "Tcl Library Procedures"
|
.BS
|
.BS
|
.SH NAME
|
.SH NAME
|
Tcl_NewBooleanObj, Tcl_SetBooleanObj, Tcl_GetBooleanFromObj \- manipulate Tcl objects as boolean values
|
Tcl_NewBooleanObj, Tcl_SetBooleanObj, Tcl_GetBooleanFromObj \- manipulate Tcl objects as boolean values
|
.SH SYNOPSIS
|
.SH SYNOPSIS
|
.nf
|
.nf
|
\fB#include \fR
|
\fB#include \fR
|
.sp
|
.sp
|
Tcl_Obj *
|
Tcl_Obj *
|
\fBTcl_NewBooleanObj\fR(\fIboolValue\fR)
|
\fBTcl_NewBooleanObj\fR(\fIboolValue\fR)
|
.sp
|
.sp
|
\fBTcl_SetBooleanObj\fR(\fIobjPtr, boolValue\fR)
|
\fBTcl_SetBooleanObj\fR(\fIobjPtr, boolValue\fR)
|
.sp
|
.sp
|
int
|
int
|
\fBTcl_GetBooleanFromObj\fR(\fIinterp, objPtr, boolPtr\fR)
|
\fBTcl_GetBooleanFromObj\fR(\fIinterp, objPtr, boolPtr\fR)
|
.SH ARGUMENTS
|
.SH ARGUMENTS
|
.AS Tcl_Interp *interp
|
.AS Tcl_Interp *interp
|
.AP int boolValue in
|
.AP int boolValue in
|
Integer value used to initialize or set a boolean object.
|
Integer value used to initialize or set a boolean object.
|
If the integer is nonzero, the boolean object is set to 1;
|
If the integer is nonzero, the boolean object is set to 1;
|
otherwise the boolean object is set to 0.
|
otherwise the boolean object is set to 0.
|
.AP Tcl_Obj *objPtr in/out
|
.AP Tcl_Obj *objPtr in/out
|
For \fBTcl_SetBooleanObj\fR, this points to the object to be converted
|
For \fBTcl_SetBooleanObj\fR, this points to the object to be converted
|
to boolean type.
|
to boolean type.
|
For \fBTcl_GetBooleanFromObj\fR, this refers to the object
|
For \fBTcl_GetBooleanFromObj\fR, this refers to the object
|
from which to get a boolean value;
|
from which to get a boolean value;
|
if \fIobjPtr\fR does not already point to a boolean object,
|
if \fIobjPtr\fR does not already point to a boolean object,
|
an attempt will be made to convert it to one.
|
an attempt will be made to convert it to one.
|
.AP Tcl_Interp *interp in/out
|
.AP Tcl_Interp *interp in/out
|
If an error occurs during conversion,
|
If an error occurs during conversion,
|
an error message is left in the interpreter's result object
|
an error message is left in the interpreter's result object
|
unless \fIinterp\fR is NULL.
|
unless \fIinterp\fR is NULL.
|
.AP int *boolPtr out
|
.AP int *boolPtr out
|
Points to place where \fBTcl_GetBooleanFromObj\fR
|
Points to place where \fBTcl_GetBooleanFromObj\fR
|
stores the boolean value (0 or 1) obtained from \fIobjPtr\fR.
|
stores the boolean value (0 or 1) obtained from \fIobjPtr\fR.
|
.BE
|
.BE
|
|
|
.SH DESCRIPTION
|
.SH DESCRIPTION
|
.PP
|
.PP
|
These procedures are used to create, modify, and read
|
These procedures are used to create, modify, and read
|
boolean Tcl objects from C code.
|
boolean Tcl objects from C code.
|
\fBTcl_NewBooleanObj\fR and \fBTcl_SetBooleanObj\fR
|
\fBTcl_NewBooleanObj\fR and \fBTcl_SetBooleanObj\fR
|
will create a new object of boolean type
|
will create a new object of boolean type
|
or modify an existing object to have boolean type.
|
or modify an existing object to have boolean type.
|
Both of these procedures set the object to have the
|
Both of these procedures set the object to have the
|
boolean value (0 or 1) specified by \fIboolValue\fR;
|
boolean value (0 or 1) specified by \fIboolValue\fR;
|
if \fIboolValue\fR is nonzero, the object is set to 1,
|
if \fIboolValue\fR is nonzero, the object is set to 1,
|
otherwise to 0.
|
otherwise to 0.
|
\fBTcl_NewBooleanObj\fR returns a pointer to a newly created object
|
\fBTcl_NewBooleanObj\fR returns a pointer to a newly created object
|
with reference count zero.
|
with reference count zero.
|
Both procedures set the object's type to be boolean
|
Both procedures set the object's type to be boolean
|
and assign the boolean value to the object's internal representation
|
and assign the boolean value to the object's internal representation
|
\fIlongValue\fR member.
|
\fIlongValue\fR member.
|
\fBTcl_SetBooleanObj\fR invalidates any old string representation
|
\fBTcl_SetBooleanObj\fR invalidates any old string representation
|
and, if the object is not already a boolean object,
|
and, if the object is not already a boolean object,
|
frees any old internal representation.
|
frees any old internal representation.
|
.PP
|
.PP
|
\fBTcl_GetBooleanFromObj\fR attempts to return a boolean value
|
\fBTcl_GetBooleanFromObj\fR attempts to return a boolean value
|
from the Tcl object \fIobjPtr\fR.
|
from the Tcl object \fIobjPtr\fR.
|
If the object is not already a boolean object,
|
If the object is not already a boolean object,
|
it will attempt to convert it to one.
|
it will attempt to convert it to one.
|
If an error occurs during conversion, it returns \fBTCL_ERROR\fR
|
If an error occurs during conversion, it returns \fBTCL_ERROR\fR
|
and leaves an error message in the interpreter's result object
|
and leaves an error message in the interpreter's result object
|
unless \fIinterp\fR is NULL.
|
unless \fIinterp\fR is NULL.
|
Otherwise, \fBTcl_GetBooleanFromObj\fR returns \fBTCL_OK\fR
|
Otherwise, \fBTcl_GetBooleanFromObj\fR returns \fBTCL_OK\fR
|
and stores the boolean value in the address given by \fIboolPtr\fR.
|
and stores the boolean value in the address given by \fIboolPtr\fR.
|
If the object is not already a boolean object,
|
If the object is not already a boolean object,
|
the conversion will free any old internal representation.
|
the conversion will free any old internal representation.
|
|
|
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
Tcl_NewObj, Tcl_DecrRefCount, Tcl_IncrRefCount, Tcl_GetObjResult
|
Tcl_NewObj, Tcl_DecrRefCount, Tcl_IncrRefCount, Tcl_GetObjResult
|
|
|
.SH KEYWORDS
|
.SH KEYWORDS
|
boolean, boolean object, boolean type, internal representation, object, object type, string representation
|
boolean, boolean object, boolean type, internal representation, object, object type, string representation
|
|
|