Difference between revisions of "Truxton media get case number"

From truxwiki.com
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
This retrieves the case number of the media.
 
This retrieves the case number of the media.
It corresponds to the <code>CaseNumber</code> column of the <code>Media</code> table.
+
It corresponds to the <code>[CaseNumber]</code> column of the <code><nowiki>[</nowiki>[[Media Table|Media]]<nowiki>]</nowiki></code> table.
  
 
This is an arbitrary string value that Truxton will associate with the media.
 
This is an arbitrary string value that Truxton will associate with the media.
Line 6: Line 6:
  
 
=Syntax=
 
=Syntax=
<syntaxhighlight lang="C">
+
<source lang="C">
 
void truxton_media_get_case_number( uint64_t media_handle, char * destination_string, size_t max_size );
 
void truxton_media_get_case_number( uint64_t media_handle, char * destination_string, size_t max_size );
</syntaxhighlight>
+
</source>
  
 
=Parameters=
 
=Parameters=
Line 21: Line 21:
  
 
=Sample=
 
=Sample=
<syntaxhighlight lang="C" highlight="12">
+
<source lang="C" highlight="12">
void print_case(uint64_t truxton)
+
void print_case( uint64_t truxton )
 
{
 
{
   uint64_t media = truxton_media_open_id(truxton, "150929ce-bf30-4d5d-08d9-b48a0806c843");
+
   uint64_t media = truxton_media_open_id( truxton, "150929ce-bf30-4d5d-08d9-b48a0806c843" );
  
 
   if ( media != 0 )
 
   if ( media != 0 )
Line 33: Line 33:
 
   char case_id[ MAX_PATH ];
 
   char case_id[ MAX_PATH ];
  
   truxton_media_get_case_number(media, case_id, sizeof(case_id));
+
   truxton_media_get_case_number( media, case_id, sizeof(case_id) );
  
 
   printf( "Case: %s\n", case_id);
 
   printf( "Case: %s\n", case_id);
  
   truxton_media_free(media);
+
   truxton_media_free( media );
 
}
 
}
</syntaxhighlight>
+
</source>

Latest revision as of 07:44, 3 February 2024

This retrieves the case number of the media. It corresponds to the [CaseNumber] column of the [Media] table.

This is an arbitrary string value that Truxton will associate with the media. The format of the case number is whatever the user wishes.

Syntax

void truxton_media_get_case_number( uint64_t media_handle, char * destination_string, size_t max_size );

Parameters

media_handle

The handle created by the truxton_media_create or truxton_media_open_id call.

destination_string

The string to be written to.

max_size

The maximum number of characters that can be written to destination_string.

Sample

void print_case( uint64_t truxton )
{
   uint64_t media = truxton_media_open_id( truxton, "150929ce-bf30-4d5d-08d9-b48a0806c843" );

   if ( media != 0 )
   {
      return;
   }

   char case_id[ MAX_PATH ];

   truxton_media_get_case_number( media, case_id, sizeof(case_id) );

   printf( "Case: %s\n", case_id);

   truxton_media_free( media );
}