FTEQW
Documentation of the FTE engine source tree.
progsint.h
Go to the documentation of this file.
1#ifndef PROGSINT_H_INCLUDED
2#define PROGSINT_H_INCLUDED
3
4#ifdef _WIN32
5 #ifndef _CRT_SECURE_NO_WARNINGS
6 #define _CRT_SECURE_NO_WARNINGS
7 #endif
8 #define _CRT_NONSTDC_NO_WARNINGS
9 #ifndef _CRT_SECURE_NO_DEPRECATE
10 #define _CRT_SECURE_NO_DEPRECATE
11 #endif
12 #ifndef _CRT_NONSTDC_NO_DEPRECATE
13 #define _CRT_NONSTDC_NO_DEPRECATE
14 #endif
15 #ifndef AVAIL_ZLIB
16 #ifdef _MSC_VER
17 //#define AVAIL_ZLIB
18 #endif
19 #endif
20#ifndef _XBOX
21 #include <windows.h>
22#else
23 #include <xtl.h>
24#endif
25#else
26 #include <stdarg.h>
27 #include <math.h>
28
29 #include <stdlib.h>
30 #include <setjmp.h>
31 #include <string.h>
32 #include <ctype.h>
33
34 #ifndef __declspec
35 #define __declspec(mode)
36 #endif
37//#define _inline inline
38#endif
39typedef unsigned char pbyte;
40#include <stdio.h>
41
42#define DLL_PROG
43#ifndef PROGSUSED
44#define PROGSUSED
45#endif
46
47#define false 0
48#define true 1
49
50#include "progtype.h"
51#include "progslib.h"
52
53#include "pr_comp.h"
54
55#ifndef safeswitch
56 //safeswitch(foo){safedefault: break;}
57 //switch, but errors for any omitted enum values despite the presence of a default case.
58 //(gcc will generally give warnings without the default, but sometimes you don't have control over the source of your enumeration values)
59 #if (__GNUC__ >= 4)
60 #define safeswitch \
61 _Pragma("GCC diagnostic push") \
62 _Pragma("GCC diagnostic error \"-Wswitch-enum\"") \
63 _Pragma("GCC diagnostic error \"-Wswitch-default\"") \
64 switch
65 #define safedefault _Pragma("GCC diagnostic pop") default
66 #else
67 #define safeswitch switch
68 #define safedefault default
69 #endif
70#endif
71
72
73#ifdef _MSC_VER
74#pragma warning(disable : 4244)
75#pragma warning(disable : 4267)
76#endif
77
78#ifndef stricmp
79#ifdef _WIN32
80 //Windows-specific...
81 #define stricmp _stricmp
82 #define strnicmp _strnicmp
83#else
84 //Posix
85 #define stricmp strcasecmp
86 #define strnicmp strncasecmp
87#endif
88#endif
89
90//extern progfuncs_t *progfuncs;
91typedef struct sharedvar_s
92{
93 int varofs;
94 int size;
96typedef struct
97{
99 unsigned char stepping;
100 unsigned char progsnum;
101 int s;
103 prclocks_t timestamp;
104} prstack_t;
105
106#if defined(QCGC) && defined(MULTITHREAD)
107 #define THREADEDGC
108#endif
109
110typedef struct
111{
112 unsigned int size; //size of the data.
113 char value[4]; //contents of the tempstring (or really any binary data - but not tempstring references because we don't mark these!).
114} tempstr_t;
115
116//FIXME: the defines hidden inside this structure are evil.
117typedef struct prinst_s
118 {
119 //temp strings are GCed, and can be created by engine, builtins, or just by ent parsing code.
121 unsigned int maxtempstrings;
122#if defined(QCGC)
123 unsigned int nexttempstring;
124 unsigned int livetemps; //increased on alloc, decremented after sweep
125 #ifdef THREADEDGC
126 struct qcgccontext_s *gccontext;
127 #endif
128#else
129 unsigned int numtempstrings;
131#endif
132
133 //alloced strings are generally used to direct strings outside of the vm itself, sharing them with general engine state.
137
139#define pr_progstate prinst.progstate
140 unsigned int maxprogs;
141
142 progsnum_t pr_typecurrent; //active index into progstate array. fixme: remove in favour of only using current_progstate
143
145#define current_progstate prinst.current_progstate
146
151
152 unsigned int numshares;
153 sharedvar_t *shares; //shared globals, not including parms
154 unsigned int maxshares;
155
156 struct prmemb_s *memblocks;
157
158 unsigned int maxfields;
159 unsigned int numfields;
160 fdef_t *field; //biggest size
161
163
164
165//pr_exec.c
166 //call stack
167#define MAX_STACK_DEPTH 1024 //insanely high value requried for xonotic.
168 prstack_t pr_stack[MAX_STACK_DEPTH];
171
172 //locals
173#define LOCALSTACK_SIZE 16384
174 int localstack[LOCALSTACK_SIZE];
176
177 //step-by-step debug state
180
182 prclocks_t profilingalert; //one second, in cpu clocks
183 mfunction_t *pr_xfunction; //active function
184 int pr_xstatement; //active statement
185
186//pr_edict.c
188 unsigned int fields_size; // in bytes
189 unsigned int max_fields_size;
190
191
192//initlib.c
197
198 unsigned int maxedicts;
201
202typedef struct progfuncs_s
203{
205 struct prinst_s inst; //private fields. Leave alone.
207
208#define prinst progfuncs->inst
209#define externs progfuncs->funcs.parms
210
211#include "qcd.h"
212
213#define STRING_SPECMASK 0xc0000000 //
214#define STRING_TEMP 0x80000000 //temp string, will be collected.
215#define STRING_STATIC 0xc0000000 //pointer to non-qcvm string.
216#define STRING_NORMAL_ 0x00000000 //stringtable/mutable. should always be a fallthrough
217#define STRING_NORMAL2_ 0x40000000 //stringtable/mutable. should always be a fallthrough
218
219typedef struct
220{
221 int targetflags; //weather we need to mark the progs as a newer version
222 char *name;
223 char *opname;
225 enum {ASSOC_LEFT, ASSOC_RIGHT, ASSOC_RIGHT_RESULT} associative;
226 struct QCC_type_s **type_a, **type_b, **type_c;
227
228 unsigned int flags; //OPF_*
229 //ASSIGNS_B
230 //ASSIGNS_IB
231 //ASSIGNS_C
232 //ASSIGNS_IC
234extern QCC_opcode_t pr_opcodes[]; // sized by initialization
235#define OPF_VALID 0x001 //we're allowed to use this opcode in the current target.
236#define OPF_STD 0x002 //reads a+b, writes c.
237#define OPF_STORE 0x010 //b+=a or just b=a
238#define OPF_STOREPTR 0x020 //the form of c=(*b+=a)
239#define OPF_STOREPTROFS 0x040 //a[c] <- b (c must be 0 when QCC_OPCode_StorePOffset returns false)
240#define OPF_STOREFLD 0x080 //a.b <- c
241#define OPF_LOADPTR 0x100
242#define OPF_STDUNARY 0x200 //reads a, writes c.
243//FIXME: add jumps
244
245
246
247#if defined(_MSC_VER) && _MSC_VER < 1900
248#define Q_vsnprintf _vsnprintf
249#else
250#define Q_vsnprintf vsnprintf
251#endif
252
253#ifndef max
254#define max(a,b) ((a) > (b) ? (a) : (b))
255#define min(a,b) ((a) < (b) ? (a) : (b))
256#endif
257
258#define sv_num_edicts (*externs->num_edicts)
259#define sv_edicts (*externs->edicts)
260
261#define PR_DPrintf externs->DPrintf
262//#define printf syntax error
263//#define Sys_Error externs->Sys_Error
264
266void PRHunkFree(progfuncs_t *progfuncs, int mark);
267void *PRHunkAlloc(progfuncs_t *progfuncs, int size, const char *name);
268void *PRAddressableExtend(progfuncs_t *progfuncs, void *src, size_t srcsize, int pad);
269
270#ifdef printf
271#undef LIKEPRINTF
272#define LIKEPRINTF(x)
273#endif
274
275//void *HunkAlloc (int size);
276char *VARGS qcva (char *text, ...) LIKEPRINTF(1);
279void PDECL QC_AddSharedVar(pubprogfuncs_t *progfuncs, int num, int type);
280void PDECL QC_AddSharedFieldVar(pubprogfuncs_t *progfuncs, int num, char *stringtable);
281void QC_AddFieldGlobal(pubprogfuncs_t *ppf, int *globdata);
282int PDECL QC_RegisterFieldVar(pubprogfuncs_t *progfuncs, unsigned int type, const char *name, signed long requestedpos, signed long originalofs);
284int PDECL PR_ToggleBreakpoint(pubprogfuncs_t *progfuncs, const char *filename, int linenum, int flag);
285void StripExtension (char *path);
286
287
288#define edvars(ed) (((edictrun_t*)ed)->fields) //pointer to the field vars, given an edict
289
290
291void SetEndian(void);
292extern short (*PRBigShort) (short l);
293extern short (*PRLittleShort) (short l);
294extern int (*PRBigLong) (int l);
295extern int (*PRLittleLong) (int l);
296extern float (*PRBigFloat) (float l);
297extern float (*PRLittleFloat) (float l);
298
299
300
301/*
302#ifndef COMPILER
303typedef union eval_s
304{
305 string_t string;
306 float _float;
307 float vector[3];
308 func_t function;
309 int _int;
310 int edict;
311 progsnum_t prog; //so it can easily be changed
312} eval_t;
313#endif
314*/
315typedef struct edictrun_s
316{
318 float freetime; // realtime when the object was freed
319 unsigned int entnum;
320 unsigned int fieldsize;
321 pbool readonly; //causes error when QC tries writing to it. (quake's world entity)
322 void *fields;
323
324// other fields from progs come immediately after
326
327
328int PDECL Comp_Begin(pubprogfuncs_t *progfuncs, int nump, const char **parms);
330
331pbool PDECL PR_SetWatchPoint(pubprogfuncs_t *progfuncs, const char *key);
332char *PDECL PR_EvaluateDebugString(pubprogfuncs_t *progfuncs, const char *key);
333char *PDECL PR_SaveEnts(pubprogfuncs_t *progfuncs, char *mem, size_t *size, size_t maxsize, int mode);
334int PDECL PR_LoadEnts(pubprogfuncs_t *ppf, const char *file, void *ctx, void (PDECL *memoryreset) (pubprogfuncs_t *progfuncs, void *ctx), void (PDECL *entspawned) (pubprogfuncs_t *progfuncs, struct edict_s *ed, void *ctx, const char *entstart, const char *entend), pbool(PDECL *extendedterm)(pubprogfuncs_t *progfuncs, void *ctx, const char **extline));
335char *PDECL PR_SaveEnt (pubprogfuncs_t *progfuncs, char *buf, size_t *size, size_t maxsize, struct edict_s *ed);
336struct edict_s *PDECL PR_RestoreEnt (pubprogfuncs_t *progfuncs, const char *buf, size_t *size, struct edict_s *ed);
337void PDECL PR_StackTrace (pubprogfuncs_t *progfuncs, int showlocals);
338
339eval_t *PR_GetReadTempStringPtr(progfuncs_t *progfuncs, string_t str, size_t offset, size_t datasize);
340eval_t *PR_GetWriteTempStringPtr(progfuncs_t *progfuncs, string_t str, size_t offset, size_t datasize);
341
342extern int noextensions;
343
344typedef enum
345{
346 PST_DEFAULT,//everything 16bit
347 PST_FTE32, //everything 32bit
348 PST_KKQWSV, //32bit statements, 16bit globaldefs. NO SAVED GAMES.
349 PST_QTEST, //16bit statements, 32bit globaldefs(other differences converted on load)
350 PST_UHEXEN2,//everything 32bit like fte's without a header, but with pre-padding rather than post-extended (little-endian) types.
352
353#ifndef COMPILER
354typedef struct progstate_s
355{
358 char *strings;
359 union {
361 ddef16_t *globaldefs16; //vanilla, kk
362 ddef32_t *globaldefs32; //fte, qtest
363 };
364 union {
366 ddef16_t *fielddefs16; //vanilla, kk
367 ddef32_t *fielddefs32; //fte, qtest
368 };
369// union {
371// dstatement16_t *statements16; //vanilla, qtest
372// dstatement32_t *statements32; //fte, kk
373// };
374// void *global_struct;
375 float *globals; // same as pr_global_struct
376 unsigned int globals_bytes; // in bytes
377
379
380 int edict_size; // in bytes
381
382 char filename[128];
383
384 int *linenums; //debug versions only
385
386 progstructtype_t structtype; //specifies the sized struct types above. FIXME: should probably just load as 32bit or something.
387
388#ifdef QCJIT
389 struct jitstate *jit;
390#endif
392
393//============================================================================
394
395
396#define pr_progs current_progstate->progs
397#define pr_cp_functions current_progstate->functions
398#define pr_strings current_progstate->strings
399#define pr_globaldefs16 ((ddef16_t*)current_progstate->globaldefs16)
400#define pr_globaldefs32 ((ddef32_t*)current_progstate->globaldefs32)
401#define pr_fielddefs16 ((ddef16_t*)current_progstate->fielddefs16)
402#define pr_fielddefs32 ((ddef32_t*)current_progstate->fielddefs32)
403#define pr_statements16 ((dstatement16_t*)current_progstate->statements)
404#define pr_statements32 ((dstatement32_t*)current_progstate->statements)
405//#define pr_global_struct current_progstate->global_struct
406#define pr_globals current_progstate->globals
407#define pr_linenums current_progstate->linenums
408#define pr_types current_progstate->types
409
410
411
412//============================================================================
413
414void PR_Init (void);
415
417
419progsnum_t PDECL PR_LoadProgs(pubprogfuncs_t *progfncs, const char *s);
420pbool PR_ReallyLoadProgs (progfuncs_t *progfuncs, const char *filename, progstate_t *progstate, pbool complain);
421
422void *PRHunkAlloc(progfuncs_t *progfuncs, int ammount, const char *name);
423
424void PR_Profile_f (void);
425
426struct edict_s *PDECL ED_Alloc (pubprogfuncs_t *progfuncs, pbool object, size_t extrasize);
427struct edict_s *PDECL ED_AllocIndex (pubprogfuncs_t *progfuncs, unsigned int num, pbool object, size_t extrasize);
428void PDECL ED_Free (pubprogfuncs_t *progfuncs, struct edict_s *ed, pbool instant);
429
430#ifdef QCGC
432#else
434#endif
435
436string_t PDECL PR_AllocTempString (pubprogfuncs_t *ppf, const char *str);
437char *PDECL ED_NewString (pubprogfuncs_t *ppf, const char *string, int minlength, pbool demarkup);
438// returns a copy of the string allocated from the server's string heap
439
440void PDECL ED_Print (pubprogfuncs_t *progfuncs, struct edict_s *ed);
441//void ED_Write (FILE *f, edictrun_t *ed);
442
443//void ED_WriteGlobals (FILE *f);
445
446//void ED_LoadFromFile (char *data);
447
448//define EDICT_NUM(n) ((edict_t *)(sv.edicts+ (n)*pr_edict_size))
449//define NUM_FOR_EDICT(e) (((byte *)(e) - sv.edicts)/pr_edict_size)
450
451struct edict_s *PDECL QC_EDICT_NUM(pubprogfuncs_t *progfuncs, unsigned int n);
452unsigned int PDECL QC_NUM_FOR_EDICT(pubprogfuncs_t *progfuncs, struct edict_s *e);
453
454#define EDICT_NUM(pf, num) QC_EDICT_NUM(&pf->funcs,num)
455#define NUM_FOR_EDICT(pf, e) QC_NUM_FOR_EDICT(&pf->funcs,e)
456
457//#define NEXT_EDICT(e) ((edictrun_t *)( (byte *)e + pr_edict_size))
458
459#define EDICT_TO_PROG(pf, e) (((edictrun_t*)e)->entnum)
460#define PROG_TO_EDICT_PB(pf, e) ((struct edictrun_s *)prinst.edicttable[e]) //index already validated
461#define PROG_TO_EDICT_UB(pf, e) ((struct edictrun_s *)prinst.edicttable[((unsigned int)(e)<prinst.maxedicts)?e:0]) //(safely) pokes world if the index is otherwise invalid
462
463//============================================================================
464
465#define G_FLOAT(o) (pr_globals[o])
466#define G_FLOAT2(o) (pr_globals[OFS_PARM0 + o*3])
467#define G_INT(o) (*(int *)&pr_globals[o])
468#define G_EDICT(o) ((edict_t *)((qbyte *)sv_edicts+ *(int *)&pr_globals[o]))
469#define G_EDICTNUM(o) NUM_FOR_EDICT(G_EDICT(o))
470#define G_VECTOR(o) (&pr_globals[o])
471#define G_STRING(o) (*(string_t *)&pr_globals[o])
472#define G_FUNCTION(o) (*(func_t *)&pr_globals[o])
473#define G_PROG(o) G_FLOAT(o) //simply so it's nice and easy to change...
474
475#define RETURN_EDICT(e) (((int *)pr_globals)[OFS_RETURN] = EDICT_TO_PROG(e))
476
477#define E_FLOAT(e,o) (((float*)&e->v)[o])
478#define E_INT(e,o) (*(int *)&((float*)&e->v)[o])
479#define E_VECTOR(e,o) (&((float*)&e->v)[o])
480//#define E_STRING(e,o) (*(string_t *)&((float*)(e+1))[o])
481
482extern const unsigned int type_size[];
483
484
485extern unsigned short pr_crc;
486
487void VARGS PR_RunError (pubprogfuncs_t *progfuncs, const char *error, ...) LIKEPRINTF(2);
488
491
492
495
496
497
498
499eval_t *PDECL QC_GetEdictFieldValue(pubprogfuncs_t *progfuncs, struct edict_s *ed, const char *name, etype_t type, evalc_t *cache);
500void PDECL PR_GenerateStatementString (pubprogfuncs_t *progfuncs, int statementnum, char *out, int outlen);
501fdef_t *PDECL ED_FieldInfo (pubprogfuncs_t *progfuncs, unsigned int *count);
503pbool PDECL ED_ParseEval (pubprogfuncs_t *progfuncs, eval_t *eval, int type, const char *s);
504char *PR_SaveCallStack (progfuncs_t *progfuncs, char *buf, size_t *bufofs, size_t bufmax);
505
506prclocks_t Sys_GetClockRate(void);
507#endif
508
509
510
511
512#ifndef COMPILER
513
514//this is windows - all files are written with this endian standard
515//optimisation
516//leave undefined if in doubt over os.
517#ifdef _WIN32
518#define NOENDIAN
519#endif
520
521
522
523
524//pr_multi.c
525
526extern pvec3_t pvec3_origin;
527
528struct qcthread_s *PDECL PR_ForkStack (pubprogfuncs_t *progfuncs);
529void PDECL PR_ResumeThread (pubprogfuncs_t *progfuncs, struct qcthread_s *thread);
531pbool PDECL PR_GetBuiltinCallInfo (pubprogfuncs_t *ppf, int *builtinnum, char *function, size_t sizeoffunction);
532
533eval_t *PDECL PR_FindGlobal(pubprogfuncs_t *prfuncs, const char *globname, progsnum_t pnum, etype_t *type);
539fdef_t *ED_ClassFieldAtOfs (progfuncs_t *progfuncs, unsigned int ofs, const char *classname);
542func_t PDECL PR_FindFunc(pubprogfuncs_t *progfncs, const char *funcname, progsnum_t pnum);
543//void PDECL PR_Configure (pubprogfuncs_t *progfncs, size_t addressable_size, int max_progs);
544int PDECL PR_InitEnts(pubprogfuncs_t *progfncs, int maxents);
546void PDECL QC_ClearEdict (pubprogfuncs_t *progfuncs, struct edict_s *ed);
547void PRAddressableFlush(progfuncs_t *progfuncs, size_t totalammount);
549
554
555string_t PDECL PR_StringToProgs (pubprogfuncs_t *inst, const char *str);
556const char *ASMCALL PR_StringToNative (pubprogfuncs_t *inst, string_t str);
557
558char *PR_GlobalString (progfuncs_t *progfuncs, int ofs, struct QCC_type_s **typehint);
560
562
563struct jitstate;
565void PR_EnterJIT(progfuncs_t *progfuncs, struct jitstate *jitstate, int statement);
566void PR_CloseJit(struct jitstate *jit);
567
568char *QCC_COM_Parse (const char *data);
569extern char qcc_token[1024];
570extern char *basictypenames[];
571#endif
572
573#endif
enum @13::coninfomode_e mode
Definition: com_phys_ode.c:695
entity_t * ent
Definition: com_mesh.c:717
dReal depth
Definition: com_phys_ode.c:320
int num
Definition: com_phys_ode.c:314
char * text
Definition: decomp.c:375
s
Definition: execloop.h:53
char filename[64]
Definition: generatebuiltin.c:8
static EGLSurface EGLSurface EGLContext ctx
Definition: gl_videgl.c:47
int error
Definition: gl_vidlinuxglx.c:447
static CONST PIXELFORMATDESCRIPTOR *static int
Definition: gl_vidnt.c:222
GLsizei count
Definition: glquake.h:149
GLint GLenum type
Definition: glquake.h:157
GLuint GLcharARB * name
Definition: glquake.h:155
GLint size
Definition: glquake.h:157
GLsizei GLboolean const GLfloat * value
Definition: glquake.h:164
GLint GLfloat * parms
Definition: glsupp.h:612
iwboolean verbose
Definition: iwebiface.c:329
char fname[MAX_QPATH]
Definition: m_mp3.c:160
char ** data
Definition: p_script.c:63
void * ddefXX_t
Definition: pr_comp.h:648
int const char * e
Definition: pr_lua.c:259
pubprogfuncs_t progfuncs
Definition: pr_lua.c:198
char * PR_ValueString(progfuncs_t *progfuncs, etype_t type, eval_t *val, pbool verbose)
Definition: pr_edict.c:519
void PDECL ED_Free(pubprogfuncs_t *progfuncs, struct edict_s *ed, pbool instant)
Definition: pr_edict.c:174
char *PDECL ED_NewString(pubprogfuncs_t *ppf, const char *string, int minlength, pbool demarkup)
Definition: pr_edict.c:1162
void PR_Profile_f(void)
char * PR_GlobalStringNoContents(progfuncs_t *progfuncs, int ofs)
Definition: pr_edict.c:992
char *PDECL PR_UglyValueString(pubprogfuncs_t *progfuncs, etype_t type, eval_t *val)
Definition: pr_edict.c:654
eval_t * PR_GetWriteTempStringPtr(progfuncs_t *progfuncs, string_t str, size_t offset, size_t datasize)
Definition: initlib.c:1081
pbool PDECL PR_SetWatchPoint(pubprogfuncs_t *progfuncs, const char *key)
Definition: pr_exec.c:791
prclocks_t Sys_GetClockRate(void)
Definition: pr_exec.c:51
void PR_FreeTemps(progfuncs_t *progfuncs, int depth)
Definition: initlib.c:1473
eval_t *PDECL QC_GetEdictFieldValue(pubprogfuncs_t *progfuncs, struct edict_s *ed, const char *name, etype_t type, evalc_t *cache)
Definition: initlib.c:875
void PR_RunGC(progfuncs_t *progfuncs)
Definition: initlib.c:1358
void * PRHunkAlloc(progfuncs_t *progfuncs, int size, const char *name)
Definition: initlib.c:11
float(* PRBigFloat)(float l)
Definition: qcc_cmdlib.c:77
char * basictypenames[]
Definition: qcc_cmdlib.c:44
fdef_t *PDECL ED_FieldInfo(pubprogfuncs_t *progfuncs, unsigned int *count)
Definition: pr_edict.c:282
pbool PDECL QC_Decompile(pubprogfuncs_t *progfuncs, const char *fname)
int PRHunkMark(progfuncs_t *progfuncs)
Definition: initlib.c:31
void StripExtension(char *path)
Definition: qcc_cmdlib.c:1338
struct edict_s *PDECL ED_AllocIndex(pubprogfuncs_t *progfuncs, unsigned int num, pbool object, size_t extrasize)
Definition: pr_edict.c:35
ddef16_t * ED_FindGlobalFromProgs16(progfuncs_t *progfuncs, progstate_t *ps, const char *name)
Definition: pr_edict.c:359
void PDECL PR_GenerateStatementString(pubprogfuncs_t *progfuncs, int statementnum, char *out, int outlen)
Definition: pr_exec.c:179
fdef_t * ED_ClassFieldAtOfs(progfuncs_t *progfuncs, unsigned int ofs, const char *classname)
Definition: pr_edict.c:263
ddef16_t * ED_FindTypeGlobalFromProgs16(progfuncs_t *progfuncs, progstate_t *ps, const char *name, int type)
Definition: pr_edict.c:386
string_t PDECL PR_AllocTempString(pubprogfuncs_t *ppf, const char *str)
Definition: initlib.c:1501
progsnum_t PDECL PR_LoadProgs(pubprogfuncs_t *progfncs, const char *s)
Definition: pr_multi.c:96
pbool PR_RunWarning(pubprogfuncs_t *progfuncs, char *error,...)
Definition: pr_exec.c:1509
const char *ASMCALL PR_StringToNative(pubprogfuncs_t *inst, string_t str)
Definition: initlib.c:1020
unsigned short pr_crc
short(* PRBigShort)(short l)
Definition: qcc_cmdlib.c:73
func_t PDECL PR_FindFunc(pubprogfuncs_t *progfncs, const char *funcname, progsnum_t pnum)
Definition: initlib.c:649
void PDECL QC_ClearEdict(pubprogfuncs_t *progfuncs, struct edict_s *ed)
Definition: pr_edict.c:25
void PR_Init(void)
Definition: pr_cmds.c:1589
ddef16_t * ED_GlobalAtOfs16(progfuncs_t *progfuncs, int ofs)
Definition: pr_edict.c:219
ddef32_t * ED_FindGlobalFromProgs32(progfuncs_t *progfuncs, progstate_t *ps, const char *name)
Definition: pr_edict.c:372
char *VARGS qcva(char *text,...) LIKEPRINTF(1)
Definition: qcc_cmdlib.c:532
void PDECL ED_Print(pubprogfuncs_t *progfuncs, struct edict_s *ed)
Definition: pr_edict.c:1046
void QC_FlushProgsOffsets(progfuncs_t *progfuncs)
Definition: pr_multi.c:210
int PDECL Comp_Begin(pubprogfuncs_t *progfuncs, int nump, const char **parms)
Definition: comprout.c:136
void SetEndian(void)
Definition: qcc_cmdlib.c:133
pbool PR_SwitchProgs(progfuncs_t *progfuncs, progsnum_t type)
Definition: pr_multi.c:20
int(* PRBigLong)(int l)
Definition: qcc_cmdlib.c:75
unsigned char pbyte
Definition: progsint.h:39
string_t PDECL PR_StringToProgs(pubprogfuncs_t *inst, const char *str)
Definition: initlib.c:927
void ED_PrintEdicts(progfuncs_t *progfuncs)
Definition: pr_edict.c:1107
char *PDECL PR_SaveEnts(pubprogfuncs_t *progfuncs, char *mem, size_t *size, size_t maxsize, int mode)
Definition: pr_edict.c:1891
fdef_t * ED_FieldAtOfs(progfuncs_t *progfuncs, unsigned int ofs)
Definition: pr_edict.c:251
ddef32_t * ED_GlobalAtOfs32(progfuncs_t *progfuncs, unsigned int ofs)
Definition: pr_edict.c:232
void ED_ParseGlobals(char *data)
struct edict_s *PDECL ED_Alloc(pubprogfuncs_t *progfuncs, pbool object, size_t extrasize)
Definition: pr_edict.c:105
int PDECL Comp_Continue(pubprogfuncs_t *progfuncs)
Definition: comprout.c:153
QCC_opcode_t pr_opcodes[]
Definition: qcc_pr_comp.c:375
int PDECL PR_LoadEnts(pubprogfuncs_t *ppf, const char *file, void *ctx, void(PDECL *memoryreset)(pubprogfuncs_t *progfuncs, void *ctx), void(PDECL *entspawned)(pubprogfuncs_t *progfuncs, struct edict_s *ed, void *ctx, const char *entstart, const char *entend), pbool(PDECL *extendedterm)(pubprogfuncs_t *progfuncs, void *ctx, const char **extline))
Definition: pr_edict.c:2027
char qcc_token[1024]
Definition: qcc_cmdlib.c:19
void PR_CloseJit(struct jitstate *jit)
int PDECL PR_ToggleBreakpoint(pubprogfuncs_t *progfuncs, const char *filename, int linenum, int flag)
Definition: pr_exec.c:1133
unsigned int PDECL QC_NUM_FOR_EDICT(pubprogfuncs_t *progfuncs, struct edict_s *e)
Definition: pr_edict.c:3719
void QC_InitShares(progfuncs_t *progfuncs)
Definition: pr_multi.c:197
struct prinst_s prinst_t
void PDECL PR_ExecuteProgram(pubprogfuncs_t *progfuncs, func_t fnum)
Definition: pr_exec.c:1803
void QC_StartShares(progfuncs_t *progfuncs)
Definition: pr_multi.c:151
int PDECL PR_InitEnts(pubprogfuncs_t *progfncs, int maxents)
Definition: initlib.c:483
fdef_t * ED_FindField(progfuncs_t *progfuncs, const char *name)
Definition: pr_edict.c:293
struct edictrun_s edictrun_t
pbool CompileFile(progfuncs_t *progfuncs, const char *filename)
Definition: comprout.c:174
void PDECL PR_StackTrace(pubprogfuncs_t *progfuncs, int showlocals)
Definition: pr_exec.c:371
void PRHunkFree(progfuncs_t *progfuncs, int mark)
Definition: initlib.c:35
int PDECL QC_RegisterFieldVar(pubprogfuncs_t *progfuncs, unsigned int type, const char *name, signed long requestedpos, signed long originalofs)
Definition: pr_multi.c:230
void VARGS PR_RunError(pubprogfuncs_t *progfuncs, const char *error,...) LIKEPRINTF(2)
Definition: pr_exec.c:1491
float(* PRLittleFloat)(float l)
Definition: qcc_cmdlib.c:78
struct edict_s *PDECL PR_RestoreEnt(pubprogfuncs_t *progfuncs, const char *buf, size_t *size, struct edict_s *ed)
Definition: pr_edict.c:2547
ddef32_t * ED_FindGlobal32(progfuncs_t *progfuncs, const char *name)
Definition: pr_edict.c:324
void PDECL PR_AbortStack(pubprogfuncs_t *progfuncs)
Definition: pr_exec.c:2092
pbool PR_ReallyLoadProgs(progfuncs_t *progfuncs, const char *filename, progstate_t *progstate, pbool complain)
Definition: pr_edict.c:2720
pvec3_t pvec3_origin
char * QCC_COM_Parse(const char *data)
Definition: qcc_cmdlib.c:290
pbool PDECL ED_ParseEval(pubprogfuncs_t *progfuncs, eval_t *eval, int type, const char *s)
Definition: pr_edict.c:1211
void PDECL PR_ResumeThread(pubprogfuncs_t *progfuncs, struct qcthread_s *thread)
Definition: pr_exec.c:1984
int noextensions
void * PRAddressableExtend(progfuncs_t *progfuncs, void *src, size_t srcsize, int pad)
Definition: initlib.c:87
struct progstate_s progstate_t
mfunction_t * ED_FindFunction(progfuncs_t *progfuncs, const char *name, progsnum_t *pnum, progsnum_t fromprogs)
Definition: pr_edict.c:465
void ED_PrintNum(progfuncs_t *progfuncs, int ent)
Definition: pr_edict.c:1095
eval_t *PDECL PR_FindGlobal(pubprogfuncs_t *prfuncs, const char *globname, progsnum_t pnum, etype_t *type)
Definition: initlib.c:781
progstructtype_t
Definition: progsint.h:345
@ PST_KKQWSV
Definition: progsint.h:348
@ PST_QTEST
Definition: progsint.h:349
@ PST_FTE32
Definition: progsint.h:347
@ PST_DEFAULT
Definition: progsint.h:346
@ PST_UHEXEN2
Definition: progsint.h:350
int(* PRLittleLong)(int l)
Definition: qcc_cmdlib.c:76
char * PR_SaveCallStack(progfuncs_t *progfuncs, char *buf, size_t *bufofs, size_t bufmax)
Definition: pr_edict.c:1807
struct sharedvar_s sharedvar_t
ddef16_t * ED_FindGlobal16(progfuncs_t *progfuncs, const char *name)
Definition: pr_edict.c:311
const unsigned int type_size[]
Definition: qcc_cmdlib.c:22
void PRAddressableFlush(progfuncs_t *progfuncs, size_t totalammount)
Definition: initlib.c:448
char *PDECL PR_SaveEnt(pubprogfuncs_t *progfuncs, char *buf, size_t *size, size_t maxsize, struct edict_s *ed)
Definition: pr_edict.c:2467
void PR_EnterJIT(progfuncs_t *progfuncs, struct jitstate *jitstate, int statement)
struct progfuncs_s progfuncs_t
void QC_AddFieldGlobal(pubprogfuncs_t *ppf, int *globdata)
Definition: pr_multi.c:516
pbool PDECL PR_GetBuiltinCallInfo(pubprogfuncs_t *ppf, int *builtinnum, char *function, size_t sizeoffunction)
Definition: pr_exec.c:2100
short(* PRLittleShort)(short l)
Definition: qcc_cmdlib.c:74
struct edict_s *PDECL QC_EDICT_NUM(pubprogfuncs_t *progfuncs, unsigned int n)
Definition: pr_edict.c:3710
void PDECL QC_AddSharedFieldVar(pubprogfuncs_t *progfuncs, int num, char *stringtable)
Definition: pr_multi.c:409
struct jitstate * PR_GenerateJit(progfuncs_t *progfuncs)
void PDECL QC_AddSharedVar(pubprogfuncs_t *progfuncs, int num, int type)
Definition: pr_multi.c:159
ddef32_t * ED_FindTypeGlobalFromProgs32(progfuncs_t *progfuncs, progstate_t *ps, const char *name, int type)
Definition: pr_edict.c:410
pbool PR_SwitchProgsParms(progfuncs_t *progfuncs, progsnum_t newprogs)
Definition: pr_multi.c:45
char *PDECL PR_EvaluateDebugString(pubprogfuncs_t *progfuncs, const char *key)
Definition: pr_exec.c:867
struct qcthread_s *PDECL PR_ForkStack(pubprogfuncs_t *progfuncs)
Definition: pr_exec.c:1914
eval_t * PR_GetReadTempStringPtr(progfuncs_t *progfuncs, string_t str, size_t offset, size_t datasize)
Definition: initlib.c:1064
char * PR_GlobalString(progfuncs_t *progfuncs, int ofs, struct QCC_type_s **typehint)
Definition: pr_edict.c:923
ereftype_e
Definition: progslib.h:60
etype_t
Definition: progslib.h:75
unsigned int pbool
Definition: progtype.h:62
pint_t progsnum_t
Definition: progtype.h:64
puint_t string_t
Definition: progtype.h:66
puint_t func_t
Definition: progtype.h:65
pvec_t pvec3_t[3]
Definition: progtype.h:63
vec3_t offset
Definition: q2m_flash.c:28
int ofs
Definition: qcc_cmdlib.c:849
const char * file
Definition: qcc_pr_lex.c:2518
int outlen
Definition: qccgui.c:6543
static AL_API ALsizei n
Definition: snd_al.c:161
static SpeexBits spx_int16_t * out
Definition: snd_dma.c:492
Definition: progsint.h:220
char * name
Definition: progsint.h:222
unsigned int flags
Definition: progsint.h:228
char * opname
Definition: progsint.h:223
int targetflags
Definition: progsint.h:221
@ ASSOC_LEFT
Definition: progsint.h:225
int priorityclass
Definition: progsint.h:224
struct QCC_type_s ** type_a
Definition: progsint.h:226
Definition: qcc.h:375
Definition: pr_comp.h:633
Definition: pr_comp.h:641
Definition: pr_comp.h:711
Definition: progs.h:65
Definition: progsint.h:316
enum ereftype_e ereftype
Definition: progsint.h:317
unsigned int fieldsize
Definition: progsint.h:320
pbool readonly
Definition: progsint.h:321
unsigned int entnum
Definition: progsint.h:319
void * fields
Definition: progsint.h:322
float freetime
Definition: progsint.h:318
Definition: progslib.h:68
Definition: progslib.h:111
Definition: pr_comp.h:686
Definition: progsint.h:118
mfunction_t * pr_xfunction
Definition: progsint.h:183
int mfreelist
Definition: progsint.h:193
int spushed
Definition: progsint.h:170
unsigned int fields_size
Definition: progsint.h:188
unsigned int numtempstringsstack
Definition: progsint.h:130
int maxallocedstrings
Definition: progsint.h:135
unsigned int maxshares
Definition: progsint.h:154
fdef_t * field
Definition: progsint.h:160
int reorganisefields
Definition: progsint.h:162
int pr_depth
Definition: progsint.h:169
struct progstate_s * progstate
Definition: progsint.h:138
int pr_xstatement
Definition: progsint.h:184
prstack_t pr_stack[MAX_STACK_DEPTH]
Definition: progsint.h:168
int localstack_used
Definition: progsint.h:175
unsigned int maxprogs
Definition: progsint.h:140
unsigned int maxfields
Definition: progsint.h:158
size_t addressablesize
Definition: progsint.h:196
etype_t watch_type
Definition: progsint.h:150
unsigned int livetemps
Definition: progsint.h:124
unsigned int numshares
Definition: progsint.h:152
pbool profiling
Definition: progsint.h:181
struct qcgccontext_s * gccontext
Definition: progsint.h:126
unsigned int max_fields_size
Definition: progsint.h:189
int exitdepth
Definition: progsint.h:179
unsigned int maxtempstrings
Definition: progsint.h:121
unsigned int numfields
Definition: progsint.h:159
unsigned int maxedicts
Definition: progsint.h:198
char * addressablehunk
Definition: progsint.h:194
eval_t * watch_ptr
Definition: progsint.h:148
prclocks_t profilingalert
Definition: progsint.h:182
char * watch_name
Definition: progsint.h:147
tempstr_t ** tempstrings
Definition: progsint.h:120
int localstack[LOCALSTACK_SIZE]
Definition: progsint.h:174
struct prmemb_s * memblocks
Definition: progsint.h:156
size_t addressableused
Definition: progsint.h:195
struct edictrun_s ** edicttable
Definition: progsint.h:199
unsigned int numtempstrings
Definition: progsint.h:129
char ** allocedstrings
Definition: progsint.h:134
struct progstate_s * current_progstate
Definition: progsint.h:144
unsigned int nexttempstring
Definition: progsint.h:123
progsnum_t pr_typecurrent
Definition: progsint.h:142
evalc_t spawnflagscache
Definition: progsint.h:187
sharedvar_t * shares
Definition: progsint.h:153
int numallocedstrings
Definition: progsint.h:136
int debugstatement
Definition: progsint.h:178
eval_t watch_old
Definition: progsint.h:149
Definition: progsint.h:203
struct pubprogfuncs_s funcs
Definition: progsint.h:204
struct prinst_s inst
Definition: progsint.h:205
Definition: progsint.h:355
typeinfo_t * types
Definition: progsint.h:378
void * statements
Definition: progsint.h:370
ddefXX_t * globaldefs
Definition: progsint.h:360
ddef32_t * globaldefs32
Definition: progsint.h:362
struct jitstate * jit
Definition: progsint.h:389
ddef32_t * fielddefs32
Definition: progsint.h:367
ddefXX_t * fielddefs
Definition: progsint.h:365
float * globals
Definition: progsint.h:375
dprograms_t * progs
Definition: progsint.h:356
unsigned int globals_bytes
Definition: progsint.h:376
ddef16_t * globaldefs16
Definition: progsint.h:361
ddef16_t * fielddefs16
Definition: progsint.h:366
char * strings
Definition: progsint.h:358
char filename[128]
Definition: progsint.h:382
mfunction_t * functions
Definition: progsint.h:357
int * linenums
Definition: progsint.h:384
progstructtype_t structtype
Definition: progsint.h:386
int edict_size
Definition: progsint.h:380
Definition: progsint.h:97
mfunction_t * f
Definition: progsint.h:98
int pushed
Definition: progsint.h:102
int s
Definition: progsint.h:101
unsigned char stepping
Definition: progsint.h:99
prclocks_t timestamp
Definition: progsint.h:103
unsigned char progsnum
Definition: progsint.h:100
Definition: progslib.h:121
Definition: progsint.h:92
int varofs
Definition: progsint.h:93
int size
Definition: progsint.h:94
Definition: progsint.h:111
unsigned int size
Definition: progsint.h:112
Definition: pr_comp.h:765
unsigned char buf[KBRINGSIZE]
Definition: sys_dos.c:27
Definition: progslib.h:295