]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - gmqcc.h
fixed shadow issue
[xonotic/gmqcc.git] / gmqcc.h
diff --git a/gmqcc.h b/gmqcc.h
index 032566a07e26018d4b90ebc650495409d07f0afc..27597f44e57ead514b892c17f9de6ccb5714e6f0 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
 #   endif /* !true  */
 #   define false (0)
 #   define true  (1)
-#   define bool _Bool
 #   if __STDC_VERSION__ < 199901L && __GNUC__ < 3
         typedef int  _Bool
+#   else
+        typedef _Bool bool;
 #   endif
 #   endif /* !__cplusplus */
 
@@ -256,6 +258,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 +495,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 +534,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 +598,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 **);