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

Functions that deal with converting between C and Python primatives. More...

Functions

REPY_Handle REPY_CreateBool (REPY_bool value)
 Returns a REPY_Handle for a Python bool object, based on a C bool.
REPY_Handle REPY_CreateBool_SUH (REPY_bool value)
 Returns a Single-Use REPY_Handle for a Python bool object, based on a C bool.
REPY_bool REPY_CastBool (REPY_Handle object)
 Casts a Python object to a C bool.
REPY_Handle REPY_CreateU8 (REPY_u8 value)
 Returns a REPY_Handle for a Python int object, based on a C u8.
REPY_Handle REPY_CreateU8_SUH (REPY_u8 value)
 Returns a Single-Use REPY_Handle for a Python int object, based on a C u8.
REPY_u8 REPY_CastU8 (REPY_Handle object)
 Casts a Python object to a C u8.
REPY_Handle REPY_CreateS8 (REPY_s8 value)
 Returns a REPY_Handle for a Python int object, based on a C s8.
REPY_Handle REPY_CreateS8_SUH (REPY_s8 value)
 Returns a Single-Use REPY_Handle for a Python int object, based on a C s8.
REPY_s8 REPY_CastS8 (REPY_Handle object)
 Casts a Python object to a C s8.
REPY_Handle REPY_CreateU16 (REPY_u16 value)
 Returns a REPY_Handle for a Python int object, based on a C u16.
REPY_Handle REPY_CreateU16_SUH (REPY_u16 value)
 Returns a Single-Use REPY_Handle for a Python u16 object, based on a C int.
REPY_u16 REPY_CastU16 (REPY_Handle object)
 Casts a Python object to a C u16.
REPY_Handle REPY_CreateS16 (REPY_s16 value)
 Returns a REPY_Handle for a Python int object, based on a C s16.
REPY_Handle REPY_CreateS16_SUH (REPY_s16 value)
 Returns a Single-Use REPY_Handle for a Python int object, based on a C s16.
REPY_s16 REPY_CastS16 (REPY_Handle object)
 Casts a Python object to a C s16.
REPY_Handle REPY_CreateU32 (REPY_u32 value)
 Returns a REPY_Handle for a Python int object, based on a C u32.
REPY_Handle REPY_CreateU32_SUH (REPY_u32 value)
 Returns a Single-Use REPY_Handle for a Python int object, based on a C u32.
REPY_u32 REPY_CastU32 (REPY_Handle object)
 Casts a Python object to a C u32.
REPY_Handle REPY_CreateS32 (REPY_s32 value)
 Returns a REPY_Handle for a Python int object, based on a C s32.
REPY_Handle REPY_CreateS32_SUH (REPY_s32 value)
 Returns a Single-Use REPY_Handle for a Python int object, based on a C s32.
REPY_s32 REPY_CastS32 (REPY_Handle object)
 Casts a Python object to a C s32.
REPY_Handle REPY_CreateF32 (REPY_f32 value)
 Returns a REPY_Handle for a Python float object, based on a C f32.
REPY_Handle REPY_CreateF32_SUH (REPY_f32 value)
 Returns a Single-Use REPY_Handle for a Python float object, based on a C f32.
REPY_f32 REPY_CastF32 (REPY_Handle object)
 Casts a Python object to a C f32.
REPY_Handle REPY_CreatePtr (void *value)
 Returns a REPY_Handle for a Python int object, based on a C void*.
REPY_Handle REPY_CreatePtr_SUH (void *value)
 Returns a Single-Use REPY_Handle for a Python int object, based on a C void*.
void * REPY_CastPtr (REPY_Handle object)
 Casts a Python object to a C void*.
REPY_Handle REPY_CreateU64 (REPY_u64 value)
 Returns a REPY_Handle for a Python int object, based on a C u64.
REPY_Handle REPY_CreateU64_SUH (REPY_u64 value)
 Returns a Single-Use REPY_Handle for a Python int object, based on a C u64.
REPY_u64 REPY_CastU64 (REPY_Handle object)
 Casts a Python object to a C u64.
REPY_Handle REPY_CreateS64 (REPY_s64 value)
 Returns a REPY_Handle for a Python int object, based on a C s64.
REPY_Handle REPY_CreateS64_SUH (REPY_s64 value)
 Returns a Single-Use REPY_Handle for a Python int object, based on a C s64.
