#include <tcl.h> Tcl_Obj * Tcl_NewIntObj(intValue) Tcl_Obj * Tcl_NewLongObj(longValue) Tcl_SetIntObj(objPtr, intValue) Tcl_SetLongObj(objPtr, longValue) int Tcl_GetIntFromObj(interp, objPtr, intPtr) int Tcl_GetLongFromObj(interp, objPtr, longPtr)
Tcl_GetIntFromObj and Tcl_GetLongFromObj attempt to return an integer value from the Tcl object objPtr. If the object is not already an integer object, they will attempt to convert it to one. If an error occurs during conversion, they return TCL_ERROR and leave an error message in the interpreter's result object unless interp is NULL. Also, if the long integer held in the object's internal representation longValue member can not be represented in a (non-long) integer, Tcl_GetIntFromObj returns TCL_ERROR and leaves an error message in the interpreter's result object unless interp is NULL. Otherwise, both procedures return TCL_OK and store the integer or the long integer value in the address given by intPtr and longPtr respectively. If the object is not already an integer object, the conversion will free any old internal representation.
Copyright © 1989-1994 The Regents of the University of California.
Copyright © 1994-1997 Sun Microsystems, Inc.