]> git.draconx.ca Git - cdecl99.git/blobdiff - src/cdecl-internal.h
libcdecl: Explicitly declare most scanner functions static.
[cdecl99.git] / src / cdecl-internal.h
index a5f3272298a20aeb3422ce685849cf223f0ee730..a1e8a9665b21ebe9593dca36eb25142e35648abe 100644 (file)
@@ -20,6 +20,9 @@
 
 #include <stddef.h>
 #include <gettext.h>
+#include "cdecl.h"
+
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
 
 #define _(s) dgettext(PACKAGE, s)
 #define N_(s) s
@@ -80,6 +83,7 @@ struct output_state {
 
 size_t cdecl__advance(struct output_state *dst, size_t amount);
 size_t cdecl__emit(struct output_state *dst, const char *src);
+size_t cdecl__emit_uint(struct output_state *dst, uintmax_t val);
 size_t cdecl__strlcpy(char *dst, const char *src, size_t len);
 
 const char *cdecl__emit_specs(struct output_state *dst,
@@ -100,4 +104,17 @@ const char *cdecl__emit_specs(struct output_state *dst,
  */
 unsigned cdecl__to_keyword(const char *s, int len, int english_mode);
 
+/* Container for an allocated parser token's value */
+struct parse_item {
+       union {
+               struct cdecl_declarator declarator;
+               struct cdecl_declspec   declspec;
+               struct cdecl            decl;
+       } u;
+
+       char s[FLEXIBLE_ARRAY_MEMBER];
+};
+
+struct parse_item *cdecl__alloc_item(size_t s_sz);
+
 #endif