libretro.api.proc¶
Types for retrieving core functions beyond
the standard retro_* API functions exposed by Core.
Module Attributes
Opaque function pointer returned by |
|
Look up an exported function pointer in the core by symbol name. |
Classes
An interface to get function pointers directly from a |
- class retro_get_proc_address_interface[source]¶
Bases:
StructureAn interface to get function pointers directly from a
Core.Corresponds to
retro_get_proc_address_interfaceinlibretro.h.- get_proc_address¶
Retrieves a function pointer by symbol name.
- self(sym)[source]¶
Call
get_proc_addresswith the given symbol name.- Parameters:
- Return type:
CFunctionType|None- Returns:
The function pointer, or
Noneif not found.- Raises:
ValueError – If
get_proc_addressisNone.
- __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 aCFUNCTYPEorTypedFunctionPointerwith 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. withextern "C"in C++). Mismatched signatures or calling conventions can lead to undefined behavior.Corresponds to
retro_proc_address_tinlibretro.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_ptrto the matchingretro_proc_address_t, orNoneif 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_tinlibretro.h.