Truxton investigation get jurisdiction

From truxwiki.com
Revision as of 11:00, 18 February 2021 by Sam (talk | contribs) (Created page with "This retrieves the case number associated with the investigation. It corresponds to the <code>[CaseNumber]</code> column of the <code>[Investigation]</code> table. =Syntax= <...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This retrieves the case number associated with the investigation. It corresponds to the [CaseNumber] column of the [Investigation] table.

Syntax

uint64_t truxton_investigation_get_case_number( uint64_t investigation_handle );

Parameters

investigation_handle

The handle created by the truxton_investigation_create().

Sample

void dump( uint64_t investigation_handle )
{
   uint64_t integer_value = 0;
   char string_value[ 256 ];

   truxton_investigation_get_id( investigation_handle, string_value, sizeof( string_value ) ) ;
   printf( "ID: %s\n", string_value );

   truxton_investigation_get_name( investigation_handle, string_value, sizeof( string_value ) );
   printf( "Name: %s\n", string_value );

   truxton_investigation_get_description( investigation_handle, string_value, sizeof( string_value ) );
   printf( "Description: %s\n", string_value );

   truxton_investigation_get_case_number( investigation_handle, string_value, sizeof( string_value ) );
   printf( "Case: %s\n", string_value );

   integer_value  = truxton_investigation_get_jurisdiction( investigation_handle );
   printf( "Jurisdiction: " PRIu64 "\n", integer_value );

   integer_value = truxton_investigation_get_status( investigation_handle );
   printf( "Status: " PRIu64 "\n", integer_value );

   integer_value = truxton_investigation_get_type( investigation_handle );
   printf( "Type: " PRIu64 "\n", integer_value );
}

Note, the PRIu64 in the sample code above is the new standard way of formatting a 64-bit integer in C. Over the years, different compilers on different operating systems used different format specifiers for things, these PRI macros, along with some tricky string concatenation the compilers perform for you, allow you to maintain a single code base without a bunch of macro magic.