RecompExternalPython for N64Recompiled 2.0.0
Loading...
Searching...
No Matches

Method functions to operate on REPY_IfStmtHelper objects. More...

Functions

REPY_IfStmtHelperREPY_IfStmtHelper_Create (REPY_IfStmtChain **chain_root)
 Initializes a REPY_IfStmtHelper for controlling managing a Pythonic if/else block.
void REPY_IfStmtHelper_Destroy (REPY_IfStmtHelper *helper)
 Destroys and deallocates a REPY_IfStmtHelper.
REPY_bool REPY_IfStmtHelper_Step (REPY_IfStmtHelper *helper, REPY_Handle global_scope, REPY_Handle local_scope, char *expr_string, char *filename, char *function_name, REPY_u32 line_number, char *identifier)
 Steps through and evaluate the next link in the REPY_IfStmtChain chain provided to the REPY_IfStmtHelper, or creates a new link if one doesn't exist.

Detailed Description

Method functions to operate on REPY_IfStmtHelper objects.

Function Documentation

◆ REPY_IfStmtHelper_Create()

REPY_IfStmtHelper * REPY_IfStmtHelper_Create ( REPY_IfStmtChain ** chain_root)

Initializes a REPY_IfStmtHelper for controlling managing a Pythonic if/else block.

Used by several of the various REPY_FN_IF_CACHE macros.

Parameters
chain_rootA pointer to the REPY_IfStmtChain* (ergo, a douple-pointer) variable for the first link in the if/else chain. For caching purposes, this will usually be a static variable. If value of the variable at root us NULL, that will be taken to mean that the chain has not been created yet (IE, this is the first run of this if/else block).
Returns
A pointer to the new REPY_IfStmtHelper.

◆ REPY_IfStmtHelper_Destroy()

void REPY_IfStmtHelper_Destroy ( REPY_IfStmtHelper * helper)

Destroys and deallocates a REPY_IfStmtHelper.

Note that the REPY_IfStmtChain attached to this helper will not be destroyed.

Parameters
helperA pointer to the REPY_IfStmtHelper being destroyed.

◆ REPY_IfStmtHelper_Step()

REPY_bool REPY_IfStmtHelper_Step ( REPY_IfStmtHelper * helper,
REPY_Handle global_scope,
REPY_Handle local_scope,
char * expr_string,
char * filename,
char * function_name,
REPY_u32 line_number,
char * identifier )

Steps through and evaluate the next link in the REPY_IfStmtChain chain provided to the REPY_IfStmtHelper, or creates a new link if one doesn't exist.

Used by several of the various REPY_FN_IF_CACHE macros. Can be used within the actual C if statements themselves.

Parameters
helperA pointer to the REPY_IfStmtHelper controlling this if/else block.
global_scopeThe global scope dict to evaluate the expression in.
local_scopeThe local scope dict to evaluate the expression in.
expr_stringThe Python expression to evaluate. Should be a NULL-terminated C string. Will be compiled into Python bytecode immediately. This argument is only used if there is no next link in the REPY_IfStmtChain chain (meaning the link needs to be created).
filenameA C filename to associate with the Python expression. Usually _FILE_NAME__. This argument is only used if there is no next link in the REPY_IfStmtChain chain (meaning the link needs to be created).
function_nameThe name of C function to associate with the Python expression. Usually __func__. This argument is only used if there is no next link in the REPY_IfStmtChain chain (meaning the link needs to be created).
line_numberA line number in a C file to associate with the Python expression. Usually __LINE__. This argument is only used if there is no next link in the REPY_IfStmtChain chain (meaning the link needs to be created).
identifierAn identifiying string for the Python expression. Usually the bytecode identifier from the C file. This argument is only used if there is no next link in the REPY_IfStmtChain chain (meaning the link needs to be created).