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

Functions that call Python functions and other callables. More...

Functions

REPY_bool REPY_Call (REPY_Handle func, REPY_Handle args_nullable, REPY_Handle kwargs_nullable)
 Call a Python function (or another callable object) by handle, and discard the return value.
REPY_Handle REPY_CallReturn (REPY_Handle func, REPY_Handle args_nullable, REPY_Handle kwargs_nullable)
 Call a Python function (or another callable object) by handle, and get the return value as a REPY_Handle.
REPY_bool REPY_CallAttr (REPY_Handle object, REPY_Handle name, REPY_Handle args_nullable, REPY_Handle kwargs_nullable)
 Call a Python object member (such as a module function, object method, or another callable) by parent object and attribute name, and discard the return value. The attribute name should be a Python str.
REPY_bool REPY_CallAttrCStr (REPY_Handle object, char *name, REPY_Handle args_nullable, REPY_Handle kwargs_nullable)
 Call a Python object member (such as a module function, object method, or another callable) by parent object and attribute name, and discard the return value. The attribute name should be a NULL-terminated C string.
REPY_Handle REPY_CallAttrReturn (REPY_Handle object, REPY_Handle name, REPY_Handle args_nullable, REPY_Handle kwargs_nullable)
 Call a Python object member (such as a module function, object method, or another callable) by parent object and attribute name, and discard the return value. The attribute name should be a NULL-terminated C string.
REPY_Handle REPY_CallAttrCStrReturn (REPY_Handle object, char *name, REPY_Handle args_nullable, REPY_Handle kwargs_nullable)
 Call a Python object member (such as a module function, object method, or another callable) by parent object and attribute name, and discard the return value. The attribute name should be a NULL-terminated C string.

Detailed Description

Functions that call Python functions and other callables.

Function Documentation

◆ REPY_Call()

REPY_bool REPY_Call ( REPY_Handle func,
REPY_Handle args_nullable,
REPY_Handle kwargs_nullable )

Call a Python function (or another callable object) by handle, and discard the return value.

REPY_CreateTuple_SUH and REPY_CreateDict_SUH serve as easy methods of nesting argument construction into a call to this function.

Parameters
funcThe Python function or callable to call. Should be the actual function object itself.
args_nullableA tuple of the positional arguments to pass to the function. Use REPY_NO_OBJECT to forgo positional arguments.
kwargs_nullableA dict of the keyword arguments to pass to the function. Use REPY_NO_OBJECT to forgo keyword arguments.
Returns
true if the call executed without error, false otherwise.

◆ REPY_CallAttr()

REPY_bool REPY_CallAttr ( REPY_Handle object,
REPY_Handle name,
REPY_Handle args_nullable,
REPY_Handle kwargs_nullable )

Call a Python object member (such as a module function, object method, or another callable) by parent object and attribute name, and discard the return value. The attribute name should be a Python str.

REPY_CreateTuple_SUH and REPY_CreateDict_SUH serve as easy methods of nesting argument construction into a call to this function.

Parameters
objectThe Python object to call a member of.
nameThe name of the object attribute to call. Should be a Python str.
args_nullableA tuple of the positional arguments to pass to the function. Use REPY_NO_OBJECT to forgo positional arguments.
kwargs_nullableA dict of the keyword arguments to pass to the function. Use REPY_NO_OBJECT to forgo keyword arguments.
Returns
true if the call executed without error, false otherwise.

◆ REPY_CallAttrCStr()

REPY_bool REPY_CallAttrCStr ( REPY_Handle object,
char * name,
REPY_Handle args_nullable,
REPY_Handle kwargs_nullable )

Call a Python object member (such as a module function, object method, or another callable) by parent object and attribute name, and discard the return value. The attribute name should be a NULL-terminated C string.

REPY_CreateTuple_SUH and REPY_CreateDict_SUH serve as easy methods of nesting argument construction into a call to this function.

Parameters
objectThe Python object to call a member of.
nameThe name of the object attribute to call. Should be a NULL-terminated C string.
args_nullableA tuple of the positional arguments to pass to the function. Use REPY_NO_OBJECT to forgo positional arguments.
kwargs_nullableA dict of the keyword arguments to pass to the function. Use REPY_NO_OBJECT to forgo keyword arguments.
Returns
true if the call executed without error, false otherwise.

◆ REPY_CallAttrCStrReturn()

REPY_Handle REPY_CallAttrCStrReturn ( REPY_Handle object,
char * name,
REPY_Handle args_nullable,
REPY_Handle kwargs_nullable )

Call a Python object member (such as a module function, object method, or another callable) by parent object and attribute name, and discard the return value. The attribute name should be a NULL-terminated C string.

Note that technically all Python functions and callables return a value. Functions that are typically thought of not having a return will actually return Python's None object. This mean that, unless an error occurs, this API function will always return a REPY_Handle that will need to be released.

REPY_CreateTuple_SUH and REPY_CreateDict_SUH serve as easy methods of nesting argument construction into a call to this function.

Parameters
objectThe Python object to call a member of.
nameThe name of the object attribute to call. Should be a NULL-terminated C string.
args_nullableA tuple of the positional arguments to pass to the function. Use REPY_NO_OBJECT to forgo positional arguments.
kwargs_nullableA dict of the keyword arguments to pass to the function. Use REPY_NO_OBJECT to forgo keyword arguments.
Returns
A handle for the resulting object. Will be REPY_NO_HANDLE if an error occured.

◆ REPY_CallAttrReturn()

REPY_Handle REPY_CallAttrReturn ( REPY_Handle object,
REPY_Handle name,
REPY_Handle args_nullable,
REPY_Handle kwargs_nullable )

Call a Python object member (such as a module function, object method, or another callable) by parent object and attribute name, and discard the return value. The attribute name should be a NULL-terminated C string.

Note that technically all Python functions and callables return a value. Functions that are typically thought of not having a return will actually return Python's None object. This mean that, unless an error occurs, this API function will always return a REPY_Handle that will need to be released.

REPY_CreateTuple_SUH and REPY_CreateDict_SUH serve as easy methods of nesting argument construction into a call to this function.

Parameters
objectThe Python object to call a member of.
nameThe name of the object attribute to call. Should be a NULL-terminated C string.
args_nullableA tuple of the positional arguments to pass to the function. Use REPY_NO_OBJECT to forgo positional arguments.
kwargs_nullableA dict of the keyword arguments to pass to the function. Use REPY_NO_OBJECT to forgo keyword arguments.
Returns
A handle for the resulting object. Will be REPY_NO_HANDLE if an error occured.

◆ REPY_CallReturn()

REPY_Handle REPY_CallReturn ( REPY_Handle func,
REPY_Handle args_nullable,
REPY_Handle kwargs_nullable )

Call a Python function (or another callable object) by handle, and get the return value as a REPY_Handle.

Note that technically all Python functions and callables return a value. Functions that are typically thought of not having a return will actually return Python's None object. This mean that, unless an error occurs, this API function will always return a REPY_Handle that will need to be released.

REPY_CreateTuple_SUH and REPY_CreateDict_SUH serve as easy methods of nesting argument construction into a call to this function.

Parameters
funcThe Python function or callable to call. Should be the actual function object itself.
args_nullableA tuple of the positional arguments to pass to the function. Use REPY_NO_OBJECT to forgo positional arguments.
kwargs_nullableA dict of the keyword arguments to pass to the function. Use REPY_NO_OBJECT to forgo keyword arguments.
Returns
true if the call executed without error, false otherwise.