]> de.git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - gmqcc.h
Fix all the memleaks in the corrector. Holy shit, the amount of hours I wasted trying...
[xonotic/gmqcc.git] / gmqcc.h
diff --git a/gmqcc.h b/gmqcc.h
index 02b9bfe147f0b06535c8f14b5115e10b45272587..36a67fdf282bb6f78b7a9cb3bb437f51912ad427 100644 (file)
--- a/gmqcc.h
+++ b/gmqcc.h
@@ -413,6 +413,7 @@ GMQCC_INLINE int     file_error  (FILE *);
 GMQCC_INLINE int     file_getc   (FILE *);
 GMQCC_INLINE int     file_printf (FILE *, const char *, ...);
 GMQCC_INLINE int     file_puts   (FILE *, const char *);
+GMQCC_INLINE int     file_putc   (FILE *, int);
 GMQCC_INLINE int     file_seek   (FILE *, long int, int);
 
 GMQCC_INLINE size_t  file_read   (void *,        size_t, size_t, FILE *);
@@ -444,6 +445,7 @@ enum {
     TYPE_ARRAY    ,
 
     TYPE_NIL      , /* it's its own type / untyped */
+    TYPE_NOEXPR   , /* simply invalid in expressions */
 
     TYPE_COUNT
 };
@@ -961,6 +963,18 @@ void parser_cleanup       ();
 /*===================================================================*/
 /*====================== ftepp.c commandline ========================*/
 /*===================================================================*/
+struct lex_file_s;
+typedef struct {
+    const char  *name;
+    char      *(*func)(struct lex_file_s *);
+} ftepp_predef_t;
+
+/*
+ * line, file, counter, counter_last, random, random_last, date, time
+ * increment when items are added
+ */
+#define FTEPP_PREDEF_COUNT 8
+
 bool        ftepp_init             ();
 bool        ftepp_preprocess_file  (const char *filename);
 bool        ftepp_preprocess_string(const char *name, const char *str);
@@ -970,6 +984,8 @@ void        ftepp_flush            ();
 void        ftepp_add_define       (const char *source, const char *name);
 void        ftepp_add_macro        (const char *name,   const char *value);
 
+extern const ftepp_predef_t ftepp_predefs[FTEPP_PREDEF_COUNT];
+
 /*===================================================================*/
 /*======================= main.c commandline ========================*/
 /*===================================================================*/