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
126 typedef struct statement_s
133 typedef struct ddef_s
135 unsigned short type; // if DEF_SAVEGLOBGAL bit is set
136 // the variable needs to be saved in savegames
141 #define DEF_SAVEGLOBAL (1<<15)
145 typedef struct dfunction_s
147 int first_statement; // negative numbers are builtins
149 int locals; // total ints of parms + locals
151 int profile; // runtime
154 int s_file; // source file defined in
157 unsigned char parm_size[MAX_PARMS];
161 typedef struct mfunction_s
163 int first_statement; // negative numbers are builtins
165 int locals; // total ints of parms + locals
167 // these are doubles so that they can count up to 54bits or so rather than 32bit
168 double tprofile; // realtime in this function
169 double tbprofile; // realtime in builtins called by this function (NOTE: builtins also have a tprofile!)
170 double profile; // runtime
171 double builtinsprofile; // cost of builtin functions called by this function
172 double callcount; // times the functions has been called since the last profile call
173 double totaltime; // total execution time of this function DIRECTLY FROM THE ENGINE
174 double tprofile_total; // runtime (NOTE: tbprofile_total makes no real sense, so not accumulating that)
175 double profile_total; // runtime
176 double builtinsprofile_total; // cost of builtin functions called by this function
180 int s_file; // source file defined in
183 unsigned char parm_size[MAX_PARMS];
187 typedef struct mstatement_s
190 int operand[3]; // always a global or -1 for unused
191 int jumpabsolute; // only used by IF, IFNOT, GOTO
196 #define PROG_VERSION 6
197 typedef struct dprograms_s
200 int crc; // check of header file
203 int numstatements; // statement 0 is an error
212 int numfunctions; // function 0 is an empty
215 int numstrings; // first string is a null string