{"id":6710,"date":"2022-12-20T19:33:28","date_gmt":"2022-12-20T22:33:28","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/tcl_booleanobj-man3-2\/"},"modified":"2022-12-20T19:33:28","modified_gmt":"2022-12-20T22:33:28","slug":"tcl_booleanobj-man3-2","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/tcl_booleanobj-man3-2\/","title":{"rendered":"Tcl_BooleanObj (man3)"},"content":{"rendered":"<h1 align=\"center\">Tcl_BooleanObj<\/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_NewBooleanObj, Tcl_SetBooleanObj, Tcl_GetBooleanFromObj \u2212 store\/retrieve boolean value in a Tcl_Obj<\/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_NewBooleanObj<\/b>(<i>boolValue<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_SetBooleanObj<\/b>(<i>objPtr, boolValue<\/i>)<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">int <b><br \/> Tcl_GetBooleanFromObj<\/b>(<i>interp, objPtr, boolPtr<\/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>boolValue<\/i> (in)<\/p>\n<\/td>\n<td width=\"13%\"><\/td>\n<td width=\"35%\">\n<p style=\"margin-top: 1em\">Integer value to be stored as a boolean value in a Tcl_Obj.<\/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=\"13%\"><\/td>\n<td width=\"35%\">\n<p>Points to the Tcl_Obj in which to store, or from which to retrieve a boolean 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=\"13%\"><\/td>\n<td width=\"35%\">\n<p>If a boolean value cannot be retrieved, an error message is left in the interpreter\u2019s result value unless <i>interp<\/i> is NULL.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"41%\">\n<p>int <i>*boolPtr<\/i> (out)<\/p>\n<\/td>\n<td width=\"13%\"><\/td>\n<td width=\"35%\">\n<p>Points to place where <b>Tcl_GetBooleanFromObj<\/b> stores the boolean value (0 or 1) obtained from <i>objPtr<\/i>.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:65%;\">______________________________________________________________________________<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">These procedures are used to pass boolean values to and from Tcl as Tcl_Obj\u2019s. When storing a boolean value into a Tcl_Obj, any non-zero integer value in <i>boolValue<\/i> is taken to be the boolean value <b>1<\/b>, and the integer value <b>0<\/b> is taken to be the boolean value <b>0<\/b>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_NewBooleanObj<\/b> creates a new Tcl_Obj, stores the boolean value <i>boolValue<\/i> in it, and returns a pointer to the new Tcl_Obj. The new Tcl_Obj has reference count of zero.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_SetBooleanObj<\/b> accepts <i>objPtr<\/i>, a pointer to an existing Tcl_Obj, and stores in the Tcl_Obj <i>*objPtr<\/i> the boolean value <i>boolValue<\/i>. This is a write operation on <i>*objPtr<\/i>, so <i>objPtr<\/i> must be unshared. Attempts to write to a shared Tcl_Obj will panic. A successful write of <i>boolValue<\/i> into <i>*objPtr<\/i> implies the freeing of any former value stored in <i>*objPtr<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Tcl_GetBooleanFromObj<\/b> attempts to retrieve a boolean value from the value stored in <i>*objPtr<\/i>. If <i>objPtr<\/i> holds a string value recognized by <b>Tcl_GetBoolean<\/b>, then the recognized boolean value is written at the address given by <i>boolPtr<\/i>. If <i>objPtr<\/i> holds any value recognized as a number by Tcl, then if that value is zero a 0 is written at the address given by <i>boolPtr<\/i> and if that value is non-zero a 1 is written at the address given by <i>boolPtr<\/i>. In all cases where a value is written at the address given by <i>boolPtr<\/i>, <b>Tcl_GetBooleanFromObj<\/b> returns <b>TCL_OK<\/b>. If the value of <i>objPtr<\/i> does not meet any of the conditions above, then <b>TCL_ERROR<\/b> is returned and an error message is left in the interpreter\u2019s result unless <i>interp<\/i> is NULL. <b>Tcl_GetBooleanFromObj<\/b> may also make changes to the internal fields of <i>*objPtr<\/i> so that future calls to <b>Tcl_GetBooleanFromObj<\/b> on the same <i>objPtr<\/i> can be performed more efficiently.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Note that the routines <b>Tcl_GetBooleanFromObj<\/b> and <b>Tcl_GetBoolean<\/b> are not functional equivalents. The set of values for which <b>Tcl_GetBooleanFromObj<\/b> will return <b>TCL_OK<\/b> is strictly larger than the set of values for which <b>Tcl_GetBoolean<\/b> will do the same. For example, the value \u201c5\u201d passed to <b>Tcl_GetBooleanFromObj<\/b> will lead to a <b>TCL_OK<\/b> return (and the boolean value 1), while the same value passed to <b>Tcl_GetBoolean<\/b> will lead to a <b>TCL_ERROR<\/b> return.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Tcl_NewObj, Tcl_IsShared, Tcl_GetBoolean<\/p>\n<h2>KEYWORDS <a name=\"KEYWORDS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">boolean, value<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  Tcl_NewBooleanObj, Tcl_SetBooleanObj, Tcl_GetBooleanFromObj \u2212 store\/retrieve boolean value in a Tcl_Obj <\/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,3086],"class_list":["post-6710","post","type-post","status-publish","format-standard","hentry","category-3-llamadas-de-bibliotecas","tag-2538","tag-man3","tag-tcl_newbooleanobj"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6710","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=6710"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6710\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=6710"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=6710"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=6710"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}