Difference between revisions of "Truxton media add child"

From truxwiki.com
Jump to navigation Jump to search
(Created page with "This creates a new child file belonging to this media. This new child will be an orphan. You must set the Truxton_child_file_set_parent_id|pare...")
 
 
(2 intermediate revisions by the same user not shown)
Line 4: Line 4:
  
 
=Syntax=
 
=Syntax=
<syntaxhighlight lang="C">
+
<source lang="C">
 
uint64_t truxton_media_add_child( uint64_t media_handle );
 
uint64_t truxton_media_add_child( uint64_t media_handle );
</syntaxhighlight>
+
</source>
  
 
=Parameters=
 
=Parameters=
Line 16: Line 16:
  
 
=Sample=
 
=Sample=
<syntaxhighlight lang="C" highlight="9">
+
<source lang="C" highlight="7">
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 29: Line 29:
 
   return( child_file );
 
   return( child_file );
 
}
 
}
</syntaxhighlight>
+
</source>

Latest revision as of 07:04, 5 February 2026

This creates a new child file belonging to this media. This new child will be an orphan. You must set the parent file id in order to have it show up in the file hierarchy.

Syntax

uint64_t truxton_media_add_child( uint64_t media_handle );

Parameters

media_handle

The handle created by the truxton_media_open_id or truxton_media_create call.

Return value

The handle to a new orphaned child file object belonging to this media.

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 );
}