]> git.draconx.ca Git - cdecl99.git/blobdiff - src/cdecl.h
Forbid arrays of functions.
[cdecl99.git] / src / cdecl.h
index ffc01e36002194b72139d13147e922f54ff79ac7..29dab352297848524708f925e907ff095db7086e 100644 (file)
@@ -41,6 +41,7 @@ enum {
        CDECL_TYPE_UNSIGNED,
        CDECL_TYPE_BOOL,
        CDECL_TYPE_COMPLEX,
+       CDECL_TYPE_IMAGINARY,
        CDECL_TYPE_STRUCT,
        CDECL_TYPE_UNION,
        CDECL_TYPE_ENUM,
@@ -62,6 +63,7 @@ enum {
        CDECL_DECL_IDENT,
        CDECL_DECL_POINTER,
        CDECL_DECL_ARRAY,
+       CDECL_DECL_FUNCTION,
 };
 
 struct cdecl {
@@ -85,6 +87,10 @@ struct cdecl {
                                char *vla;
                                uintmax_t length;
                        } array;
+                       struct cdecl_function {
+                               struct cdecl *parameters;
+                               _Bool variadic;
+                       } function;
                } u;
        } *declarators;
 };
@@ -93,6 +99,7 @@ struct cdecl *cdecl_parse_decl(const char *declstr);
 void cdecl_free(struct cdecl *decl);
 
 size_t cdecl_explain(char *buf, size_t n, struct cdecl *decl);
+size_t cdecl_declare(char *buf, size_t n, struct cdecl *decl);
 
 static inline int cdecl_spec_kind(struct cdecl_declspec *spec)
 {