Difference between revisions of "Truxton media create"
Jump to navigation
Jump to search
(→Sample) |
|||
| Line 1: | Line 1: | ||
This creates a media object. | This creates a media object. | ||
| − | You can use this to add to the <code>Media</code> table in the database. | + | You can use this to add to the <code>[Media]</code> table in the database. |
=Syntax= | =Syntax= | ||
Revision as of 09:00, 21 October 2020
This creates a media object.
You can use this to add to the [Media] table in the database.
Syntax
uint64_t truxton_media_create(uint64_t truxton_handle);
Parameters
truxton_handle
The Truxton instance this media 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, "Povenmire 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
The default behavior of this API is to:
- Generate an identifier for the media. The media identifier is not random.
- Set the created date to the current time
- Set the last updated date to the current time
- Set the expiration date set to 99 years from now
- Set the percent complete to 100
- Set the status set to loaded