spingle/source/progs.h

97 lines
2.3 KiB
C
Raw Normal View History

2019-11-24 20:45:15 -08:00
/*
Copyright (C) 1996-2001 Id Software, Inc.
Copyright (C) 2002-2009 John Fitzgibbons and others
Copyright (C) 2010-2014 QuakeSpasm developers
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
2019-12-02 07:00:56 -08:00
#ifndef spingle__progs_h
#define spingle__progs_h
2019-11-24 20:45:15 -08:00
2019-12-06 17:01:10 -08:00
#include "pr_defs.h"
#include "pr_edict.h"
#include "pr_global.h"
#include "pr_ops.h"
2019-12-06 07:53:56 -08:00
2019-12-06 17:01:10 -08:00
enum
2019-11-24 20:45:15 -08:00
{
2019-12-06 17:01:10 -08:00
PROGHEADER_CRC = 5927,
PROG_VERSION = 6
};
2019-11-24 20:45:15 -08:00
2019-12-06 17:01:10 -08:00
typedef struct
{
int32_t version;
int32_t crc; // check of header file
2019-11-24 20:45:15 -08:00
2019-12-06 17:01:10 -08:00
int32_t ofs_statements;
int32_t numstatements; // statement 0 is an error
2019-11-24 20:45:15 -08:00
2019-12-06 17:01:10 -08:00
int32_t ofs_globaldefs;
int32_t numglobaldefs;
2019-11-24 20:45:15 -08:00
2019-12-06 17:01:10 -08:00
int32_t ofs_fielddefs;
int32_t numfielddefs;
2019-11-24 20:45:15 -08:00
2019-12-06 17:01:10 -08:00
int32_t ofs_functions;
int32_t numfunctions; // function 0 is an empty
2019-12-06 07:53:56 -08:00
2019-12-06 17:01:10 -08:00
int32_t ofs_strings;
int32_t numstrings; // first string is a null string
2019-11-24 20:45:15 -08:00
2019-12-06 17:01:10 -08:00
int32_t ofs_globals;
int32_t numglobals;
2019-11-24 20:45:15 -08:00
2019-12-06 17:01:10 -08:00
int32_t entityfields;
} dprograms_t;
2019-11-24 20:45:15 -08:00
2019-12-06 17:01:10 -08:00
extern dprograms_t progs;
2019-11-24 20:45:15 -08:00
2019-12-03 06:24:28 -08:00
extern char const *pr_strings;
extern char const **pr_knownstrings;
2019-12-03 05:59:16 -08:00
extern int32_t pr_maxknownstrings;
extern int32_t pr_numknownstrings;
2019-12-02 23:02:24 -08:00
extern builtin_t pr_builtins[];
extern int32_t pr_numbuiltins;
extern int32_t pr_argc;
2019-11-24 20:45:15 -08:00
2019-12-02 23:02:24 -08:00
extern bool pr_trace;
extern dfunction_t *pr_xfunction;
extern int32_t pr_xstatement;
2019-11-24 20:45:15 -08:00
2019-12-02 23:02:24 -08:00
extern uint16_t pr_crc;
2019-11-24 20:45:15 -08:00
2019-12-03 05:59:16 -08:00
extern bool pr_alpha_supported; //johnfitz
2019-12-06 17:01:10 -08:00
const char *PR_ValueString(int32_t type, eval_t *val);
const char *PR_UglyValueString(int32_t type, eval_t *val);
2019-11-24 20:45:15 -08:00
2019-12-06 17:01:10 -08:00
void PR_Init(void);
2019-11-24 20:45:15 -08:00
2019-12-06 17:01:10 -08:00
const char *PR_GetString(int32_t num);
int32_t PR_SetEngineString(const char *s);
int32_t PR_AllocString(int32_t bufferlength, char **ptr);
void PR_Profile_f(void);
noreturn void PR_RunError(const char *error, ...) FUNC_PRINTF(1, 2);
2019-11-24 20:45:15 -08:00
2019-12-02 07:00:56 -08:00
#endif