Don't include the specific plugin headers in plugin.h.

This lets files that use plugins not depend on plugins they don't use.
This commit is contained in:
Bill Currie 2012-02-13 21:58:34 +09:00
parent 699ab70482
commit ce6ab908a5
40 changed files with 82 additions and 51 deletions

View file

@ -16,12 +16,13 @@
#include "QF/idparse.h"
#include "QF/mathlib.h"
#include "QF/msg.h"
#include "QF/plugin.h"
#include "QF/qargs.h"
#include "QF/qendian.h"
#include "QF/sizebuf.h"
#include "QF/sys.h"
#include "QF/plugin/console.h"
#include "compat.h"
#include "netchan.h"

View file

@ -37,12 +37,6 @@
#define QFPLUGIN_VERSION "1.0"
#include <QF/qtypes.h>
#include <QF/plugin/cd.h>
#include <QF/plugin/console.h>
#include <QF/plugin/general.h>
#include <QF/plugin/input.h>
#include <QF/plugin/snd_output.h>
#include <QF/plugin/snd_render.h>
#ifdef STATIC_PLUGINS
#define PLUGIN_INFO(type,name) plugin_t *type##_##name##_PluginInfo (void); plugin_t * type##_##name##_PluginInfo (void)
@ -57,24 +51,25 @@ typedef enum {
qfp_console, // Console `driver'
qfp_snd_output, // Sound output (OSS, ALSA, Win32)
qfp_snd_render, // Sound mixing
qfp_vid_render, // Video renderer
} plugin_type_t;
typedef struct plugin_funcs_s {
general_funcs_t *general;
input_funcs_t *input;
cd_funcs_t *cd;
console_funcs_t *console;
snd_output_funcs_t *snd_output;
snd_render_funcs_t *snd_render;
struct general_funcs_s *general;
struct input_funcs_s *input;
struct cd_funcs_s *cd;
struct console_funcs_s *console;
struct snd_output_funcs_s *snd_output;
struct snd_render_funcs_s *snd_render;
} plugin_funcs_t;
typedef struct plugin_data_s {
general_data_t *general;
input_data_t *input;
cd_data_t *cd;
console_data_t *console;
snd_output_data_t *snd_output;
snd_render_data_t *snd_render;
struct general_data_s *general;
struct input_data_s *input;
struct cd_data_s *cd;
struct console_data_s *console;
struct snd_output_data_s *snd_output;
struct snd_render_data_s *snd_render;
} plugin_data_t;
typedef struct plugin_s {

View file

@ -28,6 +28,7 @@
#ifndef __QF_plugin_cd_h_
#define __QF_plugin_cd_h_
#include <QF/plugin.h>
#include <QF/qtypes.h>
/*

View file

@ -32,6 +32,7 @@
#include <stdarg.h>
#include <QF/keys.h>
#include <QF/plugin.h>
#include <QF/qtypes.h>
typedef void (*P_C_Print) (const char *fmt, va_list args);
@ -41,7 +42,7 @@ typedef void (*P_C_DrawConsole) (void);
typedef void (*P_C_CheckResize) (void);
typedef void (*P_C_NewMap) (void);
typedef struct console_func_s {
typedef struct console_funcs_s {
P_C_Print pC_Print;
P_C_ProcessInput pC_ProcessInput;
P_C_KeyEvent pC_KeyEvent;

View file

@ -29,6 +29,7 @@
#ifndef __QF_plugin_general_h_
#define __QF_plugin_general_h_
#include <QF/plugin.h>
#include <QF/qtypes.h>
/*
@ -38,7 +39,7 @@
typedef void (*P_Init) (void);
typedef void (*P_Shutdown) (void);
typedef struct general_func_s {
typedef struct general_funcs_s {
P_Init p_Init;
P_Shutdown p_Shutdown;
} general_funcs_t;

View file

@ -29,6 +29,7 @@
#ifndef __QF_plugin_input_h_
#define __QF_plugin_input_h_
#include <QF/plugin.h>
#include <QF/qtypes.h>
/*

View file

@ -28,6 +28,7 @@
#ifndef __QF_plugin_snd_output_h_
#define __QF_plugin_snd_output_h_
#include <QF/plugin.h>
#include <QF/qtypes.h>
/*

View file

@ -28,6 +28,7 @@
#ifndef __QF_plugin_snd_render_h_
#define __QF_plugin_snd_render_h_
#include <QF/plugin.h>
#include <QF/qtypes.h>
/*

View file

@ -38,7 +38,9 @@
*/
//@{
#include "QF/plugin/general.h"
#include "QF/plugin/snd_render.h"
#include "QF/plugin/snd_output.h"
#include "QF/quakeio.h"
#include "QF/sound.h"
#include "QF/zone.h"

View file

@ -36,11 +36,13 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/cdaudio.h"
#include "QF/cmd.h"
#include "QF/cvar.h"
#include "QF/plugin.h"
#include "QF/qargs.h"
#include "QF/qtypes.h"
#include "QF/sys.h"
#include "QF/plugin/general.h"
#include "QF/plugin/cd.h"
cvar_t *cd_plugin;
plugin_t *cdmodule = NULL;

View file

@ -56,7 +56,6 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/cmd.h"
#include "QF/cvar.h"
#include "QF/dstring.h"
#include "QF/plugin.h"
#include "QF/qargs.h"
#include "QF/qfplist.h"
#include "QF/quakefs.h"
@ -65,6 +64,9 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/sys.h"
#include "QF/va.h"
#include "QF/plugin/general.h"
#include "QF/plugin/cd.h"
#include "compat.h"
#include "snd_internal.h"

View file

@ -53,11 +53,13 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/cdaudio.h"
#include "QF/cmd.h"
#include "QF/cvar.h"
#include "QF/plugin.h"
#include "QF/qargs.h"
#include "QF/sound.h"
#include "QF/sys.h"
#include "QF/plugin/general.h"
#include "QF/plugin/cd.h"
#include "compat.h"
static plugin_t plugin_info;

View file

@ -43,11 +43,13 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/cdaudio.h"
#include "QF/cmd.h"
#include "QF/cvar.h"
#include "QF/plugin.h"
#include "QF/qargs.h"
#include "QF/sound.h"
#include "QF/sys.h"
#include "QF/plugin/general.h"
#include "QF/plugin/cd.h"
#include "compat.h"
static plugin_t plugin_info;

View file

@ -42,7 +42,9 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/qargs.h"
#include "QF/sound.h"
#include "QF/sys.h"
#include "QF/plugin.h"
#include "QF/plugin/general.h"
#include "QF/plugin/cd.h"
#include "compat.h"

View file

@ -36,11 +36,13 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/cdaudio.h"
#include "QF/cmd.h"
#include "QF/cvar.h"
#include "QF/plugin.h"
#include "QF/qargs.h"
#include "QF/sound.h"
#include "QF/sys.h"
#include "QF/plugin/general.h"
#include "QF/plugin/cd.h"
#include "compat.h"
static plugin_t plugin_info;

View file

@ -59,11 +59,13 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/cdaudio.h"
#include "QF/cmd.h"
#include "QF/cvar.h"
#include "QF/plugin.h"
#include "QF/qargs.h"
#include "QF/sound.h"
#include "QF/sys.h"
#include "QF/plugin/general.h"
#include "QF/plugin/cd.h"
#include "compat.h"
static plugin_t plugin_info;

View file

@ -35,10 +35,11 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/cvar.h"
#include "QF/sound.h"
#include "QF/plugin.h"
#include "QF/qargs.h"
#include "QF/sys.h"
#include "snd_internal.h"
static cvar_t *snd_output;
static cvar_t *snd_render;
static plugin_t *snd_render_module = NULL;

View file

@ -37,7 +37,6 @@ static __attribute__ ((used)) const char rcsid[] =
#include <alsa/asoundlib.h>
#include "QF/cvar.h"
#include "QF/plugin.h"
#include "QF/qargs.h"
#include "QF/sys.h"

View file

@ -48,7 +48,6 @@ static __attribute__ ((used)) const char rcsid[] =
#include <sys/types.h>
#include "QF/cvar.h"
#include "QF/plugin.h"
#include "QF/qargs.h"
#include "QF/sys.h"

View file

@ -36,7 +36,6 @@ static __attribute__ ((used)) const char rcsid[] =
#include "winquake.h"
#include "QF/cvar.h"
#include "QF/plugin.h"
#include "QF/qargs.h"
#include "QF/sys.h"

View file

@ -68,7 +68,6 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/cmd.h"
#include "QF/cvar.h"
#include "QF/plugin.h"
#include "QF/qargs.h"
#include "QF/sys.h"

View file

@ -45,7 +45,6 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/cmd.h"
#include "QF/cvar.h"
#include "QF/plugin.h"
#include "QF/qargs.h"
#include "QF/sys.h"

View file

@ -37,7 +37,6 @@ static __attribute__ ((used)) const char rcsid[] =
#include <dmedia/audio.h>
#include <stdlib.h>
#include "QF/plugin.h"
#include "QF/qargs.h"
#include "QF/qtypes.h"
#include "QF/sys.h"

View file

@ -54,7 +54,6 @@ static __attribute__ ((used)) const char rcsid[] =
#include <sys/types.h>
#include <sys/wait.h>
#include "QF/plugin.h"
#include "QF/qargs.h"
#include "QF/qtypes.h"
#include "QF/sys.h"

View file

@ -35,7 +35,6 @@ static __attribute__ ((used)) const char rcsid[] =
#include "winquake.h"
#include "QF/cvar.h"
#include "QF/plugin.h"
#include "QF/qargs.h"
#include "QF/sys.h"

View file

@ -54,7 +54,6 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/gib.h"
#include "QF/input.h"
#include "QF/keys.h"
#include "QF/plugin.h"
#include "QF/qargs.h"
#include "QF/quakefs.h"
#include "QF/render.h"
@ -64,6 +63,9 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/vid.h"
#include "QF/view.h"
#include "QF/plugin/general.h"
#include "QF/plugin/console.h"
#include "compat.h"
static general_data_t plugin_info_general_data;

View file

@ -45,9 +45,11 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/console.h"
#include "QF/cvar.h"
#include "QF/mathlib.h"
#include "QF/plugin.h"
#include "QF/sys.h"
#include "QF/va.h"
#include "QF/plugin/console.h"
#include "compat.h"
/*

View file

@ -40,9 +40,11 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/cmd.h"
#include "QF/console.h"
#include "QF/cvar.h"
#include "QF/plugin.h"
#include "QF/sys.h"
#include "QF/plugin/general.h"
#include "QF/plugin/console.h"
//FIXME probably shouldn't be visible
VISIBLE int con_linewidth; // characters across screen

View file

@ -43,7 +43,6 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/cvar.h"
#include "QF/draw.h"
#include "QF/hash.h"
#include "QF/plugin.h"
#include "QF/progs.h"
#include "QF/quakefs.h"
#include "QF/render.h"
@ -52,6 +51,8 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/sys.h"
#include "QF/view.h"
#include "QF/plugin/console.h"
typedef struct menu_pic_s {
struct menu_pic_s *next;
int x, y;

View file

@ -65,13 +65,15 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/cvar.h"
#include "QF/dstring.h"
#include "QF/keys.h"
#include "QF/plugin.h"
#include "QF/qtypes.h"
#include "QF/quakefs.h"
#include "QF/sys.h"
#include "QF/va.h"
#include "QF/view.h"
#include "QF/plugin/general.h"
#include "QF/plugin/console.h"
#include "compat.h"
#include "sv_console.h"

View file

@ -61,6 +61,8 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/sys.h"
#include "QF/cmd.h"
#include "QF/plugin/general.h"
#include "compat.h"
// loaded_plugins is only for plugins loaded from scripts - not system

View file

@ -40,7 +40,6 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/input.h"
#include "QF/keys.h"
#include "QF/msg.h"
#include "QF/plugin.h"
#include "QF/qfplist.h"
#include "QF/render.h"
#include "QF/screen.h"
@ -48,6 +47,8 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/sys.h"
#include "QF/va.h"
#include "QF/plugin/console.h"
#include "chase.h"
#include "cl_skin.h"
#include "client.h"

View file

@ -45,7 +45,6 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
#include "QF/input.h"
#include "QF/keys.h"
#include "QF/msg.h"
#include "QF/plugin.h"
#include "QF/png.h"
#include "QF/progs.h"
#include "QF/qargs.h"
@ -55,6 +54,8 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
#include "QF/vid.h"
#include "QF/gib.h"
#include "QF/plugin/console.h"
#include "buildnum.h"
#include "chase.h"
#include "compat.h"

View file

@ -46,7 +46,6 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/draw.h"
#include "QF/dstring.h"
#include "QF/gib.h"
#include "QF/plugin.h"
#include "QF/screen.h"
#include "QF/sys.h"
#include "QF/va.h"
@ -54,6 +53,8 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/view.h"
#include "QF/wad.h"
#include "QF/plugin/console.h"
#include "client.h"
#include "compat.h"
#include "game.h"

View file

@ -51,13 +51,14 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/dstring.h"
#include "QF/idparse.h"
#include "QF/info.h"
#include "QF/plugin.h"
#include "QF/qargs.h"
#include "QF/quakefs.h"
#include "QF/sys.h"
#include "QF/va.h"
#include "QF/zone.h"
#include "QF/plugin/console.h"
#include "qw/protocol.h"
#include "client.h"

View file

@ -35,10 +35,11 @@ static __attribute__ ((used)) const char rcsid[] =
"$Id: template.c 11394 2007-03-17 03:23:39Z taniwha $";
#include "QF/console.h"
#include "QF/plugin.h"
#include "QF/view.h"
#include "QF/va.h"
#include "QF/plugin/console.h"
#include "client.h"
#include "server.h"
#include "sv_console.h"

View file

@ -76,7 +76,6 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/keys.h"
#include "QF/model.h"
#include "QF/msg.h"
#include "QF/plugin.h"
#include "QF/png.h"
#include "QF/progs.h"
#include "QF/qargs.h"
@ -91,6 +90,8 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/vid.h"
#include "QF/gib.h"
#include "QF/plugin/console.h"
#include "qw/bothdefs.h"
#include "buildnum.h"
#include "cl_cam.h"

View file

@ -48,7 +48,6 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/dstring.h"
#include "QF/gib.h"
#include "QF/msg.h"
#include "QF/plugin.h"
#include "QF/quakefs.h"
#include "QF/screen.h"
#include "QF/sys.h"
@ -56,6 +55,8 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/vid.h"
#include "QF/view.h"
#include "QF/plugin/console.h"
#include "qw/bothdefs.h"
#include "cl_cam.h"
#include "cl_parse.h"

View file

@ -71,7 +71,6 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/dstring.h"
#include "QF/model.h"
#include "QF/msg.h"
#include "QF/plugin.h"
#include "QF/qargs.h"
#include "QF/quakefs.h"
#include "QF/sys.h"
@ -79,6 +78,8 @@ static __attribute__ ((used)) const char rcsid[] =
#include "QF/ver_check.h"
#include "QF/zone.h"
#include "QF/plugin/console.h"
#include "qw/bothdefs.h"
#include "buildnum.h"
#include "compat.h"

View file

@ -35,10 +35,11 @@ static __attribute__ ((used)) const char rcsid[] =
"$Id: template.c 11394 2007-03-17 03:23:39Z taniwha $";
#include "QF/console.h"
#include "QF/plugin.h"
#include "QF/view.h"
#include "QF/va.h"
#include "QF/plugin/console.h"
#include "server.h"
#include "sv_console.h"
#include "sv_recorder.h"