REPY_s64 REPY_CastS64 (REPY_Handle object)
 Casts a Python object to a C s64.
REPY_Handle REPY_CreateF64 (REPY_f64 value)
 Returns a REPY_Handle for a Python int object, based on a C u8.
REPY_Handle REPY_CreateF64_SUH (REPY_f64 value)
 Returns a Single-Use REPY_Handle for a Python int object, based on a C bool.
REPY_f64 REPY_CastF64 (REPY_Handle object)
 Casts a Python object to a C u8.
REPY_Handle REPY_CreateStr (const char *string)
 Returns a REPY_Handle for a Python str object, based on a NULL-terminated C string.
REPY_Handle REPY_CreateStr_SUH (const char *string)
 Returns a Single-Use REPY_Handle for a Python str object, based on a NULL-terminated C string.
REPY_Handle REPY_CreateStrN (const char *string, REPY_u32 len)
 Returns a REPY_Handle for a Python str object, based on char array.
REPY_Handle REPY_CreateStrN_SUH (const char *string, REPY_u32 len)
 Returns a Single-Use REPY_Handle for a Python str object, based on char array.
char * REPY_CastStr (REPY_Handle object)
 Casts a Python object to NULL-terminated C string. Intended to be used with a Python str.
REPY_Handle REPY_CreateByteStr (const char *string)
 Returns a REPY_Handle for a Python bytes object, based on a NULL-terminated C string.
REPY_Handle REPY_CreateByteStr_SUH (const char *string)
 Returns a Single-Use REPY_Handle for a Python bytes object, based on a NULL-terminated C string.
REPY_Handle REPY_CreateByteStrN (const char *string, REPY_u32 len)
 Returns a REPY_Handle for a Python bytes object, based on a char array.
REPY_Handle REPY_CreateByteStrN_SUH (const char *string, REPY_u32 len)
 Returns a Single-Use REPY_Handle for a Python bytes object, based on a char array.
char * REPY_CastByteStr (REPY_Handle object)
 Casts a Python object to a NULL-terminated C string. Intended to be used with a Python bytes.

Detailed Description

Functions that deal with converting between C and Python primatives.

Function Documentation

◆ REPY_CastBool()

REPY_bool REPY_CastBool ( REPY_Handle object)

Casts a Python object to a C bool.

Intended to be used with a Python bool. Behavior with other Python types may change between versions.

Parameters
objectThe handle for the Python object in question.
Returns
A bool value corresponding to the Python object. If a Python error occurs, this value is undefined.

◆ REPY_CastByteStr()

char * REPY_CastByteStr ( REPY_Handle object)

Casts a Python object to a NULL-terminated C string. Intended to be used with a Python bytes.

Behavior with other Python types may change between versions.

Parameters
objectThe handle for the Python object in question.

◆ REPY_CastF32()

REPY_f32 REPY_CastF32 ( REPY_Handle object)

Casts a Python object to a C f32.

Intended to be used with a Python float. Behavior with other Python types may change between versions.

Parameters
objectThe handle for the Python object in question.
Returns
An f32 value corresponding to the Python object. If a Python error occurs, this value is undefined.

◆ REPY_CastF64()

REPY_f64 REPY_CastF64 ( REPY_Handle object)

Casts a Python object to a C u8.

Intended to be used with a Python float. Behavior with other Python types may change between versions.

Parameters
objectThe handle for the Python object in question.
Returns
An f64 value corresponding to the Python object. If a Python error occurs, this value is undefined.

◆ REPY_CastPtr()

void * REPY_CastPtr ( REPY_Handle object)

Casts a Python object to a C void*.

Intended to be used with a Python int. Behavior with other Python types may change between versions.

Parameters
objectThe handle for the Python object in question.
Returns
A void* value corresponding to the Python object. If a Python error occurs, this value is undefined.

◆ REPY_CastS16()

REPY_s16 REPY_CastS16 ( REPY_Handle object)

Casts a Python object to a C s16.

Intended to be used with a Python int. Behavior with other Python types may change between versions.

Parameters
objectThe handle for the Python object in question.
Returns
An s16 value corresponding to the Python object. If a Python error occurs, this value is undefined.

◆ REPY_CastS32()

