[[Mupen64Plus v2.0 Core API v1.0|Mupen64Plus v2.0 API]]

= Mupen64Plus v2.0 Basic Core API =

Most libmupen64plus functions return an <tt>m64p_error</tt> return code, which is an enumerated type defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]].  Front-end code should check the return value of each call to a libmupen64plus function.

{| border="1"
|Prototype
|'''<tt>m64p_error PluginGetVersion(m64p_plugin_type *PluginType, int *PluginVersion, int *APIVersion, const char **PluginNamePtr, int *Capabilities)</tt>'''
|-
|Input Parameters
|'''<tt>PluginType</tt>''' Pointer to an enumerated type to store the plugin type.  The value <tt>M64PLUGIN_CORE</tt> will always be stored.<br />
'''<tt>PluginVersion</tt>''' Pointer to an integer to store the version number of the Mupen64Plus core.  Version number 2.1.3 would be stored as 0x00020103.<br />
'''<tt>APIVersion</tt>''' Pointer to an integer to store the version number of the Core--Front-end API used by the Mupen64plus core library.<br />
'''<tt>PluginNamePtr</tt>''' Pointer to a const character pointer to receive the name of the core library.  The const char * which is returned must point to a persistent string (ie, not stored on the stack).<br />
'''<tt>Capabilities</tt>''' Pointer to an integer to store a logically-or'd set of flags which specify the capabilities of the core which were built into the library during compilation.  These are defined in the <tt>m64p_core_caps</tt> enumerated type, defined in [[Mupen64Plus v2.0 headers#m64p_types.h|m64p_types.h]].
|-
|Usage
|This function retrieves version information from the core library.  This function is the same for the core library and the plugins, so that a front-end may examine all shared libraries in a directory and determine their types.  Any of the input parameters may be set to NULL and this function will succeed but won't return the corresponding information.
|}
<br />
{| border="1"
|Prototype
|'''<tt>m64p_error CoreGetAPIVersions(int *ConfigVersion, int *DebugVersion, int *VidextVersion, int *ExtraVersion)</tt>'''
|-
|Input Parameters
|'''<tt>ConfigVersion</tt>''' Pointer to an integer to store the version number of the Config API exported by the Mupen64plus core library.<br />
'''<tt>DebugVersion</tt>''' Pointer to an integer to store the version number of the Debug API exported by the Mupen64plus core library.<br />
'''<tt>VidextVersion</tt>''' Pointer to an integer to store the version number of the Video Extension API exported by the Mupen64plus core library.<br />
'''<tt>ExtraVersion</tt>''' Pointer to an integer to store an API version number for future use.  Currently set to 0.<br />
|-
|Usage
|This function retrieves API version information from the core library.  This function may be used by either the front-end application or any plugin modules.  Any of the input parameters may be set to NULL and this function will succeed but won't return the corresponding information.
|}
<br />
{| border="1"
|Prototype
|'''<tt>const char * CoreErrorMessage(m64p_error ReturnCode)</tt>'''
|-
|Input Parameters
|'''<tt>ReturnCode</tt>''' Enumerated type containing an error code.
|-
|Usage
|This function returns a pointer to a NULL-terminated string giving a human-readable description of the error.
|}
<br />

