From 99c0954b47177ce6b8ba309ec1899fce459212bd Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 10 Mar 2007 12:00:59 +0000 Subject: [PATCH] the big dso visibility patch :). Sure, we have to have unique names for static builds, but with controlled visibitly we should get faster program loads (although this isn't C++, so it's not as bad) and complex plugins are cleaner. --- configure.ac | 22 +++++- include/QF/mathlib.h | 1 - include/QF/plugin.h | 2 +- libs/audio/Makefile.am | 2 +- libs/audio/cd.c | 12 ++-- libs/audio/cd/Makefile.am | 2 +- libs/audio/renderer/Makefile.am | 2 +- libs/audio/snd.c | 42 +++++------ libs/audio/targets/Makefile.am | 2 +- libs/console/Makefile.am | 2 +- libs/console/buffer.c | 6 +- libs/console/complete.c | 1 + libs/console/console.c | 17 ++++- libs/console/filelist.c | 5 ++ libs/console/inputline.c | 4 ++ libs/console/list.c | 2 +- libs/console/view.c | 8 +++ libs/gamecode/builtins/Makefile.am | 2 +- libs/gamecode/builtins/bi_gib.c | 2 +- libs/gamecode/builtins/bi_inputline.c | 4 +- libs/gamecode/builtins/pr_cmds.c | 6 +- libs/gamecode/engine/Makefile.am | 2 +- libs/gamecode/engine/pr_builtins.c | 6 +- libs/gamecode/engine/pr_debug.c | 10 +-- libs/gamecode/engine/pr_edict.c | 12 ++-- libs/gamecode/engine/pr_exec.c | 10 +-- libs/gamecode/engine/pr_load.c | 16 ++--- libs/gamecode/engine/pr_opcode.c | 8 +-- libs/gamecode/engine/pr_parse.c | 16 ++--- libs/gamecode/engine/pr_resolve.c | 10 +-- libs/gamecode/engine/pr_resource.c | 6 +- libs/gamecode/engine/pr_strings.c | 22 +++--- libs/gamecode/engine/pr_zone.c | 6 +- libs/gib/Makefile.am | 2 +- libs/gib/gib_buffer.c | 2 +- libs/gib/gib_builtin.c | 14 ++-- libs/gib/gib_init.c | 2 +- libs/gib/gib_parse.c | 2 +- libs/gib/gib_thread.c | 6 +- libs/image/Makefile.am | 2 +- libs/image/image.c | 2 +- libs/image/pcx.c | 4 +- libs/image/png.c | 8 +-- libs/image/tga.c | 2 +- libs/models/Makefile.am | 2 +- libs/models/alias/Makefile.am | 2 +- libs/models/alias/gl_model_alias.c | 2 +- libs/models/brush/Makefile.am | 2 +- libs/models/brush/gl_model_brush.c | 2 +- libs/models/brush/model_brush.c | 6 +- libs/models/brush/sw_model_brush.c | 2 +- libs/models/clip_hull.c | 4 +- libs/models/gl_model_fullbright.c | 2 +- libs/models/model.c | 14 ++-- libs/models/sprite/Makefile.am | 2 +- libs/models/trace.c | 2 +- libs/net/Makefile.am | 2 +- libs/net/nc/Makefile.am | 2 +- libs/net/nm/Makefile.am | 2 +- libs/object/Makefile.am | 2 +- libs/ruamoko/Makefile.am | 2 +- libs/ruamoko/rua_cbuf.c | 2 +- libs/ruamoko/rua_init.c | 2 +- libs/util/Makefile.am | 4 +- libs/util/bspfile.c | 36 +++++----- libs/util/buildnum.c | 2 +- libs/util/cbuf.c | 26 +++---- libs/util/checksum.c | 4 +- libs/util/cmd.c | 36 +++++----- libs/util/crc.c | 8 +-- libs/util/cvar.c | 42 +++++------ libs/util/dstring.c | 48 ++++++------- libs/util/hash.c | 36 +++++----- libs/util/idparse.c | 6 +- libs/util/info.c | 20 +++--- libs/util/link.c | 8 +-- libs/util/llist.c | 28 ++++---- libs/util/mathlib.c | 60 +++++++--------- libs/util/mdfour.c | 8 +-- libs/util/msg.c | 54 +++++++-------- libs/util/pakfile.c | 18 ++--- libs/util/plugin.c | 8 +-- libs/util/qargs.c | 10 +-- libs/util/qendian.c | 16 ++--- libs/util/qfplist.c | 38 +++++----- libs/util/quakefs.c | 64 ++++++++--------- libs/util/quakeio.c | 42 +++++------ libs/util/riff.c | 4 +- libs/util/script.c | 12 ++-- libs/util/sizebuf.c | 10 +-- libs/util/sys.c | 44 ++++++------ libs/util/va.c | 4 +- libs/util/ver_check.c | 2 +- libs/util/wad.c | 6 +- libs/util/wadfile.c | 18 ++--- libs/util/zone.c | 44 ++++++------ libs/video/renderer/gl/Makefile.am | 2 +- libs/video/renderer/gl/gl_draw.c | 28 ++++---- libs/video/renderer/gl/gl_dyn_part.c | 4 +- libs/video/renderer/gl/gl_graph.c | 2 +- libs/video/renderer/gl/gl_rmain.c | 14 ++-- libs/video/renderer/gl/gl_rmisc.c | 6 +- libs/video/renderer/gl/gl_screen.c | 4 +- libs/video/renderer/gl/gl_skin.c | 12 ++-- libs/video/renderer/gl/gl_textures.c | 2 +- libs/video/renderer/sw/Makefile.am | 4 +- libs/video/renderer/sw/d_sprite.c | 2 +- libs/video/renderer/sw/draw.c | 30 ++++---- libs/video/renderer/sw/sw_ralias.c | 2 +- libs/video/renderer/sw/sw_rmain.c | 2 +- libs/video/renderer/sw32/Makefile.am | 2 +- libs/video/renderer/sw32/d_sprite.c | 2 +- libs/video/renderer/sw32/d_surf.c | 2 +- libs/video/renderer/sw32/draw.c | 28 ++++---- libs/video/renderer/sw32/screen.c | 4 +- libs/video/renderer/sw32/sw32_graph.c | 2 +- libs/video/renderer/sw32/sw32_ralias.c | 2 +- libs/video/renderer/sw32/sw32_rmain.c | 22 +++--- libs/video/renderer/sw32/sw32_rpart.c | 4 +- libs/video/renderer/sw32/sw32_skin.c | 12 ++-- libs/video/targets/in_common.c | 6 +- libs/video/targets/joy.c | 10 +-- libs/video/targets/keys.c | 14 ++-- libs/video/targets/qfgl_ext.c | 6 +- libs/video/targets/vid.c | 4 +- libs/video/targets/vid_common_gl.c | 96 +++++++++++++------------- libs/video/targets/vid_common_sw32.c | 6 +- libs/video/targets/vid_glx.c | 2 +- libs/video/targets/vid_sdl32.c | 6 +- libs/video/targets/vid_sgl.c | 2 +- 130 files changed, 762 insertions(+), 722 deletions(-) diff --git a/configure.ac b/configure.ac index f33cdd8b2..83916981a 100644 --- a/configure.ac +++ b/configure.ac @@ -243,6 +243,24 @@ AH_VERBATIM([HAVE___ATTRIBUTE__], # define __attribute__(x) #endif]) +AC_MSG_CHECKING(for __attribute__ ((visibility))) +AC_TRY_COMPILE( + [void foo (void); + __attribute__ ((sivibility ("default"))) void foo (void) {}], + [], + AC_DEFINE(HAVE___ATTRIBUTE__VISIBILITY) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) +) +AH_VERBATIM([HAVE___ATTRIBUTE__VISIBILITY], +[/* Define this if the GCC __attribute__ keyword is available */ +#undef HAVE___ATTRIBUTE__VISIBILITY +#ifdef HAVE___ATTRIBUTE__VISIBILITY +# define VISIBLE __attribute__((visibility ("default"))) +#else +# define VISIBLE +#endif]) + AC_MSG_CHECKING(for __builtin_expect) AC_TRY_COMPILE( [long (*foo) (long, long) = __builtin_expect;], @@ -2051,8 +2069,8 @@ if test "x$enable_shared" = xno; then PREFER_PIC= PREFER_NON_PIC= else - PREFER_PIC=-prefer-pic - PREFER_NON_PIC=-prefer-non-pic + PREFER_PIC="-prefer-pic -fvisibility=hidden" + PREFER_NON_PIC="-prefer-non-pic -fvisibility=hidden" fi if test "x$enable_static" = xno; then STATIC= diff --git a/include/QF/mathlib.h b/include/QF/mathlib.h index ec5b211e3..d00a274d7 100644 --- a/include/QF/mathlib.h +++ b/include/QF/mathlib.h @@ -214,7 +214,6 @@ void _VectorScale (const vec3_t in, vec_t scale, vec3_t out); void _VectorSubtract (const vec3_t veca, const vec3_t vecb, vec3_t out); void CrossProduct (const vec3_t v1, const vec3_t v2, vec3_t cross); vec_t _VectorNormalize (vec3_t v); // returns vector length -void VectorInverse (vec3_t v); int Q_log2(int val); void R_ConcatRotations (float in1[3][3], float in2[3][3], float out[3][3]); diff --git a/include/QF/plugin.h b/include/QF/plugin.h index 572bc01ee..c8be6a386 100644 --- a/include/QF/plugin.h +++ b/include/QF/plugin.h @@ -47,7 +47,7 @@ #ifdef STATIC_PLUGINS #define PLUGIN_INFO(type,name) plugin_t *type##_##name##_PluginInfo (void); plugin_t * type##_##name##_PluginInfo (void) #else -#define PLUGIN_INFO(type,name) plugin_t *PluginInfo (void);plugin_t *PluginInfo (void) +#define PLUGIN_INFO(type,name) plugin_t *PluginInfo (void); __attribute__((visibility ("default"))) plugin_t *PluginInfo (void) #endif typedef enum { diff --git a/libs/audio/Makefile.am b/libs/audio/Makefile.am index 3f57b0a71..7e35b44a9 100644 --- a/libs/audio/Makefile.am +++ b/libs/audio/Makefile.am @@ -1,7 +1,7 @@ AUTOMAKE_OPTIONS= foreign SUBDIRS= cd targets renderer -AM_CFLAGS= @PREFER_PIC@ +CFLAGS+= @PREFER_PIC@ INCLUDES= -I$(top_srcdir)/include lib_LTLIBRARIES= @CD_TARGETS@ @SND_TARGETS@ diff --git a/libs/audio/cd.c b/libs/audio/cd.c index e63444d85..3881dd1e7 100644 --- a/libs/audio/cd.c +++ b/libs/audio/cd.c @@ -48,35 +48,35 @@ plugin_list_t cd_plugin_list[] = { CD_PLUGIN_LIST }; -void +VISIBLE void CDAudio_Pause (void) { if (cdmodule) cdmodule->functions->cd->pCDAudio_Pause (); } -void +VISIBLE void CDAudio_Play (int track, qboolean looping) { if (cdmodule) cdmodule->functions->cd->pCDAudio_Play (track, looping); } -void +VISIBLE void CDAudio_Resume (void) { if (cdmodule) cdmodule->functions->cd->pCDAudio_Resume (); } -void +VISIBLE void CDAudio_Shutdown (void) { if (cdmodule) cdmodule->functions->general->p_Shutdown (); } -void +VISIBLE void CDAudio_Update (void) { if (cdmodule) @@ -90,7 +90,7 @@ CD_f (void) cdmodule->functions->cd->pCD_f (); } -int +VISIBLE int CDAudio_Init (void) { PI_RegisterPlugins (cd_plugin_list); diff --git a/libs/audio/cd/Makefile.am b/libs/audio/cd/Makefile.am index b06094871..f91818383 100644 --- a/libs/audio/cd/Makefile.am +++ b/libs/audio/cd/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS= foreign -AM_CFLAGS= @PREFER_PIC@ +CFLAGS+= @PREFER_PIC@ INCLUDES= -I$(top_srcdir)/include SDL_LIBS= @SDL_LIBS@ XMMS_LIBS= @XMMS_LIBS@ diff --git a/libs/audio/renderer/Makefile.am b/libs/audio/renderer/Makefile.am index ba8c05c95..7490fc368 100644 --- a/libs/audio/renderer/Makefile.am +++ b/libs/audio/renderer/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS= foreign -AM_CFLAGS= @PREFER_PIC@ @VORBIS_CFLAGS@ @OGG_CFLAGS@ +CFLAGS+= @PREFER_PIC@ @VORBIS_CFLAGS@ @OGG_CFLAGS@ INCLUDES= -I$(top_srcdir)/include plugin_version= 1:0:0 plugin_ldflags= @plugin_ldflags@ -module diff --git a/libs/audio/snd.c b/libs/audio/snd.c index aacfe482e..a300ebed1 100644 --- a/libs/audio/snd.c +++ b/libs/audio/snd.c @@ -57,7 +57,7 @@ static plugin_list_t snd_render_list[] = { }; -void +VISIBLE void S_Init (struct model_s **worldmodel, int *viewentity, double *host_frametime) { if (COM_CheckParm ("-nosound")) @@ -101,7 +101,7 @@ S_Init (struct model_s **worldmodel, int *viewentity, double *host_frametime) } } -void +VISIBLE void S_Init_Cvars (void) { snd_output = Cvar_Get ("snd_output", SND_OUTPUT_DEFAULT, CVAR_ROM, NULL, @@ -110,21 +110,21 @@ S_Init_Cvars (void) "Sound Renderer Plugin to use"); } -void +VISIBLE void S_AmbientOff (void) { if (snd_render_funcs) snd_render_funcs->pS_AmbientOff (); } -void +VISIBLE void S_AmbientOn (void) { if (snd_render_funcs) snd_render_funcs->pS_AmbientOn (); } -void +VISIBLE void S_Shutdown (void) { if (snd_render_module) { @@ -138,21 +138,21 @@ S_Shutdown (void) } } -void +VISIBLE void S_TouchSound (const char *sample) { if (snd_render_funcs) snd_render_funcs->pS_TouchSound (sample); } -void +VISIBLE void S_StaticSound (sfx_t *sfx, const vec3_t origin, float vol, float attenuation) { if (snd_render_funcs) snd_render_funcs->pS_StaticSound (sfx, origin, vol, attenuation); } -void +VISIBLE void S_StartSound (int entnum, int entchannel, sfx_t *sfx, const vec3_t origin, float fvol, float attenuation) { @@ -161,14 +161,14 @@ S_StartSound (int entnum, int entchannel, sfx_t *sfx, const vec3_t origin, attenuation); } -void +VISIBLE void S_StopSound (int entnum, int entchannel) { if (snd_render_funcs) snd_render_funcs->pS_StopSound (entnum, entchannel); } -sfx_t * +VISIBLE sfx_t * S_PrecacheSound (const char *sample) { if (snd_render_funcs) @@ -176,14 +176,14 @@ S_PrecacheSound (const char *sample) return NULL; } -void +VISIBLE void S_ClearPrecache (void) { if (snd_render_funcs) snd_render_funcs->pS_ClearPrecache (); } -void +VISIBLE void S_Update (const vec3_t origin, const vec3_t v_forward, const vec3_t v_right, const vec3_t v_up) { @@ -191,56 +191,56 @@ S_Update (const vec3_t origin, const vec3_t v_forward, const vec3_t v_right, snd_render_funcs->pS_Update (origin, v_forward, v_right, v_up); } -void +VISIBLE void S_StopAllSounds (qboolean clear) { if (snd_render_funcs) snd_render_funcs->pS_StopAllSounds (clear); } -void +VISIBLE void S_BeginPrecaching (void) { if (snd_render_funcs) snd_render_funcs->pS_BeginPrecaching (); } -void +VISIBLE void S_EndPrecaching (void) { if (snd_render_funcs) snd_render_funcs->pS_EndPrecaching (); } -void +VISIBLE void S_ExtraUpdate (void) { // if (snd_render_funcs) // snd_render_funcs->pS_ExtraUpdate (); } -void +VISIBLE void S_LocalSound (const char *s) { if (snd_render_funcs) snd_render_funcs->pS_LocalSound (s); } -void +VISIBLE void S_BlockSound (void) { if (snd_render_funcs) snd_render_funcs->pS_BlockSound (); } -void +VISIBLE void S_UnblockSound (void) { if (snd_render_funcs) snd_render_funcs->pS_UnblockSound (); } -sfx_t * +VISIBLE sfx_t * S_LoadSound (const char *name) { if (snd_render_funcs) @@ -248,7 +248,7 @@ S_LoadSound (const char *name) return 0; } -struct channel_s * +VISIBLE struct channel_s * S_AllocChannel (void) { if (snd_render_funcs) diff --git a/libs/audio/targets/Makefile.am b/libs/audio/targets/Makefile.am index f4f7133e0..fbcb10b0d 100644 --- a/libs/audio/targets/Makefile.am +++ b/libs/audio/targets/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS= foreign -AM_CFLAGS= @PREFER_PIC@ +CFLAGS+= @PREFER_PIC@ INCLUDES= -I$(top_srcdir)/include SDL_LIBS = @SDL_LIBS@ plugin_version= 1:0:0 diff --git a/libs/console/Makefile.am b/libs/console/Makefile.am index 9d8a9faaf..30da08b65 100644 --- a/libs/console/Makefile.am +++ b/libs/console/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS= foreign -AM_CFLAGS= @PREFER_PIC@ +CFLAGS+= @PREFER_PIC@ INCLUDES= -I$(top_srcdir)/include plugin_version= 1:0:0 plugin_ldflags= @plugin_ldflags@ -module diff --git a/libs/console/buffer.c b/libs/console/buffer.c index 4500b93c9..9d36aa33c 100644 --- a/libs/console/buffer.c +++ b/libs/console/buffer.c @@ -45,7 +45,7 @@ static __attribute__ ((used)) const char rcsid[] = #include "QF/console.h" -con_buffer_t * +VISIBLE con_buffer_t * Con_CreateBuffer (size_t buffer_size, int max_lines) { con_buffer_t *buffer; @@ -69,7 +69,7 @@ err: return 0; } -void +VISIBLE void Con_DestroyBuffer (con_buffer_t *buffer) { free (buffer->buffer); @@ -77,7 +77,7 @@ Con_DestroyBuffer (con_buffer_t *buffer) free (buffer); } -void +VISIBLE void Con_BufferAddText (con_buffer_t *buf, const char *text) { con_line_t *cur_line = &buf->lines[buf->cur_line]; diff --git a/libs/console/complete.c b/libs/console/complete.c index d41eb6bcb..e25a6181f 100644 --- a/libs/console/complete.c +++ b/libs/console/complete.c @@ -53,6 +53,7 @@ static __attribute__ ((used)) const char rcsid[] = Thanks to Fett erich@heintz.com Thanks to taniwha */ +__attribute__((visibility ("default"))) void Con_BasicCompleteCommandLine (inputline_t *il) { diff --git a/libs/console/console.c b/libs/console/console.c index 67690f179..2e7f56af6 100644 --- a/libs/console/console.c +++ b/libs/console/console.c @@ -43,9 +43,10 @@ static __attribute__ ((used)) const char rcsid[] = #include "QF/plugin.h" #include "QF/sys.h" -int con_linewidth; // characters across screen +//FIXME probably shouldn't be visible +int con_linewidth __attribute__ ((visibility ("default"))); // characters across screen -plugin_t *con_module; +plugin_t *con_module __attribute__ ((visibility ("default"))); #define U __attribute__ ((used)) static U con_buffer_t *(*const buffer) (size_t, int) = Con_CreateBuffer; @@ -54,6 +55,7 @@ static U inputline_t *(*const create)(int, int, char) = Con_CreateInputLine; static U void (*const display)(const char **, int) = Con_DisplayList; #undef U +__attribute__ ((visibility ("default"))) void Con_Init (const char *plugin_name) { @@ -66,11 +68,13 @@ Con_Init (const char *plugin_name) } } +__attribute__ ((visibility ("default"))) void Con_Init_Cvars (void) { } +__attribute__ ((visibility ("default"))) void Con_Shutdown (void) { @@ -80,6 +84,7 @@ Con_Shutdown (void) } } +__attribute__ ((visibility ("default"))) void Con_Printf (const char *fmt, ...) { @@ -93,6 +98,7 @@ Con_Printf (const char *fmt, ...) va_end (args); } +__attribute__ ((visibility ("default"))) void Con_Print (const char *fmt, va_list args) { @@ -102,6 +108,7 @@ Con_Print (const char *fmt, va_list args) vfprintf (stdout, fmt, args); } +__attribute__ ((visibility ("default"))) void Con_DPrintf (const char *fmt, ...) { @@ -116,6 +123,7 @@ Con_DPrintf (const char *fmt, ...) } } +__attribute__ ((visibility ("default"))) void Con_ProcessInput (void) { @@ -131,6 +139,7 @@ Con_ProcessInput (void) } } +__attribute__ ((visibility ("default"))) void Con_KeyEvent (knum_t key, short unicode, qboolean down) { @@ -138,6 +147,7 @@ Con_KeyEvent (knum_t key, short unicode, qboolean down) con_module->functions->console->pC_KeyEvent (key, unicode, down); } +__attribute__ ((visibility ("default"))) void Con_SetOrMask (int mask) { @@ -145,6 +155,7 @@ Con_SetOrMask (int mask) con_module->data->console->ormask = mask; } +__attribute__ ((visibility ("default"))) void Con_DrawConsole (void) { @@ -152,6 +163,7 @@ Con_DrawConsole (void) con_module->functions->console->pC_DrawConsole (); } +__attribute__ ((visibility ("default"))) void Con_CheckResize (void) { @@ -159,6 +171,7 @@ Con_CheckResize (void) con_module->functions->console->pC_CheckResize (); } +__attribute__ ((visibility ("default"))) void Con_NewMap (void) { diff --git a/libs/console/filelist.c b/libs/console/filelist.c index cb3e7e7c1..af38e1009 100644 --- a/libs/console/filelist.c +++ b/libs/console/filelist.c @@ -115,6 +115,7 @@ filelist_print (filelist_t *filelist) } } +__attribute__ ((visibility ("default"))) void Con_Maplist_f (void) { @@ -126,6 +127,7 @@ Con_Maplist_f (void) QFS_FilelistFree (maplist); } +__attribute__ ((visibility ("default"))) void Con_Skinlist_f (void) { @@ -147,6 +149,7 @@ const char *sb_endings[] = { 0 }; +__attribute__ ((visibility ("default"))) void Con_Skyboxlist_f (void) { @@ -184,6 +187,7 @@ Con_Skyboxlist_f (void) QFS_FilelistFree (skyboxlist); } +__attribute__ ((visibility ("default"))) void Con_Demolist_QWD_f (void) { @@ -197,6 +201,7 @@ Con_Demolist_QWD_f (void) return; } +__attribute__ ((visibility ("default"))) void Con_Demolist_DEM_f (void) { diff --git a/libs/console/inputline.c b/libs/console/inputline.c index 7e210c5b6..ee5600fad 100644 --- a/libs/console/inputline.c +++ b/libs/console/inputline.c @@ -48,6 +48,7 @@ static __attribute__ ((used)) const char rcsid[] = #include "compat.h" +__attribute__ ((visibility ("default"))) struct inputline_s * Con_CreateInputLine (int lines, int lsize, char prompt) { @@ -79,12 +80,14 @@ Con_CreateInputLine (int lines, int lsize, char prompt) return inputline; } +__attribute__ ((visibility ("default"))) void Con_DestroyInputLine (inputline_t *inputline) { free (inputline); } +__attribute__ ((visibility ("default"))) void Con_ClearTyping (inputline_t *il, int save) { @@ -97,6 +100,7 @@ Con_ClearTyping (inputline_t *il, int save) il->linepos = 1; } +__attribute__ ((visibility ("default"))) void Con_ProcessInputLine (inputline_t *il, int ch) { diff --git a/libs/console/list.c b/libs/console/list.c index 102619f06..474406c1d 100644 --- a/libs/console/list.c +++ b/libs/console/list.c @@ -40,7 +40,7 @@ static __attribute__ ((used)) const char rcsid[] = #include "QF/console.h" -void (*con_list_print)(const char *fmt, ...) = Con_Printf; +void (*con_list_print)(const char *fmt, ...) __attribute__ ((visibility ("default"))) = Con_Printf; /* Con_DisplayList diff --git a/libs/console/view.c b/libs/console/view.c index 9096b5151..d5a8395b3 100644 --- a/libs/console/view.c +++ b/libs/console/view.c @@ -44,6 +44,7 @@ static __attribute__ ((used)) const char rcsid[] = #include "QF/view.h" +__attribute__ ((visibility ("default"))) view_t * view_new (int xp, int yp, int xl, int yl, grav_t grav) { @@ -120,6 +121,7 @@ setgeometry (view_t *view) setgeometry (view->children[i]); } +__attribute__ ((visibility ("default"))) void view_insert (view_t *par, view_t *view, int pos) { @@ -144,12 +146,14 @@ view_insert (view_t *par, view_t *view, int pos) setgeometry (view); } +__attribute__ ((visibility ("default"))) void view_add (view_t *par, view_t *view) { view_insert (par, view, -1); } +__attribute__ ((visibility ("default"))) void view_remove (view_t *par, view_t *view) { @@ -165,6 +169,7 @@ view_remove (view_t *par, view_t *view) } } +__attribute__ ((visibility ("default"))) void view_delete (view_t *view) { @@ -175,6 +180,7 @@ view_delete (view_t *view) free (view); } +__attribute__ ((visibility ("default"))) void view_draw (view_t *view) { @@ -209,6 +215,7 @@ _resize (view_t *view, int xl, int yl) } } +__attribute__ ((visibility ("default"))) void view_resize (view_t *view, int xl, int yl) { @@ -216,6 +223,7 @@ view_resize (view_t *view, int xl, int yl) setgeometry (view); } +__attribute__ ((visibility ("default"))) void view_move (view_t *view, int xp, int yp) { diff --git a/libs/gamecode/builtins/Makefile.am b/libs/gamecode/builtins/Makefile.am index c8087fe30..16e3da1d9 100644 --- a/libs/gamecode/builtins/Makefile.am +++ b/libs/gamecode/builtins/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS= foreign -AM_CFLAGS= @PREFER_PIC@ +CFLAGS+= @PREFER_PIC@ INCLUDES= -I$(top_srcdir)/include lib_LTLIBRARIES= libQFgamecode_builtins.la diff --git a/libs/gamecode/builtins/bi_gib.c b/libs/gamecode/builtins/bi_gib.c index 02b8db052..f9fd15ac6 100644 --- a/libs/gamecode/builtins/bi_gib.c +++ b/libs/gamecode/builtins/bi_gib.c @@ -186,7 +186,7 @@ static builtin_t builtins[] = { {0} }; -void +VISIBLE void GIB_Progs_Init (progs_t *pr) { bi_gib_resources_t *res = malloc (sizeof (bi_gib_resources_t)); diff --git a/libs/gamecode/builtins/bi_inputline.c b/libs/gamecode/builtins/bi_inputline.c index ddfeb5eba..6a52a4219 100644 --- a/libs/gamecode/builtins/bi_inputline.c +++ b/libs/gamecode/builtins/bi_inputline.c @@ -223,7 +223,7 @@ static builtin_t builtins[] = { {0} }; -void +VISIBLE void InputLine_Progs_Init (progs_t *pr) { il_resources_t *res = malloc (sizeof (il_resources_t)); @@ -234,7 +234,7 @@ InputLine_Progs_Init (progs_t *pr) PR_RegisterBuiltins (pr, builtins); } -void +VISIBLE void InputLine_Progs_SetDraw (progs_t *pr, void (*draw)(inputline_t *)) { il_resources_t *res = PR_Resources_Find (pr, "InputLine"); diff --git a/libs/gamecode/builtins/pr_cmds.c b/libs/gamecode/builtins/pr_cmds.c index 7c5d6bfc5..4843c2478 100644 --- a/libs/gamecode/builtins/pr_cmds.c +++ b/libs/gamecode/builtins/pr_cmds.c @@ -58,11 +58,11 @@ static U void (*const gib_progs_init)(progs_t *) = GIB_Progs_Init; static U void (*const inputline_progs_init)(progs_t *) = InputLine_Progs_Init; #undef U -const char *pr_gametype = ""; +VISIBLE const char *pr_gametype = ""; /* BUILT-IN FUNCTIONS */ -char * +VISIBLE char * PF_VarString (progs_t *pr, int first) { char *out; @@ -662,7 +662,7 @@ static builtin_t builtins[] = { {0} }; -void +VISIBLE void PR_Cmds_Init (progs_t *pr) { PR_RegisterBuiltins (pr, builtins); diff --git a/libs/gamecode/engine/Makefile.am b/libs/gamecode/engine/Makefile.am index 54907278c..6882b2d8e 100644 --- a/libs/gamecode/engine/Makefile.am +++ b/libs/gamecode/engine/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS= foreign -AM_CFLAGS= @PREFER_PIC@ +CFLAGS+= @PREFER_PIC@ INCLUDES= -I$(top_srcdir)/include lib_LTLIBRARIES= libQFgamecode.la diff --git a/libs/gamecode/engine/pr_builtins.c b/libs/gamecode/engine/pr_builtins.c index 326e31555..40c9ec939 100644 --- a/libs/gamecode/engine/pr_builtins.c +++ b/libs/gamecode/engine/pr_builtins.c @@ -89,7 +89,7 @@ builtin_next (progs_t *pr) return pr->bi_next++; } -void +VISIBLE void PR_RegisterBuiltins (progs_t *pr, builtin_t *builtins) { builtin_t *bi; @@ -130,7 +130,7 @@ PR_RegisterBuiltins (progs_t *pr, builtin_t *builtins) } } -builtin_t * +VISIBLE builtin_t * PR_FindBuiltin (progs_t *pr, const char *name) { return (builtin_t *) Hash_Find (pr->builtin_hash, name); @@ -158,7 +158,7 @@ bi_no_function (progs_t *pr) PR_RunError (pr, "Bad builtin called: %s = #%d", bi_name, ind); } -int +VISIBLE int PR_RelocateBuiltins (progs_t *pr) { int i, ind; diff --git a/libs/gamecode/engine/pr_debug.c b/libs/gamecode/engine/pr_debug.c index 450a1d7fa..620eb4efa 100644 --- a/libs/gamecode/engine/pr_debug.c +++ b/libs/gamecode/engine/pr_debug.c @@ -183,7 +183,7 @@ PR_Load_Source_File (progs_t *pr, const char *fname) return f; } -int +VISIBLE int PR_LoadDebug (progs_t *pr) { char *sym_path; @@ -398,7 +398,7 @@ PR_Get_Local_Def (progs_t *pr, int offs) return 0; } -void +VISIBLE void PR_DumpState (progs_t *pr) { if (pr->pr_xfunction) { @@ -594,7 +594,7 @@ global_string (progs_t *pr, int ofs, etype_t type, int contents) return line->str; } -void +VISIBLE void PR_PrintStatement (progs_t * pr, dstatement_t *s, int contents) { int addr = s - pr->pr_statements; @@ -746,7 +746,7 @@ PR_StackTrace (progs_t *pr) dump_frame (pr, pr->pr_stack + i); } -void +VISIBLE void PR_Profile (progs_t * pr) { int max, num, i; @@ -778,7 +778,7 @@ PR_Profile (progs_t * pr) For debugging */ -void +VISIBLE void ED_Print (progs_t *pr, edict_t *ed) { int type, l; diff --git a/libs/gamecode/engine/pr_edict.c b/libs/gamecode/engine/pr_edict.c index 6c61b4353..2ef4aef7e 100644 --- a/libs/gamecode/engine/pr_edict.c +++ b/libs/gamecode/engine/pr_edict.c @@ -61,7 +61,7 @@ static __attribute__ ((used)) const char rcsid[] = Sets everything to NULL */ -void +VISIBLE void ED_ClearEdict (progs_t *pr, edict_t *e, int val) { unsigned int i; @@ -83,7 +83,7 @@ ED_ClearEdict (progs_t *pr, edict_t *e, int val) instead of being removed and recreated, which can cause interpolated angles and bad trails. */ -edict_t * +VISIBLE edict_t * ED_Alloc (progs_t *pr) { int i; @@ -123,7 +123,7 @@ ED_Alloc (progs_t *pr) Marks the edict as free FIXME: walk all entities and NULL out references to this entity */ -void +VISIBLE void ED_Free (progs_t *pr, edict_t *ed) { if (pr->unlink) @@ -146,7 +146,7 @@ ED_Free (progs_t *pr, edict_t *ed) -void +VISIBLE void ED_PrintNum (progs_t *pr, int ent) { ED_Print (pr, EDICT_NUM (pr, ent)); @@ -157,7 +157,7 @@ ED_PrintNum (progs_t *pr, int ent) For debugging, prints all the entities in the current server */ -void +VISIBLE void ED_PrintEdicts (progs_t *pr, const char *fieldval) { int i; @@ -187,7 +187,7 @@ ED_PrintEdicts (progs_t *pr, const char *fieldval) For debugging */ -void +VISIBLE void ED_Count (progs_t *pr) { int i; diff --git a/libs/gamecode/engine/pr_exec.c b/libs/gamecode/engine/pr_exec.c index 73f9135bc..a24b45629 100644 --- a/libs/gamecode/engine/pr_exec.c +++ b/libs/gamecode/engine/pr_exec.c @@ -55,7 +55,7 @@ static __attribute__ ((used)) const char rcsid[] = Aborts the currently executing function */ -void +VISIBLE void PR_RunError (progs_t * pr, const char *error, ...) { dstring_t *string = dstring_new (); @@ -75,7 +75,7 @@ PR_RunError (progs_t * pr, const char *error, ...) PR_Error (pr, "Program error: %s", string->str); } -inline void +VISIBLE inline void PR_PushFrame (progs_t *pr) { prstack_t *frame; @@ -93,7 +93,7 @@ PR_PushFrame (progs_t *pr) pr->pr_xfunction = 0; } -inline void +VISIBLE inline void PR_PopFrame (progs_t *pr) { prstack_t *frame; @@ -276,7 +276,7 @@ signal_hook (int sig, void *data) return 0; } -int +VISIBLE int PR_CallFunction (progs_t *pr, func_t fnum) { dfunction_t *f; @@ -299,7 +299,7 @@ PR_CallFunction (progs_t *pr, func_t fnum) The interpretation main loop */ -void +VISIBLE void PR_ExecuteProgram (progs_t * pr, func_t fnum) { int exitdepth, profile, startprofile; diff --git a/libs/gamecode/engine/pr_load.c b/libs/gamecode/engine/pr_load.c index 5a0147b77..042be4e15 100644 --- a/libs/gamecode/engine/pr_load.c +++ b/libs/gamecode/engine/pr_load.c @@ -99,7 +99,7 @@ free_progs_mem (progs_t *pr, void *mem) { } -void +VISIBLE void PR_LoadProgsFile (progs_t * pr, QFile *file, int size, int edicts, int zone) { unsigned i; @@ -269,7 +269,7 @@ PR_LoadProgsFile (progs_t * pr, QFile *file, int size, int edicts, int zone) ((int *) pr->pr_globals)[i] = LittleLong (((int *) pr->pr_globals)[i]); } -void +VISIBLE void PR_AddLoadFunc (progs_t *pr, int (*func)(progs_t *)) { if (pr->num_load_funcs == pr->max_load_funcs) { @@ -283,7 +283,7 @@ PR_AddLoadFunc (progs_t *pr, int (*func)(progs_t *)) pr->load_funcs[pr->num_load_funcs++] = func; } -void +VISIBLE void PR_AddLoadFinishFunc (progs_t *pr, int (*func)(progs_t *)) { if (pr->num_load_finish_funcs == pr->max_load_finish_funcs) { @@ -335,7 +335,7 @@ run_load_funcs (progs_t *pr, int (**load_funcs)(progs_t *)) return 1; } -int +VISIBLE int PR_RunLoadFuncs (progs_t *pr) { int i; @@ -371,7 +371,7 @@ PR_RunLoadFuncs (progs_t *pr) /* PR_LoadProgs */ -void +VISIBLE void PR_LoadProgs (progs_t *pr, const char *progsname, int edicts, int zone) { QFile *file; @@ -389,7 +389,7 @@ PR_LoadProgs (progs_t *pr, const char *progsname, int edicts, int zone) PR_Error (pr, "unable to load %s", progsname); } -void +VISIBLE void PR_Init_Cvars (void) { pr_boundscheck = @@ -405,14 +405,14 @@ PR_Init_Cvars (void) PR_Debug_Init_Cvars (); } -void +VISIBLE void PR_Init (void) { PR_Opcode_Init (); PR_Debug_Init (); } -void +VISIBLE void PR_Error (progs_t *pr, const char *error, ...) { va_list argptr; diff --git a/libs/gamecode/engine/pr_opcode.c b/libs/gamecode/engine/pr_opcode.c index 02a226544..c863376b8 100644 --- a/libs/gamecode/engine/pr_opcode.c +++ b/libs/gamecode/engine/pr_opcode.c @@ -48,7 +48,7 @@ static __attribute__ ((used)) const char rcsid[] = hashtab_t *opcode_table; -int pr_type_size[ev_type_count] = { +VISIBLE int pr_type_size[ev_type_count] = { 1, // ev_void 1, // ev_string 1, // ev_float @@ -68,7 +68,7 @@ int pr_type_size[ev_type_count] = { 0, // ev_array variable }; -const char *pr_type_name[ev_type_count] = { +VISIBLE const char *pr_type_name[ev_type_count] = { "void", "string", "float", @@ -98,7 +98,7 @@ const char *pr_type_name[ev_type_count] = { // a operand a // b operand b // c operand c -opcode_t pr_opcodes[] = { +VISIBLE opcode_t pr_opcodes[] = { {"", "done", OP_DONE, false, ev_entity, ev_field, ev_void, PROG_ID_VERSION, @@ -1168,7 +1168,7 @@ PR_Opcode (short opcode) return Hash_FindElement (opcode_table, &op); } -void +VISIBLE void PR_Opcode_Init (void) { opcode_t *op; diff --git a/libs/gamecode/engine/pr_parse.c b/libs/gamecode/engine/pr_parse.c index ca45a7441..143712bbe 100644 --- a/libs/gamecode/engine/pr_parse.c +++ b/libs/gamecode/engine/pr_parse.c @@ -108,7 +108,7 @@ PR_UglyValueString (progs_t *pr, etype_t type, pr_type_t *val) return line; } -plitem_t * +VISIBLE plitem_t * ED_EntityDict (progs_t *pr, edict_t *ed) { plitem_t *entity = PL_NewDictionary (); @@ -150,7 +150,7 @@ ED_EntityDict (progs_t *pr, edict_t *ed) FIXME: need to tag constants, doesn't really work */ -plitem_t * +VISIBLE plitem_t * ED_GlobalsDict (progs_t *pr) { plitem_t *globals = PL_NewDictionary (); @@ -209,7 +209,7 @@ ED_NewString (progs_t *pr, const char *string) Can parse either fields or globals returns false if error */ -qboolean +VISIBLE qboolean ED_ParseEpair (progs_t *pr, pr_type_t *base, ddef_t *key, const char *s) { int i; @@ -286,7 +286,7 @@ ED_ParseEpair (progs_t *pr, pr_type_t *base, ddef_t *key, const char *s) to call ED_CallSpawnFunctions () to let the objects initialize themselves. */ -plitem_t * +VISIBLE plitem_t * ED_ConvertToPlist (progs_t *pr, script_t *script) { plitem_t *plist = PL_NewArray (); @@ -335,7 +335,7 @@ ED_ConvertToPlist (progs_t *pr, script_t *script) } -void +VISIBLE void ED_InitGlobals (progs_t *pr, plitem_t *globals) { ddef_t *global; @@ -360,7 +360,7 @@ ED_InitGlobals (progs_t *pr, plitem_t *globals) PL_Free (keys); } -void +VISIBLE void ED_InitEntity (progs_t *pr, plitem_t *entity, edict_t *ent) { ddef_t *field; @@ -439,7 +439,7 @@ ED_SpawnEntities (progs_t *pr, plitem_t *entity_list) } } -void +VISIBLE void ED_LoadFromFile (progs_t *pr, const char *data) { script_t *script; @@ -471,7 +471,7 @@ ED_LoadFromFile (progs_t *pr, const char *data) } } -void +VISIBLE void ED_EntityParseFunction (progs_t *pr) { pr->edict_parse = P_FUNCTION (pr, 0); diff --git a/libs/gamecode/engine/pr_resolve.c b/libs/gamecode/engine/pr_resolve.c index 1f2bb870d..ae292cebe 100644 --- a/libs/gamecode/engine/pr_resolve.c +++ b/libs/gamecode/engine/pr_resolve.c @@ -69,7 +69,7 @@ PR_GlobalAtOfs (progs_t * pr, int ofs) return NULL; } -ddef_t * +VISIBLE ddef_t * PR_FieldAtOfs (progs_t * pr, int ofs) { ddef_t *def; @@ -83,25 +83,25 @@ PR_FieldAtOfs (progs_t * pr, int ofs) return NULL; } -ddef_t * +VISIBLE ddef_t * PR_FindField (progs_t * pr, const char *name) { return Hash_Find (pr->field_hash, name); } -ddef_t * +VISIBLE ddef_t * PR_FindGlobal (progs_t * pr, const char *name) { return Hash_Find (pr->global_hash, name); } -dfunction_t * +VISIBLE dfunction_t * PR_FindFunction (progs_t * pr, const char *name) { return Hash_Find (pr->function_hash, name); } -void +VISIBLE void PR_Undefined (progs_t *pr, const char *type, const char *name) { PR_Error (pr, "undefined %s %s", type, name); diff --git a/libs/gamecode/engine/pr_resource.c b/libs/gamecode/engine/pr_resource.c index ebed5ea58..a94502b70 100644 --- a/libs/gamecode/engine/pr_resource.c +++ b/libs/gamecode/engine/pr_resource.c @@ -53,7 +53,7 @@ resource_get_key (void *r, void *unused) return ((pr_resource_t *)r)->name; } -void +VISIBLE void PR_Resources_Init (progs_t *pr) { pr->resource_hash = Hash_NewTable (1021, resource_get_key, 0, 0); @@ -70,7 +70,7 @@ PR_Resources_Clear (progs_t *pr) } } -void +VISIBLE void PR_Resources_Register (progs_t *pr, const char *name, void *data, void (*clear)(progs_t *, void *)) { @@ -85,7 +85,7 @@ PR_Resources_Register (progs_t *pr, const char *name, void *data, Hash_Add (pr->resource_hash, res); } -void * +VISIBLE void * PR_Resources_Find (progs_t *pr, const char *name) { pr_resource_t *res = Hash_Find (pr->resource_hash, name); diff --git a/libs/gamecode/engine/pr_strings.c b/libs/gamecode/engine/pr_strings.c index 662c57967..dbaaee067 100644 --- a/libs/gamecode/engine/pr_strings.c +++ b/libs/gamecode/engine/pr_strings.c @@ -187,7 +187,7 @@ strref_free (void *_sr, void *_pr) } } -int +VISIBLE int PR_LoadStrings (progs_t *pr) { char *end = pr->pr_strings + pr->progs->numstrings; @@ -281,13 +281,13 @@ get_string (progs_t *pr, int num) } } -qboolean +VISIBLE qboolean PR_StringValid (progs_t *pr, int num) { return get_string (pr, num) != 0; } -const char * +VISIBLE const char * PR_GetString (progs_t *pr, int num) { const char *str; @@ -298,7 +298,7 @@ PR_GetString (progs_t *pr, int num) PR_RunError (pr, "Invalid string offset %d", num); } -dstring_t * +VISIBLE dstring_t * PR_GetMutableString (progs_t *pr, int num) { strref_t *ref = get_strref (pr, num); @@ -330,7 +330,7 @@ pr_strdup (progs_t *pr, const char *s) return new; } -int +VISIBLE int PR_SetString (progs_t *pr, const char *s) { strref_t *sr; @@ -360,7 +360,7 @@ PR_ClearReturnStrings (progs_t *pr) } } -int +VISIBLE int PR_SetReturnString (progs_t *pr, const char *s) { strref_t *sr; @@ -415,7 +415,7 @@ PR_CatStrings (progs_t *pr, const char *a, const char *b) return pr_settempstring (pr, c); } -int +VISIBLE int PR_SetTempString (progs_t *pr, const char *s) { strref_t *sr; @@ -430,7 +430,7 @@ PR_SetTempString (progs_t *pr, const char *s) return pr_settempstring (pr, pr_strdup (pr, s)); } -int +VISIBLE int PR_SetDynamicString (progs_t *pr, const char *s) { strref_t *sr; @@ -469,7 +469,7 @@ PR_MakeTempString (progs_t *pr, int str) pr->pr_xtstr = sr; } -int +VISIBLE int PR_NewMutableString (progs_t *pr) { strref_t *sr = new_string_ref (pr); @@ -478,7 +478,7 @@ PR_NewMutableString (progs_t *pr) return string_index (pr, sr); } -void +VISIBLE void PR_FreeString (progs_t *pr, int str) { strref_t *sr = get_strref (pr, str); @@ -636,7 +636,7 @@ free_fmt_item (fmt_item_t *fi) #undef P_var #define P_var(p,n,t) (args[n]->t##_var) -void +VISIBLE void PR_Sprintf (progs_t *pr, dstring_t *result, const char *name, const char *format, int count, pr_type_t **args) { diff --git a/libs/gamecode/engine/pr_zone.c b/libs/gamecode/engine/pr_zone.c index dbc7b5dce..accddbf78 100644 --- a/libs/gamecode/engine/pr_zone.c +++ b/libs/gamecode/engine/pr_zone.c @@ -54,19 +54,19 @@ PR_Zone_Init (progs_t *pr) Z_ClearZone (pr->zone, pr->zone_size); } -void +VISIBLE void PR_Zone_Free (progs_t *pr, void *ptr) { Z_Free (pr->zone, ptr); } -void * +VISIBLE void * PR_Zone_Malloc (progs_t *pr, int size) { return Z_Malloc (pr->zone, size); } -void * +VISIBLE void * PR_Zone_Realloc (progs_t *pr, void *ptr, int size) { return Z_Realloc (pr->zone, ptr, size); diff --git a/libs/gib/Makefile.am b/libs/gib/Makefile.am index c85395b9f..dc5cbb201 100644 --- a/libs/gib/Makefile.am +++ b/libs/gib/Makefile.am @@ -1,5 +1,5 @@ AUTOMAKE_OPTIONS= foreign -AM_CFLAGS= @PREFER_PIC@ +CFLAGS+= @PREFER_PIC@ INCLUDES= -I$(top_srcdir)/include lib_LTLIBRARIES= libQFgib.la diff --git a/libs/gib/gib_buffer.c b/libs/gib/gib_buffer.c index 0442c41f4..94279a6ba 100644 --- a/libs/gib/gib_buffer.c +++ b/libs/gib/gib_buffer.c @@ -331,7 +331,7 @@ cbuf_interpreter_t gib_interp = { GIB_Execute, }; -cbuf_interpreter_t * +VISIBLE cbuf_interpreter_t * GIB_Interpreter (void) { return &gib_interp; diff --git a/libs/gib/gib_builtin.c b/libs/gib/gib_builtin.c index 4fb835e1d..13454aaa0 100644 --- a/libs/gib/gib_builtin.c +++ b/libs/gib/gib_builtin.c @@ -68,7 +68,7 @@ const char rcsid[] = #include "gib_classes.h" static char _gib_null_string[] = ""; -char * const gib_null_string = _gib_null_string; +VISIBLE char * const gib_null_string = _gib_null_string; hashtab_t *gib_builtins; @@ -96,7 +96,7 @@ GIB_Builtin_Free (void *ele, void *ptr) Registers a new builtin GIB command. */ -void +VISIBLE void GIB_Builtin_Add (const char *name, void (*func) (void)) { gib_builtin_t *new; @@ -111,7 +111,7 @@ GIB_Builtin_Add (const char *name, void (*func) (void)) Hash_Add (gib_builtins, new); } -void +VISIBLE void GIB_Builtin_Remove (const char *name) { gib_builtin_t *del; @@ -120,7 +120,7 @@ GIB_Builtin_Remove (const char *name) Hash_Free (gib_builtins, del); } -qboolean +VISIBLE qboolean GIB_Builtin_Exists (const char *name) { return Hash_Find (gib_builtins, name) ? true : false; @@ -133,7 +133,7 @@ GIB_Builtin_Exists (const char *name) returning a pointer to the struct on success, zero otherwise. */ -gib_builtin_t * +VISIBLE gib_builtin_t * GIB_Builtin_Find (const char *name) { if (!gib_builtins) @@ -141,7 +141,7 @@ GIB_Builtin_Find (const char *name) return (gib_builtin_t *) Hash_Find (gib_builtins, name); } -dstring_t * +VISIBLE dstring_t * GIB_Return (const char *str) { dstring_t *dstr; @@ -157,7 +157,7 @@ GIB_Return (const char *str) return 0; } -void +VISIBLE void GIB_Error (const char *type, const char *fmt, ...) { va_list args; diff --git a/libs/gib/gib_init.c b/libs/gib/gib_init.c index e74f97634..2c5385d7f 100644 --- a/libs/gib/gib_init.c +++ b/libs/gib/gib_init.c @@ -95,7 +95,7 @@ GIB_Exec_Override_f (void) Hunk_FreeToLowMark (mark); } -void +VISIBLE void GIB_Init (qboolean sandbox) { // Override the exec command with a GIB-aware one diff --git a/libs/gib/gib_parse.c b/libs/gib/gib_parse.c index d0bcac71a..3dfd755e6 100644 --- a/libs/gib/gib_parse.c +++ b/libs/gib/gib_parse.c @@ -189,7 +189,7 @@ GIB_Parse_Match_Var (const char *str, unsigned int *i) return 0; } -qboolean gib_parse_error; +VISIBLE qboolean gib_parse_error; unsigned int gib_parse_error_pos; const char *gib_parse_error_msg; diff --git a/libs/gib/gib_thread.c b/libs/gib/gib_thread.c index b5cd3ba25..b0f764e7b 100644 --- a/libs/gib/gib_thread.c +++ b/libs/gib/gib_thread.c @@ -86,7 +86,7 @@ GIB_Thread_Count (void) return llist_size (gib_threads); } -void +VISIBLE void GIB_Thread_Execute (void) { auto qboolean iterator (cbuf_t *cbuf, llist_node_t *node); @@ -124,7 +124,7 @@ GIB_Event_Free (void *ele, void *ptr) free (ev); } -gib_event_t * +VISIBLE gib_event_t * GIB_Event_New (const char *name) { gib_event_t *new; @@ -146,7 +146,7 @@ GIB_Event_Register (const char *name, gib_function_t * func) return 0; } -void +VISIBLE void GIB_Event_Callback (gib_event_t * event, unsigned int argc, ...) { gib_function_t *f = event->func; diff --git a/libs/image/Makefile.am b/libs/image/Makefile.am index 3998394da..7f435cc1d 100644 --- a/libs/image/Makefile.am +++ b/libs/image/Makefile.am @@ -1,5 +1,5 @@ AUTOMAKE_OPTIONS= foreign -AM_CFLAGS= @PREFER_PIC@ +CFLAGS+= @PREFER_PIC@ INCLUDES= -I$(top_srcdir)/include lib_LTLIBRARIES= libQFimage.la diff --git a/libs/image/image.c b/libs/image/image.c index 73ae39c6a..0cdc49ab9 100644 --- a/libs/image/image.c +++ b/libs/image/image.c @@ -45,7 +45,7 @@ static __attribute__ ((used)) const char rcsid[] = #include "QF/quakefs.h" #include "QF/tga.h" -tex_t * +VISIBLE tex_t * LoadImage (const char *imageFile) { int tmp; diff --git a/libs/image/pcx.c b/libs/image/pcx.c index 4219a7564..74b2c117f 100644 --- a/libs/image/pcx.c +++ b/libs/image/pcx.c @@ -49,7 +49,7 @@ static __attribute__ ((used)) const char rcsid[] = #include "compat.h" -tex_t * +VISIBLE tex_t * LoadPCX (QFile *f, int convert, byte *pal) { pcx_t *pcx; @@ -140,7 +140,7 @@ LoadPCX (QFile *f, int convert, byte *pal) return tex; } -pcx_t * +VISIBLE pcx_t * EncodePCX (byte * data, int width, int height, int rowbytes, byte * palette, qboolean flip, int *length) { diff --git a/libs/image/png.c b/libs/image/png.c index 982618191..a79926297 100644 --- a/libs/image/png.c +++ b/libs/image/png.c @@ -117,7 +117,7 @@ readpng_init (QFile *infile, png_structp *png_ptr, png_infop *info_ptr) } /* Load the png file and return a texture */ -tex_t * +VISIBLE tex_t * LoadPNG (QFile *infile) { double gamma; @@ -196,7 +196,7 @@ LoadPNG (QFile *infile) #define WRITEPNG_BIT_DEPTH 8 -void +VISIBLE void WritePNG (const char *fileName, byte *data, int width, int height) { QFile *outfile; @@ -282,13 +282,13 @@ WritePNG (const char *fileName, byte *data, int width, int height) #include "QF/image.h" #include "QF/png.h" -tex_t * +VISIBLE tex_t * LoadPNG (QFile *infile) { return 0; } -void +VISIBLE void WritePNG (const char *fileName, byte *data, int width, int height) { return; diff --git a/libs/image/tga.c b/libs/image/tga.c index 8ae361851..7e2c89324 100644 --- a/libs/image/tga.c +++ b/libs/image/tga.c @@ -662,7 +662,7 @@ LoadTGA (QFile *fin) return tex; } -void +VISIBLE void WriteTGAfile (const char *tganame, byte *data, int width, int height) { TargaHeader header; diff --git a/libs/models/Makefile.am b/libs/models/Makefile.am index cf6a1d374..f070844a8 100644 --- a/libs/models/Makefile.am +++ b/libs/models/Makefile.am @@ -1,7 +1,7 @@ AUTOMAKE_OPTIONS= foreign SUBDIRS= alias brush sprite -AM_CFLAGS= @PREFER_PIC@ +CFLAGS+= @PREFER_PIC@ INCLUDES= -I$(top_srcdir)/include lib_LTLIBRARIES= libQFmodels.la @VID_MODEL_TARGETS@ diff --git a/libs/models/alias/Makefile.am b/libs/models/alias/Makefile.am index 615475f80..6ec6de531 100644 --- a/libs/models/alias/Makefile.am +++ b/libs/models/alias/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS= foreign -AM_CFLAGS= @PREFER_PIC@ +CFLAGS+= @PREFER_PIC@ INCLUDES= -I$(top_srcdir)/include if BUILD_GL diff --git a/libs/models/alias/gl_model_alias.c b/libs/models/alias/gl_model_alias.c index 78030dc08..ee0aae5de 100644 --- a/libs/models/alias/gl_model_alias.c +++ b/libs/models/alias/gl_model_alias.c @@ -53,7 +53,7 @@ static __attribute__ ((used)) const char rcsid[] = #include "compat.h" -byte player_8bit_texels[640 * 400]; +VISIBLE byte player_8bit_texels[640 * 400]; // a pose is a single set of vertexes. a frame may be diff --git a/libs/models/brush/Makefile.am b/libs/models/brush/Makefile.am index ae698dc6f..842f85f41 100644 --- a/libs/models/brush/Makefile.am +++ b/libs/models/brush/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS= foreign -AM_CFLAGS= @PREFER_PIC@ +CFLAGS+= @PREFER_PIC@ INCLUDES= -I$(top_srcdir)/include if BUILD_GL diff --git a/libs/models/brush/gl_model_brush.c b/libs/models/brush/gl_model_brush.c index 001007587..5136c3d5e 100644 --- a/libs/models/brush/gl_model_brush.c +++ b/libs/models/brush/gl_model_brush.c @@ -54,7 +54,7 @@ static __attribute__ ((used)) const char rcsid[] = #include "compat.h" -int mod_lightmap_bytes = 3; +VISIBLE int mod_lightmap_bytes = 3; //FIXME should this be visible? void diff --git a/libs/models/brush/model_brush.c b/libs/models/brush/model_brush.c index 3dc84c7b2..ed83f864d 100644 --- a/libs/models/brush/model_brush.c +++ b/libs/models/brush/model_brush.c @@ -55,9 +55,9 @@ static __attribute__ ((used)) const char rcsid[] = byte mod_novis[MAX_MAP_LEAFS / 8]; -cvar_t *gl_sky_divide; +VISIBLE cvar_t *gl_sky_divide; //FIXME visibility? -mleaf_t * +VISIBLE mleaf_t * Mod_PointInLeaf (const vec3_t p, model_t *model) { float d; @@ -117,7 +117,7 @@ Mod_DecompressVis (byte * in, model_t *model) return decompressed; } -byte * +VISIBLE byte * Mod_LeafPVS (mleaf_t *leaf, model_t *model) { if (leaf == model->leafs) diff --git a/libs/models/brush/sw_model_brush.c b/libs/models/brush/sw_model_brush.c index 56ef2e9a3..d072779f8 100644 --- a/libs/models/brush/sw_model_brush.c +++ b/libs/models/brush/sw_model_brush.c @@ -43,7 +43,7 @@ static __attribute__ ((used)) const char rcsid[] = #include "QF/model.h" -int mod_lightmap_bytes = 1; +VISIBLE int mod_lightmap_bytes = 1; //FIXME should this be visible? void diff --git a/libs/models/clip_hull.c b/libs/models/clip_hull.c index ec5cb5904..255d972ac 100644 --- a/libs/models/clip_hull.c +++ b/libs/models/clip_hull.c @@ -40,7 +40,7 @@ static __attribute__ ((used)) const char rcsid[] = #include "QF/model.h" -clip_hull_t * +VISIBLE clip_hull_t * MOD_Alloc_Hull (int nodes, int planes) { clip_hull_t *ch; @@ -67,7 +67,7 @@ MOD_Alloc_Hull (int nodes, int planes) return ch; } -void +VISIBLE void MOD_Free_Hull (clip_hull_t *ch) { free (ch); diff --git a/libs/models/gl_model_fullbright.c b/libs/models/gl_model_fullbright.c index b271d30ae..3c0f24165 100644 --- a/libs/models/gl_model_fullbright.c +++ b/libs/models/gl_model_fullbright.c @@ -44,7 +44,7 @@ static __attribute__ ((used)) const char rcsid[] = #include "r_local.h" -int +VISIBLE int Mod_CalcFullbright (byte *in, byte *out, int pixels) { int fb = 0; diff --git a/libs/models/model.c b/libs/models/model.c index 92e2b8c00..222344b36 100644 --- a/libs/models/model.c +++ b/libs/models/model.c @@ -56,7 +56,7 @@ char *loadname; // for hunk tags model_t mod_known[MAX_MOD_KNOWN]; int mod_numknown; -texture_t *r_notexture_mip; +VISIBLE texture_t *r_notexture_mip; cvar_t *gl_mesh_cache; cvar_t *gl_subdivide_size; @@ -65,7 +65,7 @@ cvar_t *gl_textures_external; static void Mod_CallbackLoad (void *object, cache_allocator_t allocator); -void +VISIBLE void Mod_Init (void) { byte *dest; @@ -95,7 +95,7 @@ Mod_Init (void) } } -void +VISIBLE void Mod_Init_Cvars (void) { gl_subdivide_size = @@ -112,7 +112,7 @@ Mod_Init_Cvars (void) "Use external textures to replace BSP textures"); } -void +VISIBLE void Mod_ClearAll (void) { int i; @@ -258,7 +258,7 @@ Mod_CallbackLoad (void *object, cache_allocator_t allocator) Loads in a model for the given name */ -model_t * +VISIBLE model_t * Mod_ForName (const char *name, qboolean crash) { model_t *mod; @@ -269,7 +269,7 @@ Mod_ForName (const char *name, qboolean crash) return Mod_LoadModel (mod, crash); } -void +VISIBLE void Mod_TouchModel (const char *name) { model_t *mod; @@ -282,7 +282,7 @@ Mod_TouchModel (const char *name) } } -void +VISIBLE void Mod_Print (void) { int i; diff --git a/libs/models/sprite/Makefile.am b/libs/models/sprite/Makefile.am index 51170bedf..12288766b 100644 --- a/libs/models/sprite/Makefile.am +++ b/libs/models/sprite/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS= foreign -AM_CFLAGS= @PREFER_PIC@ +CFLAGS+= @PREFER_PIC@ INCLUDES= -I$(top_srcdir)/include if BUILD_GL diff --git a/libs/models/trace.c b/libs/models/trace.c index b3b610e0d..68b2311ad 100644 --- a/libs/models/trace.c +++ b/libs/models/trace.c @@ -91,7 +91,7 @@ calc_impact (trace_t *trace, const vec3_t start, const vec3_t end, VectorMultAdd (start, frac, dist, trace->endpos); } -qboolean +VISIBLE qboolean MOD_TraceLine (hull_t *hull, int num, const vec3_t start_point, const vec3_t end_point, trace_t *trace) diff --git a/libs/net/Makefile.am b/libs/net/Makefile.am index e522a0a6a..02718623d 100644 --- a/libs/net/Makefile.am +++ b/libs/net/Makefile.am @@ -1,7 +1,7 @@ AUTOMAKE_OPTIONS= foreign SUBDIRS= nc nm -AM_CFLAGS= @PREFER_NON_PIC@ +CFLAGS+= @PREFER_NON_PIC@ INCLUDES= -I$(top_srcdir)/include noinst_LTLIBRARIES= libnet_chan.la libnet_main.la diff --git a/libs/net/nc/Makefile.am b/libs/net/nc/Makefile.am index 27a900987..30fa97a75 100644 --- a/libs/net/nc/Makefile.am +++ b/libs/net/nc/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS= foreign -AM_CFLAGS= @PREFER_NON_PIC@ +CFLAGS+= @PREFER_NON_PIC@ INCLUDES= -I$(top_srcdir)/include noinst_LTLIBRARIES= libnc.la diff --git a/libs/net/nm/Makefile.am b/libs/net/nm/Makefile.am index ba7771470..3ee08f7d9 100644 --- a/libs/net/nm/Makefile.am +++ b/libs/net/nm/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS= foreign -AM_CFLAGS= @PREFER_NON_PIC@ +CFLAGS+= @PREFER_NON_PIC@ INCLUDES= -I$(top_srcdir)/include noinst_LTLIBRARIES= libnm.la diff --git a/libs/object/Makefile.am b/libs/object/Makefile.am index 87196d26d..ee8bdde70 100644 --- a/libs/object/Makefile.am +++ b/libs/object/Makefile.am @@ -1,5 +1,5 @@ AUTOMAKE_OPTIONS= foreign -AM_CFLAGS= @PREFER_PIC@ +CFLAGS+= @PREFER_PIC@ INCLUDES= -I$(top_srcdir)/include lib_LTLIBRARIES= libQFobject.la diff --git a/libs/ruamoko/Makefile.am b/libs/ruamoko/Makefile.am index 451cb3f0f..93899f2bb 100644 --- a/libs/ruamoko/Makefile.am +++ b/libs/ruamoko/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS= foreign -AM_CFLAGS= @PREFER_PIC@ +CFLAGS+= @PREFER_PIC@ INCLUDES= -I$(top_srcdir)/include lib_LTLIBRARIES= libQFruamoko.la diff --git a/libs/ruamoko/rua_cbuf.c b/libs/ruamoko/rua_cbuf.c index 1640dfd56..b4ad3129f 100644 --- a/libs/ruamoko/rua_cbuf.c +++ b/libs/ruamoko/rua_cbuf.c @@ -112,7 +112,7 @@ RUA_Cbuf_Init (progs_t *pr, int secure) PR_RegisterBuiltins (pr, builtins); } -void +VISIBLE void RUA_Cbuf_SetCbuf (progs_t *pr, cbuf_t *cbuf) { cbuf_resources_t *res = PR_Resources_Find (pr, "Cbuf"); diff --git a/libs/ruamoko/rua_init.c b/libs/ruamoko/rua_init.c index da9d01a55..f9f654e47 100644 --- a/libs/ruamoko/rua_init.c +++ b/libs/ruamoko/rua_init.c @@ -52,7 +52,7 @@ static void (*init_funcs[])(progs_t *, int) = { RUA_String_Init, }; -void +VISIBLE void RUA_Init (progs_t *pr, int secure) { size_t i; diff --git a/libs/util/Makefile.am b/libs/util/Makefile.am index efc494d76..aacffc4a4 100644 --- a/libs/util/Makefile.am +++ b/libs/util/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS= foreign -AM_CFLAGS= @PREFER_PIC@ -AM_CCASFLAGS= @PREFER_PIC@ +CFLAGS+= @PREFER_PIC@ +CCASFLAGS+= @PREFER_PIC@ INCLUDES= -I$(top_srcdir)/include lib_LTLIBRARIES= libQFutil.la diff --git a/libs/util/bspfile.c b/libs/util/bspfile.c index 44394beb1..de3b0d4ad 100644 --- a/libs/util/bspfile.c +++ b/libs/util/bspfile.c @@ -234,7 +234,7 @@ do { \ return bsp; } -bsp_t * +VISIBLE bsp_t * LoadBSPFile (QFile *file, int size) { void *buf; @@ -252,7 +252,7 @@ LoadBSPFile (QFile *file, int size) Swaps the bsp file in place, so it should not be referenced again */ -void +VISIBLE void WriteBSPFile (bsp_t *bsp, QFile *file) { int size; @@ -327,13 +327,13 @@ do { \ free (header); } -bsp_t * +VISIBLE bsp_t * BSP_New (void) { return calloc (1, sizeof (bsp_t)); } -void +VISIBLE void BSP_AddPlane (bsp_t *bsp, dplane_t *plane) { bsp->planes = realloc (bsp->planes, @@ -341,7 +341,7 @@ BSP_AddPlane (bsp_t *bsp, dplane_t *plane) bsp->planes[bsp->numplanes++] = *plane; } -void +VISIBLE void BSP_AddLeaf (bsp_t *bsp, dleaf_t *leaf) { bsp->leafs = realloc (bsp->leafs, @@ -349,7 +349,7 @@ BSP_AddLeaf (bsp_t *bsp, dleaf_t *leaf) bsp->leafs[bsp->numleafs++] = *leaf; } -void +VISIBLE void BSP_AddVertex (bsp_t *bsp, dvertex_t *vertex) { bsp->vertexes = realloc (bsp->vertexes, @@ -357,7 +357,7 @@ BSP_AddVertex (bsp_t *bsp, dvertex_t *vertex) bsp->vertexes[bsp->numvertexes++] = *vertex; } -void +VISIBLE void BSP_AddNode (bsp_t *bsp, dnode_t *node) { bsp->nodes = realloc (bsp->nodes, @@ -365,7 +365,7 @@ BSP_AddNode (bsp_t *bsp, dnode_t *node) bsp->nodes[bsp->numnodes++] = *node; } -void +VISIBLE void BSP_AddTexinfo (bsp_t *bsp, texinfo_t *texinfo) { bsp->texinfo = realloc (bsp->texinfo, @@ -373,7 +373,7 @@ BSP_AddTexinfo (bsp_t *bsp, texinfo_t *texinfo) bsp->texinfo[bsp->numtexinfo++] = *texinfo; } -void +VISIBLE void BSP_AddFace (bsp_t *bsp, dface_t *face) { bsp->faces = realloc (bsp->faces, @@ -381,7 +381,7 @@ BSP_AddFace (bsp_t *bsp, dface_t *face) bsp->faces[bsp->numfaces++] = *face; } -void +VISIBLE void BSP_AddClipnode (bsp_t *bsp, dclipnode_t *clipnode) { bsp->clipnodes = realloc (bsp->clipnodes, @@ -389,7 +389,7 @@ BSP_AddClipnode (bsp_t *bsp, dclipnode_t *clipnode) bsp->clipnodes[bsp->numclipnodes++] = *clipnode; } -void +VISIBLE void BSP_AddMarkSurface (bsp_t *bsp, unsigned short marksurface) { bsp->marksurfaces = realloc (bsp->marksurfaces, @@ -398,7 +398,7 @@ BSP_AddMarkSurface (bsp_t *bsp, unsigned short marksurface) bsp->marksurfaces[bsp->nummarksurfaces++] = marksurface; } -void +VISIBLE void BSP_AddSurfEdge (bsp_t *bsp, int surfedge) { bsp->surfedges = realloc (bsp->surfedges, @@ -406,7 +406,7 @@ BSP_AddSurfEdge (bsp_t *bsp, int surfedge) bsp->surfedges[bsp->numsurfedges++] = surfedge; } -void +VISIBLE void BSP_AddEdge (bsp_t *bsp, dedge_t *edge) { bsp->edges = realloc (bsp->edges, @@ -414,7 +414,7 @@ BSP_AddEdge (bsp_t *bsp, dedge_t *edge) bsp->edges[bsp->numedges++] = *edge; } -void +VISIBLE void BSP_AddModel (bsp_t *bsp, dmodel_t *model) { bsp->models = realloc (bsp->models, @@ -422,7 +422,7 @@ BSP_AddModel (bsp_t *bsp, dmodel_t *model) bsp->models[bsp->nummodels++] = *model; } -void +VISIBLE void BSP_AddLighting (bsp_t *bsp, byte *lightdata, int lightdatasize) { bsp->lightdatasize = lightdatasize; @@ -430,7 +430,7 @@ BSP_AddLighting (bsp_t *bsp, byte *lightdata, int lightdatasize) memcpy (bsp->lightdata, lightdata, lightdatasize); } -void +VISIBLE void BSP_AddVisibility (bsp_t *bsp, byte *visdata, int visdatasize) { bsp->visdatasize = visdatasize; @@ -438,7 +438,7 @@ BSP_AddVisibility (bsp_t *bsp, byte *visdata, int visdatasize) memcpy (bsp->visdata, visdata, visdatasize); } -void +VISIBLE void BSP_AddEntities (bsp_t *bsp, char *entdata, int entdatasize) { bsp->entdatasize = entdatasize; @@ -446,7 +446,7 @@ BSP_AddEntities (bsp_t *bsp, char *entdata, int entdatasize) memcpy (bsp->entdata, entdata, entdatasize); } -void +VISIBLE void BSP_AddTextures (bsp_t *bsp, byte *texdata, int texdatasize) { bsp->texdatasize = texdatasize; diff --git a/libs/util/buildnum.c b/libs/util/buildnum.c index c82b3cc65..c0bf9d147 100644 --- a/libs/util/buildnum.c +++ b/libs/util/buildnum.c @@ -49,7 +49,7 @@ static const char mond[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; /* returns days since Dec 21 1999 */ -int +VISIBLE int build_number (void) { int m = 0; diff --git a/libs/util/cbuf.c b/libs/util/cbuf.c index c5f8e9e41..e19111335 100644 --- a/libs/util/cbuf.c +++ b/libs/util/cbuf.c @@ -51,15 +51,15 @@ static __attribute__ ((used)) const char rcsid[] = #include "compat.h" -cbuf_t *cbuf_active = NULL; +VISIBLE cbuf_t *cbuf_active = NULL; -cbuf_args_t * +VISIBLE cbuf_args_t * Cbuf_ArgsNew (void) { return calloc (1, sizeof (cbuf_args_t)); } -void +VISIBLE void Cbuf_ArgsDelete (cbuf_args_t *args) { int i; @@ -72,7 +72,7 @@ Cbuf_ArgsDelete (cbuf_args_t *args) free (args); } -void +VISIBLE void Cbuf_ArgsAdd (cbuf_args_t *args, const char *arg) { int i; @@ -92,7 +92,7 @@ Cbuf_ArgsAdd (cbuf_args_t *args, const char *arg) args->argc++; } -cbuf_t * +VISIBLE cbuf_t * Cbuf_New (cbuf_interpreter_t *interp) { cbuf_t *cbuf = calloc (1, sizeof (cbuf_t)); @@ -104,7 +104,7 @@ Cbuf_New (cbuf_interpreter_t *interp) return cbuf; } -void +VISIBLE void Cbuf_Delete (cbuf_t *cbuf) { if (!cbuf) @@ -115,7 +115,7 @@ Cbuf_Delete (cbuf_t *cbuf) free (cbuf); } -void +VISIBLE void Cbuf_DeleteStack (cbuf_t *stack) { cbuf_t *next; @@ -136,7 +136,7 @@ Cbuf_Reset (cbuf_t *cbuf) cbuf->interpreter->reset (cbuf); } -cbuf_t * +VISIBLE cbuf_t * Cbuf_PushStack (cbuf_interpreter_t *interp) { cbuf_t *new; @@ -156,7 +156,7 @@ Cbuf_PushStack (cbuf_interpreter_t *interp) return new; } -void +VISIBLE void Cbuf_AddText (cbuf_t *cbuf, const char *text) { if (cbuf->state == CBUF_STATE_JUNK) @@ -164,7 +164,7 @@ Cbuf_AddText (cbuf_t *cbuf, const char *text) cbuf->interpreter->add (cbuf, text); } -void +VISIBLE void Cbuf_InsertText (cbuf_t *cbuf, const char *text) { if (cbuf->state == CBUF_STATE_JUNK) @@ -172,7 +172,7 @@ Cbuf_InsertText (cbuf_t *cbuf, const char *text) cbuf->interpreter->insert (cbuf, text); } -void +VISIBLE void Cbuf_Execute (cbuf_t *cbuf) { cbuf_t *old = cbuf_active; @@ -181,7 +181,7 @@ Cbuf_Execute (cbuf_t *cbuf) cbuf_active = old; } -void +VISIBLE void Cbuf_Execute_Stack (cbuf_t *cbuf) { cbuf_t *sp; @@ -222,7 +222,7 @@ Cbuf_Execute_Stack (cbuf_t *cbuf) Cbuf_Reset (cbuf); } -void +VISIBLE void Cbuf_Execute_Sets (cbuf_t *cbuf) { cbuf->interpreter->execute_sets (cbuf); diff --git a/libs/util/checksum.c b/libs/util/checksum.c index de60d9bc5..f7084b3cf 100644 --- a/libs/util/checksum.c +++ b/libs/util/checksum.c @@ -124,7 +124,7 @@ static byte chktbl[1024 + 4] = { For proxy protecting */ -byte +VISIBLE byte COM_BlockSequenceCRCByte (const byte * base, int length, int sequence) { byte chkb[60 + 4]; @@ -151,7 +151,7 @@ COM_BlockSequenceCRCByte (const byte * base, int length, int sequence) return (byte) crc; } -unsigned int +VISIBLE unsigned int Com_BlockChecksum (const void *buffer, int length) { int digest[4]; diff --git a/libs/util/cmd.c b/libs/util/cmd.c index febe6e73b..19db78505 100644 --- a/libs/util/cmd.c +++ b/libs/util/cmd.c @@ -62,14 +62,14 @@ typedef struct cmdalias_s { static cmdalias_t *cmd_alias; -cvar_t *cmd_warncmd; +VISIBLE cvar_t *cmd_warncmd; static hashtab_t *cmd_alias_hash; static hashtab_t *cmd_hash; -cbuf_args_t *cmd_args; +VISIBLE cbuf_args_t *cmd_args; static cbuf_t *cmd_cbuf; -cmd_source_t cmd_source; +VISIBLE cmd_source_t cmd_source; /* Command parsing functions */ @@ -84,13 +84,13 @@ typedef struct cmd_function_s { static cmd_function_t *cmd_functions; // possible commands to execute -int +VISIBLE int Cmd_Argc (void) { return cmd_args->argc; } -const char * +VISIBLE const char * Cmd_Argv (int arg) { if (arg >= cmd_args->argc) @@ -98,7 +98,7 @@ Cmd_Argv (int arg) return cmd_args->argv[arg]->str; } -const char * +VISIBLE const char * Cmd_Args (int start) { if (start >= cmd_args->argc) @@ -106,7 +106,7 @@ Cmd_Args (int start) return cmd_args->args[start]; } -int +VISIBLE int Cmd_Command (cbuf_args_t *args) { cmd_function_t *cmd; @@ -138,7 +138,7 @@ Cmd_Command (cbuf_args_t *args) } /* Registers a command and handler function */ -int +VISIBLE int Cmd_AddCommand (const char *cmd_name, xcommand_t function, const char *description) { @@ -167,7 +167,7 @@ Cmd_AddCommand (const char *cmd_name, xcommand_t function, } /* Unregisters a command */ -int +VISIBLE int Cmd_RemoveCommand (const char *name) { cmd_function_t *cmd; @@ -185,7 +185,7 @@ Cmd_RemoveCommand (const char *name) } /* Checks for the existance of a command */ -qboolean +VISIBLE qboolean Cmd_Exists (const char *cmd_name) { cmd_function_t *cmd; @@ -201,7 +201,7 @@ Cmd_Exists (const char *cmd_name) /* Command completion functions */ -const char * +VISIBLE const char * Cmd_CompleteCommand (const char *partial) { cmd_function_t *cmd; @@ -233,7 +233,7 @@ Cmd_CompleteCommand (const char *partial) Thanks to Fett erich@heintz.com Thanks to taniwha */ -int +VISIBLE int Cmd_CompleteCountPossible (const char *partial) { cmd_function_t *cmd; @@ -262,7 +262,7 @@ Cmd_CompleteCountPossible (const char *partial) Thanks to Fett erich@heintz.com Thanks to taniwha */ -const char ** +VISIBLE const char ** Cmd_CompleteBuildList (const char *partial) { cmd_function_t *cmd; @@ -523,7 +523,7 @@ Cmd_Sleep_f (void) p->resumetime = Sys_DoubleTime() + waittime; } -void +VISIBLE void Cmd_StuffCmds (cbuf_t *cbuf) { int i, j; @@ -573,14 +573,14 @@ Cmd_StuffCmds_f (void) Cmd_StuffCmds (cbuf_active); } -void +VISIBLE void Cmd_Init_Hash (void) { cmd_hash = Hash_NewTable (1021, cmd_get_key, 0, 0); cmd_alias_hash = Hash_NewTable (1021, cmd_alias_get_key, cmd_alias_free, 0); } -void +VISIBLE void Cmd_Init (void) { Cmd_AddCommand ("stuffcmds", Cmd_StuffCmds_f, "Execute the commands given " @@ -604,7 +604,7 @@ Cmd_Init (void) cmd_cbuf = Cbuf_New (&id_interp); } -int +VISIBLE int Cmd_ExecuteString (const char *text, cmd_source_t src) { cbuf_t *old = cbuf_active; @@ -618,7 +618,7 @@ Cmd_ExecuteString (const char *text, cmd_source_t src) return 0; } -void +VISIBLE void Cmd_Exec_File (cbuf_t *cbuf, const char *path, int qfs) { char *f; diff --git a/libs/util/crc.c b/libs/util/crc.c index 25beabfb8..97f10867b 100644 --- a/libs/util/crc.c +++ b/libs/util/crc.c @@ -76,19 +76,19 @@ static unsigned short crctable[256] = { }; -void +VISIBLE void CRC_Init (unsigned short *crcvalue) { *crcvalue = CRC_INIT_VALUE; } -void +VISIBLE void CRC_ProcessByte (unsigned short *crcvalue, byte data) { *crcvalue = (*crcvalue << 8) ^ crctable[(*crcvalue >> 8) ^ data]; } -void +VISIBLE void CRC_ProcessBlock (byte *start, unsigned short *crcvalue, int count) { unsigned short crc = *crcvalue; @@ -103,7 +103,7 @@ CRC_Value (unsigned short crcvalue) return crcvalue ^ CRC_XOR_VALUE; } -unsigned short +VISIBLE unsigned short CRC_Block (byte *start, int count) { unsigned short crc; diff --git a/libs/util/cvar.c b/libs/util/cvar.c index 64688cec4..dc526522d 100644 --- a/libs/util/cvar.c +++ b/libs/util/cvar.c @@ -57,21 +57,21 @@ static __attribute__ ((used)) const char rcsid[] = #define USER_RO_CVAR "User-created READ-ONLY Cvar" #define USER_CVAR "User-created cvar" -cvar_t *developer; -cvar_t *cvar_vars; -const char *cvar_null_string = ""; -cvar_alias_t *calias_vars; -hashtab_t *cvar_hash; -hashtab_t *calias_hash; +VISIBLE cvar_t *developer; +VISIBLE cvar_t *cvar_vars; +static const char *cvar_null_string = ""; +static cvar_alias_t *calias_vars; +static hashtab_t *cvar_hash; +static hashtab_t *calias_hash; -cvar_t * +VISIBLE cvar_t * Cvar_FindVar (const char *var_name) { return (cvar_t*) Hash_Find (cvar_hash, var_name); } -cvar_t * +VISIBLE cvar_t * Cvar_FindAlias (const char *alias_name) { cvar_alias_t *alias; @@ -108,7 +108,7 @@ Cvar_Alias_Get (const char *name, cvar_t *cvar) } } -float +VISIBLE float Cvar_VariableValue (const char *var_name) { cvar_t *var; @@ -121,7 +121,7 @@ Cvar_VariableValue (const char *var_name) return atof (var->string); } -const char * +VISIBLE const char * Cvar_VariableString (const char *var_name) { cvar_t *var; @@ -134,7 +134,7 @@ Cvar_VariableString (const char *var_name) return var->string; } -const char * +VISIBLE const char * Cvar_CompleteVariable (const char *partial) { cvar_t *cvar; @@ -176,7 +176,7 @@ Cvar_CompleteVariable (const char *partial) Added by EvilTypeGuy Thanks to Fett erich@heintz.com */ -int +VISIBLE int Cvar_CompleteCountPossible (const char *partial) { cvar_t *cvar; @@ -205,7 +205,7 @@ Cvar_CompleteCountPossible (const char *partial) Thanks to Fett erich@heintz.com Thanks to taniwha */ -const char ** +VISIBLE const char ** Cvar_CompleteBuildList (const char *partial) { cvar_t *cvar; @@ -227,7 +227,7 @@ Cvar_CompleteBuildList (const char *partial) return buf; } -void +VISIBLE void Cvar_Set (cvar_t *var, const char *value) { int changed; @@ -282,7 +282,7 @@ Cvar_SetROM (cvar_t *var, const char *value) var->callback (var); } -void +VISIBLE void Cvar_SetValue (cvar_t *var, float value) { Cvar_Set (var, va ("%g", value)); @@ -293,7 +293,7 @@ Cvar_SetValue (cvar_t *var, float value) Handles variable inspection and changing from the console */ -qboolean +VISIBLE qboolean Cvar_Command (void) { cvar_t *v; @@ -321,7 +321,7 @@ Cvar_Command (void) Writes lines containing "seta variable value" for all variables with the archive flag set to true. */ -void +VISIBLE void Cvar_WriteVariables (QFile *f) { cvar_t *var; @@ -465,14 +465,14 @@ calias_get_key (void *c, void *unused) return calias->name; } -void +VISIBLE void Cvar_Init_Hash (void) { cvar_hash = Hash_NewTable (1021, cvar_get_key, cvar_free, 0); calias_hash = Hash_NewTable (1021, calias_get_key, calias_free, 0); } -void +VISIBLE void Cvar_Init (void) { developer = Cvar_Get ("developer", "0", CVAR_NONE, NULL, @@ -515,7 +515,7 @@ Cvar_Shutdown (void) } } -cvar_t * +VISIBLE cvar_t * Cvar_Get (const char *name, const char *string, int cvarflags, void (*callback)(cvar_t*), const char *description) { @@ -570,7 +570,7 @@ Cvar_Get (const char *name, const char *string, int cvarflags, sets a Cvar's flags simply and easily */ -void +VISIBLE void Cvar_SetFlags (cvar_t *var, int cvarflags) { if (var == NULL) diff --git a/libs/util/dstring.c b/libs/util/dstring.c index d3224364e..383594532 100644 --- a/libs/util/dstring.c +++ b/libs/util/dstring.c @@ -57,7 +57,7 @@ dstring_realloc (void *data, void *ptr, size_t size) return realloc (ptr, size); } -dstring_mem_t dstring_default_mem = { +VISIBLE dstring_mem_t dstring_default_mem = { dstring_alloc, dstring_free, dstring_realloc, @@ -77,13 +77,13 @@ _dstring_new (dstring_mem_t *mem) return new; } -dstring_t * +VISIBLE dstring_t * dstring_new (void) { return _dstring_new (&dstring_default_mem); } -void +VISIBLE void dstring_delete (dstring_t *dstr) { if (dstr->str) @@ -91,7 +91,7 @@ dstring_delete (dstring_t *dstr) dstr->mem->free (dstr->mem->data, dstr); } -inline void +VISIBLE inline void dstring_adjust (dstring_t *dstr) { if (dstr->size > dstr->truesize) { @@ -103,7 +103,7 @@ dstring_adjust (dstring_t *dstr) } } -void +VISIBLE void dstring_copy (dstring_t *dstr, const char *data, unsigned int len) { dstr->size = len; @@ -111,7 +111,7 @@ dstring_copy (dstring_t *dstr, const char *data, unsigned int len) memcpy (dstr->str, data, len); } -void +VISIBLE void dstring_append (dstring_t *dstr, const char *data, unsigned int len) { unsigned int ins = dstr->size; // Save insertion point @@ -121,7 +121,7 @@ dstring_append (dstring_t *dstr, const char *data, unsigned int len) memcpy (dstr->str + ins, data, len); } -void +VISIBLE void dstring_insert (dstring_t *dstr, unsigned int pos, const char *data, unsigned int len) { @@ -135,7 +135,7 @@ dstring_insert (dstring_t *dstr, unsigned int pos, const char *data, memcpy (dstr->str + pos, data, len); } -void +VISIBLE void dstring_snip (dstring_t *dstr, unsigned int pos, unsigned int len) { if (pos > dstr->size) @@ -149,14 +149,14 @@ dstring_snip (dstring_t *dstr, unsigned int pos, unsigned int len) dstring_adjust (dstr); } -void +VISIBLE void dstring_clear (dstring_t *dstr) { dstr->size = 0; dstring_adjust (dstr); } -void +VISIBLE void dstring_replace (dstring_t *dstr, unsigned int pos, unsigned int rlen, const char *data, unsigned int len) { @@ -179,7 +179,7 @@ dstring_replace (dstring_t *dstr, unsigned int pos, unsigned int rlen, memcpy (dstr->str + pos, data, len); } -char * +VISIBLE char * dstring_freeze (dstring_t *dstr) { char *str = dstr->mem->realloc (dstr->mem->data, dstr->str, dstr->size); @@ -187,7 +187,7 @@ dstring_freeze (dstring_t *dstr) return str; } -inline dstring_t * +VISIBLE inline dstring_t * _dstring_newstr (dstring_mem_t *mem) { dstring_t *new; @@ -203,13 +203,13 @@ _dstring_newstr (dstring_mem_t *mem) return new; } -dstring_t * +VISIBLE dstring_t * dstring_newstr (void) { return _dstring_newstr (&dstring_default_mem); } -void +VISIBLE void dstring_copystr (dstring_t *dstr, const char *str) { dstr->size = strlen (str) + 1; @@ -217,7 +217,7 @@ dstring_copystr (dstring_t *dstr, const char *str) strcpy (dstr->str, str); } -void +VISIBLE void dstring_copysubstr (dstring_t *dstr, const char *str, unsigned int len) { len = strnlen (str, len); @@ -228,7 +228,7 @@ dstring_copysubstr (dstring_t *dstr, const char *str, unsigned int len) dstr->str[len] = 0; } -void +VISIBLE void dstring_appendstr (dstring_t *dstr, const char *str) { unsigned int pos = strnlen (dstr->str, dstr->size); @@ -239,7 +239,7 @@ dstring_appendstr (dstring_t *dstr, const char *str) strcpy (dstr->str + pos, str); } -void +VISIBLE void dstring_appendsubstr (dstring_t *dstr, const char *str, unsigned int len) { unsigned int pos = strnlen (dstr->str, dstr->size); @@ -251,14 +251,14 @@ dstring_appendsubstr (dstring_t *dstr, const char *str, unsigned int len) dstr->str[pos + len] = 0; } -void +VISIBLE void dstring_insertstr (dstring_t *dstr, unsigned int pos, const char *str) { // Don't insert strlen + 1 to achieve concatenation dstring_insert (dstr, pos, str, strlen (str)); } -void +VISIBLE void dstring_insertsubstr (dstring_t *dstr, unsigned int pos, const char *str, unsigned int len) { @@ -267,7 +267,7 @@ dstring_insertsubstr (dstring_t *dstr, unsigned int pos, const char *str, dstring_insert (dstr, pos, str, len); } -void +VISIBLE void dstring_clearstr (dstring_t *dstr) { dstr->size = 1; @@ -316,13 +316,13 @@ _dvsprintf (dstring_t *dstr, int offs, const char *fmt, va_list args) return size; } -int +VISIBLE int dvsprintf (dstring_t *dstr, const char *fmt, va_list args) { return _dvsprintf (dstr, 0, fmt, args); } -int +VISIBLE int dsprintf (dstring_t *dstr, const char *fmt, ...) { va_list args; @@ -335,7 +335,7 @@ dsprintf (dstring_t *dstr, const char *fmt, ...) return ret; } -int +VISIBLE int davsprintf (dstring_t *dstr, const char *fmt, va_list args) { int offs = 0; @@ -345,7 +345,7 @@ davsprintf (dstring_t *dstr, const char *fmt, va_list args) return _dvsprintf (dstr, offs, fmt, args); } -int +VISIBLE int dasprintf (dstring_t *dstr, const char *fmt, ...) { va_list args; diff --git a/libs/util/hash.c b/libs/util/hash.c index 2c2b36765..f1a9e2066 100644 --- a/libs/util/hash.c +++ b/libs/util/hash.c @@ -93,7 +93,7 @@ free_hashlink (hashlink_t *link) free_hashlinks = link; } -unsigned long +VISIBLE unsigned long Hash_String (const char *str) { #if 0 @@ -119,7 +119,7 @@ Hash_String (const char *str) #endif } -unsigned long +VISIBLE unsigned long Hash_Buffer (const void *_buf, int len) { const unsigned char *buf = _buf; @@ -182,7 +182,7 @@ get_index (unsigned long hash, size_t size, size_t bits) #endif } -hashtab_t * +VISIBLE hashtab_t * Hash_NewTable (int tsize, const char *(*gk)(void*,void*), void (*f)(void*,void*), void *ud) { @@ -204,7 +204,7 @@ Hash_NewTable (int tsize, const char *(*gk)(void*,void*), return tab; } -void +VISIBLE void Hash_SetHashCompare (hashtab_t *tab, unsigned long (*gh)(void*,void*), int (*cmp)(void*,void*,void*)) { @@ -212,14 +212,14 @@ Hash_SetHashCompare (hashtab_t *tab, unsigned long (*gh)(void*,void*), tab->compare = cmp; } -void +VISIBLE void Hash_DelTable (hashtab_t *tab) { Hash_FlushTable (tab); free (tab); } -void +VISIBLE void Hash_FlushTable (hashtab_t *tab) { size_t i; @@ -238,7 +238,7 @@ Hash_FlushTable (hashtab_t *tab) tab->num_ele = 0; } -int +VISIBLE int Hash_Add (hashtab_t *tab, void *ele) { unsigned long h = Hash_String (tab->get_key(ele, tab->user_data)); @@ -257,7 +257,7 @@ Hash_Add (hashtab_t *tab, void *ele) return 0; } -int +VISIBLE int Hash_AddElement (hashtab_t *tab, void *ele) { unsigned long h = tab->get_hash (ele, tab->user_data); @@ -276,7 +276,7 @@ Hash_AddElement (hashtab_t *tab, void *ele) return 0; } -void * +VISIBLE void * Hash_Find (hashtab_t *tab, const char *key) { unsigned long h = Hash_String (key); @@ -291,7 +291,7 @@ Hash_Find (hashtab_t *tab, const char *key) return 0; } -void * +VISIBLE void * Hash_FindElement (hashtab_t *tab, void *ele) { unsigned long h = tab->get_hash (ele, tab->user_data); @@ -306,7 +306,7 @@ Hash_FindElement (hashtab_t *tab, void *ele) return 0; } -void ** +VISIBLE void ** Hash_FindList (hashtab_t *tab, const char *key) { unsigned long h = Hash_String (key); @@ -334,7 +334,7 @@ Hash_FindList (hashtab_t *tab, const char *key) return list; } -void ** +VISIBLE void ** Hash_FindElementList (hashtab_t *tab, void *ele) { unsigned long h = tab->get_hash (ele, tab->user_data); @@ -362,7 +362,7 @@ Hash_FindElementList (hashtab_t *tab, void *ele) return list; } -void * +VISIBLE void * Hash_Del (hashtab_t *tab, const char *key) { unsigned long h = Hash_String (key); @@ -385,7 +385,7 @@ Hash_Del (hashtab_t *tab, const char *key) return 0; } -void * +VISIBLE void * Hash_DelElement (hashtab_t *tab, void *ele) { unsigned long h = tab->get_hash (ele, tab->user_data); @@ -408,20 +408,20 @@ Hash_DelElement (hashtab_t *tab, void *ele) return 0; } -void +VISIBLE void Hash_Free (hashtab_t *tab, void *ele) { if (ele && tab->free_ele) tab->free_ele (ele, tab->user_data); } -size_t +VISIBLE size_t Hash_NumElements (hashtab_t *tab) { return tab->num_ele; } -void ** +VISIBLE void ** Hash_GetList (hashtab_t *tab) { void **list; @@ -448,7 +448,7 @@ sqr (double x) return x * x; } -void +VISIBLE void Hash_Stats (hashtab_t *tab) { int *lengths = calloc (tab->tab_size, sizeof (int)); diff --git a/libs/util/idparse.c b/libs/util/idparse.c index 3b867c5a7..107fd4060 100644 --- a/libs/util/idparse.c +++ b/libs/util/idparse.c @@ -91,7 +91,7 @@ COM_insert (cbuf_t *cbuf, const char *str) static dstring_t *_com_token; const char *com_token; -const char * +VISIBLE const char * COM_Parse (const char *data) { int c; @@ -138,7 +138,7 @@ done: return data + i; } -void +VISIBLE void COM_TokenizeString (const char *str, cbuf_args_t *args) { const char *s; @@ -236,7 +236,7 @@ COM_execute_sets (cbuf_t *cbuf) } } -cbuf_interpreter_t id_interp = { +VISIBLE cbuf_interpreter_t id_interp = { COM_construct, COM_destruct, COM_reset, diff --git a/libs/util/info.c b/libs/util/info.c index 814705ab5..d35ca9ee7 100644 --- a/libs/util/info.c +++ b/libs/util/info.c @@ -53,7 +53,7 @@ static __attribute__ ((used)) const char rcsid[] = Searches for key in the "client-needed" info string list */ -qboolean +VISIBLE qboolean Info_FilterForKey (const char *key, const char **filter_list) { const char **s; @@ -73,7 +73,7 @@ Info_FilterForKey (const char *key, const char **filter_list) Searches the string for the given key and returns the associated value, or an empty string. */ -const char * +VISIBLE const char * Info_ValueForKey (info_t *info, const char *key) { info_key_t *k = Hash_Find (info->tab, key); @@ -82,7 +82,7 @@ Info_ValueForKey (info_t *info, const char *key) return ""; } -void +VISIBLE void Info_RemoveKey (info_t *info, const char *key) { info_key_t *k = Hash_Del (info->tab, key); @@ -94,7 +94,7 @@ Info_RemoveKey (info_t *info, const char *key) } } -int +VISIBLE int Info_SetValueForStarKey (info_t *info, const char *key, const char *value, int flags) { @@ -159,7 +159,7 @@ Info_SetValueForStarKey (info_t *info, const char *key, const char *value, return 1; } -int +VISIBLE int Info_SetValueForKey (info_t *info, const char *key, const char *value, int flags) { @@ -171,7 +171,7 @@ Info_SetValueForKey (info_t *info, const char *key, const char *value, return Info_SetValueForStarKey (info, key, value, flags); } -void +VISIBLE void Info_Print (info_t *info) { info_key_t **key_list; @@ -200,7 +200,7 @@ free_key (void *_k, void *unused) free (k); } -info_t * +VISIBLE info_t * Info_ParseString (const char *s, int maxsize, int flags) { info_t *info; @@ -235,14 +235,14 @@ Info_ParseString (const char *s, int maxsize, int flags) return info; } -void +VISIBLE void Info_Destroy (info_t *info) { Hash_DelTable (info->tab); free (info); } -char * +VISIBLE char * Info_MakeString (info_t *info, int (*filter) (const char *)) { char *string; @@ -271,7 +271,7 @@ Info_MakeString (info_t *info, int (*filter) (const char *)) return string; } -void +VISIBLE void Info_AddKeys (info_t *info, info_t *keys) { info_key_t **key_list; diff --git a/libs/util/link.c b/libs/util/link.c index f15d174b9..1cdddb466 100644 --- a/libs/util/link.c +++ b/libs/util/link.c @@ -35,20 +35,20 @@ static __attribute__ ((used)) const char rcsid[] = // ClearLink is used for new headnodes -void +VISIBLE void ClearLink (link_t *l) { l->prev = l->next = l; } -void +VISIBLE void RemoveLink (link_t *l) { l->next->prev = l->prev; l->prev->next = l->next; } -void +VISIBLE void InsertLinkBefore (link_t *l, link_t *before) { l->next = before; @@ -57,7 +57,7 @@ InsertLinkBefore (link_t *l, link_t *before) l->next->prev = l; } -void +VISIBLE void InsertLinkAfter (link_t *l, link_t *after) { l->next = after->next; diff --git a/libs/util/llist.c b/libs/util/llist.c index b91e76a52..80d06ec8a 100644 --- a/libs/util/llist.c +++ b/libs/util/llist.c @@ -52,7 +52,7 @@ llist_newnode (llist_t *list, void *data) return node; } -llist_t * +VISIBLE llist_t * llist_new (void (*freedata)(void *element, void *userdata), qboolean (*cmpdata)(const void *element, const void *comparison, void *userdata), void *userdata) { llist_t *new = calloc (1, sizeof (llist_t)); @@ -64,7 +64,7 @@ llist_new (void (*freedata)(void *element, void *userdata), qboolean (*cmpdata)( return new; } -void +VISIBLE void llist_flush (llist_t *list) { llist_node_t *node, *next; @@ -80,7 +80,7 @@ llist_flush (llist_t *list) list->start = list->end = 0; } -void +VISIBLE void llist_delete (llist_t *list) { if (!list) @@ -90,7 +90,7 @@ llist_delete (llist_t *list) free (list); } -llist_node_t * +VISIBLE llist_node_t * llist_append (llist_t *list, void *element) { llist_node_t *node = llist_newnode (list, element); @@ -107,7 +107,7 @@ llist_append (llist_t *list, void *element) return node; } -llist_node_t * +VISIBLE llist_node_t * llist_prefix (llist_t *list, void *element) { llist_node_t *node = llist_newnode (list, element); @@ -125,7 +125,7 @@ llist_prefix (llist_t *list, void *element) return node; } -llist_node_t * +VISIBLE llist_node_t * llist_getnode (llist_t *list, void *element) { llist_node_t *node; @@ -139,7 +139,7 @@ llist_getnode (llist_t *list, void *element) return 0; } -llist_node_t * +VISIBLE llist_node_t * llist_insertafter (llist_node_t *ref, void *element) { llist_node_t *node = llist_newnode (ref->parent, element); @@ -158,7 +158,7 @@ llist_insertafter (llist_node_t *ref, void *element) return node; } -llist_node_t * +VISIBLE llist_node_t * llist_insertbefore (llist_node_t *ref, void *element) { llist_node_t *node = llist_newnode (ref->parent, element); @@ -177,7 +177,7 @@ llist_insertbefore (llist_node_t *ref, void *element) return node; } -void * +VISIBLE void * llist_remove (llist_node_t *ref) { void *element; @@ -201,7 +201,7 @@ llist_remove (llist_node_t *ref) return element; } -unsigned int +VISIBLE unsigned int llist_size (llist_t *llist) { unsigned int i; @@ -214,7 +214,7 @@ llist_size (llist_t *llist) return i; } -void +VISIBLE void llist_iterate (llist_t *list, llist_iterator_t iterate) { llist_node_t *node; @@ -229,7 +229,7 @@ llist_iterate (llist_t *list, llist_iterator_t iterate) list->iter = 0; } -void * +VISIBLE void * llist_find (llist_t *list, void *comparison) { llist_node_t *node; @@ -242,7 +242,7 @@ llist_find (llist_t *list, void *comparison) return 0; } -llist_node_t * +VISIBLE llist_node_t * llist_findnode (llist_t *list, void *comparison) { llist_node_t *node; @@ -255,7 +255,7 @@ llist_findnode (llist_t *list, void *comparison) return 0; } -void * +VISIBLE void * llist_createarray (llist_t *list, size_t esize) { void *ptr, *array = malloc (llist_size (list) * esize); diff --git a/libs/util/mathlib.c b/libs/util/mathlib.c index 652619562..020dce759 100644 --- a/libs/util/mathlib.c +++ b/libs/util/mathlib.c @@ -47,11 +47,11 @@ static __attribute__ ((used)) const char rcsid[] = #include "QF/qtypes.h" #include "QF/sys.h" -int nanmask = 255 << 23; +VISIBLE int nanmask = 255 << 23; static mplane_t _frustum[4]; -mplane_t *const frustum = _frustum; +VISIBLE mplane_t *const frustum = _frustum; static vec3_t _vec3_origin = { 0, 0, 0 }; -const vec_t * const vec3_origin = _vec3_origin; +VISIBLE const vec_t * const vec3_origin = _vec3_origin; #define DEG2RAD(a) (a * (M_PI / 180.0)) @@ -100,7 +100,7 @@ PerpendicularVector (vec3_t dst, const vec3_t src) # pragma optimize( "", off ) #endif -void +VISIBLE void VectorVectors(const vec3_t forward, vec3_t right, vec3_t up) { float d; @@ -115,7 +115,7 @@ VectorVectors(const vec3_t forward, vec3_t right, vec3_t up) CrossProduct(right, forward, up); } -void +VISIBLE void RotatePointAroundVector (vec3_t dst, const vec3_t axis, const vec3_t point, float degrees) { @@ -169,7 +169,7 @@ RotatePointAroundVector (vec3_t dst, const vec3_t axis, const vec3_t point, } } -void +VISIBLE void QuatMult (const quat_t v1, const quat_t v2, quat_t out) { vec_t s; @@ -186,7 +186,7 @@ QuatMult (const quat_t v1, const quat_t v2, quat_t out) # pragma optimize( "", on ) #endif -float +VISIBLE float anglemod (float a) { a = (360.0 / 65536) * ((int) (a * (65536 / 360.0)) & 65535); @@ -199,7 +199,7 @@ anglemod (float a) Split out like this for ASM to call. */ void __attribute__ ((noreturn)) BOPS_Error (void); -void __attribute__ ((noreturn)) +VISIBLE void __attribute__ ((noreturn)) BOPS_Error (void) { Sys_Error ("BoxOnPlaneSide: Bad signbits"); @@ -212,7 +212,7 @@ BOPS_Error (void) Returns 1, 2, or 1 + 2 */ -int +VISIBLE int BoxOnPlaneSide (const vec3_t emins, const vec3_t emaxs, mplane_t *p) { float dist1, dist2; @@ -353,7 +353,7 @@ BoxOnPlaneSide (const vec3_t emins, const vec3_t emaxs, mplane_t *p) [-right] -ve due to left handed to right handed conversion [up] */ -void +VISIBLE void AngleVectors (const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up) { float angle, sr, sp, sy, cr, cp, cy; @@ -381,7 +381,7 @@ AngleVectors (const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up) up[2] = cr * cp; } -int +VISIBLE int _VectorCompare (const vec3_t v1, const vec3_t v2) { int i; @@ -393,7 +393,7 @@ _VectorCompare (const vec3_t v1, const vec3_t v2) return 1; } -void +VISIBLE void _VectorMA (const vec3_t veca, float scale, const vec3_t vecb, vec3_t vecc) { vecc[0] = veca[0] + scale * vecb[0]; @@ -401,13 +401,13 @@ _VectorMA (const vec3_t veca, float scale, const vec3_t vecb, vec3_t vecc) vecc[2] = veca[2] + scale * vecb[2]; } -vec_t +VISIBLE vec_t _DotProduct (const vec3_t v1, const vec3_t v2) { return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2]; } -void +VISIBLE void _VectorSubtract (const vec3_t veca, const vec3_t vecb, vec3_t out) { out[0] = veca[0] - vecb[0]; @@ -415,7 +415,7 @@ _VectorSubtract (const vec3_t veca, const vec3_t vecb, vec3_t out) out[2] = veca[2] - vecb[2]; } -void +VISIBLE void _VectorAdd (const vec3_t veca, const vec3_t vecb, vec3_t out) { out[0] = veca[0] + vecb[0]; @@ -423,7 +423,7 @@ _VectorAdd (const vec3_t veca, const vec3_t vecb, vec3_t out) out[2] = veca[2] + vecb[2]; } -void +VISIBLE void _VectorCopy (const vec3_t in, vec3_t out) { out[0] = in[0]; @@ -431,7 +431,7 @@ _VectorCopy (const vec3_t in, vec3_t out) out[2] = in[2]; } -void +VISIBLE void CrossProduct (const vec3_t v1, const vec3_t v2, vec3_t cross) { float v10 = v1[0]; @@ -446,7 +446,7 @@ CrossProduct (const vec3_t v1, const vec3_t v2, vec3_t cross) cross[2] = v10 * v21 - v11 * v20; } -vec_t +VISIBLE vec_t _VectorLength (const vec3_t v) { float length; @@ -455,7 +455,7 @@ _VectorLength (const vec3_t v) return length; } -vec_t +VISIBLE vec_t _VectorNormalize (vec3_t v) { int i; @@ -474,15 +474,7 @@ _VectorNormalize (vec3_t v) return length; } -void -VectorInverse (vec3_t v) -{ - v[0] = -v[0]; - v[1] = -v[1]; - v[2] = -v[2]; -} - -void +VISIBLE void _VectorScale (const vec3_t in, vec_t scale, vec3_t out) { out[0] = in[0] * scale; @@ -490,7 +482,7 @@ _VectorScale (const vec3_t in, vec_t scale, vec3_t out) out[2] = in[2] * scale; } -int +VISIBLE int Q_log2 (int val) { int answer = 0; @@ -500,7 +492,7 @@ Q_log2 (int val) return answer; } -void +VISIBLE void R_ConcatRotations (float in1[3][3], float in2[3][3], float out[3][3]) { out[0][0] = in1[0][0] * in2[0][0] + in1[0][1] * in2[1][0] + @@ -523,7 +515,7 @@ R_ConcatRotations (float in1[3][3], float in2[3][3], float out[3][3]) in1[2][2] * in2[2][2]; } -void +VISIBLE void R_ConcatTransforms (float in1[3][4], float in2[3][4], float out[3][4]) { out[0][0] = in1[0][0] * in2[0][0] + in1[0][1] * in2[1][0] + @@ -559,7 +551,7 @@ R_ConcatTransforms (float in1[3][4], float in2[3][4], float out[3][4]) numer and denom, both of which should contain no fractional part. The quotient must fit in 32 bits. */ -void +VISIBLE void FloorDivMod (double numer, double denom, int *quotient, int *rem) { double x; @@ -594,7 +586,7 @@ FloorDivMod (double numer, double denom, int *quotient, int *rem) *rem = r; } -int +VISIBLE int GreatestCommonDivisor (int i1, int i2) { if (i1 > i2) { @@ -614,7 +606,7 @@ GreatestCommonDivisor (int i1, int i2) Inverts an 8.24 value to a 16.16 value */ -fixed16_t +VISIBLE fixed16_t Invert24To16 (fixed16_t val) { if (val < 256) diff --git a/libs/util/mdfour.c b/libs/util/mdfour.c index e390adfa0..7774fbfa8 100644 --- a/libs/util/mdfour.c +++ b/libs/util/mdfour.c @@ -175,7 +175,7 @@ copy4 (unsigned char *out, uint32 x) out[3] = (x >> 24) & 0xFF; } -void +VISIBLE void mdfour_begin (struct mdfour *md) { md->A = 0x67452301; @@ -214,7 +214,7 @@ mdfour_tail (const unsigned char *in, int n) } } -void +VISIBLE void mdfour_update (struct mdfour *md, const unsigned char *in, int n) { uint32 M[16]; @@ -235,7 +235,7 @@ mdfour_update (struct mdfour *md, const unsigned char *in, int n) mdfour_tail (in, n); } -void +VISIBLE void mdfour_result (struct mdfour *md, unsigned char *out) { m = md; @@ -246,7 +246,7 @@ mdfour_result (struct mdfour *md, unsigned char *out) copy4 (out + 12, m->D); } -void +VISIBLE void mdfour (unsigned char *out, const unsigned char *in, int n) { struct mdfour md; diff --git a/libs/util/msg.c b/libs/util/msg.c index babf4b629..d0fd99539 100644 --- a/libs/util/msg.c +++ b/libs/util/msg.c @@ -52,7 +52,7 @@ static __attribute__ ((used)) const char rcsid[] = // writing functions ========================================================== -void +VISIBLE void MSG_WriteByte (sizebuf_t *sb, int c) { byte *buf; @@ -61,7 +61,7 @@ MSG_WriteByte (sizebuf_t *sb, int c) *buf = c; } -void +VISIBLE void MSG_WriteShort (sizebuf_t *sb, int c) { byte *buf; @@ -71,7 +71,7 @@ MSG_WriteShort (sizebuf_t *sb, int c) *buf = ((unsigned int) c) >> 8; } -void +VISIBLE void MSG_WriteLong (sizebuf_t *sb, int c) { byte *buf; @@ -83,7 +83,7 @@ MSG_WriteLong (sizebuf_t *sb, int c) *buf = ((unsigned int) c) >> 24; } -void +VISIBLE void MSG_WriteFloat (sizebuf_t *sb, float f) { union { @@ -97,7 +97,7 @@ MSG_WriteFloat (sizebuf_t *sb, float f) SZ_Write (sb, &dat.l, 4); } -void +VISIBLE void MSG_WriteString (sizebuf_t *sb, const char *s) { if (!s) @@ -106,13 +106,13 @@ MSG_WriteString (sizebuf_t *sb, const char *s) SZ_Write (sb, s, strlen (s) + 1); } -void +VISIBLE void MSG_WriteCoord (sizebuf_t *sb, float coord) { MSG_WriteShort (sb, (int) (coord * 8.0)); } -void +VISIBLE void MSG_WriteCoordV (sizebuf_t *sb, const vec3_t coord) { byte *buf; @@ -126,7 +126,7 @@ MSG_WriteCoordV (sizebuf_t *sb, const vec3_t coord) } } -void +VISIBLE void MSG_WriteCoordAngleV (sizebuf_t *sb, const vec3_t coord, const vec3_t angles) { byte *buf; @@ -141,13 +141,13 @@ MSG_WriteCoordAngleV (sizebuf_t *sb, const vec3_t coord, const vec3_t angles) } } -void +VISIBLE void MSG_WriteAngle (sizebuf_t *sb, float angle) { MSG_WriteByte (sb, (int) (angle * (256.0 / 360.0)) & 255); } -void +VISIBLE void MSG_WriteAngleV (sizebuf_t *sb, const vec3_t angles) { byte *buf; @@ -159,13 +159,13 @@ MSG_WriteAngleV (sizebuf_t *sb, const vec3_t angles) } } -void +VISIBLE void MSG_WriteAngle16 (sizebuf_t *sb, float angle16) { MSG_WriteShort (sb, (int) (angle16 * (65536.0 / 360.0)) & 65535); } -void +VISIBLE void MSG_WriteUTF8 (sizebuf_t *sb, unsigned utf8) { byte *buf; @@ -206,20 +206,20 @@ MSG_WriteUTF8 (sizebuf_t *sb, unsigned utf8) // reading functions ========================================================== -void +VISIBLE void MSG_BeginReading (qmsg_t *msg) { msg->readcount = 0; msg->badread = false; } -int +VISIBLE int MSG_GetReadCount (qmsg_t *msg) { return msg->readcount; } -int +VISIBLE int MSG_ReadByte (qmsg_t *msg) { if (msg->readcount + 1 <= msg->message->cursize) @@ -229,7 +229,7 @@ MSG_ReadByte (qmsg_t *msg) return -1; } -int +VISIBLE int MSG_ReadShort (qmsg_t *msg) { int c; @@ -245,7 +245,7 @@ MSG_ReadShort (qmsg_t *msg) return -1; } -int +VISIBLE int MSG_ReadLong (qmsg_t *msg) { int c; @@ -263,7 +263,7 @@ MSG_ReadLong (qmsg_t *msg) return -1; } -float +VISIBLE float MSG_ReadFloat (qmsg_t *msg) { union { @@ -289,7 +289,7 @@ MSG_ReadFloat (qmsg_t *msg) return -1; } -const char * +VISIBLE const char * MSG_ReadString (qmsg_t *msg) { char *string; @@ -324,7 +324,7 @@ MSG_ReadString (qmsg_t *msg) return string; } -int +VISIBLE int MSG_ReadBytes (qmsg_t *msg, void *buf, int len) { if (msg->badread || len > msg->message->cursize - msg->readcount) { @@ -336,13 +336,13 @@ MSG_ReadBytes (qmsg_t *msg, void *buf, int len) return len; } -float +VISIBLE float MSG_ReadCoord (qmsg_t *msg) { return MSG_ReadShort (msg) * (1.0 / 8.0); } -void +VISIBLE void MSG_ReadCoordV (qmsg_t *msg, vec3_t coord) { int i; @@ -351,7 +351,7 @@ MSG_ReadCoordV (qmsg_t *msg, vec3_t coord) coord[i] = MSG_ReadShort (msg) * (1.0 / 8.0); } -void +VISIBLE void MSG_ReadCoordAngleV (qmsg_t *msg, vec3_t coord, vec3_t angles) { int i; @@ -362,13 +362,13 @@ MSG_ReadCoordAngleV (qmsg_t *msg, vec3_t coord, vec3_t angles) } } -float +VISIBLE float MSG_ReadAngle (qmsg_t *msg) { return ((signed char) MSG_ReadByte (msg)) * (360.0 / 256.0); } -void +VISIBLE void MSG_ReadAngleV (qmsg_t *msg, vec3_t angles) { int i; @@ -377,13 +377,13 @@ MSG_ReadAngleV (qmsg_t *msg, vec3_t angles) angles[i] = ((signed char) MSG_ReadByte (msg)) * (360.0 / 256.0); } -float +VISIBLE float MSG_ReadAngle16 (qmsg_t *msg) { return MSG_ReadShort (msg) * (360.0 / 65536.0); } -int +VISIBLE int MSG_ReadUTF8 (qmsg_t *msg) { byte *buf, *start, c; diff --git a/libs/util/pakfile.c b/libs/util/pakfile.c index 0167fb3d8..844e0337a 100644 --- a/libs/util/pakfile.c +++ b/libs/util/pakfile.c @@ -54,7 +54,7 @@ pack_get_key (void *p, void *unused) return ((dpackfile_t *) p)->name; } -pack_t * +VISIBLE pack_t * pack_new (const char *name) { pack_t *pack = calloc (sizeof (*pack), 1); @@ -75,7 +75,7 @@ pack_new (const char *name) return pack; } -void +VISIBLE void pack_del (pack_t *pack) { if (pack->files) @@ -89,7 +89,7 @@ pack_del (pack_t *pack) free (pack); } -void +VISIBLE void pack_rehash (pack_t *pack) { int i; @@ -99,7 +99,7 @@ pack_rehash (pack_t *pack) } } -pack_t * +VISIBLE pack_t * pack_open (const char *name) { pack_t *pack = pack_new (name); @@ -148,7 +148,7 @@ error: return 0; } -pack_t * +VISIBLE pack_t * pack_create (const char *name) { pack_t *pack = pack_new (name); @@ -168,7 +168,7 @@ pack_create (const char *name) return pack; } -void +VISIBLE void pack_close (pack_t *pack) { int i; @@ -196,7 +196,7 @@ pack_close (pack_t *pack) pack_del (pack); } -int +VISIBLE int pack_add (pack_t *pack, const char *filename) { dpackfile_t *pf; @@ -249,7 +249,7 @@ pack_add (pack_t *pack, const char *filename) return 0; } -int +VISIBLE int pack_extract (pack_t *pack, dpackfile_t *pf) { const char *name = pf->name; @@ -276,7 +276,7 @@ pack_extract (pack_t *pack, dpackfile_t *pf) return 0; } -dpackfile_t * +VISIBLE dpackfile_t * pack_find_file (pack_t *pack, const char *filename) { return Hash_Find (pack->file_hash, filename); diff --git a/libs/util/plugin.c b/libs/util/plugin.c index 94e24c273..d0b63ddfe 100644 --- a/libs/util/plugin.c +++ b/libs/util/plugin.c @@ -234,7 +234,7 @@ PI_Plugin_Unload_f (void) Eventually this function will likely initialize libltdl. It doesn't, yet, since we aren't using libltdl yet. */ -void +VISIBLE void PI_Init (void) { PI_InitCvars (); @@ -262,7 +262,7 @@ PI_Shutdown (void) } -plugin_t * +VISIBLE plugin_t * PI_LoadPlugin (const char *type, const char *name) { char realname[4096]; @@ -378,7 +378,7 @@ PI_LoadPlugin (const char *type, const char *name) return plugin; } -qboolean +VISIBLE qboolean PI_UnloadPlugin (plugin_t *plugin) { if (plugin @@ -399,7 +399,7 @@ PI_UnloadPlugin (plugin_t *plugin) return pi_close_lib (plugin->handle); } -void +VISIBLE void PI_RegisterPlugins (plugin_list_t *plugins) { while (plugins->name) diff --git a/libs/util/qargs.c b/libs/util/qargs.c index 92f153018..b1cffca31 100644 --- a/libs/util/qargs.c +++ b/libs/util/qargs.c @@ -59,11 +59,11 @@ static const char *safeargvs[] = #define NUM_SAFE_ARGVS ((int) (sizeof(safeargvs)/sizeof(safeargvs[0]))) -int com_argc; -const char **com_argv; +VISIBLE int com_argc; +VISIBLE const char **com_argv; const char *com_cmdline; -qboolean nouse = false; // 1999-10-29 +USE fix by Maddes +VISIBLE qboolean nouse = false; // 1999-10-29 +USE fix by Maddes /* @@ -72,7 +72,7 @@ qboolean nouse = false; // 1999-10-29 +USE fix by Maddes Returns the position (1 to argc-1) in the program's argument list where the given parameter apears, or 0 if not present */ -int +VISIBLE int COM_CheckParm (const char *parm) { int i; @@ -88,7 +88,7 @@ COM_CheckParm (const char *parm) return 0; } -void +VISIBLE void COM_InitArgv (int argc, const char **argv) { qboolean safe; diff --git a/libs/util/qendian.c b/libs/util/qendian.c index 0d994c42e..e8c9cd93a 100644 --- a/libs/util/qendian.c +++ b/libs/util/qendian.c @@ -44,13 +44,13 @@ static __attribute__ ((used)) const char rcsid[] = */ #ifndef WORDS_BIGENDIAN -qboolean bigendien = false;; +VISIBLE qboolean bigendien = false;; #else -qboolean bigendien = true;; +VISIBLE qboolean bigendien = true;; #endif -short +VISIBLE short ShortSwap (short l) { byte b1, b2; @@ -61,13 +61,13 @@ ShortSwap (short l) return (b1 << 8) + b2; } -short +VISIBLE short ShortNoSwap (short l) { return l; } -int +VISIBLE int LongSwap (int l) { byte b1, b2, b3, b4; @@ -80,13 +80,13 @@ LongSwap (int l) return ((int) b1 << 24) + ((int) b2 << 16) + ((int) b3 << 8) + b4; } -int +VISIBLE int LongNoSwap (int l) { return l; } -float +VISIBLE float FloatSwap (float f) { union { @@ -102,7 +102,7 @@ FloatSwap (float f) return dat2.f; } -float +VISIBLE float FloatNoSwap (float f) { return f; diff --git a/libs/util/qfplist.c b/libs/util/qfplist.c index 5e3d2b929..e19a2e3a6 100644 --- a/libs/util/qfplist.c +++ b/libs/util/qfplist.c @@ -96,7 +96,7 @@ PL_NewItem (pltype_t type) return item; } -plitem_t * +VISIBLE plitem_t * PL_NewDictionary (void) { plitem_t *item = PL_NewItem (QFDictionary); @@ -105,7 +105,7 @@ PL_NewDictionary (void) return item; } -plitem_t * +VISIBLE plitem_t * PL_NewArray (void) { plitem_t *item = PL_NewItem (QFArray); @@ -114,7 +114,7 @@ PL_NewArray (void) return item; } -plitem_t * +VISIBLE plitem_t * PL_NewData (void *data, int size) { plitem_t *item = PL_NewItem (QFBinary); @@ -133,13 +133,13 @@ new_string (char *str) return item; } -plitem_t * +VISIBLE plitem_t * PL_NewString (const char *str) { return new_string (strdup (str)); } -void +VISIBLE void PL_Free (plitem_t *item) { switch (item->type) { @@ -170,7 +170,7 @@ PL_Free (plitem_t *item) free (item); } -const char * +VISIBLE const char * PL_String (plitem_t *string) { if (string->type != QFString) @@ -178,7 +178,7 @@ PL_String (plitem_t *string) return string->data; } -plitem_t * +VISIBLE plitem_t * PL_ObjectForKey (plitem_t *dict, const char *key) { hashtab_t *table = (hashtab_t *) dict->data; @@ -191,7 +191,7 @@ PL_ObjectForKey (plitem_t *dict, const char *key) return k ? k->value : NULL; } -plitem_t * +VISIBLE plitem_t * PL_RemoveObjectForKey (plitem_t *dict, const char *key) { hashtab_t *table = (hashtab_t *) dict->data; @@ -210,7 +210,7 @@ PL_RemoveObjectForKey (plitem_t *dict, const char *key) return value; } -plitem_t * +VISIBLE plitem_t * PL_D_AllKeys (plitem_t *dict) { void **list, **l; @@ -234,7 +234,7 @@ PL_D_AllKeys (plitem_t *dict) return array; } -int +VISIBLE int PL_D_NumKeys (plitem_t *dict) { if (dict->type != QFDictionary) @@ -242,7 +242,7 @@ PL_D_NumKeys (plitem_t *dict) return Hash_NumElements ((hashtab_t *) dict->data); } -plitem_t * +VISIBLE plitem_t * PL_ObjectAtIndex (plitem_t *array, int index) { plarray_t *arr = (plarray_t *) array->data; @@ -253,7 +253,7 @@ PL_ObjectAtIndex (plitem_t *array, int index) return index >= 0 && index < arr->numvals ? arr->values[index] : NULL; } -qboolean +VISIBLE qboolean PL_D_AddObject (plitem_t *dict, const char *key, plitem_t *value) { dictkey_t *k; @@ -278,7 +278,7 @@ PL_D_AddObject (plitem_t *dict, const char *key, plitem_t *value) return true; } -qboolean +VISIBLE qboolean PL_A_InsertObjectAtIndex (plitem_t *array, plitem_t *item, int index) { plarray_t *arr; @@ -314,13 +314,13 @@ PL_A_InsertObjectAtIndex (plitem_t *array, plitem_t *item, int index) return true; } -qboolean +VISIBLE qboolean PL_A_AddObject (plitem_t *array, plitem_t *item) { return PL_A_InsertObjectAtIndex (array, item, -1); } -int +VISIBLE int PL_A_NumObjects (plitem_t *array) { if (array->type != QFArray) @@ -328,7 +328,7 @@ PL_A_NumObjects (plitem_t *array) return ((plarray_t *) array->data)->numvals; } -plitem_t * +VISIBLE plitem_t * PL_RemoveObjectAtIndex (plitem_t *array, int index) { plarray_t *arr; @@ -778,7 +778,7 @@ PL_ParsePropertyListItem (pldata_t *pl) } // switch } -plitem_t * +VISIBLE plitem_t * PL_GetPropertyList (const char *string) { pldata_t *pl = calloc (1, sizeof (pldata_t)); @@ -926,7 +926,7 @@ write_item (dstring_t *dstr, plitem_t *item, int level) } } -char * +VISIBLE char * PL_WritePropertyList (plitem_t *pl) { dstring_t *dstr = dstring_newstr (); @@ -938,7 +938,7 @@ PL_WritePropertyList (plitem_t *pl) return dstring_freeze (dstr); } -pltype_t +VISIBLE pltype_t PL_Type (plitem_t *item) { return item->type; diff --git a/libs/util/quakefs.c b/libs/util/quakefs.c index 88f30556c..eccac80a1 100644 --- a/libs/util/quakefs.c +++ b/libs/util/quakefs.c @@ -124,9 +124,9 @@ cvar_t *fs_userpath; cvar_t *fs_sharepath; cvar_t *fs_dirconf; -const char *qfs_userpath; +VISIBLE const char *qfs_userpath; -int qfs_filesize; +VISIBLE int qfs_filesize; searchpath_t *qfs_searchpaths; @@ -139,7 +139,7 @@ typedef struct qfs_var_s { static void QFS_AddGameDirectory (const char *dir); -gamedir_t *qfs_gamedir; +VISIBLE gamedir_t *qfs_gamedir; static plitem_t *qfs_gd_plist; static const char *qfs_game = ""; static const char *qfs_default_dirconf = @@ -567,7 +567,7 @@ no_config: qfs_gd_plist = PL_GetPropertyList (qfs_default_dirconf); } -char * +VISIBLE char * QFS_FileBase (const char *in) { const char *slash, *dot, *s; @@ -614,7 +614,7 @@ QFS_Path_f (void) The filename will be prefixed by the current game directory */ -void +VISIBLE void QFS_WriteFile (const char *filename, const void *data, int len) { QFile *f; @@ -633,7 +633,7 @@ QFS_WriteFile (const char *filename, const void *data, int len) The filename will be prefixed by the current game directory */ -void +VISIBLE void QFS_WriteBuffers (const char *filename, int count, ...) { va_list args; @@ -657,7 +657,7 @@ QFS_WriteBuffers (const char *filename, int count, ...) va_end (args); } -int +VISIBLE int QFS_CreatePath (const char *path) { char *ofs; @@ -695,7 +695,7 @@ QFS_OpenRead (const char *path, int offs, int len, int zip) return file; } -char * +VISIBLE char * QFS_CompressPath (const char *pth) { char *p, *d; @@ -769,7 +769,7 @@ contains_updir (const char *path, int levels) return 0; } -int file_from_pak; // global indicating file came from pack file ZOID +VISIBLE int file_from_pak; // global indicating file came from pack file ZOID /* QFS_FOpenFile @@ -827,7 +827,7 @@ open_file (searchpath_t *search, const char *filename, QFile **gzfile, return -1; } -int +VISIBLE int _QFS_FOpenFile (const char *filename, QFile **gzfile, dstring_t *foundname, int zip) { @@ -889,7 +889,7 @@ ok: return qfs_filesize; } -int +VISIBLE int QFS_FOpenFile (const char *filename, QFile **gzfile) { return _QFS_FOpenFile (filename, gzfile, 0, 1); @@ -905,7 +905,7 @@ int loadsize; Filename are relative to the quake directory. Always appends a 0 byte to the loaded data. */ -byte * +VISIBLE byte * QFS_LoadFile (const char *path, int usehunk) { QFile *h; @@ -949,19 +949,19 @@ QFS_LoadFile (const char *path, int usehunk) return buf; } -byte * +VISIBLE byte * QFS_LoadHunkFile (const char *path) { return QFS_LoadFile (path, 1); } -byte * +VISIBLE byte * QFS_LoadTempFile (const char *path) { return QFS_LoadFile (path, 2); } -void +VISIBLE void QFS_LoadCacheFile (const char *path, struct cache_user_s *cu) { loadcache = cu; @@ -969,7 +969,7 @@ QFS_LoadCacheFile (const char *path, struct cache_user_s *cu) } // uses temp hunk if larger than bufsize -byte * +VISIBLE byte * QFS_LoadStackFile (const char *path, void *buffer, int bufsize) { byte *buf; @@ -1167,7 +1167,7 @@ QFS_AddGameDirectory (const char *dir) Sets the gamedir and path to a different directory. */ -void +VISIBLE void QFS_Gamedir (const char *dir) { int i; @@ -1189,7 +1189,7 @@ QFS_Gamedir (const char *dir) Kludge to fix all the stuff that changing gamedirs breaks */ -void +VISIBLE void QFS_GamedirCallback (gamedir_callback_t *func) { if (num_gamedir_callbacks == MAX_GAMEDIR_CALLBACKS) { @@ -1236,7 +1236,7 @@ expand_squiggle (const char *path) return strdup (path); } -void +VISIBLE void QFS_Init (const char *game) { int i; @@ -1285,7 +1285,7 @@ QFS_Init (const char *game) } } -const char * +VISIBLE const char * QFS_SkipPath (const char *pathname) { const char *last; @@ -1299,7 +1299,7 @@ QFS_SkipPath (const char *pathname) return last; } -void +VISIBLE void QFS_StripExtension (const char *in, char *out) { char *tmp; @@ -1310,7 +1310,7 @@ QFS_StripExtension (const char *in, char *out) *tmp = 0; } -const char * +VISIBLE const char * QFS_FileExtension (const char *in) { char *tmp; @@ -1321,7 +1321,7 @@ QFS_FileExtension (const char *in) return in; } -void +VISIBLE void QFS_DefaultExtension (char *path, const char *extension) { char *src; @@ -1339,7 +1339,7 @@ QFS_DefaultExtension (char *path, const char *extension) strncat (path, extension, MAX_OSPATH - strlen (path)); } -int +VISIBLE int QFS_NextFilename (dstring_t *filename, const char *prefix, const char *ext) { char *digits; @@ -1359,7 +1359,7 @@ QFS_NextFilename (dstring_t *filename, const char *prefix, const char *ext) return 0; } -QFile * +VISIBLE QFile * QFS_Open (const char *path, const char *mode) { dstring_t *full_path = dstring_new (); @@ -1388,7 +1388,7 @@ done: return file; } -QFile * +VISIBLE QFile * QFS_WOpen (const char *path, int zip) { char mode[5] = "wb\000\000\000"; @@ -1400,7 +1400,7 @@ QFS_WOpen (const char *path, int zip) return QFS_Open (path, mode); } -int +VISIBLE int QFS_Rename (const char *old, const char *new) { dstring_t *full_old = dstring_new (); @@ -1416,7 +1416,7 @@ QFS_Rename (const char *old, const char *new) return ret; } -int +VISIBLE int QFS_Remove (const char *path) { dstring_t *full_path = dstring_new (); @@ -1428,13 +1428,13 @@ QFS_Remove (const char *path) return ret; } -filelist_t * +VISIBLE filelist_t * QFS_FilelistNew (void) { return calloc (1, sizeof (filelist_t)); } -void +VISIBLE void QFS_FilelistAdd (filelist_t *filelist, const char *fname, const char *ext) { char **new_list; @@ -1459,7 +1459,7 @@ QFS_FilelistAdd (filelist_t *filelist, const char *fname, const char *ext) filelist->list[filelist->count++] = str; } -void +VISIBLE void QFS_FilelistFill (filelist_t *list, const char *path, const char *ext, int strip) { @@ -1494,7 +1494,7 @@ QFS_FilelistFill (filelist_t *list, const char *path, const char *ext, } } -void +VISIBLE void QFS_FilelistFree (filelist_t *list) { int i; diff --git a/libs/util/quakeio.c b/libs/util/quakeio.c index d3222cfa4..1f4c64db1 100644 --- a/libs/util/quakeio.c +++ b/libs/util/quakeio.c @@ -83,19 +83,19 @@ struct QFile_s { }; -int +VISIBLE int Qrename (const char *old, const char *new) { return rename (old, new); } -int +VISIBLE int Qremove (const char *path) { return remove (path); } -int +VISIBLE int Qfilesize (QFile *file) { return file->size; @@ -159,7 +159,7 @@ file_mode (const char *mode, char *out) return flags; } -QFile * +VISIBLE QFile * Qopen (const char *path, const char *mode) { QFile *file; @@ -205,7 +205,7 @@ Qopen (const char *path, const char *mode) return file; } -QFile * +VISIBLE QFile * Qdopen (int fd, const char *mode) { QFile *file; @@ -249,7 +249,7 @@ Qdopen (int fd, const char *mode) return file; } -QFile * +VISIBLE QFile * Qfopen (FILE *file, const char *mode) { QFile *qfile; @@ -267,7 +267,7 @@ Qfopen (FILE *file, const char *mode) return qfile; } -QFile * +VISIBLE QFile * Qsubopen (const char *path, int offs, int len, int zip) { int fd = open (path, O_RDONLY); @@ -286,7 +286,7 @@ Qsubopen (const char *path, int offs, int len, int zip) return file; } -void +VISIBLE void Qclose (QFile *file) { if (file->file) @@ -298,7 +298,7 @@ Qclose (QFile *file) free (file); } -int +VISIBLE int Qread (QFile *file, void *buf, int count) { int offs = 0; @@ -323,7 +323,7 @@ Qread (QFile *file, void *buf, int count) return ret == -1 ? ret : ret + offs; } -int +VISIBLE int Qwrite (QFile *file, const void *buf, int count) { if (file->file) @@ -336,7 +336,7 @@ Qwrite (QFile *file, const void *buf, int count) #endif } -int +VISIBLE int Qprintf (QFile *file, const char *fmt, ...) { va_list args; @@ -364,7 +364,7 @@ Qprintf (QFile *file, const char *fmt, ...) return ret; } -int +VISIBLE int Qputs (QFile *file, const char *buf) { if (file->file) @@ -377,7 +377,7 @@ Qputs (QFile *file, const char *buf) #endif } -char * +VISIBLE char * Qgets (QFile *file, char *buf, int count) { char *ret = buf; @@ -401,7 +401,7 @@ Qgets (QFile *file, char *buf, int count) return buf ? ret : 0; } -int +VISIBLE int Qgetc (QFile *file) { if (file->c != -1) { @@ -419,7 +419,7 @@ Qgetc (QFile *file) #endif } -int +VISIBLE int Qputc (QFile *file, int c) { if (file->file) @@ -432,7 +432,7 @@ Qputc (QFile *file, int c) #endif } -int +VISIBLE int Qungetc (QFile *file, int c) { if (file->c == -1) @@ -440,7 +440,7 @@ Qungetc (QFile *file, int c) return c; } -int +VISIBLE int Qseek (QFile *file, long offset, int whence) { file->c = -1; @@ -482,7 +482,7 @@ Qseek (QFile *file, long offset, int whence) #endif } -long +VISIBLE long Qtell (QFile *file) { int offs; @@ -500,7 +500,7 @@ Qtell (QFile *file) return ret == -1 ? ret : ret - offs; } -int +VISIBLE int Qflush (QFile *file) { if (file->file) @@ -513,7 +513,7 @@ Qflush (QFile *file) #endif } -int +VISIBLE int Qeof (QFile *file) { if (file->c != -1) @@ -533,7 +533,7 @@ Qeof (QFile *file) Dynamic length version of Qgets. DO NOT free the buffer. */ -const char * +VISIBLE const char * Qgetline (QFile *file) { static int size = 256; diff --git a/libs/util/riff.c b/libs/util/riff.c index b78c3ad54..2bd458a19 100644 --- a/libs/util/riff.c +++ b/libs/util/riff.c @@ -276,7 +276,7 @@ read_cue (QFile *f, int len) return cue; } -riff_t * +VISIBLE riff_t * riff_read (QFile *f) { dstring_t *riff_buf; @@ -463,7 +463,7 @@ free_list (riff_list_t *list) free (list); } -void +VISIBLE void riff_free (riff_t *riff) { riff_d_chunk_t **ck; diff --git a/libs/util/script.c b/libs/util/script.c index b15c6ad40..4513f1cd1 100644 --- a/libs/util/script.c +++ b/libs/util/script.c @@ -50,7 +50,7 @@ script_error (script_t *script, const char *fmt, ...) exit (1); } -script_t * +VISIBLE script_t * Script_New (void) { script_t *script = calloc (1, sizeof (script_t)); @@ -58,14 +58,14 @@ Script_New (void) return script; } -void +VISIBLE void Script_Delete (script_t *script) { dstring_delete (script->token); free (script); } -void +VISIBLE void Script_Start (script_t *script, const char *file, const char *data) { script->line = 1; @@ -74,7 +74,7 @@ Script_Start (script_t *script, const char *file, const char *data) script->unget = false; } -qboolean +VISIBLE qboolean Script_TokenAvailable (script_t *script, qboolean crossline) { if (script->unget) @@ -109,7 +109,7 @@ Script_TokenAvailable (script_t *script, qboolean crossline) return true; } -qboolean +VISIBLE qboolean Script_GetToken (script_t *script, qboolean crossline) { const char *token_p; @@ -166,7 +166,7 @@ Script_GetToken (script_t *script, qboolean crossline) return true; } -void +VISIBLE void Script_UngetToken (script_t *script) { script->unget = true; diff --git a/libs/util/sizebuf.c b/libs/util/sizebuf.c index 9f046315f..65ea2b3ce 100644 --- a/libs/util/sizebuf.c +++ b/libs/util/sizebuf.c @@ -43,7 +43,7 @@ static __attribute__ ((used)) const char rcsid[] = #include "QF/zone.h" -void +VISIBLE void SZ_Alloc (sizebuf_t *buf, int startsize) { if (startsize < 256) @@ -53,14 +53,14 @@ SZ_Alloc (sizebuf_t *buf, int startsize) buf->cursize = 0; } -void +VISIBLE void SZ_Clear (sizebuf_t *buf) { buf->cursize = 0; buf->overflowed = false; } -void * +VISIBLE void * SZ_GetSpace (sizebuf_t *buf, int length) { void *data; @@ -85,13 +85,13 @@ getspace: goto getspace; } -void +VISIBLE void SZ_Write (sizebuf_t *buf, const void *data, int length) { memcpy (SZ_GetSpace (buf, length), data, length); } -void +VISIBLE void SZ_Print (sizebuf_t *buf, const char *data) { int len; diff --git a/libs/util/sys.c b/libs/util/sys.c index e0ec8f453..16f6398e2 100644 --- a/libs/util/sys.c +++ b/libs/util/sys.c @@ -76,8 +76,8 @@ static __attribute__ ((used)) const char rcsid[] = static void Sys_StdPrintf (const char *fmt, va_list args); static void Sys_ErrPrintf (const char *fmt, va_list args); -cvar_t *sys_nostdout; -cvar_t *sys_extrasleep; +VISIBLE cvar_t *sys_nostdout; +VISIBLE cvar_t *sys_extrasleep; cvar_t *sys_dead_sleep; cvar_t *sys_sleep; @@ -99,7 +99,7 @@ qboolean stdin_ready; #endif /* The translation table between the graphical font and plain ASCII --KB */ -const char sys_char_map[256] = { +VISIBLE const char sys_char_map[256] = { '\0', '#', '#', '#', '#', '.', '#', '#', '#', 9, 10, '#', ' ', 13, '.', '.', '[', ']', '0', '1', '2', '3', '4', '5', @@ -169,7 +169,7 @@ Sys_mkdir (const char *path) return 0; } -int +VISIBLE int Sys_FileTime (const char *path) { #ifdef HAVE_ACCESS @@ -192,13 +192,13 @@ Sys_FileTime (const char *path) for want of a better name, but it sets the function pointer for the actual implementation of Sys_Printf. */ -void +VISIBLE void Sys_SetStdPrintf (sys_printf_t func) { sys_std_printf_function = func; } -void +VISIBLE void Sys_SetErrPrintf (sys_printf_t func) { sys_err_printf_function = func; @@ -246,7 +246,7 @@ Sys_ErrPrintf (const char *fmt, va_list args) Sys_Print (stderr, fmt, args); } -void +VISIBLE void Sys_Printf (const char *fmt, ...) { va_list args; @@ -255,7 +255,7 @@ Sys_Printf (const char *fmt, ...) va_end (args); } -void +VISIBLE void Sys_DPrintf (const char *fmt, ...) { va_list args; @@ -267,7 +267,7 @@ Sys_DPrintf (const char *fmt, ...) va_end (args); } -double +VISIBLE double Sys_DoubleTime (void) { static qboolean first = true; @@ -309,7 +309,7 @@ Sys_DoubleTime (void) #endif } -void +VISIBLE void Sys_TimeOfDay (date_t *date) { struct tm *newtime; @@ -364,7 +364,7 @@ Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length) #endif } -void +VISIBLE void Sys_Init_Cvars (void) { sys_nostdout = Cvar_Get ("sys_nostdout", "0", CVAR_NONE, NULL, @@ -397,7 +397,7 @@ Sys_Shutdown (void) } } -void +VISIBLE void Sys_Quit (void) { Sys_Shutdown (); @@ -413,7 +413,7 @@ Sys_Quit (void) # define VA_COPY(a,b) memcpy (a, b, sizeof (a)) #endif -void +VISIBLE void Sys_Error (const char *error, ...) { va_list args; @@ -442,7 +442,7 @@ Sys_Error (const char *error, ...) exit (1); } -void +VISIBLE void Sys_RegisterShutdown (void (*func) (void)) { shutdown_list_t *p; @@ -456,7 +456,7 @@ Sys_RegisterShutdown (void (*func) (void)) shutdown_list = p; } -int +VISIBLE int Sys_TimeID (void) //FIXME I need a new name, one that doesn't make me feel 3 feet thick { int val; @@ -468,7 +468,7 @@ Sys_TimeID (void) //FIXME I need a new name, one that doesn't make me feel 3 fee return val; } -void +VISIBLE void Sys_PageIn (void *ptr, int size) { //may or may not be useful in linux #ifdef _WIN32 @@ -489,7 +489,7 @@ Sys_PageIn (void *ptr, int size) //#endif } -void +VISIBLE void Sys_DebugLog (const char *file, const char *fmt, ...) { va_list args; @@ -509,7 +509,7 @@ Sys_DebugLog (const char *file, const char *fmt, ...) } } -int +VISIBLE int Sys_CheckInput (int idle, int net_socket) { fd_set fdset; @@ -564,7 +564,7 @@ Sys_CheckInput (int idle, int net_socket) Checks for a complete line of text typed in at the console, then forwards it to the host command processor */ -const char * +VISIBLE const char * Sys_ConsoleInput (void) { static char text[256]; @@ -632,7 +632,7 @@ static sh_stack_t *free_sh; static int (*signal_hook)(int,void*); static void *signal_hook_data; -void +VISIBLE void Sys_PushSignalHook (int (*hook)(int, void *), void *data) { sh_stack_t *s; @@ -653,7 +653,7 @@ Sys_PushSignalHook (int (*hook)(int, void *), void *data) sh_stack = s; } -void +VISIBLE void Sys_PopSignalHook (void) { if (sh_stack) { @@ -734,7 +734,7 @@ signal_handler (int sig) } } -void +VISIBLE void Sys_Init (void) { // catch signals diff --git a/libs/util/va.c b/libs/util/va.c index 9920e3614..7da7a775f 100644 --- a/libs/util/va.c +++ b/libs/util/va.c @@ -50,7 +50,7 @@ static __attribute__ ((used)) const char rcsid[] = does a varargs printf into a temp buffer, so I don't need to have varargs versions of all text functions. */ -char * +VISIBLE char * va (const char *fmt, ...) { va_list args; @@ -66,7 +66,7 @@ va (const char *fmt, ...) return string->str; } -char * +VISIBLE char * nva (const char *fmt, ...) { va_list args; diff --git a/libs/util/ver_check.c b/libs/util/ver_check.c index 9a5047d8d..3dbc478b6 100644 --- a/libs/util/ver_check.c +++ b/libs/util/ver_check.c @@ -46,7 +46,7 @@ static __attribute__ ((used)) const char rcsid[] = return a positive number. If the second is greater, return a negative. If they are equal, return zero. */ -int +VISIBLE int ver_compare (const char *value, const char *reference) { const char *valptr, *refptr; diff --git a/libs/util/wad.c b/libs/util/wad.c index a884d24e0..b040fbc85 100644 --- a/libs/util/wad.c +++ b/libs/util/wad.c @@ -76,7 +76,7 @@ W_CleanupName (const char *in, char *out) out[i] = 0; } -void +VISIBLE void W_LoadWadFile (const char *filename) { lumpinfo_t *lump_p; @@ -125,7 +125,7 @@ W_GetLumpinfo (const char *name) return NULL; } -void * +VISIBLE void * W_GetLumpName (const char *name) { lumpinfo_t *lump; @@ -135,7 +135,7 @@ W_GetLumpName (const char *name) return (void *) (wad_base + lump->filepos); } -void +VISIBLE void SwapPic (qpic_t *pic) { pic->width = LittleLong (pic->width); diff --git a/libs/util/wadfile.c b/libs/util/wadfile.c index 60a51772c..6194320e6 100644 --- a/libs/util/wadfile.c +++ b/libs/util/wadfile.c @@ -74,7 +74,7 @@ wad_compare (void *la, void *lb, void *unused) ((lumpinfo_t *) lb)->name) == 0; } -wad_t * +VISIBLE wad_t * wad_new (const char *name) { wad_t *wad = calloc (sizeof (*wad), 1); @@ -96,7 +96,7 @@ wad_new (const char *name) return wad; } -void +VISIBLE void wad_del (wad_t *wad) { if (wad->lumps) @@ -110,7 +110,7 @@ wad_del (wad_t *wad) free (wad); } -void +VISIBLE void wad_rehash (wad_t *wad) { int i; @@ -120,7 +120,7 @@ wad_rehash (wad_t *wad) } } -wad_t * +VISIBLE wad_t * wad_open (const char *name) { wad_t *wad = wad_new (name); @@ -169,7 +169,7 @@ error: return 0; } -wad_t * +VISIBLE wad_t * wad_create (const char *name) { wad_t *wad = wad_new (name); @@ -189,7 +189,7 @@ wad_create (const char *name) return wad; } -void +VISIBLE void wad_close (wad_t *wad) { int i; @@ -216,7 +216,7 @@ wad_close (wad_t *wad) wad_del (wad); } -int +VISIBLE int wad_add (wad_t *wad, const char *filename, const char *lumpname, byte type) { lumpinfo_t *pf; @@ -271,7 +271,7 @@ wad_add (wad_t *wad, const char *filename, const char *lumpname, byte type) return 0; } -int +VISIBLE int wad_add_data (wad_t *wad, const char *lumpname, byte type, const void *data, int bytes) { @@ -318,7 +318,7 @@ wad_add_data (wad_t *wad, const char *lumpname, byte type, const void *data, return 0; } -lumpinfo_t * +VISIBLE lumpinfo_t * wad_find_lump (wad_t *wad, const char *lumpname) { lumpinfo_t dummy; diff --git a/libs/util/zone.c b/libs/util/zone.c index 28a17c321..3314283a9 100644 --- a/libs/util/zone.c +++ b/libs/util/zone.c @@ -98,7 +98,7 @@ struct memzone_s }; -void +VISIBLE void Z_ClearZone (memzone_t *zone, int size) { memblock_t *block; @@ -121,7 +121,7 @@ Z_ClearZone (memzone_t *zone, int size) block->size = size - sizeof (memzone_t); } -void +VISIBLE void Z_Free (memzone_t *zone, void *ptr) { memblock_t *block, *other; @@ -160,7 +160,7 @@ Z_Free (memzone_t *zone, void *ptr) } } -void * +VISIBLE void * Z_Malloc (memzone_t *zone, int size) { void *buf; @@ -231,7 +231,7 @@ Z_TagMalloc (memzone_t *zone, int size, int tag) return (void *) (base + 1); } -void * +VISIBLE void * Z_Realloc (memzone_t *zone, void *ptr, int size) { int old_size; @@ -329,7 +329,7 @@ qboolean hunk_tempactive; Run consistancy and sentinal trahing checks */ -void +VISIBLE void Hunk_Check (void) { hunk_t *h; @@ -416,7 +416,7 @@ Hunk_Print (qboolean all) Sys_Printf ("%8i total blocks\n", totalblocks); } */ -void * +VISIBLE void * Hunk_AllocName (int size, const char *name) { hunk_t *h; @@ -450,19 +450,19 @@ Hunk_AllocName (int size, const char *name) return (void *) (h + 1); } -void * +VISIBLE void * Hunk_Alloc (int size) { return Hunk_AllocName (size, "unknown"); } -int +VISIBLE int Hunk_LowMark (void) { return hunk_low_used; } -void +VISIBLE void Hunk_FreeToLowMark (int mark) { if (mark < 0 || mark > hunk_low_used) @@ -471,7 +471,7 @@ Hunk_FreeToLowMark (int mark) hunk_low_used = mark; } -int +VISIBLE int Hunk_HighMark (void) { if (hunk_tempactive) { @@ -482,7 +482,7 @@ Hunk_HighMark (void) return hunk_high_used; } -void +VISIBLE void Hunk_FreeToHighMark (int mark) { if (hunk_tempactive) { @@ -495,7 +495,7 @@ Hunk_FreeToHighMark (int mark) hunk_high_used = mark; } -void * +VISIBLE void * Hunk_HighAllocName (int size, const char *name) { hunk_t *h; @@ -535,7 +535,7 @@ Hunk_HighAllocName (int size, const char *name) Return space from the top of the hunk */ -void * +VISIBLE void * Hunk_TempAlloc (int size) { void *buf; @@ -828,7 +828,7 @@ Cache_Print (void) CACHE_WRITE_UNLOCK; } -void +VISIBLE void Cache_Report (void) { CACHE_WRITE_LOCK; @@ -857,7 +857,7 @@ Cache_Init (void) Frees the memory and removes it from the LRU list */ -void +VISIBLE void Cache_Free (cache_user_t *c) { CACHE_WRITE_LOCK; @@ -908,7 +908,7 @@ Cache_RealCheck (cache_user_t *c) return c->data; } -void * +VISIBLE void * Cache_Check (cache_user_t *c) { void *mem; @@ -919,7 +919,7 @@ Cache_Check (cache_user_t *c) return mem; } -void * +VISIBLE void * Cache_Alloc (cache_user_t *c, int size, const char *name) { void *mem; @@ -997,7 +997,7 @@ Cache_Profile (void) CACHE_WRITE_UNLOCK; } -void +VISIBLE void Cache_Add (cache_user_t *c, void *object, cache_loader_t loader) { CACHE_WRITE_LOCK; @@ -1030,7 +1030,7 @@ Cache_Remove (cache_user_t *c) CACHE_WRITE_UNLOCK; } -void * +VISIBLE void * Cache_TryGet (cache_user_t *c) { void *mem; @@ -1049,7 +1049,7 @@ Cache_TryGet (cache_user_t *c) return mem; } -void * +VISIBLE void * Cache_Get (cache_user_t *c) { void *mem = Cache_TryGet (c); @@ -1059,7 +1059,7 @@ Cache_Get (cache_user_t *c) return mem; } -void +VISIBLE void Cache_Release (cache_user_t *c) { int *readlock; @@ -1174,7 +1174,7 @@ QA_strdup (const char *s) //============================================================================ -void +VISIBLE void Memory_Init (void *buf, int size) { hunk_base = buf; diff --git a/libs/video/renderer/gl/Makefile.am b/libs/video/renderer/gl/Makefile.am index 6ddf75e73..ae1fa77f2 100644 --- a/libs/video/renderer/gl/Makefile.am +++ b/libs/video/renderer/gl/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS= foreign -AM_CFLAGS= @PREFER_PIC@ +CFLAGS+= @PREFER_PIC@ INCLUDES= -I$(top_srcdir)/include $(GLX_CFLAGS) if BUILD_GL diff --git a/libs/video/renderer/gl/gl_draw.c b/libs/video/renderer/gl/gl_draw.c index 7c7b067c6..aaeb0b36b 100644 --- a/libs/video/renderer/gl/gl_draw.c +++ b/libs/video/renderer/gl/gl_draw.c @@ -158,7 +158,7 @@ Draw_InitText (void) } } -qpic_t * +VISIBLE qpic_t * Draw_PicFromWad (const char *name) { glpic_t *gl; @@ -196,7 +196,7 @@ Draw_ClearCache (void) pic->dirty = true; } -qpic_t * +VISIBLE qpic_t * Draw_CachePic (const char *path, qboolean alpha) { cachepic_t *pic; @@ -254,7 +254,7 @@ Draw_CachePic (const char *path, qboolean alpha) return &pic->pic; } -void +VISIBLE void Draw_TextBox (int x, int y, int width, int lines, byte alpha) { int cx, cy, n; @@ -308,7 +308,7 @@ Draw_TextBox (int x, int y, int width, int lines, byte alpha) qfglColor3ubv (color_white); } -void +VISIBLE void Draw_Init (void) { int i; @@ -429,7 +429,7 @@ tVA_increment (void) It can be clipped to the top of the screen to allow the console to be smoothly scrolled off. */ -void +VISIBLE void Draw_Character (int x, int y, unsigned int chr) { chr &= 255; @@ -443,7 +443,7 @@ Draw_Character (int x, int y, unsigned int chr) tVA_increment (); } -void +VISIBLE void Draw_String (int x, int y, const char *str) { unsigned char chr; @@ -466,7 +466,7 @@ Draw_String (int x, int y, const char *str) } } -void +VISIBLE void Draw_nString (int x, int y, const char *str, int count) { unsigned char chr; @@ -572,7 +572,7 @@ static void (*crosshair_func[]) (int x, int y) = { crosshair_3, }; -void +VISIBLE void Draw_Crosshair (void) { int x, y; @@ -598,7 +598,7 @@ Draw_CrosshairAt (int ch, int x, int y) crosshair_func[ch] (x, y); } -void +VISIBLE void Draw_Pic (int x, int y, qpic_t *pic) { glpic_t *gl; @@ -618,7 +618,7 @@ Draw_Pic (int x, int y, qpic_t *pic) qfglEnd (); } -void +VISIBLE void Draw_SubPic (int x, int y, qpic_t *pic, int srcx, int srcy, int width, int height) { @@ -654,7 +654,7 @@ Draw_SubPic (int x, int y, qpic_t *pic, int srcx, int srcy, int width, Draws console background (obviously!) Completely rewritten to use several simple yet very cool GL effects. --KB */ -void +VISIBLE void Draw_ConsoleBackground (int lines, byte alpha) { float ofs; @@ -728,7 +728,7 @@ Draw_ConsoleBackground (int lines, byte alpha) This repeats a 64*64 tile graphic to fill the screen around a sized down refresh window. */ -void +VISIBLE void Draw_TileClear (int x, int y, int w, int h) { qfglColor3ubv (color_0_8); @@ -751,7 +751,7 @@ Draw_TileClear (int x, int y, int w, int h) Fills a box of pixels with a single color */ -void +VISIBLE void Draw_Fill (int x, int y, int w, int h, int c) { qfglDisable (GL_TEXTURE_2D); @@ -769,7 +769,7 @@ Draw_Fill (int x, int y, int w, int h, int c) qfglEnable (GL_TEXTURE_2D); } -void +VISIBLE void Draw_FadeScreen (void) { GL_FlushText (); // Flush text that should be rendered before the menu diff --git a/libs/video/renderer/gl/gl_dyn_part.c b/libs/video/renderer/gl/gl_dyn_part.c index 5a511fd60..e940d9eb1 100644 --- a/libs/video/renderer/gl/gl_dyn_part.c +++ b/libs/video/renderer/gl/gl_dyn_part.c @@ -145,7 +145,7 @@ particle_new_veryrandom (ptype_t type, int texnum, const vec3_t org, } */ -void +VISIBLE void R_ClearParticles (void) { numparticles = 0; @@ -1767,7 +1767,7 @@ R_ParticleFunctionInit (void) r_easter_eggs_f (easter_eggs); } -void +VISIBLE void R_Particles_Init_Cvars (void) { R_ParticleFunctionInit (); diff --git a/libs/video/renderer/gl/gl_graph.c b/libs/video/renderer/gl/gl_graph.c index c3d3d13f7..a0d35bd09 100644 --- a/libs/video/renderer/gl/gl_graph.c +++ b/libs/video/renderer/gl/gl_graph.c @@ -70,7 +70,7 @@ R_InitGraphTextures (int base) return base; } -void +VISIBLE void R_LineGraph (int x, int y, int *h_vals, int count) { byte color; diff --git a/libs/video/renderer/gl/gl_rmain.c b/libs/video/renderer/gl/gl_rmain.c index 1a577c5ad..b855ea33a 100644 --- a/libs/video/renderer/gl/gl_rmain.c +++ b/libs/video/renderer/gl/gl_rmain.c @@ -77,7 +77,7 @@ vec3_t modelorg, r_entorigin; entity_t *currententity; int r_visframecount; // bumped when going to a new PVS -int r_framecount; // used for dlight push checking +VISIBLE int r_framecount; // used for dlight push checking int c_brush_polys, c_alias_polys; @@ -88,16 +88,16 @@ qboolean mirror; mplane_t *mirror_plane; // view origin -vec3_t vup; -vec3_t vpn; -vec3_t vright; -vec3_t r_origin; +VISIBLE vec3_t vup; +VISIBLE vec3_t vpn; +VISIBLE vec3_t vright; +VISIBLE vec3_t r_origin; float r_world_matrix[16]; float r_base_world_matrix[16]; // screen size info -refdef_t r_refdef; +VISIBLE refdef_t r_refdef; mleaf_t *r_viewleaf, *r_oldviewleaf; @@ -664,7 +664,7 @@ R_RenderView_ (void) static void R_RenderViewFishEye (void); -void +VISIBLE void R_RenderView (void) { if(!scr_fisheye->int_val) diff --git a/libs/video/renderer/gl/gl_rmisc.c b/libs/video/renderer/gl/gl_rmisc.c index 76bde24f0..6859575a1 100644 --- a/libs/video/renderer/gl/gl_rmisc.c +++ b/libs/video/renderer/gl/gl_rmisc.c @@ -140,7 +140,7 @@ R_LoadSky_f (void) R_LoadSkys (Cmd_Argv (1)); } -void +VISIBLE void R_Init (void) { Cmd_AddCommand ("timerefresh", R_TimeRefresh_f, @@ -163,7 +163,7 @@ R_Init (void) R_InitSprites (); } -void +VISIBLE void R_NewMap (model_t *worldmodel, struct model_s **models, int num_models) { cvar_t *r_skyname; @@ -246,7 +246,7 @@ R_TimeRefresh_f (void) GL_BeginRendering (&glx, &gly, &glwidth, &glheight); } -void +VISIBLE void D_FlushCaches (void) { } diff --git a/libs/video/renderer/gl/gl_screen.c b/libs/video/renderer/gl/gl_screen.c index 4aa5a580f..0b351d6cd 100644 --- a/libs/video/renderer/gl/gl_screen.c +++ b/libs/video/renderer/gl/gl_screen.c @@ -69,7 +69,7 @@ int glx, gly, glwidth, glheight; /* SCREEN SHOTS */ -tex_t * +VISIBLE tex_t * SCR_ScreenShot (int width, int height) { unsigned char *src, *dest, *snap; @@ -189,7 +189,7 @@ SCR_TileClear (void) WARNING: be very careful calling this from elsewhere, because the refresh needs almost the entire 256k of stack space! */ -void +VISIBLE void SCR_UpdateScreen (double realtime, SCR_Func *scr_funcs) { double time1 = 0, time2; diff --git a/libs/video/renderer/gl/gl_skin.c b/libs/video/renderer/gl/gl_skin.c index 4d2919c2d..34ebcaeb6 100644 --- a/libs/video/renderer/gl/gl_skin.c +++ b/libs/video/renderer/gl/gl_skin.c @@ -56,7 +56,7 @@ static unsigned int translate32[256]; static int player_width = 296; static int player_height = 194; -void +VISIBLE void Skin_Set_Translate (int top, int bottom, void *_dest) { int i; @@ -182,7 +182,7 @@ build_skin (int texnum, byte *ptexels, int width, int height, } } -void +VISIBLE void Skin_Do_Translation (skin_t *player_skin, int slot, skin_t *skin) { byte *original; @@ -204,7 +204,7 @@ Skin_Do_Translation (skin_t *player_skin, int slot, skin_t *skin) player_width, player_height, false); } -void +VISIBLE void Skin_Do_Translation_Model (model_t *model, int skinnum, int slot, skin_t *skin) { byte *original; @@ -238,7 +238,7 @@ Skin_Do_Translation_Model (model_t *model, int skinnum, int slot, skin_t *skin) Cache_Release (&model->cache); } -void +VISIBLE void Skin_Player_Model (model_t *model) { aliashdr_t *paliashdr; @@ -256,7 +256,7 @@ Skin_Player_Model (model_t *model) Cache_Release (&model->cache); } -void +VISIBLE void Skin_Init_Translation (void) { int i; @@ -267,7 +267,7 @@ Skin_Init_Translation (void) } } -void +VISIBLE void Skin_Process (skin_t *skin, tex_t *tex) { int pixels = tex->width * tex->height; diff --git a/libs/video/renderer/gl/gl_textures.c b/libs/video/renderer/gl/gl_textures.c index e228a0d1b..fd74efc88 100644 --- a/libs/video/renderer/gl/gl_textures.c +++ b/libs/video/renderer/gl/gl_textures.c @@ -552,7 +552,7 @@ GL_Upload8 (byte *data, int width, int height, qboolean mipmap, qboolean alpha) free (trans); } -int +VISIBLE int GL_LoadTexture (const char *identifier, int width, int height, byte *data, qboolean mipmap, qboolean alpha, int bytesperpixel) { diff --git a/libs/video/renderer/sw/Makefile.am b/libs/video/renderer/sw/Makefile.am index 0a067766e..4d861a0a0 100644 --- a/libs/video/renderer/sw/Makefile.am +++ b/libs/video/renderer/sw/Makefile.am @@ -1,7 +1,7 @@ AUTOMAKE_OPTIONS= foreign -AM_CFLAGS= @PREFER_NON_PIC@ -AM_CCASFLAGS= @PREFER_NON_PIC@ +CFLAGS+= @PREFER_NON_PIC@ +CCASFLAGS+= @PREFER_NON_PIC@ INCLUDES= -I$(top_srcdir)/include if ASM_ARCH diff --git a/libs/video/renderer/sw/d_sprite.c b/libs/video/renderer/sw/d_sprite.c index 8d463c693..e92b13a76 100644 --- a/libs/video/renderer/sw/d_sprite.c +++ b/libs/video/renderer/sw/d_sprite.c @@ -333,7 +333,7 @@ D_SpriteCalculateGradients (void) TransformVector (r_spritedesc.vpn, p_normal); TransformVector (r_spritedesc.vright, p_saxis); TransformVector (r_spritedesc.vup, p_taxis); - VectorInverse (p_taxis); + VectorNegate (p_taxis, p_taxis); distinv = 1.0 / (-DotProduct (modelorg, r_spritedesc.vpn)); diff --git a/libs/video/renderer/sw/draw.c b/libs/video/renderer/sw/draw.c index e6ea49d87..8139f143f 100644 --- a/libs/video/renderer/sw/draw.c +++ b/libs/video/renderer/sw/draw.c @@ -75,7 +75,7 @@ cachepic_t cachepics[MAX_CACHED_PICS]; int numcachepics; -qpic_t * +VISIBLE qpic_t * Draw_PicFromWad (const char *name) { return W_GetLumpName (name); @@ -88,7 +88,7 @@ Draw_ClearCache (void) } -qpic_t * +VISIBLE qpic_t * Draw_CachePic (const char *path, qboolean alpha) { cachepic_t *pic; @@ -125,7 +125,7 @@ Draw_CachePic (const char *path, qboolean alpha) } -void +VISIBLE void Draw_TextBox (int x, int y, int width, int lines, byte alpha) { qpic_t *p; @@ -199,7 +199,7 @@ Draw_Init (void) It can be clipped to the top of the screen to allow the console to be smoothly scrolled off. */ -inline void +VISIBLE inline void Draw_Character (int x, int y, unsigned int chr) { byte *dest; @@ -253,7 +253,7 @@ Draw_Character (int x, int y, unsigned int chr) } -void +VISIBLE void Draw_String (int x, int y, const char *str) { while (*str) { @@ -263,7 +263,7 @@ Draw_String (int x, int y, const char *str) } -void +VISIBLE void Draw_nString (int x, int y, const char *str, int count) { while (count-- && *str) { @@ -273,7 +273,7 @@ Draw_nString (int x, int y, const char *str, int count) } -void +VISIBLE void Draw_AltString (int x, int y, const char *str) { while (*str) { @@ -334,7 +334,7 @@ static void (*crosshair_func[]) (int x, int y) = { crosshair_3, }; -void +VISIBLE void Draw_Crosshair (void) { int x, y; @@ -350,7 +350,7 @@ Draw_Crosshair (void) crosshair_func[ch] (x, y); } -void +VISIBLE void Draw_CrosshairAt (int ch, int x, int y) { ch -= 1; @@ -361,7 +361,7 @@ Draw_CrosshairAt (int ch, int x, int y) } -void +VISIBLE void Draw_Pic (int x, int y, qpic_t *pic) { byte *dest, *source, tbyte; @@ -412,7 +412,7 @@ Draw_Pic (int x, int y, qpic_t *pic) } -void +VISIBLE void Draw_SubPic (int x, int y, qpic_t *pic, int srcx, int srcy, int width, int height) { @@ -464,7 +464,7 @@ Draw_SubPic (int x, int y, qpic_t *pic, int srcx, int srcy, int width, } -void +VISIBLE void Draw_ConsoleBackground (int lines, byte alpha) { int x, y, v; @@ -545,7 +545,7 @@ R_DrawRect (vrect_t *prect, int rowbytes, byte * psrc, int transparent) This repeats a 64*64 tile graphic to fill the screen around a sized down refresh window. */ -void +VISIBLE void Draw_TileClear (int x, int y, int w, int h) { int width, height, tileoffsetx, tileoffsety; @@ -607,7 +607,7 @@ Draw_TileClear (int x, int y, int w, int h) Fills a box of pixels with a single color */ -void +VISIBLE void Draw_Fill (int x, int y, int w, int h, int c) { byte *dest; @@ -626,7 +626,7 @@ Draw_Fill (int x, int y, int w, int h, int c) } -void +VISIBLE void Draw_FadeScreen (void) { unsigned int x, y; diff --git a/libs/video/renderer/sw/sw_ralias.c b/libs/video/renderer/sw/sw_ralias.c index 977ac6d67..c843eb1de 100644 --- a/libs/video/renderer/sw/sw_ralias.c +++ b/libs/video/renderer/sw/sw_ralias.c @@ -398,7 +398,7 @@ R_AliasSetUpTransform (int trivial_accept) // TODO: should be global, set when vright, etc., set VectorCopy (vright, viewmatrix[0]); VectorCopy (vup, viewmatrix[1]); - VectorInverse (viewmatrix[1]); + VectorNegate (viewmatrix[1], viewmatrix[1]); VectorCopy (vpn, viewmatrix[2]); // viewmatrix[0][3] = 0; diff --git a/libs/video/renderer/sw/sw_rmain.c b/libs/video/renderer/sw/sw_rmain.c index 35d32bd7f..5779ebbcb 100644 --- a/libs/video/renderer/sw/sw_rmain.c +++ b/libs/video/renderer/sw/sw_rmain.c @@ -503,7 +503,7 @@ R_DrawViewModel (void) VectorSubtract (r_origin, r_entorigin, modelorg); VectorCopy (vup, viewlightvec); - VectorInverse (viewlightvec); + VectorNegate (viewlightvec, viewlightvec); minlight = max (currententity->min_light, currententity->model->min_light); diff --git a/libs/video/renderer/sw32/Makefile.am b/libs/video/renderer/sw32/Makefile.am index fac6855c5..7ebbaff69 100644 --- a/libs/video/renderer/sw32/Makefile.am +++ b/libs/video/renderer/sw32/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS= foreign -AM_CFLAGS= @PREFER_PIC@ +CFLAGS+= @PREFER_PIC@ INCLUDES= -I$(top_srcdir)/include if BUILD_SW32 diff --git a/libs/video/renderer/sw32/d_sprite.c b/libs/video/renderer/sw32/d_sprite.c index e61aafd10..3d56f6aca 100644 --- a/libs/video/renderer/sw32/d_sprite.c +++ b/libs/video/renderer/sw32/d_sprite.c @@ -643,7 +643,7 @@ D_SpriteCalculateGradients (void) TransformVector (r_spritedesc.vpn, p_normal); TransformVector (r_spritedesc.vright, p_saxis); TransformVector (r_spritedesc.vup, p_taxis); - VectorInverse (p_taxis); + VectorNegate (p_taxis, p_taxis); distinv = 1.0 / (-DotProduct (modelorg, r_spritedesc.vpn)); distinv = min (distinv, 1.0); diff --git a/libs/video/renderer/sw32/d_surf.c b/libs/video/renderer/sw32/d_surf.c index 9723d9284..179151d94 100644 --- a/libs/video/renderer/sw32/d_surf.c +++ b/libs/video/renderer/sw32/d_surf.c @@ -123,7 +123,7 @@ D_InitCaches (void *buffer, int size) } -void +VISIBLE void D_FlushCaches (void) { surfcache_t *c; diff --git a/libs/video/renderer/sw32/draw.c b/libs/video/renderer/sw32/draw.c index ccbaf5665..ba9e8144f 100644 --- a/libs/video/renderer/sw32/draw.c +++ b/libs/video/renderer/sw32/draw.c @@ -75,7 +75,7 @@ cachepic_t cachepics[MAX_CACHED_PICS]; int numcachepics; -qpic_t * +VISIBLE qpic_t * Draw_PicFromWad (const char *name) { return W_GetLumpName (name); @@ -88,7 +88,7 @@ Draw_ClearCache (void) } -qpic_t * +VISIBLE qpic_t * Draw_CachePic (const char *path, qboolean alpha) { cachepic_t *pic; @@ -125,7 +125,7 @@ Draw_CachePic (const char *path, qboolean alpha) } -void +VISIBLE void Draw_TextBox (int x, int y, int width, int lines, byte alpha) { qpic_t *p; @@ -178,7 +178,7 @@ Draw_TextBox (int x, int y, int width, int lines, byte alpha) } -void +VISIBLE void Draw_Init (void) { draw_chars = W_GetLumpName ("conchars"); @@ -199,7 +199,7 @@ Draw_Init (void) It can be clipped to the top of the screen to allow the console to be smoothly scrolled off. */ -void +VISIBLE void Draw_Character (int x, int y, unsigned int chr) { byte *source; @@ -316,7 +316,7 @@ Draw_Character (int x, int y, unsigned int chr) } } -void +VISIBLE void Draw_String (int x, int y, const char *str) { while (*str) { @@ -325,7 +325,7 @@ Draw_String (int x, int y, const char *str) } } -void +VISIBLE void Draw_nString (int x, int y, const char *str, int count) { while (count-- && *str) { @@ -408,7 +408,7 @@ static void (*crosshair_func[]) (int x, int y) = { crosshair_3, }; -void +VISIBLE void Draw_Crosshair (void) { int x, y; @@ -434,7 +434,7 @@ Draw_CrosshairAt (int ch, int x, int y) crosshair_func[ch] (x, y); } -void +VISIBLE void Draw_Pic (int x, int y, qpic_t *pic) { byte *source, tbyte; @@ -525,7 +525,7 @@ Draw_Pic (int x, int y, qpic_t *pic) } -void +VISIBLE void Draw_SubPic (int x, int y, qpic_t *pic, int srcx, int srcy, int width, int height) { @@ -581,7 +581,7 @@ Draw_SubPic (int x, int y, qpic_t *pic, int srcx, int srcy, int width, } -void +VISIBLE void Draw_ConsoleBackground (int lines, byte alpha) { int x, y, v; @@ -958,7 +958,7 @@ R_DrawRect (vrect_t *prect, int rowbytes, byte * psrc, int transparent) This repeats a 64*64 tile graphic to fill the screen around a sized down refresh window. */ -void +VISIBLE void Draw_TileClear (int x, int y, int w, int h) { int width, height, tileoffsetx, tileoffsety; @@ -1020,7 +1020,7 @@ Draw_TileClear (int x, int y, int w, int h) Fills a box of pixels with a single color */ -void +VISIBLE void Draw_Fill (int x, int y, int w, int h, int c) { int u, v; @@ -1066,7 +1066,7 @@ Draw_Fill (int x, int y, int w, int h, int c) } -void +VISIBLE void Draw_FadeScreen (void) { unsigned int x, y; diff --git a/libs/video/renderer/sw32/screen.c b/libs/video/renderer/sw32/screen.c index ad6690713..21bbcee6a 100644 --- a/libs/video/renderer/sw32/screen.c +++ b/libs/video/renderer/sw32/screen.c @@ -156,7 +156,7 @@ SCR_ApplyBlend (void) // Used to be V_UpdatePalette /* SCREEN SHOTS */ -tex_t * +VISIBLE tex_t * SCR_ScreenShot (int width, int height) { return 0; @@ -213,7 +213,7 @@ SCR_ScreenShot_f (void) WARNING: be very careful calling this from elsewhere, because the refresh needs almost the entire 256k of stack space! */ -void +VISIBLE void SCR_UpdateScreen (double realtime, SCR_Func *scr_funcs) { vrect_t vrect; diff --git a/libs/video/renderer/sw32/sw32_graph.c b/libs/video/renderer/sw32/sw32_graph.c index 3157bd7c5..d8578a8ce 100644 --- a/libs/video/renderer/sw32/sw32_graph.c +++ b/libs/video/renderer/sw32/sw32_graph.c @@ -44,7 +44,7 @@ static __attribute__ ((used)) const char rcsid[] = Only called by R_DisplayTime */ -void +VISIBLE void R_LineGraph (int x, int y, int *h_vals, int count) { int h, i, s, color; diff --git a/libs/video/renderer/sw32/sw32_ralias.c b/libs/video/renderer/sw32/sw32_ralias.c index c2b8ce3a4..04ef16ee0 100644 --- a/libs/video/renderer/sw32/sw32_ralias.c +++ b/libs/video/renderer/sw32/sw32_ralias.c @@ -401,7 +401,7 @@ R_AliasSetUpTransform (int trivial_accept) // TODO: should be global, set when vright, etc., set VectorCopy (vright, viewmatrix[0]); VectorCopy (vup, viewmatrix[1]); - VectorInverse (viewmatrix[1]); + VectorNegate (viewmatrix[1], viewmatrix[1]); VectorCopy (vpn, viewmatrix[2]); // viewmatrix[0][3] = 0; diff --git a/libs/video/renderer/sw32/sw32_rmain.c b/libs/video/renderer/sw32/sw32_rmain.c index ebc098415..74ee4669f 100644 --- a/libs/video/renderer/sw32/sw32_rmain.c +++ b/libs/video/renderer/sw32/sw32_rmain.c @@ -65,7 +65,7 @@ int r_numallocatededges; qboolean r_drawpolys; qboolean r_drawculledpolys; qboolean r_worldpolysbacktofront; -int r_pixbytes = 1; +VISIBLE int r_pixbytes = 1; float r_aliasuvscale = 1.0; int r_outofsurfaces; int r_outofedges; @@ -91,13 +91,13 @@ qboolean r_fov_greater_than_90; entity_t r_worldentity; // view origin -vec3_t vup, base_vup; -vec3_t vpn, base_vpn; -vec3_t vright, base_vright; -vec3_t r_origin; +VISIBLE vec3_t vup, base_vup; +VISIBLE vec3_t vpn, base_vpn; +VISIBLE vec3_t vright, base_vright; +VISIBLE vec3_t r_origin; // screen size info -refdef_t r_refdef; +VISIBLE refdef_t r_refdef; float xcenter, ycenter; float xscale, yscale; float xscaleinv, yscaleinv; @@ -114,7 +114,7 @@ float xOrigin, yOrigin; mplane_t screenedge[4]; // refresh flags -int r_framecount = 1; // so frame counts initialized to 0 don't match +VISIBLE int r_framecount = 1; // so frame counts initialized to 0 don't match int r_visframecount; int d_spanpixcount; int r_polycount; @@ -170,7 +170,7 @@ R_Textures_Init (void) } } -void +VISIBLE void R_Init (void) { int dummy; @@ -213,7 +213,7 @@ R_Init_Cvars (void) } */ -void +VISIBLE void R_NewMap (model_t *worldmodel, struct model_s **models, int num_models) { int i; @@ -522,7 +522,7 @@ R_DrawViewModel (void) VectorSubtract (r_origin, r_entorigin, modelorg); VectorCopy (vup, viewlightvec); - VectorInverse (viewlightvec); + VectorNegate (viewlightvec, viewlightvec); minlight = max (currententity->min_light, currententity->model->min_light); @@ -882,7 +882,7 @@ R_RenderView_ (void) Con_Printf ("Short roughly %d edges\n", r_outofedges * 2 / 3); } -void +VISIBLE void R_RenderView (void) { int dummy; diff --git a/libs/video/renderer/sw32/sw32_rpart.c b/libs/video/renderer/sw32/sw32_rpart.c index 0a5f998c4..99f330e96 100644 --- a/libs/video/renderer/sw32/sw32_rpart.c +++ b/libs/video/renderer/sw32/sw32_rpart.c @@ -54,7 +54,7 @@ R_InitParticles (void) { } -void +VISIBLE void R_ClearParticles (void) { unsigned int i; @@ -876,7 +876,7 @@ R_ParticleFunctionInit (void) R_VoorTrail = R_VoorTrail_QF; } -void +VISIBLE void R_Particles_Init_Cvars (void) { R_ParticleFunctionInit (); diff --git a/libs/video/renderer/sw32/sw32_skin.c b/libs/video/renderer/sw32/sw32_skin.c index b1db44e99..19736bc80 100644 --- a/libs/video/renderer/sw32/sw32_skin.c +++ b/libs/video/renderer/sw32/sw32_skin.c @@ -46,7 +46,7 @@ static __attribute__ ((used)) const char rcsid[] = #include "compat.h" #include "d_iface.h" -void +VISIBLE void Skin_Set_Translate (int top, int bottom, void *_dest) { int i, j; @@ -172,30 +172,30 @@ Skin_Set_Translate (int top, int bottom, void *_dest) */ } -void +VISIBLE void Skin_Do_Translation (skin_t *player_skin, int slot, skin_t *skin) { } -void +VISIBLE void Skin_Do_Translation_Model (model_t *model, int skinnum, int slot, skin_t *skin) { } -void +VISIBLE void Skin_Player_Model (model_t *model) { } -void +VISIBLE void Skin_Init_Translation (void) { } -void +VISIBLE void Skin_Process (skin_t *skin, struct tex_s *tex) { } diff --git a/libs/video/targets/in_common.c b/libs/video/targets/in_common.c index 6634fc05f..9aec41635 100644 --- a/libs/video/targets/in_common.c +++ b/libs/video/targets/in_common.c @@ -59,11 +59,11 @@ static __attribute__ ((used)) const char rcsid[] = #include "QF/mathlib.h" #include "QF/vid.h" -viewdelta_t viewdelta; +VISIBLE viewdelta_t viewdelta; cvar_t *in_grab; -cvar_t *in_amp; -cvar_t *in_pre_amp; +VISIBLE cvar_t *in_amp; +VISIBLE cvar_t *in_pre_amp; cvar_t *in_freelook; cvar_t *in_mouse_filter; cvar_t *in_mouse_amp; diff --git a/libs/video/targets/joy.c b/libs/video/targets/joy.c index 9977b2fe3..f86b50da7 100644 --- a/libs/video/targets/joy.c +++ b/libs/video/targets/joy.c @@ -71,13 +71,13 @@ struct joy_axis joy_axes[JOY_MAX_AXES]; struct joy_button joy_buttons[JOY_MAX_BUTTONS]; -void +VISIBLE void JOY_Command (void) { JOY_Read (); } -void +VISIBLE void JOY_Move (void) { float mult_joy; @@ -149,7 +149,7 @@ JOY_Move (void) } } -void +VISIBLE void JOY_Init (void) { int i; @@ -185,7 +185,7 @@ joyamp_f (cvar_t *var) Cvar_Set (var, va ("%g", max (0.0001, var->value))); } -void +VISIBLE void JOY_Init_Cvars (void) { int i; @@ -206,7 +206,7 @@ JOY_Init_Cvars (void) } } -void +VISIBLE void JOY_Shutdown (void) { if (!joy_active) diff --git a/libs/video/targets/keys.c b/libs/video/targets/keys.c index 26489b89c..dd2756f67 100644 --- a/libs/video/targets/keys.c +++ b/libs/video/targets/keys.c @@ -60,11 +60,11 @@ static __attribute__ ((used)) const char rcsid[] = cvar_t *in_bind_imt; -keydest_t key_dest = key_console; -imt_t game_target = IMT_CONSOLE; +VISIBLE keydest_t key_dest = key_console; +VISIBLE imt_t game_target = IMT_CONSOLE; -struct keybind_s keybindings[IMT_LAST][QFK_LAST]; -int keydown[QFK_LAST]; +VISIBLE struct keybind_s keybindings[IMT_LAST][QFK_LAST]; +VISIBLE int keydown[QFK_LAST]; static int keyhelp; static cbuf_t *cbuf; @@ -513,7 +513,7 @@ Key_StringToKeynum (const char *str) Returns a string (a QFK_* name) for the given keynum. FIXME: handle quote special (general escape sequence?) */ -const char * +VISIBLE const char * Key_KeynumToString (knum_t keynum) { keyname_t *kn; @@ -782,7 +782,7 @@ keyhelp_f (void) Called by the system between frames for both key up and key down events Should NOT be called during an interrupt! */ -void +VISIBLE void Key_Event (knum_t key, short unicode, qboolean down) { // Con_Printf ("%d %d %d : %d\n", game_target, key_dest, key, down); //@@@ @@ -880,7 +880,7 @@ Key_GetBinding (imt_t imt, knum_t key) return keybindings[imt][key].str; } -void +VISIBLE void Key_SetBinding (imt_t target, knum_t keynum, const char *binding) { if (keynum == (knum_t) -1) diff --git a/libs/video/targets/qfgl_ext.c b/libs/video/targets/qfgl_ext.c index a5517e151..e09639c2b 100644 --- a/libs/video/targets/qfgl_ext.c +++ b/libs/video/targets/qfgl_ext.c @@ -95,9 +95,9 @@ QFGL_ProcAddress (void *handle, const char *name, qboolean crit) // First we need to get all the function pointers declared. #define QFGL_WANT(ret, name, args) \ - ret (GLAPIENTRY * qf##name) args; + VISIBLE ret (GLAPIENTRY * qf##name) args; #define QFGL_NEED(ret, name, args) \ - ret (GLAPIENTRY * qf##name) args; + VISIBLE ret (GLAPIENTRY * qf##name) args; #include "QF/GL/qf_funcs_list.h" #undef QFGL_NEED #undef QFGL_WANT @@ -159,7 +159,7 @@ QFGL_ParseExtensionList (const GLubyte *list, const char *name) return 0; } -qboolean +VISIBLE qboolean QFGL_ExtensionPresent (const char *name) { static const GLubyte *gl_extensions = NULL; diff --git a/libs/video/targets/vid.c b/libs/video/targets/vid.c index fedbb1b98..37d96fcc9 100644 --- a/libs/video/targets/vid.c +++ b/libs/video/targets/vid.c @@ -50,14 +50,14 @@ static __attribute__ ((used)) const char rcsid[] = #include "view.h" /* Software and hardware gamma support */ -byte gammatable[256]; +VISIBLE byte gammatable[256]; cvar_t *vid_gamma; cvar_t *vid_system_gamma; cvar_t *con_width; // FIXME: Try to move with rest of con code cvar_t *con_height; // FIXME: Try to move with rest of con code qboolean vid_gamma_avail; // hardware gamma availability -unsigned int d_8to24table[256]; +VISIBLE unsigned int d_8to24table[256]; /* Screen size */ int scr_width, scr_height; diff --git a/libs/video/targets/vid_common_gl.c b/libs/video/targets/vid_common_gl.c index e808b4208..fd1191839 100644 --- a/libs/video/targets/vid_common_gl.c +++ b/libs/video/targets/vid_common_gl.c @@ -63,73 +63,73 @@ static __attribute__ ((used)) const char rcsid[] = #define WARP_WIDTH 320 #define WARP_HEIGHT 200 -unsigned char d_15to8table[65536]; +VISIBLE unsigned char d_15to8table[65536]; -QF_glActiveTexture qglActiveTexture = NULL; -QF_glMultiTexCoord2f qglMultiTexCoord2f = NULL; -QF_glMultiTexCoord2fv qglMultiTexCoord2fv = NULL; +VISIBLE QF_glActiveTexture qglActiveTexture = NULL; +VISIBLE QF_glMultiTexCoord2f qglMultiTexCoord2f = NULL; +VISIBLE QF_glMultiTexCoord2fv qglMultiTexCoord2fv = NULL; -const char *gl_extensions; -const char *gl_renderer; -const char *gl_vendor; -const char *gl_version; +VISIBLE const char *gl_extensions; +VISIBLE const char *gl_renderer; +VISIBLE const char *gl_vendor; +VISIBLE const char *gl_version; -int gl_major; -int gl_minor; -int gl_release_number; +VISIBLE int gl_major; +VISIBLE int gl_minor; +VISIBLE int gl_release_number; static int gl_bgra_capable; -int use_bgra; -int gl_va_capable; -int vaelements; -int texture_extension_number = 1; -int gl_filter_min = GL_LINEAR_MIPMAP_LINEAR; -int gl_filter_max = GL_LINEAR; -float gldepthmin, gldepthmax; +VISIBLE int use_bgra; +VISIBLE int gl_va_capable; +VISIBLE int vaelements; +VISIBLE int texture_extension_number = 1; +VISIBLE int gl_filter_min = GL_LINEAR_MIPMAP_LINEAR; +VISIBLE int gl_filter_max = GL_LINEAR; +VISIBLE float gldepthmin, gldepthmax; // Multitexture -qboolean gl_mtex_capable = false; +VISIBLE qboolean gl_mtex_capable = false; static int gl_mtex_tmus = 0; -GLenum gl_mtex_enum; -int gl_mtex_active_tmus = 0; -qboolean gl_mtex_fullbright = false; +VISIBLE GLenum gl_mtex_enum; +VISIBLE int gl_mtex_active_tmus = 0; +VISIBLE qboolean gl_mtex_fullbright = false; // Combine -qboolean gl_combine_capable = false; -int lm_src_blend, lm_dest_blend; -float rgb_scale = 1.0; +VISIBLE qboolean gl_combine_capable = false; +VISIBLE int lm_src_blend, lm_dest_blend; +VISIBLE float rgb_scale = 1.0; -QF_glColorTableEXT qglColorTableEXT = NULL; -qboolean is8bit = false; +VISIBLE QF_glColorTableEXT qglColorTableEXT = NULL; +VISIBLE qboolean is8bit = false; -qboolean gl_feature_mach64 = false; +VISIBLE qboolean gl_feature_mach64 = false; // GL_EXT_texture_filter_anisotropic -qboolean Anisotropy; +VISIBLE qboolean Anisotropy; static float aniso_max; -float aniso; +VISIBLE float aniso; // GL_ATI_pn_triangles static qboolean TruForm; static int tess_max; -int tess; +VISIBLE int tess; // GL_LIGHT -int gl_max_lights; +VISIBLE int gl_max_lights; -cvar_t *gl_anisotropy; -cvar_t *gl_doublebright; -cvar_t *gl_fb_bmodels; -cvar_t *gl_finish; -cvar_t *gl_max_size; -cvar_t *gl_multitexture; -cvar_t *gl_tessellate; -cvar_t *gl_textures_bgra; -cvar_t *gl_vaelements_max; -cvar_t *gl_vector_light; -cvar_t *gl_screenshot_byte_swap; -cvar_t *vid_mode; -cvar_t *vid_use8bit; +VISIBLE cvar_t *gl_anisotropy; +VISIBLE cvar_t *gl_doublebright; +VISIBLE cvar_t *gl_fb_bmodels; +VISIBLE cvar_t *gl_finish; +VISIBLE cvar_t *gl_max_size; +VISIBLE cvar_t *gl_multitexture; +VISIBLE cvar_t *gl_tessellate; +VISIBLE cvar_t *gl_textures_bgra; +VISIBLE cvar_t *gl_vaelements_max; +VISIBLE cvar_t *gl_vector_light; +VISIBLE cvar_t *gl_screenshot_byte_swap; +VISIBLE cvar_t *vid_mode; +VISIBLE cvar_t *vid_use8bit; void gl_multitexture_f (cvar_t *var); @@ -177,7 +177,7 @@ gl_fb_bmodels_f (cvar_t *var) } } -void +VISIBLE void gl_multitexture_f (cvar_t *var) { if (!var) @@ -614,7 +614,7 @@ GL_Init_Common (void) CheckLights (); } -void +VISIBLE void GL_BeginRendering (int *x, int *y, int *width, int *height) { *x = *y = 0; @@ -622,7 +622,7 @@ GL_BeginRendering (int *x, int *y, int *width, int *height) *height = scr_height; } -qboolean +VISIBLE qboolean VID_Is8bit (void) { return is8bit; diff --git a/libs/video/targets/vid_common_sw32.c b/libs/video/targets/vid_common_sw32.c index 17f196ff1..f16fc9f83 100644 --- a/libs/video/targets/vid_common_sw32.c +++ b/libs/video/targets/vid_common_sw32.c @@ -41,7 +41,7 @@ static __attribute__ ((used)) const char rcsid[] = -unsigned short d_8to16table[256]; +VISIBLE unsigned short d_8to16table[256]; unsigned char d_15to8table[65536]; @@ -203,7 +203,7 @@ VID_MakeColormaps (int fullbrights, byte *pal) VID_MakeColormap32(vid.colormap32, pal); } -void +VISIBLE void VID_InitBuffers (void) { int buffersize, zbuffersize, cachesize = 1; @@ -260,7 +260,7 @@ VID_InitBuffers (void) vid.init_caches (vid.surfcache, cachesize); } -void +VISIBLE void VID_ShiftPalette (unsigned char *p) { VID_SetPalette (p); diff --git a/libs/video/targets/vid_glx.c b/libs/video/targets/vid_glx.c index b7058bfc9..1e7d620c5 100644 --- a/libs/video/targets/vid_glx.c +++ b/libs/video/targets/vid_glx.c @@ -160,7 +160,7 @@ GL_Init (void) GL_Init_Common (); } -void +VISIBLE void GL_EndRendering (void) { qfglFinish (); diff --git a/libs/video/targets/vid_sdl32.c b/libs/video/targets/vid_sdl32.c index daad3fd01..110ecf058 100644 --- a/libs/video/targets/vid_sdl32.c +++ b/libs/video/targets/vid_sdl32.c @@ -181,7 +181,7 @@ VID_Init (unsigned char *palette) vid.initialized = true; } -void +VISIBLE void VID_Update (vrect_t *rects) { while (rects) { @@ -230,12 +230,12 @@ D_EndDirectRect (int x, int y, int width, int height) SDL_UpdateRect (screen, x, y, width, height); } -void +VISIBLE void VID_LockBuffer (void) { } -void +VISIBLE void VID_UnlockBuffer (void) { } diff --git a/libs/video/targets/vid_sgl.c b/libs/video/targets/vid_sgl.c index 709f99d97..b5536e4a9 100644 --- a/libs/video/targets/vid_sgl.c +++ b/libs/video/targets/vid_sgl.c @@ -90,7 +90,7 @@ GL_Init (void) GL_Init_Common (); } -void +VISIBLE void GL_EndRendering (void) { qfglFinish ();