REPY_s32 REPY_CastS32 ( REPY_Handle object)

Casts a Python object to a C s32.

Intended to be used with a Python int. Behavior with other Python types may change between versions.

Parameters
objectThe handle for the Python object in question.
Returns
An s32* value corresponding to the Python object. If a Python error occurs, this value is undefined.

◆ REPY_CastS64()

REPY_s64 REPY_CastS64 ( REPY_Handle object)

Casts a Python object to a C s64.

Intended to be used with a Python int. Behavior with other Python types may change between versions.

Parameters
objectThe handle for the Python object in question.
Returns
An s64 value corresponding to the Python object. If a Python error occurs, this value is undefined.

◆ REPY_CastS8()

REPY_s8 REPY_CastS8 ( REPY_Handle object)

Casts a Python object to a C s8.

Intended to be used with a Python int. Behavior with other Python types may change between versions.

Parameters
objectThe handle for the Python object in question.
Returns
An s8 value corresponding to the Python object. If a Python error occurs, this value is undefined.

◆ REPY_CastStr()

char * REPY_CastStr ( REPY_Handle object)

Casts a Python object to NULL-terminated C string. Intended to be used with a Python str.

Behavior with other Python types may change between versions.

Parameters
objectThe handle for the Python object in question.

◆ REPY_CastU16()

REPY_u16 REPY_CastU16 ( REPY_Handle object)

Casts a Python object to a C u16.

Intended to be used with a Python int. Behavior with other Python types may change between versions.

Parameters
objectThe handle for the Python object in question.
Returns
A u16 value corresponding to the Python object. If a Python error occurs, this value is undefined.

◆ REPY_CastU32()

REPY_u32 REPY_CastU32 ( REPY_Handle object)

Casts a Python object to a C u32.

Intended to be used with a Python int. Behavior with other Python types may change between versions.

Parameters
objectThe handle for the Python object in question.
Returns
A u32 value corresponding to the Python object. If a Python error occurs, this value is undefined.

◆ REPY_CastU64()

REPY_u64 REPY_CastU64 ( REPY_Handle object)

Casts a Python object to a C u64.

Intended to be used with a Python int. Behavior with other Python types may change between versions.

Parameters
objectThe handle for the Python object in question.
Returns
A u64 value corresponding to the Python object. If a Python error occurs, this value is undefined.

◆ REPY_CastU8()

REPY_u8 REPY_CastU8 ( REPY_Handle object)

Casts a Python object to a C u8.

Intended to be used with a Python int. Behavior with other Python types may change between versions.

Parameters
objectThe handle for the Python object in question.
Returns
A u8 value corresponding to the Python object. If a Python error occurs, this value is undefined.

◆ REPY_CreateBool()

REPY_Handle REPY_CreateBool ( REPY_bool value)

Returns a REPY_Handle for a Python bool object, based on a C bool.

The handle returned by this function will need to be released, either by making is Single-Use or by calling REPY_Release. Even though both Python's True and False objects are immortal objects, will still take up space in the handle management system. Ergo, failure to release this handle will result in a memory leak.

Parameters
valueThe value for the Python bool.
Returns
A new handle for your Python bool.

◆ REPY_CreateBool_SUH()

REPY_Handle REPY_CreateBool_SUH ( REPY_bool value)

Returns a Single-Use REPY_Handle for a Python bool object, based on a C bool.

At this time, this function is just shorthand for REPY_MakeSUH(REPY_CreateBool(value)), and thus will perform similarly. However, internal performance improvements may make this function more performant in the future.

Parameters
valueThe value for the Python bool.
Returns
A new Single-Use handle for your Python bool.

◆ REPY_CreateByteStr()

REPY_Handle REPY_CreateByteStr ( const char * string)

Returns a REPY_Handle for a Python bytes object, based on a NULL-terminated C string.

The handle returned by this function will need to be released, either by making is Single-Use or by calling REPY_Release. Failure to release this handle will result in a memory leak.

Parameters
stringThe value for the Python bytes.
Returns
A new handle for your Python bytes.

◆ REPY_CreateByteStr_SUH()

REPY_Handle REPY_CreateByteStr_SUH ( const char * string)

Returns a Single-Use REPY_Handle for a Python bytes object, based on a NULL-terminated C string.

