Difference between revisions of "Truxton investigation get jurisdiction"

From truxwiki.com
Jump to navigation Jump to search
(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= <...")
 
Line 1: Line 1:
 
This retrieves the case number associated with the investigation.
 
This retrieves the case number associated with the investigation.
It corresponds to the <code>[CaseNumber]</code> column of the <code>[Investigation]</code> table.
+
It corresponds to the <code>[JurisdictionID]</code> column of the <code>[Investigation]</code> table.
 +
It should contain a value from the <code>[ID]</code> column of the <code>[Jurisdiction]</code> table.
  
 
=Syntax=
 
=Syntax=
 
<source lang="C">
 
<source lang="C">
uint64_t truxton_investigation_get_case_number( uint64_t investigation_handle );
+
uint64_t truxton_investigation_get_jurisdiction( uint64_t investigation_handle );
 
</source>
 
</source>
  
Line 10: Line 11:
 
==<code>investigation_handle</code>==
 
==<code>investigation_handle</code>==
 
The handle created by the [[truxton_investigation_create|truxton_investigation_create()]].
 
The handle created by the [[truxton_investigation_create|truxton_investigation_create()]].
 +
 +
=Return value=
 +
The identifier of the jurisdiction.
  
 
=Sample=
 
=Sample=

Revision as of 11:15, 18 February 2021

This retrieves the case number associated with the investigation. It corresponds to the [JurisdictionID] column of the [Investigation] table. It should contain a value from the [ID] column of the [Jurisdiction] table.

Syntax

uint64_t truxton_investigation_get_jurisdiction( uint64_t investigation_handle );

Parameters

investigation_handle

The handle created by the truxton_investigation_create().

Return value

The identifier of the jurisdiction.

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.