1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2 * Mupen64plus-core - m64p_common.h *
3 * Mupen64Plus homepage: https://mupen64plus.org/ *
4 * Copyright (C) 2009 Richard Goedeken *
5 * *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the *
18 * Free Software Foundation, Inc., *
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
20 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
21
22/* This header file defines typedefs for function pointers to common Core
23 * and plugin functions, for use by the front-end and plugin modules to attach
24 * to the dynamic libraries.
25 */
26
27#if !defined(M64P_COMMON_H)
28#define M64P_COMMON_H
29
30#include "m64p_types.h"
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36/* PluginGetVersion()
37 *
38 * This function retrieves version information from a library. This
39 * function is the same for the core library and the plugins.
40 */
41typedef m64p_error (*ptr_PluginGetVersion)(m64p_plugin_type *, int *, int *, const char **, int *);
42#if defined(M64P_PLUGIN_PROTOTYPES) || defined(M64P_CORE_PROTOTYPES)
43EXPORT m64p_error CALL PluginGetVersion(m64p_plugin_type *, int *, int *, const char **, int *);
44#endif
45
46/* CoreGetAPIVersions()
47 *
48 * This function retrieves API version information from the core.
49 */
50typedef m64p_error (*ptr_CoreGetAPIVersions)(int *, int *, int *, int *);
51#if defined(M64P_CORE_PROTOTYPES)
52EXPORT m64p_error CALL CoreGetAPIVersions(int *, int *, int *, int *);
53#endif
54
55/* CoreErrorMessage()
56 *
57 * This function returns a pointer to a NULL-terminated string giving a
58 * human-readable description of the error.
59*/
60typedef const char * (*ptr_CoreErrorMessage)(m64p_error);
61#if defined(M64P_CORE_PROTOTYPES)
62EXPORT const char * CALL CoreErrorMessage(m64p_error);
63#endif
64
65/* PluginStartup()
66 *
67 * This function initializes a plugin for use by allocating memory, creating
68 * data structures, and loading the configuration data.
69*/
70typedef m64p_error (*ptr_PluginStartup)(m64p_dynlib_handle, void *, void (*)(void *, int, const char *));
71#if defined(M64P_PLUGIN_PROTOTYPES) || defined(M64P_CORE_PROTOTYPES)
72EXPORT m64p_error CALL PluginStartup(m64p_dynlib_handle, void *, void (*)(void *, int, const char *));
73#endif
74
75/* PluginShutdown()
76 *
77 * This function destroys data structures and releases memory allocated by
78 * the plugin library.
79*/
80typedef m64p_error (*ptr_PluginShutdown)(void);
81#if defined(M64P_PLUGIN_PROTOTYPES) || defined(M64P_CORE_PROTOTYPES)
82EXPORT m64p_error CALL PluginShutdown(void);
83#endif
84
85#ifdef __cplusplus
86}
87#endif
88
89#endif /* #define M64P_COMMON_H */
90
91