Difference between revisions of "Truxton option get integer"

From truxwiki.com
Jump to navigation Jump to search
Line 2: Line 2:
  
 
=Syntax=
 
=Syntax=
<syntaxhighlight lang="C">
+
<source lang="C">
 
int64_t truxton_options_get_integer( uint64_t options_handle, char const * name );
 
int64_t truxton_options_get_integer( uint64_t options_handle, char const * name );
</syntaxhighlight>
+
</source>
  
 
=Parameters=
 
=Parameters=
Line 18: Line 18:
  
 
=Sample=
 
=Sample=
<syntaxhighlight lang="C" highlight="5">
+
<source lang="C" highlight="5">
 
void print_starting_MFT(void)
 
void print_starting_MFT(void)
 
{
 
{
Line 29: Line 29:
 
   truxton_options_destroy(options);
 
   truxton_options_destroy(options);
 
}
 
}
</syntaxhighlight>
+
</source>

Revision as of 11:04, 18 January 2021

Reads an integer setting.

Syntax

int64_t truxton_options_get_integer( 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

The value of the setting if specified. If the option name is not found, zero is returned.

Sample

void print_starting_MFT(void)
{
   uint64_t options = truxton_options_create();

   int64_t mft = truxton_options_get_integer( options, "startatmft" );

   printf( "Will start processing the NTFS volume beginning at MFT %" PRId64 "\n" );

   truxton_options_destroy(options);
}