Difference between revisions of "Truxton artifact set media id"
Jump to navigation
Jump to search
(Created page with "This sets the source media of the artifact. =Syntax= <source lang="C"> void truxton_artifact_set_media_id( uint64_t artifact_handle, char const * id ); </source> =Parameters...") |
|||
| Line 37: | Line 37: | ||
printf( "Artifact ID is %s\n", id ); | printf( "Artifact ID is %s\n", id ); | ||
| − | truxton_artifact_destroy(artifact); | + | truxton_artifact_destroy( artifact ); |
| − | truxton_destroy(truxton); | + | truxton_destroy( truxton ); |
} | } | ||
</source> | </source> | ||
Revision as of 11:13, 10 February 2021
This sets the source media of the artifact.
Syntax
void truxton_artifact_set_media_id( uint64_t artifact_handle, char const * id );
Parameters
artifact_handle
The handle to an artifact created by the truxton_artifact_create call.
id
The string representation of a GUID.
It corresponds to the [MediaID] column of the [Entity] table.
Remarks
This identifier should be a value from the [ID] column of the [Media] table in the database.
Sample
void create_artifact( char const * file_id, char const * media_id )
{
uint64_t truxton = truxton_create();
uint64_t artifact= truxton_artifact_create(truxton);
truxton_artifact_set_file_id( artifact, file_id );
truxton_artifact_set_media_id( artifact, media_id );
truxton_artifact_set_name( artifact, "Ducky Momo Server" );
truxton_artifact_save( artifact);
truxton_artifact_tag( artifact, "Too Young", "Yes, yes I am", 1 );
char id[ 65 ];
truxton_artifact_get_id( artifact, id, sizeof( id ) );
printf( "Artifact ID is %s\n", id );
truxton_artifact_destroy( artifact );
truxton_destroy( truxton );
}