Truxton child file get truxton

From truxwiki.com
Jump to navigation Jump to search

This retrieves the handle to the Truxton instance handling this file object.

Syntax

uint64_t truxton_child_file_get_truxton( uint64_t child_handle );

Parameters

child_handle

The handle created by the truxton_child_file_create or truxton_file_create_child call.

Return value

A non-zero value on success, zero on failure.

Remarks

This allows you to call any API that requires a handle to the Truxton object. Many times, in code, you are given one type of thing but need another. Should you find yourself in a situation where you were given file handle and you need to do something at the Truxton level, you can get the handle you need.

Sample

void conditionally_add( uint64_t parent_file )
{
   if ( truxton_child_file_get_type( parent_file ) != Type_FileSystemRoot )
   {
      return;
   }
   
   int64_t truxton = truxton_child_file_get_truxton( truxton );

   truxton_start_adding_files( truxton );
}