Truxton event get id

From truxwiki.com
Revision as of 09:51, 10 November 2020 by Sam (talk | contribs) (Created page with "This retrieves the [https://en.wikipedia.org/wiki/Universally_unique_identifier GUID] of the event. This corresponds to the <code>[ID]</code> column of the <code><nowiki>[</no...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This retrieves the GUID of the event. This corresponds to the [ID] column of the [Event] table. If you created this event, the identifier only becomes available after you have called truxton_event_save.

Syntax

void truxton_event_get_id( uint64_t event_handle, char * destination_string, size_t max_size );

Parameters

event_handle

The handle to an event created by the truxton_event_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

void dump_event(uint64_t event_handle)
{
   char guid_string[ 40 ];

   truxton_event_get_file_id( event_handle, guid_string, sizeof(guid_string) );
   printf( "File ID is %s\n", guid_string );

   truxton_event_get_media_id( event_handle, guid_string, sizeof(guid_string) );
   printf( "Media ID is %s\n", guid_string );

   truxton_event_get_id( event_handle, guid_string, sizeof(guid_string) );
   printf( "Event ID is %s\n", guid_string );

   uint64_t value = truxton_event_get_type( event_handle );
   printf( "Type is %" PRIu64 "\n", value );
}