Truxton subject get birthday

From truxwiki.com
Revision as of 10:22, 15 February 2021 by Sam (talk | contribs) (→‎Sample)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This retrieves the birthday of the subject. This corresponds to the [Birthday] column of the [Suspect] table.

Syntax

uint64_t truxton_subject_get_birthday( uint64_t subject_handle );

Parameters

subject_handle

This comes from calling truxton_subject_create().

Return value

The birthday of the subject in FILETIME ticks.

Sample

void dump_subject( uint64_t subject_handle )
{
   uint64_t integer_value = 0;

   char temp_string[ 1024 ];

   truxton_subject_get_id( subject_handle, temp_string, sizeof(temp_string) );
   printf( "Subject ID is %s\n", temp_string );

   truxton_subject_get_name( subject_handle, temp_string, sizeof(temp_string) );
   printf( "Name: %s\n", temp_string );

   truxton_subject_get_description( subject_handle, temp_string, sizeof(temp_string) );
   printf( "Description: %s\n", temp_string );

   truxton_subject_get_custom( subject_handle, temp_string, sizeof(temp_string) );
   printf( "Custom: %s\n", temp_string );

   truxton_subject_get_picture( subject_handle, temp_string, sizeof(temp_string) );
   display_base64_encoded_png( temp_string );

   integer_value = truxton_subject_get_birthday( subject_handle );

   if ( integer_value == 0 )
   {
      printf( "Birthday: Unknown\n" );
   }
   else
   {
      printf( "Birthday: %" PRIu64 "\n", integer_value );
   }
}

The PRIu64 in the sample code above is a standard way of formatting a 64-bit unsigned 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.