Difference between revisions of "Truxton message get file id"

From truxwiki.com
Jump to navigation Jump to search
(Created page with "This retrieves the [https://en.wikipedia.org/wiki/Universally_unique_identifier GUID] of the file this message is about. This corresponds to the <code>ID</code> column of the...")
 
Line 19: Line 19:
 
=Sample=
 
=Sample=
  
<syntaxhighlight lang="C" highlight="12">
+
<syntaxhighlight lang="C" highlight="5">
 
int print_id(uint64_t message_handle)
 
int print_id(uint64_t message_handle)
 
{
 
{

Revision as of 08:41, 24 June 2020

This retrieves the GUID of the file this message is about. This corresponds to the ID column of the File table.

Syntax

void truxton_message_get_file_id( uint64_t message_handle, char * destination_string, size_t max_size );

Parameters

message_handle

The handle to a message created by the truxton_message_create call.

destination_string

The string to be written to.

max_size

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

Sample

int print_id(uint64_t message_handle)
{
   char guid_string[ 40 ];

   truxton_message_get_file_id( message_handle, guid_string, sizeof(guid_string));

   printf( "File ID is %s\n", guid_string);
}