At this time, this function is just shorthand for REPY_MakeSUH(REPY_CreateByteStr(string)), and thus will perform similarly. However, internal performance improvements may make this function more performant in the future.

Parameters
stringThe value for the Python bytes.
Returns
A new Single-Use handle for your Python bytes.

◆ REPY_CreateByteStrN()

REPY_Handle REPY_CreateByteStrN ( const char * string,
REPY_u32 len )

Returns a REPY_Handle for a Python bytes object, based on a char array.

This function will stop reading from string if it encounters a NULL-terminator. If you need to copy a region of memory regardless of it's contents, use REPY_MemcpyToBytes.

The handle returned by this function will need to be released, either by making is Single-Use or by calling REPY_Release. Failure to release this handle will result in a memory leak.

Parameters
stringThe beginning of the char array to create a Python bytes from.
lenThe maximum length of the string array.
Returns
A new Single-Use handle for your Python bytes.

◆ REPY_CreateByteStrN_SUH()

REPY_Handle REPY_CreateByteStrN_SUH ( const char * string,
REPY_u32 len )

Returns a Single-Use REPY_Handle for a Python bytes object, based on a char array.

This function will stop reading from string if it encounters a NULL-terminator. If you need to copy a region of memory regardless of it's contents, use REPY_MemcpyToBytes.

At this time, this function is just shorthand for REPY_MakeSUH(REPY_CreateByteStrN(string)), and thus will perform similarly. However, internal performance improvements may make this function more performant in the future.

Parameters
stringThe beginning of the char array to create a Python bytes from.
lenThe length of the string array.
Returns
A new Single-Use handle for your Python bytes.

◆ REPY_CreateF32()

REPY_Handle REPY_CreateF32 ( REPY_f32 value)

Returns a REPY_Handle for a Python float object, based on a C f32.

The handle returned by this function will need to be released, either by making is Single-Use or by calling REPY_Release. Failure to release this handle will result in a memory leak.

Parameters
valueThe value for the Python float.
Returns
A new handle for your Python float.

◆ REPY_CreateF32_SUH()

REPY_Handle REPY_CreateF32_SUH ( REPY_f32 value)

Returns a Single-Use REPY_Handle for a Python float object, based on a C f32.

At this time, this function is just shorthand for REPY_MakeSUH(REPY_CreateBool(value)), and thus will perform similarly. However, internal performance improvements may make this function more performant in the future.

Parameters
valueThe value for the Python float.
Returns
A new Single-Use handle for your Python float.

◆ REPY_CreateF64()

REPY_Handle REPY_CreateF64 ( REPY_f64 value)

Returns a REPY_Handle for a Python int object, based on a C u8.

The handle returned by this function will need to be released, either by making is Single-Use or by calling REPY_Release. Failure to release this handle will result in a memory leak.

Parameters
valueThe value for the Python int.
Returns
A new handle for your Python int.

◆ REPY_CreateF64_SUH()

REPY_Handle REPY_CreateF64_SUH ( REPY_f64 value)

Returns a Single-Use REPY_Handle for a Python int object, based on a C bool.

At this time, this function is just shorthand for REPY_MakeSUH(REPY_CreateBool(value)), and thus will perform similarly. However, internal performance improvements may make this function more performant in the future.

Parameters
valueThe value for the Python int.
Returns
A new Single-Use handle for your Python int.

◆ REPY_CreatePtr()

REPY_Handle REPY_CreatePtr ( void * value)

Returns a REPY_Handle for a Python int object, based on a C void*.

The handle returned by this function will need to be released, either by making is Single-Use or by calling REPY_Release. Failure to release this handle will result in a memory leak.

Parameters
valueThe value for the Python int.
Returns
A new handle for your Python int.

◆ REPY_CreatePtr_SUH()

REPY_Handle REPY_CreatePtr_SUH ( void * value)

Returns a Single-Use REPY_Handle for a Python int object, based on a C void*.

At this time, this function is just shorthand for REPY_MakeSUH(REPY_CreatePtr(value)), and thus will perform similarly. However, internal performance improvements may make this function more performant in the future.

Parameters
valueThe value for the Python int.
Returns
A new Single-Use handle for your Python int.

◆ REPY_CreateS16()

REPY_Handle REPY_CreateS16 ( REPY_s16 value)

