Bochs/bochs/extplugin.h
Volker Ruppert 4f311f0618 Some work on the Bochs plugins support.
- Added suffix "_gui" to the base name of display library plugins.
- Added new function plugins_search() that browses the plugin folder(s) and
  detects the type from the library name. Plugins with no prefix or suffix are
  treated as i/o device plugins. The plugin_load() function uses this database.
- Some related fixes and cleanups.
2021-01-02 20:49:39 +00:00

69 lines
1.6 KiB
C

/////////////////////////////////////////////////////////////////////////
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002-2021 The Bochs Project
//
// 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 original 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
#if BX_PLUGINS && !defined(WIN32)
#if BX_HAVE_LTDL
#include <ltdl.h>
#else
#include "ltdl-bochs.h"
#endif
#endif
enum plugintype_t {
PLUGTYPE_DEV=0,
PLUGTYPE_CORE,
PLUGTYPE_VGA,
PLUGTYPE_STANDARD,
PLUGTYPE_OPTIONAL,
PLUGTYPE_USER,
PLUGTYPE_GUI=0x100,
PLUGTYPE_IMG=0x200,
PLUGTYPE_NET=0x300,
PLUGTYPE_SND=0x400,
PLUGTYPE_USB=0x500
};
typedef int (CDECL *plugin_init_t)(struct _plugin_t *plugin, plugintype_t type);
typedef void (CDECL *plugin_fini_t)(void);
typedef struct _plugin_t
{
plugintype_t type;
bx_bool loaded;
bx_bool initialized;
#if BX_PLUGINS
#if defined(WIN32)
HINSTANCE handle;
#else
lt_dlhandle handle;
#endif
#endif
char *name;
plugin_init_t plugin_init;
plugin_fini_t plugin_fini;
struct _plugin_t *next;
} plugin_t;
#endif /* __EXTPLUGIN_H */