libretro.api.proc

Types for retrieving core functions beyond the standard retro_* API functions exposed by Core.

Module Attributes

retro_proc_address_t

Opaque function pointer returned by retro_get_proc_address_t.

retro_get_proc_address_t

Look up an exported function pointer in the core by symbol name.

Classes

retro_get_proc_address_interface

An interface to get function pointers directly from a Core.

class retro_get_proc_address_interface[source]

Bases: Structure

An interface to get function pointers directly from a Core.

Corresponds to retro_get_proc_address_interface in libretro.h.

get_proc_address

Retrieves a function pointer by symbol name.

self(sym)[source]

Call get_proc_address with the given symbol name.

Parameters:

sym (str | bytes) – Symbol name as a string or bytes.

Return type:

CFunctionType | None

Returns:

The function pointer, or None if not found.

Raises:
__init__(*args, **kwargs)
classmethod __new__(*args, **kwargs)
__deepcopy__(_)[source]

Return a copy of this object. Intended for use with copy.deepcopy().

retro_proc_address_t

Opaque function pointer returned by retro_get_proc_address_t.

Despite this declaration, the underlying function may have any signature; use ctypes.cast() to convert it to a CFUNCTYPE or TypedFunctionPointer with the correct prototype before invoking it.

Danger

When calling a function pointer obtained from retro_get_proc_address_t, ensure that the signature matches the expected function prototype and that it follows the C ABI (e.g. with extern "C" in C++). Mismatched signatures or calling conventions can lead to undefined behavior.

Corresponds to retro_proc_address_t in libretro.h.

retro_get_proc_address_t

Look up an exported function pointer in the core by symbol name.

Registered by the core and called by the frontend to access libretro extensions implemented by the core.

Parameters:

sym – The symbol name to look up, as a bytes-like object.

Returns:

A c_void_ptr to the matching retro_proc_address_t, or None if the core does not export a function with that name.

Note

The returned pointer must be cast to the correct function signature before use.

Corresponds to retro_get_proc_address_t in libretro.h.