Difference between revisions of "Truxton option get boolean"
Jump to navigation
Jump to search
(→Sample) |
|||
| Line 1: | Line 1: | ||
| − | + | Reads a boolean setting. | |
=Syntax= | =Syntax= | ||
Revision as of 04:57, 27 July 2020
Reads a boolean setting.
Syntax
int64_t truxton_options_get_boolean( uint64_t options_handle, char const * name );
Parameters
options_handle
The handle to the options object created by calling the truxton_options_create function.
name
The name of the option to read.
Return value
Zero if the boolean value is false, one if the boolean value is true.
Sample
void process_free(void)
{
uint64_t options = truxton_options_create();
if ( truxton_options_get_boolean("pfree") == 1 )
{
printf( "Yes, we will process free space\n" );
}
else
{
printf( "No, we will not process free space\n" );
}
truxton_options_destroy(options);
}