]> git.draconx.ca Git - cdecl99.git/blobdiff - src/cdecl.h
Use the reentrant scanner API.
[cdecl99.git] / src / cdecl.h
index 807ad6a687145e4d0dab486a7d9c1036463b6300..3217f9e46f6d1d267490cc9ebc7112f1a641459a 100644 (file)
@@ -1,3 +1,20 @@
+/*
+ *  Copyright © 2011 Nick Bowler
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
 #ifndef CDECL_H_
 #define CDECL_H_
 
@@ -41,12 +58,16 @@ enum {
 
 /* Declarator types. */
 enum {
+       CDECL_DECL_NULL,
        CDECL_DECL_IDENT,
        CDECL_DECL_POINTER,
        CDECL_DECL_ARRAY,
+       CDECL_DECL_FUNCTION,
 };
 
 struct cdecl {
+       struct cdecl *next;
+
        struct cdecl_declspec {
                struct cdecl_declspec *next;
                unsigned type;
@@ -54,7 +75,7 @@ struct cdecl {
        } *specifiers;
 
        struct cdecl_declarator {
-               struct cdecl_declarator *next, *child;
+               struct cdecl_declarator *child;
                unsigned type;
                union {
                        char *ident;
@@ -65,6 +86,10 @@ struct cdecl {
                                char *vla;
                                uintmax_t length;
                        } array;
+                       struct cdecl_function {
+                               struct cdecl *parameters;
+                               _Bool variadic;
+                       } function;
                } u;
        } *declarators;
 };