2 Copyright (C) 1996-1997 Id Software, Inc.
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.
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.
13 See the GNU General Public License for more details.
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.
21 // this file is shared by quake and qcc
26 typedef unsigned int func_t;
29 typedef enum etype_e {ev_void, ev_string, ev_float, ev_vector, ev_entity, ev_field, ev_function, ev_pointer} etype_t;
34 #define OFS_PARM0 4 // leave 3 ofs for each parm to hold vectors
42 #define RESERVED_OFS 28
208 typedef struct statement_s
215 typedef struct ddef_s
217 unsigned short type; // if DEF_SAVEGLOBGAL bit is set
218 // the variable needs to be saved in savegames
223 #define DEF_SAVEGLOBAL (1<<15)
227 typedef struct dfunction_s
229 int first_statement; // negative numbers are builtins
231 int locals; // total ints of parms + locals
233 int profile; // runtime
236 int s_file; // source file defined in
239 unsigned char parm_size[MAX_PARMS];
243 typedef struct mfunction_s
245 int first_statement; // negative numbers are builtins
247 int locals; // total ints of parms + locals
249 // these are doubles so that they can count up to 54bits or so rather than 32bit
250 double tprofile; // realtime in this function
251 double tbprofile; // realtime in builtins called by this function (NOTE: builtins also have a tprofile!)
252 double profile; // runtime
253 double builtinsprofile; // cost of builtin functions called by this function
254 double callcount; // times the functions has been called since the last profile call
255 double totaltime; // total execution time of this function DIRECTLY FROM THE ENGINE
256 double tprofile_total; // runtime (NOTE: tbprofile_total makes no real sense, so not accumulating that)
257 double profile_total; // runtime
258 double builtinsprofile_total; // cost of builtin functions called by this function
262 int s_file; // source file defined in
265 unsigned char parm_size[MAX_PARMS];
269 typedef struct mstatement_s
272 int operand[3]; // always a global or -1 for unused
273 int jumpabsolute; // only used by IF, IFNOT, GOTO
278 #define PROG_VERSION 6
279 typedef struct dprograms_s
282 int crc; // check of header file
285 int numstatements; // statement 0 is an error
294 int numfunctions; // function 0 is an empty
297 int numstrings; // first string is a null string