10#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
13 #ifdef __MINGW_PRINTF_FORMAT
14 #define LIKEPRINTF(x) __attribute__((format(__MINGW_PRINTF_FORMAT,x,x+1)))
16 #define LIKEPRINTF(x) __attribute__((format(ms_printf,x,x+1)))
19 #define LIKEPRINTF(x) __attribute__((format(printf,x,x+1)))
29#if defined(_M_IX86) || defined(__i386__)
30 #if defined(__GNUC__) || defined(_MSC_VER)
35#define QCBUILTIN ASMCALL
65#define ED_ISFREE(e) ((e)->ereftype != ER_ENTITY)
74#define sizeofevalc sizeof(evalc_t)
241 void *(PDECL *
ReadFile) (
const char *
fname,
unsigned char *(PDECL *buf_get)(
void *
ctx,
size_t len),
void *buf_ctx,
size_t *out_size,
pbool issourcefile);
264 void (VARGS *memfree) (
void * mem);
285#if defined(QCLIBDLL_EXPORTS)
312#define PROGSTRUCT_VERSION 4
316#define PR_Configure(pf, memsize, max_progs, profiling) (*pf->Configure) (pf, memsize, max_progs, profiling)
317#define PR_LoadProgs(pf, s) (*pf->LoadProgs) (pf, s)
318#define PR_InitEnts(pf, maxents) (*pf->InitEnts) (pf, maxents)
319#define PR_ExecuteProgram(pf, fnum) (*pf->ExecuteProgram) (pf, fnum)
320#define PR_globals(pf, num) (*pf->globals) (pf, num)
321#define PR_entvars(pf, ent) (*pf->entvars) (pf, ent)
323#define PR_RegisterFieldVar(pf,type,name,reqofs,qcofs) (*pf->RegisterFieldVar) (pf,type,name,reqofs,qcofs)
325#define ED_Alloc(pf,isobj,extsize) (*pf->EntAlloc) (pf, isobj, extsize)
326#define ED_Free(pf, ed) (*pf->EntFree) (pf, ed, false)
327#define ED_Clear(pf, ed) (*pf->EntClear) (pf, ed)
329#define PR_LoadEnts(pf, s, ctx, memreset, entcb, extcb) (*pf->load_ents) (pf, s, ctx, memreset, entcb, extcb)
330#define PR_SaveEnts(pf, buf, size, maxsize, mode) (*pf->save_ents) (pf, buf, size, maxsize, mode)
333#define EDICT_NUM(pf, num) (*pf->EDICT_NUM) (pf, num)
335#define EDICT_NUM_PB(pf, num) (pf->edicttable[num])
336#define EDICT_NUM_UB(pf, num) EDICT_NUM_PB(pf,(((unsigned int)(num))>=pf->edicttable_length)?0:num)
338#define NUM_FOR_EDICT(pf, e) (*pf->NumForEdict) (pf, (struct edict_s*)(e))
339#define SetGlobalEdict(pf, ed, ofs) (*pf->SetGlobalEdict) (pf, ed, ofs)
340#define PR_VarString(pf,first) (*pf->VarString) (pf,first)
342#define PR_StartCompile(pf,argc,argv) (*pf->StartCompile) (pf,argc,argv)
343#define PR_ContinueCompile(pf) (*pf->ContinueCompile) (pf)
345#define PR_StackTrace(pf,locals) (*pf->StackTrace) (pf,locals)
346#define PR_AbortStack(pf) (*pf->AbortStack) (pf)
348#define PR_RunError(pf,str) (*pf->RunError) (pf,str)
350#define PR_PrintEdict(pf,ed) (*pf->PrintEdict) (pf, ed)
352#define PR_FindFunction(pf, name, num) (*pf->FindFunction) (pf, name, num)
353#define PR_FindGlobal(pf, name, progs, type) (*pf->FindGlobal) (pf, name, progs, type)
354#define PR_AddString(pf, ed, len, demarkup) (*pf->AddString) (pf, ed, len, demarkup)
355#define PR_Alloc(pf,size,whatfor) (*pf->Tempmem) (pf, size, whatfor)
356#define PR_AddressableAlloc(pf,size) (*pf->AddressableAlloc) (pf, size)
357#define PR_AddressableFree(pf,mem) (*pf->AddressableFree) (pf, mem)
359#define PROG_TO_EDICTINDEX(pf, ed) ed
360#define PROG_TO_EDICT(pf, ed) (*pf->ProgsToEdict) (pf, ed)
361#define EDICT_TO_PROG(pf, ed) (*pf->EdictToProgs) (pf, (struct edict_s*)ed)
363#define PR_GetString(pf,s) (*pf->StringToNative) (pf, s)
364#define PR_GetStringOfs(pf,o) (*pf->StringToNative) (pf, G_INT(o))
365#define PR_SetString(pf, s) (*pf->StringToProgs) (pf, s)
367#define NEXT_EDICT(pf,o) EDICT_NUM(pf, NUM_FOR_EDICT(pf, o)+1)
368#define RETURN_EDICT(pf, e) (((pint_t *)pr_globals)[OFS_RETURN] = EDICT_TO_PROG(pf, e))
373#define G_FLOAT(o) (((pvec_t *)pr_globals)[o])
374#define G_FLOAT2(o) (((pvec_t *)pr_globals)[OFS_PARM0 + o*3])
375#define G_DOUBLE(o) (*(pdouble_t *)(((pvec_t *)pr_globals+(o))))
376#define G_INT(o) (((pint_t *)pr_globals)[o])
377#define G_UINT(o) (((puint_t *)pr_globals)[o])
378#define G_INT64(o) (*(pint64_t *)((pint_t *)pr_globals+(o)))
379#define G_UINT64(o) (*(puint64_t *)((puint_t *)pr_globals+(o)))
380#define G_EDICT(pf, o) PROG_TO_EDICT(pf, G_INT(o))
381#define G_EDICTNUM(pf, o) NUM_FOR_EDICT(pf, G_EDICT(pf, o))
382#define G_VECTOR(o) (&((pvec_t *)pr_globals)[o])
383#define G_FUNCTION(o) (*(func_t *)&((pvec_t *)pr_globals)[o])
394#define PR_NewString(p, s) (p)->TempString(p, s)
396#define PR_NewString(p, s) PR_SetString(p, PR_AddString(p, s, 0, false))
399#define ev_prog ev_integer
401#define E_STRING(o) (char *)(((pint_t *)((char *)ed) + progparms.edictsize)[o])
418#define RESERVED_OFS 28
void(QDECL *vgui_frame)(void)
entity_t * ent
Definition: com_mesh.c:717
static EGLSurface EGLSurface EGLContext ctx
Definition: gl_videgl.c:47
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
char fname[MAX_QPATH]
Definition: m_mp3.c:160
void PDECL ED_Print(pubprogfuncs_t *ppf, struct edict_s *ed)
Definition: pr_edict.c:1046
pubprogfuncs_t progfuncs
Definition: pr_lua.c:198
int idx
Definition: pr_lua.c:221
ereftype_e
Definition: progslib.h:60
@ ER_FREE
Definition: progslib.h:62
@ ER_ENTITY
Definition: progslib.h:61
@ ER_OBJECT
Definition: progslib.h:63
void(ASMCALL * builtin_t)(pubprogfuncs_t *prinst, struct globalvars_s *gvars)
Definition: progslib.h:57
__declspec(dllexport) __attribute__((visibility("default"))) pubprogfuncs_t *PDECL InitProgs(progparms_t *ext)
Definition: sys_win.c:46
struct progexterns_s progparms_t
struct progexterns_s progexterns_t
etype_t
Definition: progslib.h:75
@ ev_boolean
Definition: progslib.h:98
@ ev_uint64
Definition: progslib.h:89
@ ev_accessor
Definition: progslib.h:95
@ ev_enum
Definition: progslib.h:96
@ ev_function
Definition: progslib.h:83
@ ev_typedef
Definition: progslib.h:97
@ ev_void
Definition: progslib.h:77
@ ev_vector
Definition: progslib.h:80
@ ev_entity
Definition: progslib.h:81
@ ev_int64
Definition: progslib.h:88
@ ev_field
Definition: progslib.h:82
@ ev_double
Definition: progslib.h:90
@ ev_variant
Definition: progslib.h:92
@ ev_string
Definition: progslib.h:78
@ ev_union
Definition: progslib.h:94
@ ev_uint
Definition: progslib.h:87
@ ev_float
Definition: progslib.h:79
@ ev_integer
Definition: progslib.h:86
@ ev_pointer
Definition: progslib.h:84
@ ev_struct
Definition: progslib.h:93
@ DEBUG_TRACE_NORESUME
Definition: progslib.h:107
@ DEBUG_TRACE_ABORTERROR
Definition: progslib.h:105
@ DEBUG_TRACE_OVER
Definition: progslib.h:103
@ DEBUG_TRACE_INTO
Definition: progslib.h:102
@ DEBUG_TRACE_OUT
Definition: progslib.h:104
@ DEBUG_TRACE_OFF
Definition: progslib.h:101
unsigned int pbool
Definition: progtype.h:62
uint64_t puint_t
Definition: progtype.h:21
pint_t progsnum_t
Definition: progtype.h:64
int64_t pint_t
Definition: progtype.h:20
puint_t string_t
Definition: progtype.h:66
puint_t func_t
Definition: progtype.h:65
double pvec_t
Definition: progtype.h:19
static ALC_API ALCvoid * buffer
Definition: snd_al.c:259
static AL_API ALsizei n
Definition: snd_al.c:161
Definition: progslib.h:68
struct fdef_s * ofs32
Definition: progslib.h:70
const char * varname
Definition: progslib.h:69
Definition: progslib.h:111
const char * name
Definition: progslib.h:115
unsigned int progsofs
Definition: progslib.h:114
unsigned int type
Definition: progslib.h:112
int ofs
Definition: progslib.h:113
Definition: progdefs.h:24
Definition: progslib.h:238
float vara
Definition: progslib.h:253
void *VARGS * memalloc(int size)
progsnum_t idx
Definition: progslib.h:248
char * oldb
Definition: progslib.h:267
void(VARGS *memfree)(void *mem)
progsnum_t int const char * filename
Definition: progslib.h:248
int headercrc
Definition: progslib.h:259
float var
Definition: progslib.h:252
void(PDECL *loadcompleate)(int edictsize)
const char int int * statement
Definition: progslib.h:266
int edictsize
Definition: progslib.h:280
struct edict_s ** edicts
Definition: progslib.h:278
int(VARGS *DPrintf)(const char *
void(VARGS *Sys_Error)(const char *
void int len
Definition: progslib.h:243
void(ASMCALL *cwstateop)(pubprogfuncs_t *prinst
char char * newb
Definition: progslib.h:267
float float varb
Definition: progslib.h:253
pbool(PDECL *entcanfree)(struct edict_s *ent)
const char int * line
Definition: progslib.h:266
int(PDECL *FileSize)(const char *fname)
progsnum_t int crc
Definition: progslib.h:248
@ PR_COMPILEEXISTANDCHANGED
Definition: progslib.h:272
@ PR_COMPILEALWAYS
Definition: progslib.h:272
@ PR_COMPILEIGNORE
Definition: progslib.h:272
@ PR_COMPILECHANGED
Definition: progslib.h:272
@ PR_COMPILENEXIST
Definition: progslib.h:272
@ PR_NOCOMPILE
Definition: progslib.h:272
const char int int int char * reason
Definition: progslib.h:266
void * user
Definition: progslib.h:282
int progsversion
Definition: progslib.h:239
char char int oldlen
Definition: progslib.h:267
float func_t func
Definition: progslib.h:252
struct edict_s const char const char * value
Definition: progslib.h:261
int loading
Definition: progslib.h:250
enum progexterns_s::@371 autocompile
int numglobalbuiltins
Definition: progslib.h:270
pbool usethreadedgc
Definition: progslib.h:276
struct edict_s const char * keyname
Definition: progslib.h:261
const char int int int char pbool fatal
Definition: progslib.h:266
const char int int int funcstart
Definition: progslib.h:266
struct edict_s * ent
Definition: progslib.h:255
unsigned int * num_edicts
Definition: progslib.h:279
int(VARGS *Printf)(const char *
double * gametime
Definition: progslib.h:274
void *PDECL * ReadFile(const char *fname, unsigned char *(PDECL *buf_get)(void *ctx, size_t len), void *buf_ctx, size_t *out_size, pbool issourcefile)
int const char * builtinname
Definition: progslib.h:259
builtin_t * globalbuiltins
Definition: progslib.h:269
void * data
Definition: progslib.h:243
pbool(PDECL *WriteFile)(const char *name
float float func_t currentfunc
Definition: progslib.h:253
Definition: progsint.h:355
Definition: progslib.h:121
progsnum_t int const char * name
Definition: progslib.h:196
string_t(PDECL *StringToProgs)(pubprogfuncs_t *prinst
unsigned struct edict_s * e
Definition: progslib.h:141
struct edict_s *PDECL * EntAlloc(pubprogfuncs_t *prinst, pbool object, size_t extrasize)
func_t int unsigned char int char size_t funcnamesize
Definition: progslib.h:219
unsigned int activefieldslots
Definition: progslib.h:188
int char int outlen
Definition: progslib.h:220
void(PDECL *Shutdown)(pubprogfuncs_t *inst)
const char void void struct edict_s void const char * entstart
Definition: progslib.h:160
int const char ** argc
Definition: progslib.h:150
func_t func
Definition: progslib.h:219
struct edict_s string_t * fld
Definition: progslib.h:224
const char void void struct edict_s void const char const char * entend
Definition: progslib.h:160
void(PDECL *AbortStack)(pubprogfuncs_t *prinst)
int num
Definition: progslib.h:217
struct edict_s string_t const char pbool str_is_static
Definition: progslib.h:224
const char int linenum
Definition: progslib.h:176
const char void void struct edict_s void const char const char void const char ** extline
Definition: progslib.h:162
char *PDECL * VarString(pubprogfuncs_t *prinst, int first)
char * tempstringbase
Definition: progslib.h:233
char unsigned int len
Definition: progslib.h:205
void *PDECL * AddressableAlloc(pubprogfuncs_t *progfuncs, unsigned int ammount)
const char * s
Definition: progslib.h:127
int argv
Definition: progslib.h:150
const char void void struct edict_s void const char const char pbool(PDECL *extendedterm)(pubprogfuncs_t *progfuncs
fdef_t *PDECL * FieldInfo(pubprogfuncs_t *progfuncs, unsigned int *count)
int showlocals
Definition: progslib.h:175
const char void * ctx
Definition: progslib.h:158
int tempstringnum
Definition: progslib.h:234
string_t(PDECL *TempString)(pubprogfuncs_t *prinst
int statementnum
Definition: progslib.h:220
unsigned int type
Definition: progslib.h:198
const char *ASMCALL * StringToNative(pubprogfuncs_t *prinst, string_t str)
struct edict_s * ed
Definition: progslib.h:134
int(PDECL *EdictToProgs)(pubprogfuncs_t *prinst
func_t(PDECL *FindFunction)(pubprogfuncs_t *prinst
const char void void struct edict_s void * ctx
Definition: progslib.h:160
char *PDECL * UglyValueString(pubprogfuncs_t *progfuncs, etype_t type, union eval_s *val)
struct edict_s *PDECL * ProgsToEdict(pubprogfuncs_t *prinst, int progs)
int char * function
Definition: progslib.h:195
int debug_trace
Definition: progslib.h:174
char *PDECL * RemoveProgsString(pubprogfuncs_t *progfuncs, string_t str)
struct qcthread_s * thread
Definition: progslib.h:192
struct edict_s ** edicttable
Definition: progslib.h:228
union eval_s *PDECL * GetEdictFieldValue(pubprogfuncs_t *prinst, struct edict_s *ent, const char *name, etype_t type, evalc_t *s)
progsnum_t prnum
Definition: progslib.h:196
int char size_t sizeoffunction
Definition: progslib.h:195
const char void void struct edict_s void const char const char void * ctx
Definition: progslib.h:161
int * builtinnum
Definition: progslib.h:195
struct edict_s pbool instant
Definition: progslib.h:138
int int size
Definition: progslib.h:216
struct edict_s * e
Definition: progslib.h:211
struct edict_s *PDECL * EntAllocIndex(pubprogfuncs_t *prinst, unsigned int idx, pbool object, size_t extrasize)
unsigned int const char signed long signed long originalofs
Definition: progslib.h:198
struct progstate_s ** progstate
Definition: progslib.h:145
int progsversion
Definition: progslib.h:122
size_t int max_progs
Definition: progslib.h:126
const char void void * ctx
Definition: progslib.h:159
progsnum_t(PDECL *LoadProgs)(pubprogfuncs_t *prinst
unsigned int stringtablesize
Definition: progslib.h:185
char *PDECL * save_ents(pubprogfuncs_t *prinst, char *buf, size_t *size, size_t maxsize, int mode)
const char * key
Definition: progslib.h:214
int char * relstringtable
Definition: progslib.h:217
int callargc
Definition: progslib.h:182
int(PDECL *InitEnts)(pubprogfuncs_t *prinst
size_t addressablesize
Definition: progslib.h:126
struct progexterns_s * parms
Definition: progslib.h:178
struct edict_s *PDECL * restoreent(pubprogfuncs_t *prinst, const char *buf, size_t *size, struct edict_s *ed)
const char progsnum_t num
Definition: progslib.h:148
const char int int mode
Definition: progslib.h:176
pbool resetprofiles
Definition: progslib.h:225
struct pubprogfuncs_s::@370 user
func_t fnum
Definition: progslib.h:129
char *PDECL * EvaluateDebugString(pubprogfuncs_t *prinst, const char *key)
unsigned int stringtablemaxsize
Definition: progslib.h:186
char *PDECL * filefromprogs(pubprogfuncs_t *prinst, progsnum_t prnum, const char *fname, size_t *size, char *buffer)
char *PDECL * saveent(pubprogfuncs_t *prinst, char *buf, size_t *size, size_t maxsize, struct edict_s *ed)
char * stringtable
Definition: progslib.h:184
int char * prefix
Definition: progslib.h:212
union eval_s * eval
Definition: progslib.h:223
const char * msg
Definition: progslib.h:133
int numprogs
Definition: progslib.h:146
const char * str
Definition: progslib.h:204
union eval_s *PDECL * FindGlobal(pubprogfuncs_t *prinst, const char *name, progsnum_t num, etype_t *type)
unsigned int const char signed long requestedpos
Definition: progslib.h:198
const char * filename
Definition: progslib.h:176
int char char union eval_s etype_t void * ctx
Definition: progslib.h:212
const char * funcname
Definition: progslib.h:148
unsigned int etype_t char const evalc_t * fieldcache
Definition: progslib.h:209
struct entvars_s *PDECL * entvars(pubprogfuncs_t *prinst, struct edict_s *ent)
char *PDECL * filefromnewprogs(pubprogfuncs_t *prinst, const char *prname, const char *fname, size_t *size, char *buffer)
char *PDECL * AddString(pubprogfuncs_t *prinst, const char *val, int minlength, pbool demarkup)
size_t int pbool enableprofiling
Definition: progslib.h:126
int char * out
Definition: progslib.h:220
pbool(PDECL *DumpProfile)(pubprogfuncs_t *progfuncs
int fieldadjust
Definition: progslib.h:187
void * mem
Definition: progslib.h:203
int(PDECL *RegisterFieldVar)(pubprogfuncs_t *prinst
func_t int * argcount
Definition: progslib.h:219
int(PDECL *ContinueCompile)(pubprogfuncs_t *prinst)
unsigned int fieldoffset
Definition: progslib.h:209
const char * fname
Definition: progslib.h:180
int start
Definition: progslib.h:216
func_t int unsigned char ** argsizes
Definition: progslib.h:219
progsnum_t int binum
Definition: progslib.h:196
struct globalvars_s *PDECL * globals(pubprogfuncs_t *prinst, progsnum_t num)
int max_ents
Definition: progslib.h:128
struct qcthread_s *PDECL * Fork(pubprogfuncs_t *prinst)
void(PDECL *ED_Print)(pubprogfuncs_t *prinst
void *PDECL * Tempmem(pubprogfuncs_t *prinst, int ammount, char *whatfor)
struct edict_s *PDECL * EdictNum(pubprogfuncs_t *prinst, unsigned int n)
int char char union eval_s * val
Definition: progslib.h:212
unsigned int edicttable_length
Definition: progslib.h:227
unsigned char buf[KBRINGSIZE]
Definition: sys_dos.c:27
void Sys_Error(const char *error,...)
Definition: sys_droid.c:878
__attribute__((visibility("default")))
Definition: sys_win.c:3997
Definition: progslib.h:295
pvec_t _float
Definition: progslib.h:297
pvec_t prog
Definition: progslib.h:306
pint64_t i64
Definition: progslib.h:302
puint64_t u64
Definition: progslib.h:303
pvec_t _vector[3]
Definition: progslib.h:298
pint_t _int
Definition: progslib.h:300
pdouble_t _double
Definition: progslib.h:304
pint_t edict
Definition: progslib.h:305
func_t function
Definition: progslib.h:299
string_t string
Definition: progslib.h:296
puint_t _uint
Definition: progslib.h:301
ctx first
Definition: zone.c:587