Truxton relation get source id
Jump to navigation
Jump to search
This retrieves the GUID of the source object of the relation.
This corresponds to the [SourceID] column of the [Relation] table.
Syntax
void truxton_relation_get_source_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 );
}