git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4515 4a8a32a2...
[fw/sdcc] / src / SDCCutil.h
index d8956d49322aa078b6daed1a9f4f3b7eb00b0eaf..6d5f75f92e529460dc66f3862d754e49639feb5c 100644 (file)
@@ -26,6 +26,7 @@
 #define SDCCUTIL_H
 
 #include "SDCChasht.h"
+#include "dbuf.h"
 #include <stdarg.h>
 
 /** Given an array of name, value string pairs creates a new hash
@@ -112,4 +113,21 @@ size_t SDCCsnprintf(char *, size_t, const char *, ...);
 #  error "Need at least one of snprintf, vsnprintf, vsprintf!"
 # endif
 
+/** Pragma tokenizer
+ */
+enum pragma_token_e { TOKEN_UNKNOWN, TOKEN_STR, TOKEN_INT, TOKEN_EOL };
+
+struct pragma_token_s {
+  enum pragma_token_e type;
+  struct dbuf_s dbuf;
+  union {
+    int int_val;
+  } val;
+};
+
+void init_pragma_token(struct pragma_token_s *token);
+char *get_pragma_token(const char *s, struct pragma_token_s *token);
+const char *get_pragma_string(struct pragma_token_s *token);
+void free_pragma_token(struct pragma_token_s *token);
+
 #endif