Truxton set black box source code location

From truxwiki.com
Revision as of 14:51, 28 May 2023 by Sam (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

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

Sample

 1 #define CHECK_SIZE_CPP (0x1122334455)
 2 
 3 int is_valid_size( file_object * f )
 4 {
 5    truxton_set_black_box_source_code_location( CHECK_SIZE_CPP, __LINE__ );
 6 
 7    if ( f->bytes_per_page < 3 )
 8    {
 9       return( 0 );
10    }
11 
12    truxton_set_black_box_source_code_location( CHECK_SIZE_CPP, __LINE__ );
13 
14    if ( check_alignment( f ) == 0 )
15    {
16       return( 0 );
17    }
18 
19    truxton_set_black_box_source_code_location( CHECK_SIZE_CPP, __LINE__ );
20 
21    if ( ( f->bytes_per_sector % 512 ) == 0 )
22    {
23       return( 1 );
24    }
25    
26    truxton_set_black_box_source_code_location( CHECK_SIZE_CPP, __LINE__ );
27 
28    return( 0 );
29 }