Truxton option get boolean

From truxwiki.com
Revision as of 04:44, 27 July 2020 by Sam (talk | contribs) (Created page with "This destroys an options object. =Syntax= <syntaxhighlight lang="C"> int64_t truxton_options_get_boolean( uint64_t options_handle, char const * name ); </syntaxhighlight> =P...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This destroys an options object.

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

 1 void process_free(void)
 2 {
 3    uint64_t options = truxton_options_create();
 4 
 5    if ( truxton_options_get_boolean("pfree") == 1 )
 6    {
 7       printf( "Yes, we will process free space\n" );
 8    }
 9    else
10    {
11       printf( "No, we will not process free space\n" );
12    }
13 
14    truxton_options_destroy(options);
15 }