2002-10-25 01:07:56 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
2011-02-25 01:05:47 +03:00
|
|
|
// $Id$
|
2002-10-25 01:07:56 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// extplugin.h
|
|
|
|
//
|
|
|
|
// This header file defines the types necessary to make a Bochs plugin,
|
|
|
|
// but without mentioning all the details of Bochs internals (bochs.h).
|
|
|
|
// It is included by the configuration interfaces and possibly other
|
|
|
|
// things which are intentionally isolated from other parts of the program.
|
|
|
|
//
|
|
|
|
// The plugin_t struct comes from the plugin.h file from plex86.
|
|
|
|
// Plex86 is Copyright (C) 1999-2000 The plex86 developers team
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __EXTPLUGIN_H
|
|
|
|
#define __EXTPLUGIN_H
|
|
|
|
|
2013-12-30 00:04:16 +04:00
|
|
|
#if BX_PLUGINS && !defined(WIN32)
|
2011-01-23 23:21:21 +03:00
|
|
|
#if BX_HAVE_LTDL
|
|
|
|
#include <ltdl.h>
|
2013-11-07 23:38:23 +04:00
|
|
|
#else
|
2013-12-17 23:57:40 +04:00
|
|
|
#include "ltdl-bochs.h"
|
2002-12-12 18:29:45 +03:00
|
|
|
#endif
|
2011-01-23 23:21:21 +03:00
|
|
|
#endif
|
2002-10-25 01:07:56 +04:00
|
|
|
|
|
|
|
enum plugintype_t {
|
|
|
|
PLUGTYPE_NULL=100,
|
|
|
|
PLUGTYPE_CORE,
|
2012-01-10 21:45:18 +04:00
|
|
|
PLUGTYPE_STANDARD,
|
2002-10-25 01:07:56 +04:00
|
|
|
PLUGTYPE_OPTIONAL,
|
|
|
|
PLUGTYPE_USER
|
|
|
|
};
|
|
|
|
|
|
|
|
#define MAX_ARGC 10
|
|
|
|
|
2014-06-08 12:40:08 +04:00
|
|
|
typedef int (CDECL *plugin_init_t)(struct _plugin_t *plugin, plugintype_t type, int argc, char *argv[]);
|
|
|
|
typedef void (CDECL *plugin_fini_t)(void);
|
2011-12-22 14:35:49 +04:00
|
|
|
|
2002-10-25 01:07:56 +04:00
|
|
|
typedef struct _plugin_t
|
|
|
|
{
|
|
|
|
plugintype_t type;
|
|
|
|
int initialized;
|
2002-12-12 18:29:45 +03:00
|
|
|
#if BX_PLUGINS
|
2013-12-30 00:04:16 +04:00
|
|
|
#if defined(WIN32)
|
2011-06-15 21:24:32 +04:00
|
|
|
HINSTANCE handle;
|
|
|
|
#else
|
2002-10-25 01:07:56 +04:00
|
|
|
lt_dlhandle handle;
|
2011-06-15 21:24:32 +04:00
|
|
|
#endif
|
2002-12-12 18:29:45 +03:00
|
|
|
#endif
|
2002-10-25 01:07:56 +04:00
|
|
|
int argc;
|
|
|
|
char *name, *args, *argv[MAX_ARGC];
|
2011-12-22 14:35:49 +04:00
|
|
|
plugin_init_t plugin_init;
|
|
|
|
plugin_fini_t plugin_fini;
|
2002-10-25 01:07:56 +04:00
|
|
|
|
|
|
|
struct _plugin_t *next;
|
|
|
|
} plugin_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* __EXTPLUGIN_H */
|
|
|
|
|