Difference between revisions of "Truxton media get generated files folder id"

From truxwiki.com
Jump to navigation Jump to search
 
Line 3: Line 3:
  
 
=Syntax=
 
=Syntax=
<syntaxhighlight lang="C">
+
<source lang="C">
 
void truxton_media_get_generated_files_folder_id( uint64_t media_handle, char * destination_string, size_t max_size );
 
void truxton_media_get_generated_files_folder_id( uint64_t media_handle, char * destination_string, size_t max_size );
</syntaxhighlight>
+
</source>
  
 
=Parameters=
 
=Parameters=
Line 18: Line 18:
  
 
=Sample=
 
=Sample=
<syntaxhighlight lang="C" highlight="5">
+
<source lang="C" highlight="5">
uint64_t make_new_generated_file(uint64_t media)
+
uint64_t make_new_generated_file( uint64_t media )
 
{
 
{
 
   char guid_string[ 40 ];
 
   char guid_string[ 40 ];
  
   truxton_media_get_generated_files_folder_id( media, guid_string, sizeof(guid_string));
+
   truxton_media_get_generated_files_folder_id( media, guid_string, sizeof(guid_string) );
  
 
   uint64_t child_file = truxton_media_add_child( media )
 
   uint64_t child_file = truxton_media_add_child( media )
Line 31: Line 31:
 
   return( child_file );
 
   return( child_file );
 
}
 
}
</syntaxhighlight>
+
</source>

Latest revision as of 06:45, 10 February 2021

This retrieves the GUID of the Generated Files folder in the media. This corresponds to the ID column of the File table.

Syntax

void truxton_media_get_generated_files_folder_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

uint64_t make_new_generated_file( uint64_t media )
{
   char guid_string[ 40 ];

   truxton_media_get_generated_files_folder_id( media, guid_string, sizeof(guid_string) );

   uint64_t child_file = truxton_media_add_child( media )

   truxton_child_file_set_parent_id( child_file, guid_string );

   return( child_file );
}