]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - gmqcc.h
prepare fields before generating globals so we avoid the need for relocating initiali...
[xonotic/gmqcc.git] / gmqcc.h
diff --git a/gmqcc.h b/gmqcc.h
index c3a44cd98552bc73b4867321e6f8fab04559a140..cc265053d9155a6d13532bf3bafc9ef4532decc1 100644 (file)
--- a/gmqcc.h
+++ b/gmqcc.h
@@ -328,6 +328,11 @@ enum {
     TYPE_COUNT
 };
 
+/* const/var qualifiers */
+#define CV_NONE  0
+#define CV_CONST 1
+#define CV_VAR  -1
+
 extern const char *type_name[TYPE_COUNT];
 
 extern size_t type_sizeof[TYPE_COUNT];
@@ -438,7 +443,7 @@ typedef struct {
     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                  */
+    int32_t   nargs;      /* number of arguments                  */
     uint8_t   argsize[8]; /* size of arguments (keep 8 always?)   */
 } prog_section_function;
 
@@ -532,6 +537,7 @@ enum {
 };
 
 extern prog_section_statement *code_statements;
+extern int                    *code_linenums;
 extern prog_section_def       *code_defs;
 extern prog_section_field     *code_fields;
 extern prog_section_function  *code_functions;
@@ -546,12 +552,15 @@ typedef int32_t qcint;
  * code_write -- writes out the compiled file
  * code_init  -- prepares the code file
  */
-bool     code_write       (const char *filename);
+bool     code_write       (const char *filename, const char *lno);
 void     code_init        ();
 uint32_t code_genstring   (const char *string);
 uint32_t code_cachedstring(const char *string);
 qcint    code_alloc_field (size_t qcsize);
 
+/* this function is used to keep statements and linenumbers together */
+void     code_push_statement(prog_section_statement *stmt, int linenum);
+
 /*
  * A shallow copy of a lex_file to remember where which ast node
  * came from.