Unify pr_comp.h across all sourceports

This commit is contained in:
cypress 2024-09-03 19:16:59 -07:00 committed by GitHub
parent 82781db52c
commit 471866ab58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 43 additions and 26 deletions

View File

@ -1,5 +1,6 @@
/* /*
Copyright (C) 1996-1997 Id Software, Inc. Copyright (C) 1996-2001 Id Software, Inc.
Copyright (C) 2010-2014 QuakeSpasm developers
This program is free software; you can redistribute it and/or This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -18,17 +19,30 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#ifndef __PR_COMP_H
#define __PR_COMP_H
// this file is shared by quake and qcc // this file is shared by quake and qcc
typedef int func_t; typedef int func_t;
typedef int string_t; typedef int string_t;
typedef enum {ev_void, ev_string, ev_float, ev_vector, ev_entity, ev_field, ev_function, ev_pointer} etype_t; typedef enum
{
ev_bad = -1,
ev_void = 0,
ev_string,
ev_float,
ev_vector,
ev_entity,
ev_field,
ev_function,
ev_pointer
} etype_t;
#define OFS_NULL 0 #define OFS_NULL 0
#define OFS_RETURN 1 #define OFS_RETURN 1
#define OFS_PARM0 4 // leave 3 ofs for each parm to hold vectors #define OFS_PARM0 4 // leave 3 ofs for each parm to hold vectors
#define OFS_PARM1 7 #define OFS_PARM1 7
#define OFS_PARM2 10 #define OFS_PARM2 10
#define OFS_PARM3 13 #define OFS_PARM3 13
@ -39,7 +53,8 @@ typedef enum {ev_void, ev_string, ev_float, ev_vector, ev_entity, ev_field, ev_f
#define RESERVED_OFS 28 #define RESERVED_OFS 28
enum { enum
{
OP_DONE, OP_DONE,
OP_MUL_F, OP_MUL_F,
OP_MUL_V, OP_MUL_V,
@ -117,20 +132,20 @@ enum {
OP_BITOR OP_BITOR
}; };
typedef struct statement_s typedef struct statement_s
{ {
unsigned short op; unsigned short op;
short a,b,c; short a, b, c;
} dstatement_t; } dstatement_t;
typedef struct typedef struct
{ {
unsigned short type; // if DEF_SAVEGLOBGAL bit is set unsigned short type; // if DEF_SAVEGLOBAL bit is set
// the variable needs to be saved in savegames // the variable needs to be saved in savegames
unsigned short ofs; unsigned short ofs;
int s_name; int s_name;
} ddef_t; } ddef_t;
#define DEF_SAVEGLOBAL (1<<15) #define DEF_SAVEGLOBAL (1<<15)
#define MAX_PARMS 8 #define MAX_PARMS 8
@ -139,7 +154,7 @@ typedef struct
{ {
int first_statement; // negative numbers are builtins int first_statement; // negative numbers are builtins
int parm_start; int parm_start;
int locals; // total ints of parms + locals int locals; // total ints of parms + locals
int profile; // runtime int profile; // runtime
@ -155,7 +170,7 @@ typedef struct
typedef struct typedef struct
{ {
int version; int version;
int crc; // check of header file int crc; // check of header file
int ofs_statements; int ofs_statements;
int numstatements; // statement 0 is an error int numstatements; // statement 0 is an error
@ -170,7 +185,7 @@ typedef struct
int numfunctions; // function 0 is an empty int numfunctions; // function 0 is an empty
int ofs_strings; int ofs_strings;
int numstrings; // first string is a null string int numstrings; // first string is a null string
int ofs_globals; int ofs_globals;
int numglobals; int numglobals;
@ -178,3 +193,5 @@ typedef struct
int entityfields; int entityfields;
} dprograms_t; } dprograms_t;
#endif /* __PR_COMP_H */