]> icculus.org git repositories - divverent/darkplaces.git/blob - progsvm.h
fog gets additional parameters mindist and maxdist that specify where fog "starts...
[divverent/darkplaces.git] / progsvm.h
1 /*
2 Copyright (C) 1996-1997 Id Software, Inc.
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
13 See the GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18
19 */
20 /*
21 This is a try to make the vm more generic, it is mainly based on the progs.h file.
22 For the license refer to progs.h.
23
24 Generic means, less as possible hard-coded links with the other parts of the engine.
25 This means no edict_engineprivate struct usage, etc.
26 The code uses void pointers instead.
27 */
28
29 #ifndef PROGSVM_H
30 #define PROGSVM_H
31
32 #include "pr_comp.h"                    // defs shared with qcc
33 #include "progdefs.h"                   // generated by program cdefs
34 #include "clprogdefs.h"                 // generated by program cdefs
35
36 #ifdef SUPPORT_GECKO
37 // forward declaration of clgecko_t
38 typedef struct clgecko_s clgecko_t;
39 #endif
40
41 typedef struct prvm_stack_s
42 {
43         int                             s;
44         mfunction_t             *f;
45 } prvm_stack_t;
46
47
48 typedef union prvm_eval_s
49 {
50         string_t                string;
51         float                   _float;
52         float                   vector[3];
53         func_t                  function;
54         int                             ivector[3];
55         int                             _int;
56         int                             edict;
57 } prvm_eval_t;
58
59 typedef struct prvm_required_field_s
60 {
61         int type;
62         const char *name;
63 } prvm_required_field_t;
64
65
66 // AK: I dont call it engine private cause it doesnt really belongs to the engine
67 //     it belongs to prvm.
68 typedef struct prvm_edict_private_s
69 {
70         qboolean free;
71         float freetime;
72 } prvm_edict_private_t;
73
74 typedef struct prvm_edict_s
75 {
76         // engine-private fields (stored in dynamically resized array)
77         //edict_engineprivate_t *e;
78         union
79         {
80                 prvm_edict_private_t *required;
81                 void *vp;
82                 // FIXME: this server pointer really means world, not server
83                 // (it is used by both server qc and client qc, but not menu qc)
84                 edict_engineprivate_t *server;
85                 // add other private structs as you desire
86                 // new structs have to start with the elements of prvm_edit_private_t
87                 // e.g. a new struct has to either look like this:
88                 //      typedef struct server_edict_private_s {
89                 //              prvm_edict_private_t base;
90                 //              vec3_t moved_from;
91                 //      vec3_t moved_fromangles;
92                 //              ... } server_edict_private_t;
93                 // or:
94                 //      typedef struct server_edict_private_s {
95                 //              qboolean free;
96                 //              float freetime;
97                 //              vec3_t moved_from;
98                 //      vec3_t moved_fromangles;
99                 //              ... } server_edict_private_t;
100                 // However, the first one should be preferred.
101         } priv;
102         // QuakeC fields (stored in dynamically resized array)
103         union
104         {
105                 void *vp;
106                 entvars_t               *server;
107                 cl_entvars_t    *client;
108         } fields;
109 } prvm_edict_t;
110
111 #define PRVM_EDICTFIELDVALUE(ed, fieldoffset) (fieldoffset >= 0 ? (prvm_eval_t *)((int *)ed->fields.vp + fieldoffset) : NULL)
112 #define PRVM_GLOBALFIELDVALUE(fieldoffset) (fieldoffset >= 0 ? (prvm_eval_t *)((int *)prog->globals.generic + fieldoffset) : NULL)
113
114 //============================================================================
115 #define PRVM_OP_STATE           1
116
117 #define PRVM_MAX_STACK_DEPTH            1024
118 #define PRVM_LOCALSTACK_SIZE            16384
119
120 #define PRVM_MAX_OPENFILES 256
121 #define PRVM_MAX_OPENSEARCHES 128
122 #ifdef SUPPORT_GECKO
123 #define PRVM_MAX_GECKOINSTANCES 32
124 #endif
125
126 typedef void (*prvm_builtin_t) (void);
127
128 // NOTE: field offsets use -1 for NULL
129 typedef struct prvm_prog_fieldoffsets_s
130 {
131         // server and client use a lot of similar fields, so this is combined
132         int SendEntity; // ssqc
133         int Version; // ssqc
134         int alpha; // ssqc / csqc
135         int ammo_cells1; // ssqc - Dissolution of Eternity mission pack
136         int ammo_lava_nails; // ssqc - Dissolution of Eternity mission pack
137         int ammo_multi_rockets; // ssqc - Dissolution of Eternity mission pack
138         int ammo_nails1; // ssqc - Dissolution of Eternity mission pack
139         int ammo_plasma; // ssqc - Dissolution of Eternity mission pack
140         int ammo_rockets1; // ssqc - Dissolution of Eternity mission pack
141         int ammo_shells1; // ssqc - Dissolution of Eternity mission pack
142         int angles; // common - used by changeyaw/changepitch
143         int button3; // ssqc
144         int button4; // ssqc
145         int button5; // ssqc
146         int button6; // ssqc
147         int button7; // ssqc
148         int button8; // ssqc
149         int button9; // ssqc
150         int button10; // ssqc
151         int button11; // ssqc
152         int button12; // ssqc
153         int button13; // ssqc
154         int button14; // ssqc
155         int button15; // ssqc
156         int button16; // ssqc
157         int buttonchat; // ssqc
158         int buttonuse; // ssqc
159         int chain; // common - used by find builtins
160         int classname; // common
161         int clientcolors; // ssqc
162         int color; // ssqc
163         int colormod; // ssqc / csqc
164         int contentstransition; // ssqc
165         int cursor_active; // ssqc
166         int cursor_screen; // ssqc
167         int cursor_trace_endpos; // ssqc
168         int cursor_trace_ent; // ssqc
169         int cursor_trace_start; // ssqc
170         int customizeentityforclient; // ssqc
171         int dimension_hit; // ssqc / csqc
172         int dimension_solid; // ssqc / csqc
173         int disableclientprediction; // ssqc
174         int dphitcontentsmask; // ssqc / csqc
175         int drawonlytoclient; // ssqc
176         int effects; // ssqc / csqc
177         int exteriormodeltoclient; // ssqc
178         int fatness; // ssqc / csqc
179         int forceshader; // csqc
180         int frame1time; // csqc
181         int frame2; // csqc
182         int frame2time; // csqc
183         int frame; // common - used by OP_STATE
184         int fullbright; // ssqc - Nehahra support
185         int glow_color; // ssqc
186         int glow_size; // ssqc
187         int glow_trail; // ssqc
188         int gravity; // ssqc
189         int groundentity; // ssqc / csqc
190         int hull; // ssqc / csqc
191         int ideal_yaw; // ssqc / csqc
192         int idealpitch; // ssqc / csqc
193         int items2; // ssqc
194         int lerpfrac; // csqc
195         int light_lev; // ssqc
196         int message; // csqc
197         int modelflags; // ssqc
198         int movement; // ssqc
199         int nextthink; // common - used by OP_STATE
200         int netaddress; // ssqc
201         int nodrawtoclient; // ssqc
202         int pflags; // ssqc
203         int ping; // ssqc
204         int pitch_speed; // ssqc / csqc
205         int playermodel; // ssqc
206         int playerskin; // ssqc
207         int pmodel; // ssqc
208         int punchvector; // ssqc
209         int renderamt; // ssqc - HalfLife support
210         int renderflags; // csqc
211         int rendermode; // ssqc - HalfLife support
212         int scale; // ssqc / csqc
213         int style; // ssqc
214         int tag_entity; // ssqc / csqc
215         int tag_index; // ssqc / csqc
216         int think; // common - used by OP_STATE
217         int viewmodelforclient; // ssqc
218         int viewzoom; // ssqc
219         int yaw_speed; // ssqc / csqc
220 }
221 prvm_prog_fieldoffsets_t;
222
223 // NOTE: global offsets use -1 for NULL
224 typedef struct prvm_prog_globaloffsets_s
225 {
226         // server and client use a lot of similar globals, so this is combined
227         int SV_InitCmd; // ssqc
228         int self; // common
229         int time; // ssqc / csqc
230         int v_forward; // ssqc / csqc
231         int v_right; // ssqc / csqc
232         int v_up; // ssqc / csqc
233         int view_angles; // csqc
234         int trace_allsolid; // ssqc / csqc
235         int trace_startsolid; // ssqc / csqc
236         int trace_fraction; // ssqc / csqc
237         int trace_inwater; // ssqc / csqc
238         int trace_inopen; // ssqc / csqc
239         int trace_endpos; // ssqc / csqc
240         int trace_plane_normal; // ssqc / csqc
241         int trace_plane_dist; // ssqc / csqc
242         int trace_ent; // ssqc / csqc
243         int trace_dphitcontents; // ssqc / csqc
244         int trace_dphitq3surfaceflags; // ssqc / csqc
245         int trace_dphittexturename; // ssqc / csqc
246         int trace_dpstartcontents; // ssqc / csqc
247         int intermission; // csqc
248         int coop; // csqc
249         int deathmatch; // csqc
250         int dmg_take; // csqc
251         int dmg_save; // csqc
252         int dmg_origin; // csqc
253         int sb_showscores; // csqc
254         int drawfont; // csqc / menu
255 }
256 prvm_prog_globaloffsets_t;
257
258 // these are initialized using PRVM_ED_FindFunction
259 // NOTE: function offsets use 0 for NULL
260 typedef struct prvm_prog_funcoffsets_s
261 {
262         func_t CSQC_ConsoleCommand; // csqc
263         func_t CSQC_Ent_Remove; // csqc
264         func_t CSQC_Ent_Update; // csqc
265         func_t CSQC_Event; // csqc [515]: engine call this for its own needs so csqc can do some things according to what engine it's running on.  example: to say about edicts increase, whatever...
266         func_t CSQC_Event_Sound; // csqc : called by engine when an incoming sound packet arrives so CSQC can act on it
267         func_t CSQC_Init; // csqc
268         func_t CSQC_InputEvent; // csqc
269         func_t CSQC_Parse_CenterPrint; // csqc
270         func_t CSQC_Parse_Print; // csqc
271         func_t CSQC_Parse_StuffCmd; // csqc
272         func_t CSQC_Parse_TempEntity; // csqc [515]: very helpfull when you want to create your own particles/decals/etc for effects that already exist
273         func_t CSQC_Shutdown; // csqc
274         func_t CSQC_UpdateView; // csqc
275         func_t EndFrame; // ssqc
276         func_t RestoreGame; // ssqc
277         func_t SV_ChangeTeam; // ssqc
278         func_t SV_ParseClientCommand; // ssqc
279         func_t SV_PlayerPhysics; // ssqc
280         func_t SV_OnEntityNoSpawnFunction; // ssqc
281         func_t GameCommand; // any
282
283         // menu qc only uses some functions, nothing else
284         func_t m_draw; // mqc
285         func_t m_init; // mqc
286         func_t m_keydown; // mqc
287         func_t m_keyup; // mqc
288         func_t m_shutdown; // mqc
289         func_t m_toggle; // mqc
290 }
291 prvm_prog_funcoffsets_t;
292
293 // [INIT] variables flagged with this token can be initialized by 'you'
294 // NOTE: external code has to create and free the mempools but everything else is done by prvm !
295 typedef struct prvm_prog_s
296 {
297         double              starttime;
298         dprograms_t                     *progs;
299         mfunction_t                     *functions;
300         char                            *strings;
301         int                                     stringssize;
302         ddef_t                          *fielddefs;
303         ddef_t                          *globaldefs;
304         dstatement_t            *statements;
305         int                                     edict_size;                     // in bytes
306         int                                     edictareasize;          // LordHavoc: in bytes (for bound checking)
307
308         int                                     *statement_linenums; // NULL if not available
309
310         double                          *statement_profile; // only incremented if prvm_statementprofiling is on
311
312         union {
313                 float *generic;
314                 globalvars_t *server;
315                 cl_globalvars_t *client;
316         } globals;
317
318         int                                     maxknownstrings;
319         int                                     numknownstrings;
320         // this is updated whenever a string is removed or added
321         // (simple optimization of the free string search)
322         int                                     firstfreeknownstring;
323         const char                      **knownstrings;
324         unsigned char           *knownstrings_freeable;
325         const char                      ***stringshash;
326
327         // all memory allocations related to this vm_prog (code, edicts, strings)
328         mempool_t                       *progs_mempool; // [INIT]
329
330         prvm_builtin_t          *builtins; // [INIT]
331         int                                     numbuiltins; // [INIT]
332
333         int                                     argc;
334
335         int                                     trace;
336         mfunction_t                     *xfunction;
337         int                                     xstatement;
338
339         // stacktrace writes into stack[MAX_STACK_DEPTH]
340         // thus increase the array, so depth wont be overwritten
341         prvm_stack_t            stack[PRVM_MAX_STACK_DEPTH+1];
342         int                                     depth;
343
344         int                                     localstack[PRVM_LOCALSTACK_SIZE];
345         int                                     localstack_used;
346
347         unsigned short          headercrc; // [INIT]
348
349         unsigned short          filecrc;
350
351         //============================================================================
352         // until this point everything also exists (with the pr_ prefix) in the old vm
353
354         qfile_t                         *openfiles[PRVM_MAX_OPENFILES];
355         fssearch_t                      *opensearches[PRVM_MAX_OPENSEARCHES];
356 #ifdef SUPPORT_GECKO
357         clgecko_t                       *opengeckoinstances[PRVM_MAX_GECKOINSTANCES];
358 #endif
359
360         // copies of some vars that were former read from sv
361         int                                     num_edicts;
362         // number of edicts for which space has been (should be) allocated
363         int                                     max_edicts; // [INIT]
364         // used instead of the constant MAX_EDICTS
365         int                                     limit_edicts; // [INIT]
366
367         // number of reserved edicts (allocated from 1)
368         int                                     reserved_edicts; // [INIT]
369
370         prvm_edict_t            *edicts;
371         void                                    *edictsfields;
372         void                                    *edictprivate;
373
374         // size of the engine private struct
375         int                                     edictprivate_size; // [INIT]
376
377         prvm_prog_fieldoffsets_t        fieldoffsets;
378         prvm_prog_globaloffsets_t       globaloffsets;
379         prvm_prog_funcoffsets_t         funcoffsets;
380
381         // allow writing to world entity fields, this is set by server init and
382         // cleared before first server frame
383         qboolean                        allowworldwrites;
384
385         // name of the prog, e.g. "Server", "Client" or "Menu" (used for text output)
386         char                            *name; // [INIT]
387
388         // flag - used to store general flags like PRVM_GE_SELF, etc.
389         int                             flag;
390
391         char                            *extensionstring; // [INIT]
392
393         qboolean                        loadintoworld; // [INIT]
394
395         // used to indicate whether a prog is loaded
396         qboolean                        loaded;
397
398 //      prvm_builtin_mem_t  *mem_list;
399
400 // now passed as parameter of PRVM_LoadProgs
401 //      char                            **required_func;
402 //      int                                     numrequiredfunc;
403
404         //============================================================================
405
406         ddef_t                          *self; // if self != 0 then there is a global self
407
408         //============================================================================
409         // function pointers
410
411         void                            (*begin_increase_edicts)(void); // [INIT] used by PRVM_MEM_Increase_Edicts
412         void                            (*end_increase_edicts)(void); // [INIT]
413
414         void                            (*init_edict)(prvm_edict_t *edict); // [INIT] used by PRVM_ED_ClearEdict
415         void                            (*free_edict)(prvm_edict_t *ed); // [INIT] used by PRVM_ED_Free
416
417         void                            (*count_edicts)(void); // [INIT] used by PRVM_ED_Count_f
418
419         qboolean                        (*load_edict)(prvm_edict_t *ent); // [INIT] used by PRVM_ED_LoadFromFile
420
421         void                            (*init_cmd)(void); // [INIT] used by PRVM_InitProg
422         void                            (*reset_cmd)(void); // [INIT] used by PRVM_ResetProg
423
424         void                            (*error_cmd)(const char *format, ...) DP_FUNC_PRINTF(1); // [INIT]
425
426 } prvm_prog_t;
427
428 extern prvm_prog_t * prog;
429
430 #define PRVM_MAXPROGS 3
431 #define PRVM_SERVERPROG 0 // actually not used at the moment
432 #define PRVM_CLIENTPROG 1
433 #define PRVM_MENUPROG   2
434
435 extern prvm_prog_t prvm_prog_list[PRVM_MAXPROGS];
436
437 //============================================================================
438 // prvm_cmds part
439
440 extern prvm_builtin_t vm_sv_builtins[];
441 extern prvm_builtin_t vm_cl_builtins[];
442 extern prvm_builtin_t vm_m_builtins[];
443
444 extern const int vm_sv_numbuiltins;
445 extern const int vm_cl_numbuiltins;
446 extern const int vm_m_numbuiltins;
447
448 extern char * vm_sv_extensions; // client also uses this
449 extern char * vm_m_extensions;
450
451 void VM_SV_Cmd_Init(void);
452 void VM_SV_Cmd_Reset(void);
453
454 void VM_CL_Cmd_Init(void);
455 void VM_CL_Cmd_Reset(void);
456
457 void VM_M_Cmd_Init(void);
458 void VM_M_Cmd_Reset(void);
459
460 void VM_Cmd_Init(void);
461 void VM_Cmd_Reset(void);
462 //============================================================================
463
464 void PRVM_Init (void);
465
466 void PRVM_ExecuteProgram (func_t fnum, const char *errormessage);
467
468 #define PRVM_Alloc(buffersize) _PRVM_Alloc(buffersize, __FILE__, __LINE__)
469 #define PRVM_Free(buffer) _PRVM_Free(buffer, __FILE__, __LINE__)
470 #define PRVM_FreeAll() _PRVM_FreeAll(__FILE__, __LINE__)
471 void *_PRVM_Alloc (size_t buffersize, const char *filename, int fileline);
472 void _PRVM_Free (void *buffer, const char *filename, int fileline);
473 void _PRVM_FreeAll (const char *filename, int fileline);
474
475 void PRVM_Profile (int maxfunctions, int mininstructions);
476 void PRVM_Profile_f (void);
477 void PRVM_CallProfile_f (void);
478 void PRVM_PrintFunction_f (void);
479
480 void PRVM_PrintState(void);
481 void PRVM_CrashAll (void);
482 void PRVM_Crash (void);
483
484 ddef_t *PRVM_ED_FindField(const char *name);
485 ddef_t *PRVM_ED_FindGlobal(const char *name);
486 mfunction_t *PRVM_ED_FindFunction(const char *name);
487
488 int PRVM_ED_FindFieldOffset(const char *name);
489 int PRVM_ED_FindGlobalOffset(const char *name);
490 func_t PRVM_ED_FindFunctionOffset(const char *name);
491 #define PRVM_ED_FindFieldOffset_FromStruct(st, field) prog->fieldoffsets . field = ((int *)(&((st *)NULL)-> field ) - ((int *)NULL))
492 #define PRVM_ED_FindGlobalOffset_FromStruct(st, field) prog->globaloffsets . field = ((int *)(&((st *)NULL)-> field ) - ((int *)NULL))
493
494 void PRVM_MEM_IncreaseEdicts(void);
495
496 prvm_edict_t *PRVM_ED_Alloc (void);
497 void PRVM_ED_Free (prvm_edict_t *ed);
498 void PRVM_ED_ClearEdict (prvm_edict_t *e);
499
500 void PRVM_PrintFunctionStatements (const char *name);
501 void PRVM_ED_Print(prvm_edict_t *ed, const char *wildcard_fieldname);
502 void PRVM_ED_Write (qfile_t *f, prvm_edict_t *ed);
503 const char *PRVM_ED_ParseEdict (const char *data, prvm_edict_t *ent);
504
505 void PRVM_ED_WriteGlobals (qfile_t *f);
506 void PRVM_ED_ParseGlobals (const char *data);
507
508 void PRVM_ED_LoadFromFile (const char *data);
509
510 prvm_edict_t *PRVM_EDICT_NUM_ERROR(int n, char *filename, int fileline);
511 #define PRVM_EDICT_NUM(n) (((unsigned)(n) < (unsigned int)prog->max_edicts) ? prog->edicts + (n) : PRVM_EDICT_NUM_ERROR(n, __FILE__, __LINE__))
512
513 //int NUM_FOR_EDICT_ERROR(prvm_edict_t *e);
514 #define PRVM_NUM_FOR_EDICT(e) ((int)((prvm_edict_t *)(e) - prog->edicts))
515 //int PRVM_NUM_FOR_EDICT(prvm_edict_t *e);
516
517 #define PRVM_NEXT_EDICT(e) ((e) + 1)
518
519 #define PRVM_EDICT_TO_PROG(e) (PRVM_NUM_FOR_EDICT(e))
520 //int PRVM_EDICT_TO_PROG(prvm_edict_t *e);
521 #define PRVM_PROG_TO_EDICT(n) (PRVM_EDICT_NUM(n))
522 //prvm_edict_t *PRVM_PROG_TO_EDICT(int n);
523
524 //============================================================================
525
526 #define PRVM_G_FLOAT(o) (prog->globals.generic[o])
527 #define PRVM_G_INT(o) (*(int *)&prog->globals.generic[o])
528 #define PRVM_G_EDICT(o) (PRVM_PROG_TO_EDICT(*(int *)&prog->globals.generic[o]))
529 #define PRVM_G_EDICTNUM(o) PRVM_NUM_FOR_EDICT(PRVM_G_EDICT(o))
530 #define PRVM_G_VECTOR(o) (&prog->globals.generic[o])
531 #define PRVM_G_STRING(o) (PRVM_GetString(*(string_t *)&prog->globals.generic[o]))
532 //#define       PRVM_G_FUNCTION(o) (*(func_t *)&prog->globals.generic[o])
533
534 // FIXME: make these go away?
535 #define PRVM_E_FLOAT(e,o) (((float*)e->fields.vp)[o])
536 #define PRVM_E_INT(e,o) (((int*)e->fields.vp)[o])
537 //#define       PRVM_E_VECTOR(e,o) (&((float*)e->fields.vp)[o])
538 #define PRVM_E_STRING(e,o) (PRVM_GetString(*(string_t *)&((float*)e->fields.vp)[o]))
539
540 extern  int             prvm_type_size[8]; // for consistency : I think a goal of this sub-project is to
541 // make the new vm mostly independent from the old one, thus if it's necessary, I copy everything
542
543 void PRVM_Init_Exec(void);
544
545 void PRVM_ED_PrintEdicts_f (void);
546 void PRVM_ED_PrintNum (int ent, const char *wildcard_fieldname);
547
548 const char *PRVM_GetString(int num);
549 int PRVM_SetEngineString(const char *s);
550 int PRVM_SetTempString(const char *s);
551 int PRVM_AllocString(size_t bufferlength, char **pointer);
552 void PRVM_FreeString(int num);
553
554 //============================================================================
555
556 // used as replacement for a prog stack
557 //#define PRVM_DEBUGPRSTACK
558
559 #ifdef PRVM_DEBUGPRSTACK
560 #define PRVM_Begin  if(prog != 0) Con_Printf("prog not 0(prog = %i) in file: %s line: %i!\n", PRVM_GetProgNr(), __FILE__, __LINE__)
561 #define PRVM_End        prog = 0
562 #else
563 #define PRVM_Begin
564 #define PRVM_End        prog = 0
565 #endif
566
567 //#define PRVM_SAFENAME
568 #ifndef PRVM_SAFENAME
569 #       define PRVM_NAME        (prog->name)
570 #else
571 #       define PRVM_NAME        (prog->name ? prog->name : "Unknown prog name")
572 #endif
573
574 // helper macro to make function pointer calls easier
575 #define PRVM_GCALL(func)        if(prog->func) prog->func
576
577 #define PRVM_ERROR              prog->error_cmd
578
579 // other prog handling functions
580 qboolean PRVM_SetProgFromString(const char *str);
581 void PRVM_SetProg(int prognr);
582
583 /*
584 Initializing a vm:
585 Call InitProg with the num
586 Set up the fields marked with [INIT] in the prog struct
587 Load a program with LoadProgs
588 */
589 void PRVM_InitProg(int prognr);
590 // LoadProgs expects to be called right after InitProg
591 void PRVM_LoadProgs (const char *filename, int numrequiredfunc, char **required_func, int numrequiredfields, prvm_required_field_t *required_field, int numrequiredglobals, char **required_global);
592 void PRVM_ResetProg(void);
593
594 qboolean PRVM_ProgLoaded(int prognr);
595
596 int     PRVM_GetProgNr(void);
597
598 void VM_Warning(const char *fmt, ...) DP_FUNC_PRINTF(1);
599
600 // TODO: fill in the params
601 //void PRVM_Create();
602
603 #endif