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
|
|
|
|
|
2002-12-12 18:29:45 +03:00
|
|
|
#if BX_PLUGINS
|
2011-01-23 23:21:21 +03:00
|
|
|
#if BX_HAVE_LTDL
|
|
|
|
#include <ltdl.h>
|
2011-06-15 21:24:32 +04:00
|
|
|
#elif !defined(_MSC_VER)
|
2002-11-15 21:09:37 +03:00
|
|
|
#include "ltdl.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
|
|
|
|
|
2011-12-22 14:35:49 +04:00
|
|
|
typedef int (*plugin_init_t)(struct _plugin_t *plugin, plugintype_t type, int argc, char *argv[]);
|
|
|
|
typedef void (*plugin_fini_t)(void);
|
|
|
|
|
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
|
2011-06-15 21:24:32 +04:00
|
|
|
#if defined(_MSC_VER)
|
|
|
|
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 */
|
|
|
|
|