+// best option: we can define our own snprintf which logs errors.
+# define SNPRINTF SDCCsnprintf
+
+# elif defined(HAVE_SPRINTF)
+
+// if we can't build a safe snprintf for lack of vsnprintf but there
+// is a native snprintf, use it.
+# define SNPRINTF snprintf
+
+# elif defined(HAVE_VSPRINTF)
+
+// we can at least define our own unsafe version.
+# define SNPRINTF SDCCsnprintf
+
+# else
+// We don't have a native snprintf nor the functions we need to write one.
+# 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);
+
+unsigned char hexEscape (const char **src);
+unsigned char octalEscape (const char **src);
+int copyStr (char *dest, const char *src);
+
+#endif