Difference between revisions of "Truxton message set file id"

From truxwiki.com
Jump to navigation Jump to search
(Created page with "Sets the identifier of the file in the message. This corresponds to the <code>ID</code> column of the <code> File</code> table. =Syntax= <syntaxhighlight lang...")
 
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
Sets the identifier of the file in the message.
+
Sets the <code>[[Message Bus Messages#file_id|file_id]]</code> member of the [[Message Bus Messages#Message Structure|message]].
This corresponds to the <code>ID</code> column of the <code>[[File Table | File]]</code> table.
+
This should be a value from the <code>[ID]</code> column of the <code><nowiki>[</nowiki>[[File Table|File]]<nowiki>]</nowiki></code> table.
  
 
=Syntax=
 
=Syntax=
<syntaxhighlight lang="C">
+
<source lang="C">
void truxton_message_set_file_id( uint64_t message_handle, char * id );
+
void truxton_message_set_file_id( uint64_t message_handle, char const * id );
</syntaxhighlight>
+
</source>
  
 
=Parameters=
 
=Parameters=
Line 15: Line 15:
  
 
=Remarks=
 
=Remarks=
 
+
This identifier should be a value from the <code>[ID]</code> column of the <code><nowiki>[</nowiki>[[File Table|File]]<nowiki>]</nowiki></code> table in the database.
This identifier should be a value from the <code>ID</code> column of the <code>File</code> table in the database.
 
  
 
=Sample=
 
=Sample=
<syntaxhighlight lang="C" highlight="7">
+
<source lang="C" highlight="7">
void process_file(uint64_t message, uint64_t file)
+
void process_file( uint64_t message, uint64_t file )
 
{
 
{
 
   char id[40];
 
   char id[40];
  
   truxton_file_get_id(parent_file, id, sizeof(id));
+
   truxton_file_get_id( file, id, sizeof(id) );
  
 
   truxton_message_set_file_id( message, id );
 
   truxton_message_set_file_id( message, id );
 
}
 
}
</syntaxhighlight>
+
</source>

Latest revision as of 15:58, 16 February 2021

Sets the file_id member of the message. This should be a value from the [ID] column of the [File] table.

Syntax

void truxton_message_set_file_id( uint64_t message_handle, char const * id );

Parameters

message_handle

The handle created by the truxton_message_create call.

id

The string representation of a GUID.

Remarks

This identifier should be a value from the [ID] column of the [File] table in the database.

Sample

void process_file( uint64_t message, uint64_t file )
{
   char id[40];

   truxton_file_get_id( file, id, sizeof(id) );

   truxton_message_set_file_id( message, id );
}