Truxton media destroy

From truxwiki.com
Revision as of 13:29, 24 June 2020 by Sam (talk | contribs) (Created page with "This frees any resources allocated to this media object. You can use this to add to the <code>Media</code> table in the database. =Syntax= <syntaxhighlight lang="C"> uint64_t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This frees any resources allocated to this media object. You can use this to add to the Media table in the database.

Syntax

uint64_t truxton_media_destroy(uint64_t truxton_handle);

Parameters

truxton_handle

The Truxton instance this file type will belong. This handle comes from calling truxton_create().

Return value

A handle to a media object.

Sample

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

   uint64_t media = truxton_media_create(truxton);

   truxton_media_set_name( media, "Ducky Momo Server" );
   truxton_media_set_description( media, "Original plans for I Hate People plate" );
   truxton_media_set_case_number( media, "PNF-S02E30");
   truxton_media_set_originator( media, "Provenmire and Marsh" );
   truxton_media_set_evidence_bag( media, "EVINC-20100709" );
   truxton_media_set_type( media, MEDIA_TYPE_HARD_DISK_IMAGE );
   truxton_media_set_size( media, 100 * ONE_GIGABYTE );
   truxton_media_set_latitude( media, -17.60978782 );
   truxton_media_set_longitude( media, 177.0342855299 );
   truxton_media_save( media );
   truxton_media_tag( media, "Too Young", "Yes, yes I am", 1 );

   char id[ 65 ];

   truxton_media_get_id( media, id, sizeof( id ) );

   printf( "Media ID is %s\n", id );

   truxton_media_destroy(media);
   truxton_destroy(truxton);
}

Remarks

By default, when this API is called the identifier for the media will be generated, the created and last updated timestamps will be set to the current time, the expiration date set to 99 years from now, the percent complete set to 100 and the status set to loaded.