Difference between revisions of "Truxton message get signature"

From truxwiki.com
Jump to navigation Jump to search
(Created page with "Gives you the first four bytes of the file's contents. This signature is often times called a [https://en.wikipedia.org/wiki/Magic_number_(programming) magic value.] =Syntax=...")
 
Line 19: Line 19:
 
void dump_signature(uint64_t message)
 
void dump_signature(uint64_t message)
 
{
 
{
   uint32_t priority = truxton_message_get_signature( message );
+
   uint32_t signature = truxton_message_get_signature( message );
  
   printf( "Signature is %08" PRIX32 "\n" );
+
   printf( "Signature is %08" PRIX32 "\n", signature );
 
}
 
}
 
</syntaxhighlight>
 
</syntaxhighlight>

Revision as of 06:46, 13 June 2020

Gives you the first four bytes of the file's contents. This signature is often times called a magic value.

Syntax

uint32_t truxton_message_get_signature( uint64_t message_handle );

Parameters

message_handle

The handle to a message created by the truxton_message_create call.

Return value

The first four bytes of the file's contents. If the file length is less than four, this value will be padded with zeroes.

Sample

void dump_signature(uint64_t message)
{
   uint32_t signature = truxton_message_get_signature( message );

   printf( "Signature is %08" PRIX32 "\n", signature );
}