Difference between revisions of "Truxton set black box source code location"

From truxwiki.com
Jump to navigation Jump to search
(Created page with "This function writes information to the Black Box about where you are in your source code. =Syntax= <source lang="C"> void truxton_set_black_box_source_code_location( uin...")
 
 
(One intermediate revision by the same user not shown)
Line 11: Line 11:
  
 
==<code>line_number_in_the_source_code_file</code>==
 
==<code>line_number_in_the_source_code_file</code>==
An integer value that you created to represent the name of the source code file.
+
The line number in the source code file.
  
 
=Sample=
 
=Sample=
<source lang="C" line highlight="5,12,19,26">
+
<source lang="C" highlight="5,12,19,26">
 
#define CHECK_SIZE_CPP (0x1122334455)
 
#define CHECK_SIZE_CPP (0x1122334455)
  

Latest revision as of 06:30, 20 February 2026

This function writes information to the Black Box about where you are in your source code.

Syntax

void truxton_set_black_box_source_code_location( uint64_t source_code_file_identifier, uint64_t line_number_in_the_source_code_file );

Parameters

source_code_file_identifier

An integer value that you created to represent the name of the source code file.

line_number_in_the_source_code_file

The line number in the source code file.

Sample

#define CHECK_SIZE_CPP (0x1122334455)

int is_valid_size( file_object * f )
{
   truxton_set_black_box_source_code_location( CHECK_SIZE_CPP, __LINE__ );

   if ( f->bytes_per_page < 3 )
   {
      return( 0 );
   }

   truxton_set_black_box_source_code_location( CHECK_SIZE_CPP, __LINE__ );

   if ( check_alignment( f ) == 0 )
   {
      return( 0 );
   }

   truxton_set_black_box_source_code_location( CHECK_SIZE_CPP, __LINE__ );

   if ( ( f->bytes_per_sector % 512 ) == 0 )
   {
      return( 1 );
   }
   
   truxton_set_black_box_source_code_location( CHECK_SIZE_CPP, __LINE__ );

   return( 0 );
}