Truxton artifact add note
Revision as of 08:22, 1 October 2022 by Sam (talk | contribs) (Created page with "This will add an investigator's note to the artifact. You can only add a note to an artifact after <code>truxton_artifact_save()</code> has been called. This will cause a...")
This will add an investigator's note to the artifact.
You can only add a note to an artifact after truxton_artifact_save() has been called.
This will cause a record to be created in the [InvestigatorNote] table.
Syntax
int truxton_artifact_add_note( uint64_t artifact_handle, char const * text );
Parameters
artifact_handle
The handle created by calling truxton_artifact_create().
text
The contents of the note.
Return value
A non-zero value on success, zero on failure.
Sample
void create_artifact( void )
{
uint64_t truxton = truxton_create();
uint64_t artifact = truxton_artifact_create( truxton );
truxton_artifact_set_name( artifact, "Ducky Momo Server" );
// Commit the data to the database
if ( truxton_artifact_save( artifact ) == 0 )
{
printf( "Cannot save data to the database.\n" );
}
else
{
char id[ 65 ];
truxton_artifact_get_id( artifact, id, sizeof( id ) );
printf( "Artifact ID is %s\n", id );
if ( truxton_artifact_add_note( artifact, "This is the bestest arifact ever" ) == 0 )
{
printf( "Failed to add a note\n" );
}
}
truxton_artifact_destroy( artifact );
truxton_destroy( truxton );
}