]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - gmqcc.h
Use hashtable for macro definitions in the preprocessor, this speeds up the search...
[xonotic/gmqcc.git] / gmqcc.h
diff --git a/gmqcc.h b/gmqcc.h
index c45731321be8ff7bc5469be5affd6479b10516ce..42e771459303cc7be78cb564abd28b7d5d73273e 100644 (file)
--- a/gmqcc.h
+++ b/gmqcc.h
@@ -417,10 +417,13 @@ typedef struct hash_set_t {
  * util_htdel(foo);
  */
 hash_table_t *util_htnew (size_t size);
+void          util_htrem (hash_table_t *ht, void (*callback)(void *data));
 void          util_htset (hash_table_t *ht, const char *key, void *value);
 void          util_htdel (hash_table_t *ht);
 size_t        util_hthash(hash_table_t *ht, const char *key);
 void          util_htseth(hash_table_t *ht, const char *key, size_t hash, void *value);
+void          util_htrmh (hash_table_t *ht, const char *key, size_t bin, void (*cb)(void*));
+void          util_htrm  (hash_table_t *ht, const char *key, void (*cb)(void*));
 
 void         *util_htget (hash_table_t *ht, const char *key);
 void         *util_htgeth(hash_table_t *ht, const char *key, size_t hash);
@@ -1038,6 +1041,8 @@ void             parser_cleanup       (struct parser_s *parser);
 /*====================== ftepp.c commandline ========================*/
 /*===================================================================*/
 struct lex_file_s;
+struct ftepp_s;
+
 typedef struct {
     const char  *name;
     char      *(*func)(struct lex_file_s *);
@@ -1049,14 +1054,14 @@ typedef struct {
  */
 #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);
-void        ftepp_finish           ();
-const char *ftepp_get              ();
-void        ftepp_flush            ();
-void        ftepp_add_define       (const char *source, const char *name);
-void        ftepp_add_macro        (const char *name,   const char *value);
+struct ftepp_s *ftepp_create           ();
+bool            ftepp_preprocess_file  (struct ftepp_s *ftepp, const char *filename);
+bool            ftepp_preprocess_string(struct ftepp_s *ftepp, const char *name, const char *str);
+void            ftepp_finish           (struct ftepp_s *ftepp);
+const char     *ftepp_get              (struct ftepp_s *ftepp);
+void            ftepp_flush            (struct ftepp_s *ftepp);
+void            ftepp_add_define       (struct ftepp_s *ftepp, const char *source, const char *name);
+void            ftepp_add_macro        (struct ftepp_s *ftepp, const char *name,   const char *value);
 
 extern const ftepp_predef_t ftepp_predefs[FTEPP_PREDEF_COUNT];