Truxton location destroy

From truxwiki.com
Revision as of 07:36, 13 December 2020 by Sam (talk | contribs)
Jump to navigation Jump to search

This destroys a location object.

Syntax

void truxton_location_destroy( uint64_t location );

Parameters

location

The handle to the location object. This handle comes from calling truxton_location_create() or truxton_child_file_create_location()

Sample

void create_location(void)
{
   uint64_t truxton = truxton_create();

   uint64_t location = truxton_location_create(truxton);

   truxton_location_save();

   uint64_t new_id = truxton_file_get_id( file_type );

   if ( new_id == 0 )
   {
      printf( "Failed to create new file type\n" );
   }
   else
   {
      printf( "Created new file type as id %" PRIu64 "\n", new_id );
   }

   truxton_location_destroy(location);
   truxton_destroy(truxton);
}