Macros | |
| #define | REPY_FN_IMPORT(module_name) |
| Inserts a Python module into the local scope. | |
| #define | REPY_FN_GET(var_name) |
| Gets a variable from the local scope. | |
| #define | REPY_FN_SET(var_name, py_object) |
| Sets a variable in the the local scope, using a REPY_Handle for the value. | |
| #define | REPY_FN_GET_BOOL(var_name) |
| Gets a variable from the local scope and casts it to a bool. | |
| #define | REPY_FN_SET_BOOL(var_name, value) |
| Sets a variable of the Python type bool in the the local scope, using a bool for the value. | |
| #define | REPY_FN_GET_U8(var_name) |
| Gets a variable from the local scope and casts it to a u8. | |
| #define | REPY_FN_SET_U8(var_name, value) |
| Sets a variable of the Python type int in the the local scope, using a u8 for the value. | |
| #define | REPY_FN_GET_S8(var_name) |
| Gets a variable from the local scope and casts it to a s8. | |
| #define | REPY_FN_SET_S8(var_name, value) |
| Sets a variable of the Python type int in the the local scope, using a s8 for the value. | |
| #define | REPY_FN_GET_U16(var_name) |
| Gets a variable from the local scope and casts it to a u16. | |
| #define | REPY_FN_SET_U16(var_name, value) |
| Sets a variable of the Python type int in the the local scope, using a u16 for the value. | |
| #define | REPY_FN_GET_S16(var_name) |
| Gets a variable from the local scope and casts it to a s16. | |
| #define | REPY_FN_SET_S16(var_name, value) |
| Sets a variable of the Python type int in the the local scope, using a s16 for the value. | |
| #define | REPY_FN_GET_U32(var_name) |
| Gets a variable from the local scope and casts it to a u32. | |
| #define | REPY_FN_SET_U32(var_name, value) |
| Sets a variable of the Python type int in the the local scope, using a u32 for the value. | |
| #define | REPY_FN_GET_S32(var_name) |
| Gets a variable from the local scope and casts it to a s32. | |
| #define | REPY_FN_SET_S32(var_name, value) |
| Sets a variable of the Python type int in the the local scope, using a s32 for the value. | |
| #define | REPY_FN_GET_F32(var_name) |
| Gets a variable from the local scope and casts it to a f32. | |
| #define | REPY_FN_SET_F32(var_name, value) |
| Sets a variable of the Python type float in the the local scope, using a f32 for the value. | |
| #define | REPY_FN_GET_U64(var_name) |
| Gets a variable from the local scope and casts it to a u64. | |
| #define | REPY_FN_SET_U64(var_name, value) |
| Sets a variable of the Python type int in the the local scope, using a u64 for the value. | |
| #define | REPY_FN_GET_S64(var_name) |
| Gets a variable from the local scope and casts it to a s64. | |
| #define | REPY_FN_SET_S64(var_name, value) |
| Sets a variable of the Python type int in the the local scope, using a s64 for the value. | |
| #define | REPY_FN_GET_F64(var_name) |
| Gets a variable from the local scope and casts it to a f64. | |
| #define | REPY_FN_SET_F64(var_name, value) |
| Sets a variable of the Python type float in the the local scope, using a f64 for the value. | |
| #define | REPY_FN_GET_STR(var_name) |
| Gets a variable from the local scope and casts it to a char*. Intended to be used when the variable object is a Python str. | |
| #define | REPY_FN_SET_STR(var_name, value) |
| Sets a variable of the Python type str in the the local scope, using a NULL-terminated C string. | |
| #define | REPY_FN_SET_STR_N(var_name, value, len) |
| Sets a variable of the Python type str in the the local scope, using char array of N length for the value. | |
| #define | REPY_FN_GET_BYTESTR(var_name) |
| Gets a variable from the local scope and casts it to a char*. Intended to be used when the variable object is a Python bytes. | |
| #define | REPY_FN_SET_BYTESTR(var_name, value) |
| Sets a variable of the Python type str in the the local scope, using a NULL-terminated C string. | |
| #define | REPY_FN_SET_BYTESTR_N(var_name, value, len) |
| Sets a variable of the Python type bytes in the the local scope, using char array of N length for the value. | |
Add variables to the Python scope, and retrieve handles and values. For convenience, many common casting operations have their own variant macros.
| #define REPY_FN_GET | ( | var_name | ) |
Gets a variable from the local scope.
Note that this macro will not retrieve global variables.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| #define REPY_FN_GET_BOOL | ( | var_name | ) |
Gets a variable from the local scope and casts it to a bool.
Note that this macro will not retrieve global variables.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| #define REPY_FN_GET_BYTESTR | ( | var_name | ) |
Gets a variable from the local scope and casts it to a char*. Intended to be used when the variable object is a Python bytes.
Note that this macro will not retrieve global variables.
The C string returned by this macro will need to be freed with recomp_free. Failure to do so will result in a memory leak.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| #define REPY_FN_GET_F32 | ( | var_name | ) |
Gets a variable from the local scope and casts it to a f32.
Note that this macro will not retrieve global variables.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| #define REPY_FN_GET_F64 | ( | var_name | ) |
Gets a variable from the local scope and casts it to a f64.
Note that this macro will not retrieve global variables.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| #define REPY_FN_GET_S16 | ( | var_name | ) |
Gets a variable from the local scope and casts it to a s16.
Note that this macro will not retrieve global variables.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| #define REPY_FN_GET_S32 | ( | var_name | ) |
Gets a variable from the local scope and casts it to a s32.
Note that this macro will not retrieve global variables.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| #define REPY_FN_GET_S64 | ( | var_name | ) |
Gets a variable from the local scope and casts it to a s64.
Note that this macro will not retrieve global variables.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| #define REPY_FN_GET_S8 | ( | var_name | ) |
Gets a variable from the local scope and casts it to a s8.
Note that this macro will not retrieve global variables.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| #define REPY_FN_GET_STR | ( | var_name | ) |
Gets a variable from the local scope and casts it to a char*. Intended to be used when the variable object is a Python str.
Note that this macro will not retrieve global variables.
The C string returned by this macro will need to be freed with recomp_free. Failure to do so will result in a memory leak.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| #define REPY_FN_GET_U16 | ( | var_name | ) |
Gets a variable from the local scope and casts it to a u16.
Note that this macro will not retrieve global variables.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| #define REPY_FN_GET_U32 | ( | var_name | ) |
Gets a variable from the local scope and casts it to a u32.
Note that this macro will not retrieve global variables.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| #define REPY_FN_GET_U64 | ( | var_name | ) |
Gets a variable from the local scope and casts it to a u64.
Note that this macro will not retrieve global variables.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| #define REPY_FN_GET_U8 | ( | var_name | ) |
Gets a variable from the local scope and casts it to a u8.
Note that this macro will not retrieve global variables.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| #define REPY_FN_IMPORT | ( | module_name | ) |
Inserts a Python module into the local scope.
The variable name for the module will be the same as the module name.
| module_name | The name of the Python module as a C string. |
| #define REPY_FN_SET | ( | var_name, | |
| py_object ) |
Sets a variable in the the local scope, using a REPY_Handle for the value.
Note that the global scope will be unaffected.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| py_object | The python object to insert. Should be a REPY_Handle. |
| #define REPY_FN_SET_BOOL | ( | var_name, | |
| value ) |
Sets a variable of the Python type bool in the the local scope, using a bool for the value.
Note that the global scope will be unaffected.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| value | The python object to insert. Should be a bool. |
| #define REPY_FN_SET_BYTESTR | ( | var_name, | |
| value ) |
Sets a variable of the Python type str in the the local scope, using a NULL-terminated C string.
Note that the global scope will be unaffected.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| value | The value of the Python str. Should be a NULL-terminated C string. |
| #define REPY_FN_SET_BYTESTR_N | ( | var_name, | |
| value, | |||
| len ) |
Sets a variable of the Python type bytes in the the local scope, using char array of N length for the value.
Note that the global scope will be unaffected.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| value | The content of the Python bytes. Should be a char*. |
| len | The length of value in bytes. |
| #define REPY_FN_SET_F32 | ( | var_name, | |
| value ) |
Sets a variable of the Python type float in the the local scope, using a f32 for the value.
Note that the global scope will be unaffected.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| value | The value of the Python float. Should be a f32. |
| #define REPY_FN_SET_F64 | ( | var_name, | |
| value ) |
Sets a variable of the Python type float in the the local scope, using a f64 for the value.
Note that the global scope will be unaffected.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| value | The value of the Python float. Should be a f64. |
| #define REPY_FN_SET_S16 | ( | var_name, | |
| value ) |
Sets a variable of the Python type int in the the local scope, using a s16 for the value.
Note that the global scope will be unaffected.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| value | The value of the Python int. Should be a s16. |
| #define REPY_FN_SET_S32 | ( | var_name, | |
| value ) |
Sets a variable of the Python type int in the the local scope, using a s32 for the value.
Note that the global scope will be unaffected.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| value | The value of the Python int. Should be a s32. |
| #define REPY_FN_SET_S64 | ( | var_name, | |
| value ) |
Sets a variable of the Python type int in the the local scope, using a s64 for the value.
Note that the global scope will be unaffected.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| value | The value of the Python int. Should be a s64. |
| #define REPY_FN_SET_S8 | ( | var_name, | |
| value ) |
Sets a variable of the Python type int in the the local scope, using a s8 for the value.
Note that the global scope will be unaffected.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| value | The value of the Python int. Should be a s8. |
| #define REPY_FN_SET_STR | ( | var_name, | |
| value ) |
Sets a variable of the Python type str in the the local scope, using a NULL-terminated C string.
Note that the global scope will be unaffected.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| value | The value of the Python str. Should be a NULL-terminated C string. |
| #define REPY_FN_SET_STR_N | ( | var_name, | |
| value, | |||
| len ) |
Sets a variable of the Python type str in the the local scope, using char array of N length for the value.
Note that the global scope will be unaffected.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| value | The content of the Python str. Should be a char*. |
| len | The length of value in bytes. |
| #define REPY_FN_SET_U16 | ( | var_name, | |
| value ) |
Sets a variable of the Python type int in the the local scope, using a u16 for the value.
Note that the global scope will be unaffected.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| value | The value of the Python int. Should be a u16. |
| #define REPY_FN_SET_U32 | ( | var_name, | |
| value ) |
Sets a variable of the Python type int in the the local scope, using a u32 for the value.
Note that the global scope will be unaffected.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| value | The value of the Python int. Should be a u32. |
| #define REPY_FN_SET_U64 | ( | var_name, | |
| value ) |
Sets a variable of the Python type int in the the local scope, using a u64 for the value.
Note that the global scope will be unaffected.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| value | The value of the Python int. Should be a u64. |
| #define REPY_FN_SET_U8 | ( | var_name, | |
| value ) |
Sets a variable of the Python type int in the the local scope, using a u8 for the value.
Note that the global scope will be unaffected.
| var_name | The name of the variable. Should be a NULL-terminated C string. |
| value | The value of the Python int. Should be a u8. |