Returns a REPY_Handle for a Python int object, based on a C s16.

The handle returned by this function will need to be released, either by making is Single-Use or by calling REPY_Release. Failure to release this handle will result in a memory leak.

Parameters
valueThe value for the Python int.
Returns
A new handle for your Python int.

◆ REPY_CreateS16_SUH()

REPY_Handle REPY_CreateS16_SUH ( REPY_s16 value)

Returns a Single-Use REPY_Handle for a Python int object, based on a C s16.

At this time, this function is just shorthand for REPY_MakeSUH(REPY_CreateS16(value)), and thus will perform similarly. However, internal performance improvements may make this function more performant in the future.

Parameters
valueThe value for the Python int.
Returns
A new Single-Use handle for your Python int.

◆ REPY_CreateS32()

REPY_Handle REPY_CreateS32 ( REPY_s32 value)

Returns a REPY_Handle for a Python int object, based on a C s32.

The handle returned by this function will need to be released, either by making is Single-Use or by calling REPY_Release. Failure to release this handle will result in a memory leak.

Parameters
valueThe value for the Python int.
Returns
A new handle for your Python int.

◆ REPY_CreateS32_SUH()

REPY_Handle REPY_CreateS32_SUH ( REPY_s32 value)

Returns a Single-Use REPY_Handle for a Python int object, based on a C s32.

At this time, this function is just shorthand for REPY_MakeSUH(REPY_CreateS32(value)), and thus will perform similarly. However, internal performance improvements may make this function more performant in the future.

Parameters
valueThe value for the Python int.
Returns
A new Single-Use handle for your Python int.

◆ REPY_CreateS64()

REPY_Handle REPY_CreateS64 ( REPY_s64 value)

Returns a REPY_Handle for a Python int object, based on a C s64.

The handle returned by this function will need to be released, either by making is Single-Use or by calling REPY_Release. Failure to release this handle will result in a memory leak.

Parameters
valueThe value for the Python int.
Returns
A new handle for your Python int.

◆ REPY_CreateS64_SUH()

REPY_Handle REPY_CreateS64_SUH ( REPY_s64 value)

Returns a Single-Use REPY_Handle for a Python int object, based on a C s64.

At this time, this function is just shorthand for REPY_MakeSUH(REPY_CreateS64(value)), and thus will perform similarly. However, internal performance improvements may make this function more performant in the future.

Parameters
valueThe value for the Python int.
Returns
A new Single-Use handle for your Python int.

◆ REPY_CreateS8()

REPY_Handle REPY_CreateS8 ( REPY_s8 value)

Returns a REPY_Handle for a Python int object, based on a C s8.

The handle returned by this function will need to be released, either by making is Single-Use or by calling REPY_Release. Failure to release this handle will result in a memory leak.

Parameters
valueThe value for the Python int.
Returns
A new handle for your Python int.

◆ REPY_CreateS8_SUH()

REPY_Handle REPY_CreateS8_SUH ( REPY_s8 value)

Returns a Single-Use REPY_Handle for a Python int object, based on a C s8.

At this time, this function is just shorthand for REPY_MakeSUH(REPY_CreateS8(value)), and thus will perform similarly. However, internal performance improvements may make this function more performant in the future.

Parameters
valueThe value for the Python int.
Returns
A new Single-Use handle for your Python int.

◆ REPY_CreateStr()

REPY_Handle REPY_CreateStr ( const char * string)

Returns a REPY_Handle for a Python str object, based on a NULL-terminated C string.

The handle returned by this function will need to be released, either by making is Single-Use or by calling REPY_Release. Failure to release this handle will result in a memory leak.

Parameters
stringThe value for the Python str.
Returns
A new handle for your Python str.

◆ REPY_CreateStr_SUH()

REPY_Handle REPY_CreateStr_SUH ( const char * string)

Returns a Single-Use REPY_Handle for a Python str object, based on a NULL-terminated C string.

At this time, this function is just shorthand for REPY_MakeSUH(REPY_CreateStr(string)), and thus will perform similarly. However, internal performance improvements may make this function more performant in the future.

Parameters
stringThe value for the Python str.
Returns
A new Single-Use handle for your Python str.

◆ REPY_CreateStrN()

REPY_Handle REPY_CreateStrN ( const char * string,
REPY_u32 len )

