*/
+#ifndef PROGS_H
+#define PROGS_H
+
#include "pr_comp.h" // defs shared with qcc
#include "progdefs.h" // generated by program cdefs
entvars_t v; // C exported fields from progs
// other fields from progs come immediately after
} edict_t;
-//#define EDICT_FROM_AREA(l) ((edict_t *)((qbyte *)l - (int)&(((edict_t *)0)->area)))
-//#define EDICT_FROM_AREA(l) STRUCT_FROM_LINK(l,edict_t,area)
// LordHavoc: in an effort to eliminate time wasted on GetEdictFieldValue... see pr_edict.c for the functions which use these.
extern int eval_gravity;
void PR_Init (void);
-void PR_ExecuteProgram (func_t fnum, char *errormessage);
+void PR_ExecuteProgram (func_t fnum, const char *errormessage);
void PR_LoadProgs (void);
void PR_Profile_f (void);
+void PR_Crash (void);
+
edict_t *ED_Alloc (void);
void ED_Free (edict_t *ed);
-char *ED_NewString (char *string);
+char *ED_NewString (const char *string);
// returns a copy of the string allocated from the server's string heap
void ED_Print (edict_t *ed);
void ED_Write (QFile *f, edict_t *ed);
-char *ED_ParseEdict (char *data, edict_t *ent);
+const char *ED_ParseEdict (const char *data, edict_t *ent);
void ED_WriteGlobals (QFile *f);
-void ED_ParseGlobals (char *data);
+void ED_ParseGlobals (const char *data);
-void ED_LoadFromFile (char *data);
+void ED_LoadFromFile (const char *data);
edict_t *EDICT_NUM_ERROR(int n);
#define EDICT_NUM(n) (n >= 0 ? (n < sv.max_edicts ? (edict_t *)((qbyte *)sv.edicts + (n) * pr_edict_size) : EDICT_NUM_ERROR(n)) : EDICT_NUM_ERROR(n))
-//define EDICT_NUM(n) ((edict_t *)(sv.edicts+ (n)*pr_edict_size))
-//define NUM_FOR_EDICT(e) (((qbyte *)(e) - sv.edicts)/pr_edict_size)
-//edict_t *EDICT_NUM(int n);
int NUM_FOR_EDICT(edict_t *e);
#define NEXT_EDICT(e) ((edict_t *)( (qbyte *)e + pr_edict_size))
extern unsigned short pr_crc;
-void PR_RunError (char *error, ...);
+void PR_Execute_ProgsLoaded(void);
void ED_PrintEdicts (void);
void ED_PrintNum (int ent);
-//eval_t *GetEdictFieldValue(edict_t *ed, char *field);
+#endif