diff --git a/include/QF/plugin.h b/include/QF/plugin.h index f1ff974a3..96de3124e 100644 --- a/include/QF/plugin.h +++ b/include/QF/plugin.h @@ -88,11 +88,11 @@ typedef struct plugin_s { /* General plugin info return function type */ -typedef plugin_t * (*P_PluginInfo) (void); +typedef plugin_t *(*plugin_info_t) (void); typedef struct plugin_list_s { - const char *name; - P_PluginInfo info; + const char *name; + plugin_info_t info; } plugin_list_t; /* diff --git a/include/QF/plugin/cd.h b/include/QF/plugin/cd.h index ad7495159..337fc6220 100644 --- a/include/QF/plugin/cd.h +++ b/include/QF/plugin/cd.h @@ -24,33 +24,24 @@ Boston, MA 02111-1307, USA */ -#ifndef __QF_plugin_cd_h_ -#define __QF_plugin_cd_h_ +#ifndef __QF_plugin_cd_h +#define __QF_plugin_cd_h #include #include -/* - All CDAudio plugins must export these functions -*/ -typedef void (*P_CDAudio_CD_f) (void); // -typedef void (*P_CDAudio_Pause) (void); -typedef void (*P_CDAudio_Play) (int, qboolean); -typedef void (*P_CDAudio_Resume) (void); -typedef void (*P_CDAudio_Shutdown) (void); -typedef void (*P_CDAudio_Update) (void); -typedef void (*P_CDAudio_Init) (void); - typedef struct cd_funcs_s { - P_CDAudio_CD_f pCD_f; // - P_CDAudio_Pause pCDAudio_Pause; - P_CDAudio_Play pCDAudio_Play; - P_CDAudio_Resume pCDAudio_Resume; - P_CDAudio_Update pCDAudio_Update; + void (*cd_f) (void); // + void (*pause) (void); + void (*play) (int, qboolean); + void (*resume) (void); + void (*shutdown) (void); + void (*update) (void); + void (*init) (void); } cd_funcs_t; typedef struct cd_data_s { - int unused; /* C requires that a struct or union has at least one member */ + int unused; } cd_data_t; -#endif // __QF_plugin_cd_h_ +#endif // __QF_plugin_cd_h diff --git a/include/QF/plugin/console.h b/include/QF/plugin/console.h index d7beec399..a1a61b8fa 100644 --- a/include/QF/plugin/console.h +++ b/include/QF/plugin/console.h @@ -25,8 +25,8 @@ */ -#ifndef __QF_plugin_console_h_ -#define __QF_plugin_console_h_ +#ifndef __QF_plugin_console_h +#define __QF_plugin_console_h #include @@ -34,36 +34,29 @@ #include #include -typedef void (*P_C_Print) (const char *fmt, va_list args) __attribute__((format(PRINTF, 1, 0))); -typedef void (*P_C_ProcessInput) (void); -typedef void (*P_C_KeyEvent) (knum_t key, short unicode, qboolean down); -typedef void (*P_C_DrawConsole) (void); -typedef void (*P_C_CheckResize) (void); -typedef void (*P_C_NewMap) (void); - typedef struct console_funcs_s { - P_C_Print pC_Print; - P_C_ProcessInput pC_ProcessInput; - P_C_KeyEvent pC_KeyEvent; - P_C_DrawConsole pC_DrawConsole; - P_C_CheckResize pC_CheckResize; - P_C_NewMap pC_NewMap; + void (*print) (const char *fmt, va_list args) __attribute__((format(PRINTF, 1, 0))); + void (*process_input) (void); + void (*key_event) (knum_t key, short unicode, qboolean down); + void (*draw_console) (void); + void (*check_resize) (void); + void (*new_map) (void); } console_funcs_t; typedef struct console_data_s { - struct dstring_s *dl_name; - int *dl_percent; - double *realtime; - double *frametime; - int force_commandline; - int ormask; - void (*quit)(void); - struct cbuf_s *cbuf; - struct view_s *view; - struct view_s *status_view; - float lines; - int (*exec_line)(void *data, const char *line); - void *exec_data; + struct dstring_s *dl_name; + int *dl_percent; + double *realtime; + double *frametime; + int force_commandline; + int ormask; + void (*quit) (void); + struct cbuf_s *cbuf; + struct view_s *view; + struct view_s *status_view; + float lines; + int (*exec_line)(void *data, const char *line); + void *exec_data; } console_data_t; -#endif // __QF_plugin_console_h_ +#endif // __QF_plugin_console_h diff --git a/include/QF/plugin/general.h b/include/QF/plugin/general.h index 16141e410..7718e375e 100644 --- a/include/QF/plugin/general.h +++ b/include/QF/plugin/general.h @@ -25,28 +25,21 @@ */ -#ifndef __QF_plugin_general_h_ -#define __QF_plugin_general_h_ +#ifndef __QF_plugin_general_h +#define __QF_plugin_general_h #include #include -/* - All plugins, of all types, must export these functions -*/ - -typedef void (*P_Init) (void); -typedef void (*P_Shutdown) (void); - typedef struct general_funcs_s { - P_Init p_Init; - P_Shutdown p_Shutdown; + void (*init) (void); + void (*shutdown) (void); } general_funcs_t; #define PIF_GLOBAL 1 typedef struct general_data_s { - int flag; + int flag; } general_data_t; -#endif // __QF_plugin_general_h_ +#endif // __QF_plugin_general_h diff --git a/include/QF/plugin/input.h b/include/QF/plugin/input.h index 1077c1d99..297a2953b 100644 --- a/include/QF/plugin/input.h +++ b/include/QF/plugin/input.h @@ -25,29 +25,16 @@ */ -#ifndef __QF_plugin_input_h_ -#define __QF_plugin_input_h_ +#ifndef __QF_plugin_input_h +#define __QF_plugin_input_h #include #include -/* - All input plugins must export these functions -*/ -typedef void (*P_IN_Commands) (void); -typedef void (*P_IN_SendKeyEvents) (void); -typedef void (*P_IN_Move) (void); -typedef void (*P_IN_ModeChanged) (void); - typedef struct input_funcs_s { - P_IN_Commands pIN_Commands; - P_IN_SendKeyEvents pIN_SendKeyEvents; - P_IN_Move pIN_Move; - P_IN_ModeChanged pIN_ModeChanged; } input_funcs_t; typedef struct input_data_s { - int unused; /* C requires that a struct or union has at least one member */ } input_data_t; -#endif // __QF_plugin_input_h_ +#endif // __QF_plugin_input_h diff --git a/include/QF/plugin/snd_output.h b/include/QF/plugin/snd_output.h index 5b6cd02d5..1ac445292 100644 --- a/include/QF/plugin/snd_output.h +++ b/include/QF/plugin/snd_output.h @@ -24,8 +24,8 @@ Boston, MA 02111-1307, USA */ -#ifndef __QF_plugin_snd_output_h_ -#define __QF_plugin_snd_output_h_ +#ifndef __QF_plugin_snd_output_h +#define __QF_plugin_snd_output_h #include #include @@ -54,4 +54,4 @@ typedef struct snd_output_data_s { unsigned *paintedtime; } snd_output_data_t; -#endif // __QF_plugin_snd_output_h_ +#endif // __QF_plugin_snd_output_h diff --git a/include/QF/plugin/snd_render.h b/include/QF/plugin/snd_render.h index 078b6f01d..4cf1ea021 100644 --- a/include/QF/plugin/snd_render.h +++ b/include/QF/plugin/snd_render.h @@ -24,8 +24,8 @@ Boston, MA 02111-1307, USA */ -#ifndef __QF_plugin_snd_render_h_ -#define __QF_plugin_snd_render_h_ +#ifndef __QF_plugin_snd_render_h +#define __QF_plugin_snd_render_h #include #include @@ -64,4 +64,4 @@ typedef struct snd_render_data_s { struct plugin_s *output; } snd_render_data_t; -#endif // __QF_plugin_snd_render_h_ +#endif // __QF_plugin_snd_render_h diff --git a/include/QF/plugin/vid_render.h b/include/QF/plugin/vid_render.h index 18788e641..7256b54d7 100644 --- a/include/QF/plugin/vid_render.h +++ b/include/QF/plugin/vid_render.h @@ -24,8 +24,8 @@ Boston, MA 02111-1307, USA */ -#ifndef __QF_plugin_vid_render_h_ -#define __QF_plugin_vid_render_h_ +#ifndef __QF_plugin_vid_render_h +#define __QF_plugin_vid_render_h #include #include @@ -199,4 +199,4 @@ typedef struct vid_render_data_s { vec_t *vup; } vid_render_data_t; -#endif // __QF_plugin_vid_render_h_ +#endif // __QF_plugin_vid_render_h diff --git a/libs/audio/cd.c b/libs/audio/cd.c index c6a9e8893..ebc1777d3 100644 --- a/libs/audio/cd.c +++ b/libs/audio/cd.c @@ -52,42 +52,42 @@ VISIBLE void CDAudio_Pause (void) { if (cdmodule) - cdmodule->functions->cd->pCDAudio_Pause (); + cdmodule->functions->cd->pause (); } VISIBLE void CDAudio_Play (int track, qboolean looping) { if (cdmodule) - cdmodule->functions->cd->pCDAudio_Play (track, looping); + cdmodule->functions->cd->play (track, looping); } VISIBLE void CDAudio_Resume (void) { if (cdmodule) - cdmodule->functions->cd->pCDAudio_Resume (); + cdmodule->functions->cd->resume (); } static void CDAudio_shutdown (void *data) { if (cdmodule) - cdmodule->functions->general->p_Shutdown (); + cdmodule->functions->general->shutdown (); } VISIBLE void CDAudio_Update (void) { if (cdmodule) - cdmodule->functions->cd->pCDAudio_Update (); + cdmodule->functions->cd->update (); } static void CD_f (void) { if (cdmodule) - cdmodule->functions->cd->pCD_f (); + cdmodule->functions->cd->cd_f (); } VISIBLE int @@ -111,7 +111,7 @@ CDAudio_Init (void) Sys_Printf ("Loading of cd module: %s failed!\n", cd_plugin->string); return -1; } - cdmodule->functions->general->p_Init (); + cdmodule->functions->general->init (); Cmd_AddCommand ( "cd", CD_f, "Control the CD player.\n" "Commands:\n" diff --git a/libs/audio/snd.c b/libs/audio/snd.c index 2561c97cd..1c6e3a6f5 100644 --- a/libs/audio/snd.c +++ b/libs/audio/snd.c @@ -99,8 +99,8 @@ S_Init (int *viewentity, double *host_frametime) host_frametime; snd_render_module->data->snd_render->output = snd_output_module; - snd_output_module->functions->general->p_Init (); - snd_render_module->functions->general->p_Init (); + snd_output_module->functions->general->init (); + snd_render_module->functions->general->init (); snd_output_module->data->snd_output->soundtime = snd_render_module->data->snd_render->soundtime; diff --git a/libs/audio/targets/snd_alsa.c b/libs/audio/targets/snd_alsa.c index 399baae9b..89dbc713b 100644 --- a/libs/audio/targets/snd_alsa.c +++ b/libs/audio/targets/snd_alsa.c @@ -552,8 +552,8 @@ PLUGIN_INFO(snd_output, alsa) plugin_info_funcs.input = NULL; plugin_info_funcs.snd_output = &plugin_info_snd_output_funcs; - plugin_info_general_funcs.p_Init = SNDDMA_Init_Cvars; - plugin_info_general_funcs.p_Shutdown = NULL; + plugin_info_general_funcs.init = SNDDMA_Init_Cvars; + plugin_info_general_funcs.shutdown = NULL; plugin_info_snd_output_funcs.pS_O_Init = SNDDMA_Init; plugin_info_snd_output_funcs.pS_O_Shutdown = SNDDMA_shutdown; plugin_info_snd_output_funcs.pS_O_GetDMAPos = SNDDMA_GetDMAPos; diff --git a/libs/audio/targets/snd_oss.c b/libs/audio/targets/snd_oss.c index dc2902b1b..c7e53b534 100644 --- a/libs/audio/targets/snd_oss.c +++ b/libs/audio/targets/snd_oss.c @@ -410,8 +410,8 @@ PLUGIN_INFO(snd_output, oss) plugin_info_funcs.input = NULL; plugin_info_funcs.snd_output = &plugin_info_snd_output_funcs; - plugin_info_general_funcs.p_Init = SNDDMA_Init_Cvars; - plugin_info_general_funcs.p_Shutdown = NULL; + plugin_info_general_funcs.init = SNDDMA_Init_Cvars; + plugin_info_general_funcs.shutdown = NULL; plugin_info_snd_output_funcs.pS_O_Init = SNDDMA_Init; plugin_info_snd_output_funcs.pS_O_Shutdown = SNDDMA_shutdown; plugin_info_snd_output_funcs.pS_O_GetDMAPos = SNDDMA_GetDMAPos; diff --git a/libs/console/console.c b/libs/console/console.c index cbf98a463..0484bae1b 100644 --- a/libs/console/console.c +++ b/libs/console/console.c @@ -90,7 +90,7 @@ static void Con_shutdown (void *data) { if (con_module) { - con_module->functions->general->p_Shutdown (); + con_module->functions->general->shutdown (); PI_UnloadPlugin (con_module); } } @@ -102,8 +102,8 @@ Con_Init (const char *plugin_name) con_module = PI_LoadPlugin ("console", plugin_name); if (con_module) { - con_module->functions->general->p_Init (); - Sys_SetStdPrintf (con_module->functions->console->pC_Print); + con_module->functions->general->init (); + Sys_SetStdPrintf (con_module->functions->console->print); } else { setvbuf (stdout, 0, _IOLBF, BUFSIZ); } @@ -143,7 +143,7 @@ Con_Printf (const char *fmt, ...) va_start (args, fmt); if (con_module) - con_module->functions->console->pC_Print (fmt, args); + con_module->functions->console->print (fmt, args); else vfprintf (stdout, fmt, args); va_end (args); @@ -153,7 +153,7 @@ VISIBLE void Con_Print (const char *fmt, va_list args) { if (con_module) - con_module->functions->console->pC_Print (fmt, args); + con_module->functions->console->print (fmt, args); else vfprintf (stdout, fmt, args); } @@ -162,7 +162,7 @@ VISIBLE void Con_ProcessInput (void) { if (con_module) { - con_module->functions->console->pC_ProcessInput (); + con_module->functions->console->process_input (); } else { static int been_there_done_that = 0; @@ -177,7 +177,7 @@ VISIBLE void Con_KeyEvent (knum_t key, short unicode, qboolean down) { if (con_module) - con_module->functions->console->pC_KeyEvent (key, unicode, down); + con_module->functions->console->key_event (key, unicode, down); } VISIBLE void @@ -191,19 +191,19 @@ VISIBLE void Con_DrawConsole (void) { if (con_module) - con_module->functions->console->pC_DrawConsole (); + con_module->functions->console->draw_console (); } VISIBLE void Con_CheckResize (void) { if (con_module) - con_module->functions->console->pC_CheckResize (); + con_module->functions->console->check_resize (); } VISIBLE void Con_NewMap (void) { if (con_module) - con_module->functions->console->pC_NewMap (); + con_module->functions->console->new_map (); } diff --git a/libs/util/plugin.c b/libs/util/plugin.c index 629b22e28..6ce0d9049 100644 --- a/libs/util/plugin.c +++ b/libs/util/plugin.c @@ -201,8 +201,8 @@ PI_Plugin_Load_f (void) Sys_Printf ("Error loading plugin %s %s\n", type, name); else if (pi->functions && pi->functions->general && - pi->functions->general->p_Init) - pi->functions->general->p_Init (); + pi->functions->general->init) + pi->functions->general->init (); } static void @@ -274,7 +274,7 @@ PI_LoadPlugin (const char *type, const char *name) const char *tmpname; void *dlhand = 0; plugin_t *plugin = 0; - P_PluginInfo plugin_info = 0; + plugin_info_t plugin_info = 0; plugin_list_t *pl; loaded_plugin_t *lp; @@ -388,8 +388,8 @@ PI_UnloadPlugin (plugin_t *plugin) if (plugin && plugin->functions && plugin->functions->general - && plugin->functions->general->p_Shutdown) { - plugin->functions->general->p_Shutdown (); + && plugin->functions->general->shutdown) { + plugin->functions->general->shutdown (); } else { Sys_MaskPrintf (SYS_dev, "Warning: No shutdown function for type %d plugin!\n", diff --git a/libs/video/renderer/r_init.c b/libs/video/renderer/r_init.c index 733004a21..25a36e6df 100644 --- a/libs/video/renderer/r_init.c +++ b/libs/video/renderer/r_init.c @@ -68,8 +68,8 @@ static U void (*const r_scrapdelete)(rscrap_t *) = R_ScrapDelete; static void R_shutdown (void *data) { - if (vidrendmodule->functions->general->p_Shutdown) { - vidrendmodule->functions->general->p_Shutdown (); + if (vidrendmodule->functions->general->shutdown) { + vidrendmodule->functions->general->shutdown (); } } @@ -89,7 +89,7 @@ R_LoadModule (vid_internal_t *vid_internal) r_data = vidrendmodule->data->vid_render; r_data->vid->vid_internal = vid_internal; - vidrendmodule->functions->general->p_Init (); + vidrendmodule->functions->general->init (); Sys_RegisterShutdown (R_shutdown, 0); }