{"id":6627,"date":"2022-12-20T19:19:27","date_gmt":"2022-12-20T22:19:27","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/tcl_intobj-man3\/"},"modified":"2022-12-20T19:19:27","modified_gmt":"2022-12-20T22:19:27","slug":"tcl_intobj-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/tcl_intobj-man3\/","title":{"rendered":"Tcl_IntObj (man3)"},"content":{"rendered":"<h1 align=\"center\">Tcl_IntObj<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#ARGUMENTS\">ARGUMENTS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#KEYWORDS\">KEYWORDS<\/a> <\/p>\n<hr>\n<p>______________________________________________________________________________<\/p>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Tcl_NewIntObj, Tcl_NewLongObj, Tcl_NewWideIntObj, Tcl_SetIntObj, Tcl_SetLongObj, Tcl_SetWideIntObj, Tcl_GetIntFromObj, Tcl_GetLongFromObj, Tcl_GetWideIntFromObj, Tcl_NewBignumObj, Tcl_SetBignumObj, Tcl_GetBignumFromObj, Tcl_TakeBignumFromObj \u2212 manipulate Tcl values as integers<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>#include <tcl.h><\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Tcl_Obj bodies manpages.csv script_extrae_body.sh script.sh usr <b><br \/> Tcl_NewIntObj<\/b>(<i>intValue<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Tcl_Obj bodies manpages.csv script_extrae_body.sh script.sh usr <b><br \/> Tcl_NewLongObj<\/b>(<i>longValue<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Tcl_Obj bodies manpages.csv script_extrae_body.sh script.sh usr <b><br \/> Tcl_NewWideIntObj<\/b>(<i>wideValue<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_SetIntObj<\/b>(<i>objPtr, intValue<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_SetLongObj<\/b>(<i>objPtr, longValue<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_SetWideIntObj<\/b>(<i>objPtr, wideValue<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">int <b><br \/> Tcl_GetIntFromObj<\/b>(<i>interp, objPtr, intPtr<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">int <b><br \/> Tcl_GetLongFromObj<\/b>(<i>interp, objPtr, longPtr<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">int <b><br \/> Tcl_GetWideIntFromObj<\/b>(<i>interp, objPtr, widePtr<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>#include <tclTomMath.h><\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Tcl_Obj bodies manpages.csv script_extrae_body.sh script.sh usr <b><br \/> Tcl_NewBignumObj<\/b>(<i>bigValue<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_SetBignumObj<\/b>(<i>objPtr, bigValue<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">int <b><br \/> Tcl_GetBignumFromObj<\/b>(<i>interp, objPtr, bigValue<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">int <b><br \/> Tcl_TakeBignumFromObj<\/b>(<i>interp, objPtr, bigValue<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">int <b><br \/> Tcl_InitBignumFromDouble<\/b>(<i>interp, doubleValue, bigValue<\/i>)<\/p>\n<h2>ARGUMENTS <a name=\"ARGUMENTS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"41%\">\n<p style=\"margin-top: 1em\">int <i>intValue<\/i> (in)<\/p>\n<\/td>\n<td width=\"17%\"><\/td>\n<td width=\"31%\">\n<p style=\"margin-top: 1em\">Integer value used to initialize or set a Tcl value.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"41%\">\n<p>long <i>longValue<\/i> (in)<\/p>\n<\/td>\n<td width=\"17%\"><\/td>\n<td width=\"31%\">\n<p>Long integer value used to initialize or set a Tcl value.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"41%\">\n<p>Tcl_WideInt <i>wideValue<\/i> (in)<\/p>\n<\/td>\n<td width=\"17%\"><\/td>\n<td width=\"31%\">\n<p>Wide integer value used to initialize or set a Tcl value.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"41%\">\n<p>Tcl_Obj <i>*objPtr<\/i> (in\/out)<\/p>\n<\/td>\n<td width=\"17%\"><\/td>\n<td width=\"31%\">\n<p>For <b>Tcl_SetIntObj<\/b>, <b>Tcl_SetLongObj<\/b>, <b>Tcl_SetWideIntObj<\/b>, and <b>Tcl_SetBignumObj<\/b>, this points to the value in which to store an integral value. For <b>Tcl_GetIntFromObj<\/b>, <b>Tcl_GetLongFromObj<\/b>, <b>Tcl_GetWideIntFromObj<\/b>, <b>Tcl_GetBignumFromObj<\/b>, and <b>Tcl_TakeBignumFromObj<\/b>, this refers to the value from which to retrieve an integral value.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"41%\">\n<p>Tcl_Interp <i>*interp<\/i> (in\/out)<\/p>\n<\/td>\n<td width=\"17%\"><\/td>\n<td width=\"31%\">\n<p>When non-NULL, an error message is left here when integral value retrieval fails.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"41%\">\n<p>int <i>*intPtr<\/i> (out)<\/p>\n<\/td>\n<td width=\"17%\"><\/td>\n<td width=\"31%\">\n<p>Points to place to store the integer value retrieved from <i>objPtr<\/i>.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"41%\">\n<p>long <i>*longPtr<\/i> (out)<\/p>\n<\/td>\n<td width=\"17%\"><\/td>\n<td width=\"31%\">\n<p>Points to place to store the long integer value retrieved from <i>objPtr<\/i>.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"41%\">\n<p>Tcl_WideInt <i>*widePtr<\/i> (out)<\/p>\n<\/td>\n<td width=\"17%\"><\/td>\n<td width=\"31%\">\n<p>Points to place to store the wide integer value retrieved from <i>objPtr<\/i>.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"41%\">\n<p>mp_int <i>*bigValue<\/i> (in\/out)<\/p>\n<\/td>\n<td width=\"17%\"><\/td>\n<td width=\"31%\">\n<p>Points to a multi-precision integer structure declared by the LibTomMath library.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"41%\">\n<p>double <i>doubleValue<\/i> (in)<\/p>\n<\/td>\n<td width=\"17%\"><\/td>\n<td width=\"31%\">\n<p>Double value from which the integer part is determined and used to initialize a multi-precision integer value.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:69%;\">______________________________________________________________________________<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">These procedures are used to create, modify, and read Tcl values that hold integral values.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The different routines exist to accommodate different integral types in C with which values might be exchanged. The C integral types for which Tcl provides value exchange routines are <b>int<\/b>, <b>long int<\/b>, <b>Tcl_WideInt<\/b>, and <b>mp_int<\/b>. The <b>int<\/b> and <b>long int<\/b> types are provided by the C language standard. The <b>Tcl_WideInt<\/b> type is a typedef defined to be whatever signed integral type covers at least the 64-bit integer range (-9223372036854775808 to 9223372036854775807). Depending on the platform and the C compiler, the actual type might be <b>long int<\/b>, <b>long long int<\/b>, <b>__int64<\/b>, or something else. The <b>mp_int<\/b> type is a multiple-precision integer type defined by the LibTomMath multiple-precision integer library.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>Tcl_NewIntObj<\/b>, <b>Tcl_NewLongObj<\/b>, <b>Tcl_NewWideIntObj<\/b>, and <b>Tcl_NewBignumObj<\/b> routines each create and return a new Tcl value initialized to the integral value of the argument. The returned Tcl value is unshared.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>Tcl_SetIntObj<\/b>, <b>Tcl_SetLongObj<\/b>, <b>Tcl_SetWideIntObj<\/b>, and <b>Tcl_SetBignumObj<\/b> routines each set the value of an existing Tcl value pointed to by <i>objPtr<\/i> to the integral value provided by the other argument. The <i>objPtr<\/i> argument must point to an unshared Tcl value. Any attempt to set the value of a shared Tcl value violates Tcl\u2019s copy-on-write policy. Any existing string representation or internal representation in the unshared Tcl value will be freed as a consequence of setting the new value.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>Tcl_GetIntFromObj<\/b>, <b>Tcl_GetLongFromObj<\/b>, <b>Tcl_GetWideIntFromObj<\/b>, <b>Tcl_GetBignumFromObj<\/b>, and <b>Tcl_TakeBignumFromObj<\/b> routines attempt to retrieve an integral value of the appropriate type from the Tcl value <i>objPtr<\/i>. If the attempt succeeds, then <b>TCL_OK<\/b> is returned, and the value is written to the storage provided by the caller. The attempt might fail if <i>objPtr<\/i> does not hold an integral value, or if the value exceeds the range of the target type. If the attempt fails, then <b>TCL_ERROR<\/b> is returned, and if <i>interp<\/i> is non-NULL, an error message is left in <i>interp<\/i>. The <b>Tcl_ObjType<\/b> of <i>objPtr<\/i> may be changed to make subsequent calls to the same routine more efficient. Unlike the other functions, <b>Tcl_TakeBignumFromObj<\/b> may set the content of the Tcl value <i>objPtr<\/i> to an empty string in the process of retrieving the multiple-precision integer value.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The choice between <b>Tcl_GetBignumFromObj<\/b> and <b>Tcl_TakeBignumFromObj<\/b> is governed by how the caller will continue to use <i>objPtr<\/i>. If after the <b>mp_int<\/b> value is retrieved from <i>objPtr<\/i>, the caller will make no more use of <i>objPtr<\/i>, then using <b>Tcl_TakeBignumFromObj<\/b> permits Tcl to detect when an unshared <i>objPtr<\/i> permits the value to be moved instead of copied, which should be more efficient. If anything later in the caller requires <i>objPtr<\/i> to continue to hold the same value, then <b>Tcl_GetBignumFromObj<\/b> must be chosen.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>Tcl_InitBignumFromDouble<\/b> routine is a utility procedure that extracts the integer part of <i>doubleValue<\/i> and stores that integer value in the <b>mp_int<\/b> value <i>bigValue<\/i>.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Tcl_NewObj, Tcl_DecrRefCount, Tcl_IncrRefCount, Tcl_GetObjResult<\/p>\n<h2>KEYWORDS <a name=\"KEYWORDS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">integer, integer value, integer type, internal representation, value, value type, string representation<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  Tcl_NewIntObj, Tcl_NewLongObj, Tcl_NewWideIntObj, Tcl_SetIntObj, Tcl_SetLongObj, Tcl_SetWideIntObj, Tcl_GetIntFromObj, Tcl_GetLongFromObj, Tcl_GetWideIntFromObj, Tcl_NewBignumObj, Tcl_SetBignumObj, Tcl_GetBignumFromObj, Tcl_TakeBignumFromObj \u2212 manipulate Tcl values as integers <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2536],"tags":[2538,3007,3008],"class_list":["post-6627","post","type-post","status-publish","format-standard","hentry","category-3-llamadas-de-bibliotecas","tag-2538","tag-man3","tag-tcl_newwideintobj"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6627","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=6627"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6627\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=6627"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=6627"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=6627"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}