Difference between revisions of "Truxton media get root file id"
Jump to navigation
Jump to search
(Created page with "This retrieves the [https://en.wikipedia.org/wiki/Universally_unique_identifier GUID] of the topmost file in the media. This corresponds to the <code>ID</code> column of the <...") |
|||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | This retrieves the [https://en.wikipedia.org/wiki/Universally_unique_identifier GUID] of the | + | This retrieves the [https://en.wikipedia.org/wiki/Universally_unique_identifier GUID] of the latest [[Type_Root|root]] file in the media. |
| − | This corresponds to the <code>ID</code> column of the <code>[[File Table|File]]</code> table. | + | This corresponds to the <code>[ID]</code> column of the <code><nowiki>[</nowiki>[[File Table|File]]<nowiki>]</nowiki></code> table. |
=Syntax= | =Syntax= | ||
| − | < | + | <source lang="C"> |
void truxton_media_get_root_file_id( uint64_t media_handle, char * destination_string, size_t max_size ); | void truxton_media_get_root_file_id( uint64_t media_handle, char * destination_string, size_t max_size ); | ||
| − | </ | + | </source> |
=Parameters= | =Parameters= | ||
| Line 18: | Line 18: | ||
=Sample= | =Sample= | ||
| − | + | <source lang="C" highlight="12"> | |
| − | < | + | void print_id( uint64_t truxton ) |
| − | void print_id(uint64_t truxton) | ||
{ | { | ||
| − | uint64_t media = truxton_media_open_id(truxton, "1506fd04-3b7f-a872-ba0d-ec43efbdcf9e"); | + | uint64_t media = truxton_media_open_id( truxton, "1506fd04-3b7f-a872-ba0d-ec43efbdcf9e" ); |
if ( media != 0 ) | if ( media != 0 ) | ||
| Line 31: | Line 30: | ||
char guid_string[ 40 ]; | char guid_string[ 40 ]; | ||
| − | truxton_media_get_root_file_id( media, guid_string, sizeof(guid_string)); | + | truxton_media_get_root_file_id( media, guid_string, sizeof(guid_string) ); |
| − | truxton_media_free(media); | + | truxton_media_free( media ); |
| − | printf( "Media Root ID is %s\n", guid_string); | + | printf( "Media Root ID is %s\n", guid_string ); |
} | } | ||
| − | </ | + | </source> |
Latest revision as of 12:22, 22 February 2021
This retrieves the GUID of the latest root file in the media.
This corresponds to the [ID] column of the [File] table.
Syntax
void truxton_media_get_root_file_id( uint64_t media_handle, char * destination_string, size_t max_size );
Parameters
media_handle
The handle created by the truxton_media_open_id or truxton_media_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 print_id( uint64_t truxton )
{
uint64_t media = truxton_media_open_id( truxton, "1506fd04-3b7f-a872-ba0d-ec43efbdcf9e" );
if ( media != 0 )
{
return;
}
char guid_string[ 40 ];
truxton_media_get_root_file_id( media, guid_string, sizeof(guid_string) );
truxton_media_free( media );
printf( "Media Root ID is %s\n", guid_string );
}