]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - gmqcc.h
Adding a few error message.
[xonotic/gmqcc.git] / gmqcc.h
diff --git a/gmqcc.h b/gmqcc.h
index 032566a07e26018d4b90ebc650495409d07f0afc..7290cb61392ac35501be7508e3c5016ce70ba29f 100644 (file)
--- a/gmqcc.h
+++ b/gmqcc.h
@@ -28,6 +28,7 @@
 #include <stdio.h>
 #include <ctype.h>
 
+
 #define GMQCC_VERSION_MAJOR 0
 #define GMQCC_VERSION_MINOR 1
 #define GMQCC_VERSION_PATCH 0
@@ -256,6 +257,7 @@ void  util_meminfo       ();
 
 bool  util_strupper      (const char *);
 bool  util_strdigit      (const char *);
+bool  util_strncmpexact  (const char *, const char *, size_t);
 char *util_strdup        (const char *);
 char *util_strrq         (const char *);
 char *util_strrnl        (const char *);
@@ -492,7 +494,15 @@ enum {
     INSTR_BITAND,
     INSTR_BITOR,
 
-    /* Virtual instructions used by the IR
+    /*
+     * Virtual instructions used by the assembler
+     * keep at the end but before virtual instructions
+     * for the IR below.
+     */
+    AINSTR_END,
+
+    /*
+     * Virtual instructions used by the IR
      * Keep at the end!
      */
     VINSTR_PHI,
@@ -523,8 +533,10 @@ VECTOR_PROT(char,                   code_chars     );
  * code_write -- writes out the compiled file
  * code_init  -- prepares the code file
  */
-void code_write ();
-void code_init  ();
+bool     code_write       (const char *filename);
+void     code_init        ();
+uint32_t code_genstring   (const char *string);
+uint32_t code_cachedstring(const char *string);
 
 /*===================================================================*/
 /*========================= assembler.c =============================*/
@@ -585,21 +597,22 @@ static const struct {
     { "NOT_FNC"   , 0, 7 },
     { "IF"        , 0, 2 },
     { "IFNOT"     , 0, 5 },
-    { "CALL0"     , 0, 5 },
-    { "CALL1"     , 0, 5 },
-    { "CALL2"     , 0, 5 },
-    { "CALL3"     , 0, 5 },
-    { "CALL4"     , 0, 5 },
-    { "CALL5"     , 0, 5 },
-    { "CALL6"     , 0, 5 },
-    { "CALL7"     , 0, 5 },
-    { "CALL8"     , 0, 5 },
+    { "CALL0"     , 1, 5 },
+    { "CALL1"     , 2, 5 },
+    { "CALL2"     , 3, 5 },
+    { "CALL3"     , 4, 5 },
+    { "CALL4"     , 5, 5 },
+    { "CALL5"     , 6, 5 },
+    { "CALL6"     , 7, 5 },
+    { "CALL7"     , 8, 5 },
+    { "CALL8"     , 9, 5 },
     { "STATE"     , 0, 5 },
     { "GOTO"      , 0, 4 },
     { "AND"       , 0, 3 },
     { "OR"        , 0, 2 },
     { "BITAND"    , 0, 6 },
-    { "BITOR"     , 0, 5 }
+    { "BITOR"     , 0, 5 },
+    { "END"       , 0, 3 } /* virtual assembler instruction */
 };
 
 void asm_init (const char *, FILE **);