Returns a REPY_Handle for a Python str object, based on char array.

The handle returned by this function will need to be released, either by making is Single-Use or by calling REPY_Release. Failure to release this handle will result in a memory leak.

Parameters
stringThe beginning of the char array to create a Python str from.
lenThe length of the string array.
Returns
A new Single-Use handle for your Python str.

◆ REPY_CreateStrN_SUH()

REPY_Handle REPY_CreateStrN_SUH ( const char * string,
REPY_u32 len )

Returns a Single-Use REPY_Handle for a Python str object, based on char array.

At this time, this function is just shorthand for REPY_MakeSUH(REPY_CreateStrN_SUH(string, len)), and thus will perform similarly. However, internal performance improvements may make this function more performant in the future.

Parameters
stringThe beginning of the char array to create a Python str from.
lenThe length of the string array.
Returns
A new Single-Use handle for your Python str.

◆ REPY_CreateU16()

REPY_Handle REPY_CreateU16 ( REPY_u16 value)

Returns a REPY_Handle for a Python int object, based on a C u16.

The handle returned by this function will need to be released, either by making is Single-Use or by calling REPY_Release. Failure to release this handle will result in a memory leak.

Parameters
valueThe value for the Python int.
Returns
A new handle for your Python int.

◆ REPY_CreateU16_SUH()

REPY_Handle REPY_CreateU16_SUH ( REPY_u16 value)

Returns a Single-Use REPY_Handle for a Python u16 object, based on a C int.

At this time, this function is just shorthand for REPY_MakeSUH(REPY_CreateU16(value)), and thus will perform similarly. However, internal performance improvements may make this function more performant in the future.

Parameters
valueThe value for the Python int.
Returns
A new Single-Use handle for your Python int.

◆ REPY_CreateU32()

REPY_Handle REPY_CreateU32 ( REPY_u32 value)

Returns a REPY_Handle for a Python int object, based on a C u32.

The handle returned by this function will need to be released, either by making is Single-Use or by calling REPY_Release. Failure to release this handle will result in a memory leak.

Parameters
valueThe value for the Python int.
Returns
A new handle for your Python int.

◆ REPY_CreateU32_SUH()

REPY_Handle REPY_CreateU32_SUH ( REPY_u32 value)

Returns a Single-Use REPY_Handle for a Python int object, based on a C u32.

At this time, this function is just shorthand for REPY_MakeSUH(REPY_CreateU32(value)), and thus will perform similarly. However, internal performance improvements may make this function more performant in the future.

Parameters
valueThe value for the Python int.
Returns
A new Single-Use handle for your Python int.

◆ REPY_CreateU64()

REPY_Handle REPY_CreateU64 ( REPY_u64 value)

Returns a REPY_Handle for a Python int object, based on a C u64.

The handle returned by this function will need to be released, either by making is Single-Use or by calling REPY_Release. Failure to release this handle will result in a memory leak.

Parameters
valueThe value for the Python int.
Returns
A new handle for your Python int.

◆ REPY_CreateU64_SUH()

REPY_Handle REPY_CreateU64_SUH ( REPY_u64 value)

Returns a Single-Use REPY_Handle for a Python int object, based on a C u64.

At this time, this function is just shorthand for REPY_MakeSUH(REPY_CreateU64(value)), and thus will perform similarly. However, internal performance improvements may make this function more performant in the future.

Parameters
valueThe value for the Python int.
Returns
A new Single-Use handle for your Python int.

◆ REPY_CreateU8()

REPY_Handle REPY_CreateU8 ( REPY_u8 value)

Returns a REPY_Handle for a Python int object, based on a C u8.

The handle returned by this function will need to be released, either by making is Single-Use or by calling REPY_Release. Failure to release this handle will result in a memory leak.

Parameters
valueThe value for the Python int.
Returns
A new handle for your Python int.

◆ REPY_CreateU8_SUH()

REPY_Handle REPY_CreateU8_SUH ( REPY_u8 value)

Returns a Single-Use REPY_Handle for a Python int object, based on a C u8.

At this time, this function is just shorthand for REPY_MakeSUH(REPY_CreateU8(value)), and thus will perform similarly. However, internal performance improvements may make this function more performant in the future.

Parameters
valueThe value for the Python int.
Returns
A new Single-Use handle for your Python int.