X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCutil.h;h=6d5f75f92e529460dc66f3862d754e49639feb5c;hb=ee76e2f5985c5917392f3f6ea121db57a9e314ce;hp=d8956d49322aa078b6daed1a9f4f3b7eb00b0eaf;hpb=f970f0e6603401042048d98927927133a0f9f255;p=fw%2Fsdcc diff --git a/src/SDCCutil.h b/src/SDCCutil.h index d8956d49..6d5f75f9 100644 --- a/src/SDCCutil.h +++ b/src/SDCCutil.h @@ -26,6 +26,7 @@ #define SDCCUTIL_H #include "SDCChasht.h" +#include "dbuf.h" #include /** 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