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
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2021-01-02 23:49:39 +03:00
|
|
|
// Copyright (C) 2002-2021 The Bochs Project
|
2017-01-13 21:09:51 +03:00
|
|
|
//
|
2002-10-25 01:07:56 +04:00
|
|
|
// extplugin.h
|
|
|
|
//
|
|
|
|
// This header file defines the types necessary to make a Bochs plugin,
|
2017-01-13 21:09:51 +03:00
|
|
|
// but without mentioning all the details of Bochs internals (bochs.h).
|
|
|
|
// It is included by the configuration interfaces and possibly other
|
2002-10-25 01:07:56 +04:00
|
|
|
// things which are intentionally isolated from other parts of the program.
|
|
|
|
//
|
2017-01-13 21:09:51 +03:00
|
|
|
// The original plugin_t struct comes from the plugin.h file from plex86.
|
2002-10-25 01:07:56 +04:00
|
|
|
// 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 {
|
2021-01-02 23:49:39 +03:00
|
|
|
PLUGTYPE_DEV=0,
|
2002-10-25 01:07:56 +04:00
|
|
|
PLUGTYPE_CORE,
|
2021-01-02 23:49:39 +03:00
|
|
|
PLUGTYPE_VGA,
|
2012-01-10 21:45:18 +04:00
|
|
|
PLUGTYPE_STANDARD,
|
2002-10-25 01:07:56 +04:00
|
|
|
PLUGTYPE_OPTIONAL,
|
2021-01-02 23:49:39 +03:00
|
|
|
PLUGTYPE_GUI=0x100,
|
|
|
|
PLUGTYPE_IMG=0x200,
|
|
|
|
PLUGTYPE_NET=0x300,
|
|
|
|
PLUGTYPE_SND=0x400,
|
|
|
|
PLUGTYPE_USB=0x500
|
2002-10-25 01:07:56 +04:00
|
|
|
};
|
|
|
|
|
2021-01-23 15:06:11 +03:00
|
|
|
typedef int (CDECL *plugin_entry_t)(struct _plugin_t *plugin, plugintype_t type, bool init);
|
2011-12-22 14:35:49 +04:00
|
|
|
|
2002-10-25 01:07:56 +04:00
|
|
|
typedef struct _plugin_t
|
|
|
|
{
|
2002-12-12 18:29:45 +03:00
|
|
|
#if BX_PLUGINS
|
2021-01-21 21:10:40 +03:00
|
|
|
char *name;
|
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
|
2021-01-21 21:10:40 +03:00
|
|
|
#else
|
|
|
|
const char *name;
|
2002-12-12 18:29:45 +03:00
|
|
|
#endif
|
2021-01-21 21:10:40 +03:00
|
|
|
plugintype_t type;
|
2021-01-23 15:06:11 +03:00
|
|
|
plugin_entry_t plugin_entry;
|
2021-01-21 21:10:40 +03:00
|
|
|
bool initialized;
|
|
|
|
#if BX_PLUGINS
|
|
|
|
bool loaded;
|
2002-10-25 01:07:56 +04:00
|
|
|
|
|
|
|
struct _plugin_t *next;
|
2021-01-21 21:10:40 +03:00
|
|
|
#endif
|
2002-10-25 01:07:56 +04:00
|
|
|
} plugin_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* __EXTPLUGIN_H */
|