X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=progsvm.h;h=c977d7ab6b05e097fef515c757ebb4f7f54a8d86;hb=11da6c67eca981d8d8f2362a45fe69d9dd61024b;hp=b8ebe8008bc62110e075218c59fc6fdac7bd08c4;hpb=56561de0acdb9cf29d155992440ac3e0d32909dd;p=xonotic%2Fdarkplaces.git diff --git a/progsvm.h b/progsvm.h index b8ebe800..c977d7ab 100644 --- a/progsvm.h +++ b/progsvm.h @@ -152,7 +152,7 @@ typedef union prvm_eval_s int edict; } prvm_eval_t; -typedef struct prvm_required_field_s +typedef struct prvm_required_field_s { int type; const char *name; @@ -200,7 +200,7 @@ typedef struct prvm_edict_s // However, the first one should be preferred. } priv; // QuakeC fields (stored in dynamically resized array) - union + union { void *vp; entvars_t *server; @@ -261,6 +261,8 @@ typedef struct prvm_prog_s int edict_size; // in bytes int edictareasize; // LordHavoc: in bytes (for bound checking) + int *statement_linenums; // NULL if not available + union { float *generic; globalvars_t *server; @@ -268,7 +270,12 @@ typedef struct prvm_prog_s int maxknownstrings; int numknownstrings; + // this is updated whenever a string is removed or added + // (simple optimization of the free string search) + int firstfreeknownstring; const char **knownstrings; + qbyte *knownstrings_freeable; + const char ***stringshash; // all memory allocations related to this vm_prog (code, edicts, strings) mempool_t *progs_mempool; // [INIT] @@ -321,6 +328,10 @@ typedef struct prvm_prog_s float *time; float _time; + // allow writing to world entity fields, this is set by server init and + // cleared before first server frame + qboolean allowworldwrites; + // name of the prog, e.g. "Server", "Client" or "Menu" (used for text output) char *name; // [INIT] @@ -477,10 +488,9 @@ void PRVM_ED_PrintEdicts_f (void); void PRVM_ED_PrintNum (int ent); const char *PRVM_GetString(int num); -int PRVM_SetQCString(const char *s); int PRVM_SetEngineString(const char *s); -char *PRVM_AllocString(int bufferlength); -void PRVM_FreeString(char *s); +int PRVM_AllocString(size_t bufferlength, char **pointer); +void PRVM_FreeString(int num); //============================================================================