Truxton artifact get offset

From truxwiki.com
Revision as of 07:28, 6 November 2020 by Sam (talk | contribs) (Created page with "This tells you the offset into the object where the raw bytes that make up the artifact begin. This corresponds to the <code>[Offset]</code> column of the <code><nowiki>[</now...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This tells you the offset into the object where the raw bytes that make up the artifact begin. This corresponds to the [Offset] column of the [Entity] table in the database.

Syntax

uint64_t truxton_artifact_get_offset(uint64_t artifact_handle);

Parameters

artifact_handle

The artifact instance. This handle comes from calling truxton_artifact_create().

Return value

The offset into the parent object where the raw artifact begins.

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" );
   truxton_artifact_set_offset( artifact, 42 );
   truxton_artifact_save( artifact);
   truxton_artifact_tag( artifact, "Too Young", "Yes, yes I am", 1 );

   uint64_t offset = truxton_artifact_get_offset( offset );

   printf( "Artifact offset is%" PRIu64 "\n", offset );

   truxton_artifact_destroy(artifact);
   truxton_destroy(truxton);
}