Manual Pages for UNIX Darwin command on man Tcl_SetLongObj
MyWebUniversity

Manual Pages for UNIX Darwin command on man Tcl_SetLongObj

TclIntObj(3) Tcl Library Procedures TclIntObj(3)

NAME

TclNewIntObj, TclNewLongObj, TclNewWideIntObj, TclSetIntObj,

TclSetLongObj, TclSetWideIntObj, TclGetIntFromObj, TclGetLongFro-

mObj, TclGetWideIntFromObj - manipulate Tcl objects as integers and

wide integers

SYNOPSIS

##iinncclluuddee <>

TclObj * TTccllNNeewwIInnttOObbjj(intValue) TclObj * TTccllNNeewwLLoonnggOObbjj(longValue) TclObj * | TTccllNNeewwWWiiddeeIInnttOObbjj(wideValue) | TTccllSSeettIInnttOObbjj(objPtr, intValue) TTccllSSeettLLoonnggOObbjj(objPtr, longValue) TTccllSSeettWWiiddeeIInnttOObbjj(objPtr, wideValue) | int TTccllGGeettIInnttFFrroommOObbjj(interp, objPtr, intPtr) int TTccllGGeettLLoonnggFFrroommOObbjj(interp, objPtr, longPtr) int | TTccllGGeettWWiiddeeIInnttFFrroommOObbjj(interp, objPtr, widePtr) | AARRGGUUMMEENNTTSS int intValue (in) Integer value used to initialize or set an integer object. long longValue (in) Long integer value used to initialize or set an integer object.

TclWideInt wideValue (in) Wide integer value (minimum 64-bits |

wide where supported by the compiler) | used to initialize or set a wide | integer object. TclObj *objPtr (in/out) For TTccllSSeettIInnttOObbjj, TTccllSSeettLLoonnggOObbjj, and TTccllSSeettWWiiddeeIInnttOObbjj, this points to | the object to be converted to integer | type. For TTccllGGeettIInnttFFrroommOObbjj, | TTccllGGeettLLoonnggFFrroommOObbjj, and | TTccllGGeettWWiiddeeIInnttFFrroommOObbjj, this refers to |

the object from which to get an inte- |

ger or long integer value; if objPtr | does not already point to an integer | object (or a wide integer object in | the case of TTccllSSeettWWiiddeeIInnttOObbjj and | TTccllGGeettWWiiddeeIInnttFFrroommOObbjj,) an attempt will be made to convert it to one. TclInterp *interp (in/out) If an error occurs during conversion, an error message is left in the interpreter's result object unless interp is NULL. int *intPtr (out) Points to place to store the integer value obtained by TTccllGGeettIInnttFFrroommOObbjj from objPtr. long *longPtr (out) Points to place to store the long

integer value obtained by TTccllGGeett-

LLoonnggFFrroommOObbjj from objPtr. TclWideInt *widePtr (out) Points to place to store the wide | integer value obtained by | TTccllGGeettWWiiddeeIInnttFFrroommOObbjj from objPtr.

DESCRIPTION

These procedures are used to create, modify, and read integer and wide integer Tcl objects from C code. TTccllNNeewwIInnttOObbjj, TTccllNNeewwLLoonnggOObbjj, TTccllSSeettIInnttOObbjj, and TTccllSSeettLLoonnggOObbjj create a new object of integer type

or modify an existing object to have integer type, and TTccllNNeewwWWiiddeeIInn- |

ttOObbjj and TTccllSSeettWWiiddeeIInnttOObbjj create a new object of wide integer type or | modify an existing object to have wide integer type. TTccllNNeewwIInnttOObbjj and

TTccllSSeettIInnttOObbjj set the object to have the integer value given by int-

Value, TTccllNNeewwLLoonnggOObbjj and TTccllSSeettLLoonnggOObbjj set the object to have the long integer value given by longValue, and TTccllNNeewwWWiiddeeIInnttOObbjj and | TTccllSSeettWWiiddeeIInnttOObbjj set the object to have the wide integer value given | by wideValue. TTccllNNeewwIInnttOObbjj, TTccllNNeewwLLoonnggOObbjj and TTccllNNeewwWWiiddeeIInnttOObbjj | 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 longValue or | wideValue member (as appropriate). TTccllSSeettIInnttOObbjj, TTccllSSeettLLoonnggOObbjj and | TTccllSSeettWWiiddeeIInnttOObbjj invalidate any old string representation and, if the

object is not already an integer object, free any old internal repre-

sentation. TTccllGGeettIInnttFFrroommOObbjj and TTccllGGeettLLoonnggFFrroommOObbjj attempt to return an integer value from the Tcl object objPtr, and TTccllGGeettWWiiddeeIInnttFFrroommOObbjj attempts to | return a wide integer value from the Tcl object objPtr. If the object | is not already an integer object, or a wide integer object in the case | of TTccllGGeettWWiiddeeIInnttFFrroommOObbjj they will attempt to convert it to one. If an error occurs during conversion, they return TTCCLLEERRRROORR 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,

TTccllGGeettIInnttFFrroommOObbjj returns TTCCLLEERRRROORR and leaves an error message in the interpreter's result object unless interp is NULL. Otherwise, all three procedures return TTCCLLOOKK and store the integer, long integer value or wide integer in the address given by intPtr, longPtr and | widePtr respectively. If the object is not already an integer or wide

integer object, the conversion will free any old internal representa-

tion.

SEE ALSO

TclNewObj, TclDecrRefCount, TclIncrRefCount, TclGetObjResult KKEEYYWWOORRDDSS integer, integer object, integer type, internal representation, object, object type, string representation Tcl 8.0 TclIntObj(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™