2004-10-15 00:35:53 +00:00
//contains generic plugin code for dll/qvm
//it's this one or the engine...
# include "plugin.h"
typedef struct {
2012-10-08 05:29:52 +00:00
const char * name ;
2004-10-15 00:35:53 +00:00
export_t func ;
} exports_t ;
extern exports_t exports [ 16 ] ;
2012-10-08 05:29:52 +00:00
qintptr_t NATIVEEXPORT vmMain ( qintptr_t command , qintptr_t arg0 , qintptr_t arg1 , qintptr_t arg2 , qintptr_t arg3 , qintptr_t arg4 , qintptr_t arg5 , qintptr_t arg6 , qintptr_t arg7 , qintptr_t arg8 , qintptr_t arg9 , qintptr_t arg10 , qintptr_t arg11 )
2004-10-15 00:35:53 +00:00
{
2012-10-08 05:29:52 +00:00
qintptr_t ret ;
qintptr_t args [ 12 ] ;
2004-10-15 00:35:53 +00:00
args [ 0 ] = arg0 ;
args [ 1 ] = arg1 ;
args [ 2 ] = arg2 ;
args [ 3 ] = arg3 ;
args [ 4 ] = arg4 ;
args [ 5 ] = arg5 ;
args [ 6 ] = arg6 ;
args [ 7 ] = arg7 ;
args [ 8 ] = arg8 ;
args [ 9 ] = arg9 ;
args [ 10 ] = arg10 ;
args [ 11 ] = arg11 ;
// return exports[command].func(args);
ret = exports [ command ] . func ( args ) ;
return ret ;
}
# ifndef Q3_VM
2012-10-08 05:29:52 +00:00
qintptr_t ( QDECL * plugin_syscall ) ( qintptr_t arg , . . . ) ;
2004-10-15 00:35:53 +00:00
# endif
# define PASSFLOAT(f) *(int*)&(f)
# define ARGNAMES ,funcname
2012-10-08 05:29:52 +00:00
BUILTINR ( funcptr_t , Plug_GetEngineFunction , ( const char * funcname ) ) ;
2004-10-15 00:35:53 +00:00
# undef ARGNAMES
# define ARGNAMES ,funcname,expnum
2012-10-08 05:29:52 +00:00
BUILTINR ( int , Plug_ExportToEngine , ( const char * funcname , int expnum ) ) ;
2004-10-15 00:35:53 +00:00
# undef ARGNAMES
2012-04-23 05:07:40 +00:00
# ifndef Q3_VM
# define ARGNAMES ,funcname,func
2012-10-08 05:29:52 +00:00
BUILTINR ( qboolean , Plug_ExportNative , ( const char * funcname , void * func ) ) ;
2012-04-23 05:07:40 +00:00
# undef ARGNAMES
# endif
2004-10-15 00:35:53 +00:00
# define ARGNAMES ,text
2012-10-08 05:29:52 +00:00
BUILTIN ( void , Con_Print , ( const char * text ) ) ; //on to main console.
2004-10-15 00:35:53 +00:00
# undef ARGNAMES
2005-07-20 11:50:00 +00:00
# define ARGNAMES ,conname,text
BUILTIN ( void , Con_SubPrint , ( char * conname , char * text ) ) ; //on to named sub console (creating it too).
# undef ARGNAMES
# define ARGNAMES ,old,new
2005-12-16 18:08:40 +00:00
BUILTIN ( void , Con_RenameSub , ( char * old , char * new ) ) ; //rename a subconsole
# undef ARGNAMES
# define ARGNAMES ,conname
BUILTINR ( int , Con_IsActive , ( char * conname ) ) ;
# undef ARGNAMES
# define ARGNAMES ,conname
BUILTIN ( void , Con_SetActive , ( char * conname ) ) ;
# undef ARGNAMES
# define ARGNAMES ,conname
BUILTIN ( void , Con_Destroy , ( char * conname ) ) ;
# undef ARGNAMES
# define ARGNAMES ,connum,conname,connamelen
BUILTIN ( void , Con_NameForNum , ( int connum , char * conname , int connamelen ) ) ;
2005-07-20 11:50:00 +00:00
# undef ARGNAMES
2004-10-15 00:35:53 +00:00
# define ARGNAMES ,message
BUILTIN ( void , Sys_Error , ( char * message ) ) ; //abort the entire engine.
# undef ARGNAMES
2005-07-20 11:50:00 +00:00
# define ARGNAMES
2005-12-06 15:40:52 +00:00
BUILTINR ( unsigned int , Sys_Milliseconds , ( void ) ) ; //get the time the engine has been running.
2005-07-20 11:50:00 +00:00
# undef ARGNAMES
2004-10-15 00:35:53 +00:00
2005-07-20 11:50:00 +00:00
# define ARGNAMES ,buffer
2005-12-15 18:52:03 +00:00
BUILTINR ( int , Cmd_AddCommand , ( char * buffer ) ) ; //register a command.
2005-07-20 11:50:00 +00:00
# undef ARGNAMES
2004-10-15 00:35:53 +00:00
# define ARGNAMES ,buffer,bufsize
2005-12-06 15:40:52 +00:00
BUILTIN ( void , Cmd_Args , ( char * buffer , int bufsize ) ) ; //retrieve some arguments.
2004-10-15 00:35:53 +00:00
# undef ARGNAMES
# define ARGNAMES ,argnum,buffer,bufsize
2005-12-06 15:40:52 +00:00
BUILTIN ( void , Cmd_Argv , ( int argnum , char * buffer , int bufsize ) ) ; //retrieve a single argument at a time.
2004-10-15 00:35:53 +00:00
# undef ARGNAMES
# define ARGNAMES
2005-12-06 15:40:52 +00:00
BUILTINR ( int , Cmd_Argc , ( void ) ) ; //get the argument count.
2005-11-27 01:12:16 +00:00
# undef ARGNAMES
# define ARGNAMES ,msg
2005-12-06 15:40:52 +00:00
BUILTIN ( void , Cmd_TokenizeString , ( char * msg ) ) ; //tokenize a string.
2004-10-15 00:35:53 +00:00
# undef ARGNAMES
# define ARGNAMES ,text,insert
2005-12-06 15:40:52 +00:00
BUILTIN ( void , Cmd_AddText , ( char * text , qboolean insert ) ) ; //add stuff to the console input.
2004-10-15 00:35:53 +00:00
# undef ARGNAMES
# define ARGNAMES ,name,value
2005-12-06 15:40:52 +00:00
BUILTIN ( void , Cvar_SetString , ( char * name , char * value ) ) ; //set a cvar string
2004-10-15 00:35:53 +00:00
# undef ARGNAMES
2005-12-06 15:40:52 +00:00
# define ARGNAMES ,name,PASSFLOAT(value)
BUILTIN ( void , Cvar_SetFloat , ( char * name , float value ) ) ; //set a cvar float
2004-10-15 00:35:53 +00:00
# undef ARGNAMES
# define ARGNAMES ,name,retstring,sizeofretstring
2005-12-06 15:40:52 +00:00
BUILTINR ( qboolean , Cvar_GetString , ( char * name , char * retstring , int sizeofretstring ) ) ; //retrieve a cvar string
2004-10-15 00:35:53 +00:00
# undef ARGNAMES
# define ARGNAMES ,name
2005-12-06 15:40:52 +00:00
BUILTINR ( float , Cvar_GetFloat , ( char * name ) ) ; //get a cvar's value
2004-10-15 00:35:53 +00:00
# undef ARGNAMES
# define ARGNAMES ,name,defaultval,flags,grouphint
2005-12-06 15:40:52 +00:00
BUILTINR ( qhandle_t , Cvar_Register , ( char * name , char * defaultval , int flags , char * grouphint ) ) ; //register a new cvar
2004-10-15 00:35:53 +00:00
# undef ARGNAMES
# define ARGNAMES ,handle,modificationcount,stringv,floatv
2005-11-27 01:12:16 +00:00
BUILTINR ( int , Cvar_Update , ( qhandle_t handle , int * modificationcount , char * stringv , float * floatv ) ) ; //stringv is 256 chars long, don't expect this function to do anything if modification count is unchanged.
2004-10-15 00:35:53 +00:00
# undef ARGNAMES
# define ARGNAMES ,pnum,stats,maxstats
BUILTIN ( void , CL_GetStats , ( int pnum , unsigned int * stats , int maxstats ) ) ;
# undef ARGNAMES
2006-01-21 00:07:47 +00:00
# define ARGNAMES ,pnum,info
2007-08-11 15:20:35 +00:00
BUILTINR ( int , GetPlayerInfo , ( int pnum , plugclientinfo_t * info ) ) ;
2006-01-21 00:07:47 +00:00
# undef ARGNAMES
2007-09-17 20:54:26 +00:00
# define ARGNAMES
BUILTINR ( int , LocalPlayerNumber , ( void ) ) ;
# undef ARGNAMES
# define ARGNAMES ,info,infolen
BUILTIN ( void , GetServerInfo , ( char * info , int infolen ) ) ;
# undef ARGNAMES
# define ARGNAMES ,key,value
BUILTIN ( void , SetUserInfo , ( char * key , char * value ) ) ;
# undef ARGNAMES
2004-10-15 00:35:53 +00:00
2007-10-05 10:50:13 +00:00
# define ARGNAMES ,pos,buffer,bufferlen
2008-02-11 22:36:48 +00:00
BUILTIN ( void , GetLocationName , ( float * pos , char * buffer , int bufferlen ) ) ;
2007-10-05 10:50:13 +00:00
# undef ARGNAMES
2004-10-15 00:35:53 +00:00
# define ARGNAMES ,soundname
BUILTIN ( void , LocalSound , ( char * soundname ) ) ;
# undef ARGNAMES
2005-12-15 18:52:03 +00:00
# define ARGNAMES ,plugnum, buffer, bufsize
BUILTIN ( void , GetPluginName , ( int plugnum , char * buffer , int bufsize ) ) ;
# undef ARGNAMES
2004-10-15 00:35:53 +00:00
# define ARGNAMES ,name,iswadimage
BUILTINR ( qhandle_t , Draw_LoadImage , ( char * name , qboolean iswadimage ) ) ; //wad image is ONLY for loading out of q1 gfx.wad
# undef ARGNAMES
# define ARGNAMES ,PASSFLOAT(x),PASSFLOAT(y),PASSFLOAT(w),PASSFLOAT(h),PASSFLOAT(s1),PASSFLOAT(t1),PASSFLOAT(s2),PASSFLOAT(t2),image
2007-08-11 15:20:35 +00:00
BUILTINR ( int , Draw_Image , ( float x , float y , float w , float h , float s1 , float t1 , float s2 , float t2 , qhandle_t image ) ) ;
2004-10-15 00:35:53 +00:00
# undef ARGNAMES
2005-12-10 00:19:24 +00:00
# define ARGNAMES ,PASSFLOAT(x1),PASSFLOAT(y1),PASSFLOAT(x2),PASSFLOAT(y2)
BUILTIN ( void , Draw_Line , ( float x1 , float y1 , float x2 , float y2 ) ) ;
# undef ARGNAMES
2004-10-15 00:35:53 +00:00
# define ARGNAMES ,PASSFLOAT(x),PASSFLOAT(y),PASSFLOAT(w),PASSFLOAT(h)
2006-01-13 06:11:47 +00:00
BUILTIN ( void , Draw_Fill , ( float x , float y , float w , float h ) ) ;
2004-10-15 00:35:53 +00:00
# undef ARGNAMES
# define ARGNAMES ,x,y,characture
BUILTIN ( void , Draw_Character , ( int x , int y , unsigned int characture ) ) ;
# undef ARGNAMES
# define ARGNAMES ,palcol
BUILTIN ( void , Draw_Colourp , ( int palcol ) ) ;
# undef ARGNAMES
# define ARGNAMES ,PASSFLOAT(r),PASSFLOAT(g),PASSFLOAT(b)
BUILTIN ( void , Draw_Colour3f , ( float r , float g , float b ) ) ;
# undef ARGNAMES
# define ARGNAMES ,PASSFLOAT(r),PASSFLOAT(g),PASSFLOAT(b),PASSFLOAT(a)
BUILTIN ( void , Draw_Colour4f , ( float r , float g , float b , float a ) ) ;
# undef ARGNAMES
2005-11-27 01:12:16 +00:00
# define ARGNAMES ,s
BUILTIN ( void , SCR_CenterPrint , ( char * s ) ) ;
# undef ARGNAMES
2004-10-15 00:35:53 +00:00
# define ARGNAMES ,mnum
BUILTIN ( void , Menu_Control , ( int mnum ) ) ;
# undef ARGNAMES
# define ARGNAMES ,keyname
BUILTINR ( int , Key_GetKeyCode , ( char * keyname ) ) ;
# undef ARGNAMES
2005-11-30 00:48:29 +00:00
# define ARGNAMES ,name,handle,mode
2005-12-06 15:40:52 +00:00
BUILTINR ( int , FS_Open , ( char * name , qhandle_t * handle , int mode ) ) ;
2005-11-30 00:48:29 +00:00
# undef ARGNAMES
# define ARGNAMES ,handle
2005-12-06 15:40:52 +00:00
BUILTIN ( void , FS_Close , ( qhandle_t handle ) ) ;
2005-11-30 00:48:29 +00:00
# undef ARGNAMES
# define ARGNAMES ,handle,data,len
2005-12-06 15:40:52 +00:00
BUILTINR ( int , FS_Write , ( qhandle_t handle , void * data , int len ) ) ;
2005-11-30 00:48:29 +00:00
# undef ARGNAMES
# define ARGNAMES ,handle,data,len
2005-12-06 15:40:52 +00:00
BUILTINR ( int , FS_Read , ( qhandle_t handle , void * data , int len ) ) ;
2005-11-30 00:48:29 +00:00
# undef ARGNAMES
2005-07-20 11:50:00 +00:00
# define ARGNAMES ,ip,port
2005-12-06 15:40:52 +00:00
BUILTINR ( qhandle_t , Net_TCPConnect , ( char * ip , int port ) ) ;
2005-07-20 11:50:00 +00:00
# undef ARGNAMES
# define ARGNAMES ,ip,port,maxcount
2005-12-06 15:40:52 +00:00
BUILTINR ( qhandle_t , Net_TCPListen , ( char * ip , int port , int maxcount ) ) ;
2005-07-20 11:50:00 +00:00
# undef ARGNAMES
# define ARGNAMES ,socket,address,addresslen
2005-12-06 15:40:52 +00:00
BUILTINR ( qhandle_t , Net_Accept , ( qhandle_t socket , char * address , int addresslen ) ) ;
2005-07-20 11:50:00 +00:00
# undef ARGNAMES
# define ARGNAMES ,socket,buffer,len
2005-12-06 15:40:52 +00:00
BUILTINR ( int , Net_Recv , ( qhandle_t socket , void * buffer , int len ) ) ;
2005-07-20 11:50:00 +00:00
# undef ARGNAMES
# define ARGNAMES ,socket,buffer,len
2005-12-06 15:40:52 +00:00
BUILTINR ( int , Net_Send , ( qhandle_t socket , void * buffer , int len ) ) ;
2005-07-20 11:50:00 +00:00
# undef ARGNAMES
# define ARGNAMES ,socket
2005-12-06 15:40:52 +00:00
BUILTIN ( void , Net_Close , ( qhandle_t socket ) ) ;
2005-07-20 11:50:00 +00:00
# undef ARGNAMES
2009-04-19 01:46:52 +00:00
# define ARGNAMES ,inputbuffer,buffersize
BUILTINR ( int , ReadInputBuffer , ( void * inputbuffer , int buffersize ) ) ;
# undef ARGNAMES
# define ARGNAMES ,inputbuffer,bytes
BUILTINR ( int , UpdateInputBuffer , ( void * inputbuffer , int bytes ) ) ;
# undef ARGNAMES
2005-07-20 11:50:00 +00:00
# ifdef Q3_VM
# define ARGNAMES ,out,in,len
BUILTIN ( void , memcpy , ( void * out , void * in , int len ) ) ;
# undef ARGNAMES
# define ARGNAMES ,out,in,len
BUILTIN ( void , memset , ( void * out , int in , int len ) ) ;
# undef ARGNAMES
2005-11-27 01:12:16 +00:00
# define ARGNAMES ,out,in,len
BUILTIN ( void , memmove , ( void * out , void * in , int len ) ) ;
# undef ARGNAMES
2005-12-06 15:40:52 +00:00
# define ARGNAMES ,PASSFLOAT(f)
BUILTINR ( float , sqrt , ( float f ) ) ;
2005-12-10 00:19:24 +00:00
BUILTINR ( float , sin , ( float f ) ) ;
BUILTINR ( float , cos , ( float f ) ) ;
2005-12-06 15:40:52 +00:00
# undef ARGNAMES
2005-07-20 11:50:00 +00:00
# endif
2009-04-19 01:46:52 +00:00
2004-10-15 00:35:53 +00:00
char * va ( char * format , . . . ) //Identical in function to the one in Quake, though I can assure you that I wrote it...
{ //It's not exactly hard, just easy to use, so gets duplicated lots.
va_list argptr ;
static char string [ 1024 ] ;
va_start ( argptr , format ) ;
vsnprintf ( string , sizeof ( string ) , format , argptr ) ;
va_end ( argptr ) ;
return string ;
}
2012-10-08 05:29:52 +00:00
void Con_Printf ( const char * format , . . . )
2004-10-15 00:35:53 +00:00
{
va_list argptr ;
static char string [ 1024 ] ;
va_start ( argptr , format ) ;
vsnprintf ( string , sizeof ( string ) , format , argptr ) ;
va_end ( argptr ) ;
Con_Print ( string ) ;
}
2012-10-08 05:29:52 +00:00
void Sys_Errorf ( const char * format , . . . )
2004-10-15 00:35:53 +00:00
{
va_list argptr ;
static char string [ 1024 ] ;
va_start ( argptr , format ) ;
vsnprintf ( string , sizeof ( string ) , format , argptr ) ;
va_end ( argptr ) ;
Sys_Error ( string ) ;
}
2005-12-01 01:16:55 +00:00
void BadBuiltin ( void )
{
Sys_Error ( " Plugin tried calling a missing builtin \n " ) ;
}
2004-10-15 00:35:53 +00:00
void Plug_InitStandardBuiltins ( void )
{
2005-12-01 01:16:55 +00:00
//con_print is used if the others don't exist, and MUST come first (for the sake of sanity)
CHECKBUILTIN ( Con_Print ) ;
CHECKBUILTIN ( Plug_ExportToEngine ) ;
2012-04-23 05:07:40 +00:00
# ifndef Q3_VM
CHECKBUILTIN ( Plug_ExportNative ) ;
# endif
2005-12-01 01:16:55 +00:00
CHECKBUILTIN ( Sys_Error ) ;
2009-04-19 01:46:52 +00:00
CHECKBUILTIN ( ReadInputBuffer ) ;
CHECKBUILTIN ( UpdateInputBuffer ) ;
2005-07-20 11:50:00 +00:00
# ifdef Q3_VM
CHECKBUILTIN ( memcpy ) ;
2005-11-27 01:12:16 +00:00
CHECKBUILTIN ( memmove ) ;
2005-07-20 11:50:00 +00:00
CHECKBUILTIN ( memset ) ;
2005-12-06 15:40:52 +00:00
CHECKBUILTIN ( sqrt ) ;
2005-12-10 00:19:24 +00:00
CHECKBUILTIN ( sin ) ;
CHECKBUILTIN ( cos ) ;
2005-07-20 11:50:00 +00:00
# endif
CHECKBUILTIN ( Sys_Milliseconds ) ;
2004-10-15 00:35:53 +00:00
2005-07-20 11:50:00 +00:00
//command execution
CHECKBUILTIN ( Cmd_AddCommand ) ;
2004-10-15 00:35:53 +00:00
CHECKBUILTIN ( Cmd_Args ) ;
CHECKBUILTIN ( Cmd_Argv ) ;
CHECKBUILTIN ( Cmd_Argc ) ;
CHECKBUILTIN ( Cmd_AddText ) ;
2005-07-20 11:50:00 +00:00
//cvar stuff
2004-10-15 00:35:53 +00:00
CHECKBUILTIN ( Cvar_SetString ) ;
CHECKBUILTIN ( Cvar_SetFloat ) ;
CHECKBUILTIN ( Cvar_GetString ) ;
CHECKBUILTIN ( Cvar_GetFloat ) ;
CHECKBUILTIN ( Cvar_Register ) ;
CHECKBUILTIN ( Cvar_Update ) ;
2005-11-30 00:48:29 +00:00
//file system
CHECKBUILTIN ( FS_Open ) ;
CHECKBUILTIN ( FS_Read ) ;
CHECKBUILTIN ( FS_Write ) ;
CHECKBUILTIN ( FS_Close ) ;
2005-07-20 11:50:00 +00:00
//networking
CHECKBUILTIN ( Net_TCPConnect ) ;
CHECKBUILTIN ( Net_TCPListen ) ;
CHECKBUILTIN ( Net_Accept ) ;
CHECKBUILTIN ( Net_Recv ) ;
CHECKBUILTIN ( Net_Send ) ;
CHECKBUILTIN ( Net_Close ) ;
//random things
2004-10-15 00:35:53 +00:00
CHECKBUILTIN ( CL_GetStats ) ;
2006-01-21 00:07:47 +00:00
CHECKBUILTIN ( GetPlayerInfo ) ;
2007-09-17 20:54:26 +00:00
CHECKBUILTIN ( LocalPlayerNumber ) ;
CHECKBUILTIN ( GetServerInfo ) ;
CHECKBUILTIN ( SetUserInfo ) ;
2004-10-15 00:35:53 +00:00
CHECKBUILTIN ( LocalSound ) ;
CHECKBUILTIN ( Menu_Control ) ;
CHECKBUILTIN ( Key_GetKeyCode ) ;
2007-10-05 10:50:13 +00:00
CHECKBUILTIN ( GetLocationName ) ;
2004-10-15 00:35:53 +00:00
2005-07-20 11:50:00 +00:00
//drawing routines
2004-10-15 00:35:53 +00:00
CHECKBUILTIN ( Draw_LoadImage ) ;
CHECKBUILTIN ( Draw_Image ) ;
2005-12-10 00:19:24 +00:00
CHECKBUILTIN ( Draw_Line ) ;
2004-10-15 00:35:53 +00:00
CHECKBUILTIN ( Draw_Fill ) ;
CHECKBUILTIN ( Draw_Character ) ;
CHECKBUILTIN ( Draw_Colourp ) ;
CHECKBUILTIN ( Draw_Colour3f ) ;
CHECKBUILTIN ( Draw_Colour4f ) ;
2005-11-27 01:12:16 +00:00
CHECKBUILTIN ( SCR_CenterPrint ) ;
2005-07-20 11:50:00 +00:00
2005-12-15 18:52:03 +00:00
CHECKBUILTIN ( GetPluginName ) ;
2005-07-20 11:50:00 +00:00
//sub consoles (optional)
CHECKBUILTIN ( Con_SubPrint ) ;
CHECKBUILTIN ( Con_RenameSub ) ;
2005-12-16 18:08:40 +00:00
CHECKBUILTIN ( Con_IsActive ) ;
CHECKBUILTIN ( Con_SetActive ) ;
CHECKBUILTIN ( Con_Destroy ) ;
CHECKBUILTIN ( Con_NameForNum ) ;
2004-10-15 00:35:53 +00:00
}
# ifndef Q3_VM
2012-10-08 05:29:52 +00:00
void NATIVEEXPORT dllEntry ( qintptr_t ( QDECL * funcptr ) ( qintptr_t , . . . ) )
2005-05-17 22:05:45 +00:00
{
2005-06-15 15:40:10 +00:00
plugin_syscall = funcptr ;
2004-10-15 00:35:53 +00:00
}
# endif
vmvideo_t vid ;
2012-10-08 05:29:52 +00:00
qintptr_t Plug_UpdateVideo ( qintptr_t * args )
2004-10-15 00:35:53 +00:00
{
vid . width = args [ 0 ] ;
vid . height = args [ 1 ] ;
return true ;
}
2012-10-08 05:29:52 +00:00
qintptr_t Plug_InitAPI ( qintptr_t * args )
2004-10-15 00:35:53 +00:00
{
# ifdef Q3_VM
Plug_GetEngineFunction = ( void * ) args [ 0 ] ;
# else
BUILTIN_Plug_GetEngineFunction = args [ 0 ] ;
# endif
Plug_InitStandardBuiltins ( ) ;
Plug_Export ( " UpdateVideo " , Plug_UpdateVideo ) ;
return Plug_Init ( args ) ;
}
2012-10-08 05:29:52 +00:00
qboolean Plug_Export ( const char * name , export_t func )
2004-10-15 00:35:53 +00:00
{
int i ;
for ( i = 0 ; i < sizeof ( exports ) / sizeof ( exports [ 0 ] ) ; i + + )
{
if ( ! exports [ i ] . name )
{
exports [ i ] . name = name ;
exports [ i ] . func = func ;
return Plug_ExportToEngine ( name , i ) ;
}
}
Sys_Error ( " Plugin exports too many functions " ) ;
return 0 ;
}
exports_t exports [ sizeof ( exports ) / sizeof ( exports [ 0 ] ) ] = {
{ " Plug_Init " , Plug_InitAPI } ,
} ;
2005-07-20 11:50:00 +00:00