-typedef struct {
- uint16_t opcode;
-
- /* operand 1 */
- union {
- int16_t s1; /* signed */
- uint16_t u1; /* unsigned */
- };
- /* operand 2 */
- union {
- int16_t s2; /* signed */
- uint16_t u2; /* unsigned */
- };
- /* operand 3 */
- union {
- int16_t s3; /* signed */
- uint16_t u3; /* unsigned */
- };
-
- /*
- * This is the same as the structure in darkplaces
- * {
- * unsigned short op;
- * short a,b,c;
- * }
- * But this one is more sane to work with, and the
- * type sizes are guranteed.
- */
-} prog_section_statement;
-
-typedef struct {
- /* The type is (I assume)
- * 0 = ev_void
- * 1 = ev_string
- * 2 = ev_float
- * 3 = ev_vector
- * 4 = ev_entity
- * 5 = ev_field
- * 6 = ev_function
- * 7 = ev_pointer
- * 8 = ev_bad (is this right for uint16_t type?)
- */
- uint16_t type;
- uint16_t offset; /* offset in file? (what about length) */
- uint32_t name; /* offset in string table? (confused :() */
-} prog_section_both;
-
-/*
- * var and field use the same structure. But lets not use the same
- * name just for safety reasons? (still castable ...).
- */
-typedef prog_section_both prog_section_def;
-typedef prog_section_both prog_section_field;
-
-typedef struct {
- int32_t entry; /* in statement table for instructions */
- uint32_t firstlocal; /* First local in local table */
- uint32_t locals; /* Total ints of params + locals */
- uint32_t profile; /* Always zero (engine uses this) */
- uint32_t name; /* name of function in string table */
- uint32_t file; /* file of the source file */
- uint32_t nargs; /* number of arguments */
- uint8_t argsize[8]; /* size of arguments (keep 8 always?) */
-} prog_section_function;
-