Truxton relation get b id

From truxwiki.com
Revision as of 07:59, 17 January 2021 by Sam (talk | contribs) (Created page with "This retrieves the [https://en.wikipedia.org/wiki/Universally_unique_identifier GUID] of the B object of the relation. This corresponds to the <code>[B_ID]</code> column of th...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This retrieves the GUID of the B object of the relation. This corresponds to the [B_ID] column of the [Relation] table.

Syntax

void truxton_relation_get_b_id( uint64_t relation_handle, char * destination_string, size_t max_size );

Parameters

relation_handle

This handle comes from calling truxton_relation_create()

destination_string

The string to be written to.

max_size

The maximum number of characters that can be written to destination_string.

Sample

void dump_relation(uint64_t relation_handle)
{
   uint64_t value = 0;
   char guid_string[ 65 ];

   value = truxton_relation_get_a_type( relation_handle );
   truxton_relation_get_a_id( relation_handle, guid_string, sizeof( guid_string ) );
   printf( "A (%" PRIu64 ") %s is a ", value, guid_string );

   value = truxton_relation_get_relation( relation_handle );
   printf( "%" PRIu64 " of ", value );

   value = truxton_relation_get_b_type( relation_handle );
   truxton_relation_get_b_id( relation_handle, guid_string, sizeof( guid_string ) );
   printf( "B (%" PRIu64 ") %s is a ", value, guid_string );

   value = truxton_relation_get_source_type( relation_handle );
   truxton_relation_get_source_id( relation_handle, guid_string, sizeof( guid_string ) );

   printf( "Source (%" PRIu64 ") is %s\n", value, guid_string );   
}