Method functions to operate on REPY_IfStmtHelper objects. More...
Functions | |
| REPY_IfStmtHelper * | REPY_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. | |
Method functions to operate on REPY_IfStmtHelper objects.
| 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.
| chain_root | A 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). |
| 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.
| helper | A pointer to the REPY_IfStmtHelper being destroyed. |
| 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.
| helper | A pointer to the REPY_IfStmtHelper controlling this if/else block. |
| global_scope | The global scope dict to evaluate the expression in. |
| local_scope | The local scope dict to evaluate the expression in. |
| expr_string | The 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). |
| filename | A 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_name | The 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_number | A 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). |
| identifier | An 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). |