+/*
+ * Return a newly-allocated null declarator. The child member is set by the
+ * argument; other members are initialized to zero.
+ */
+struct cdecl_declarator *new_declarator(struct cdecl_declarator *child)
+{
+ struct cdecl_declarator *d, init = { child, CDECL_DECL_NULL };
+
+ d = malloc_nofail(sizeof *d);
+ *d = init;
+
+ return d;
+}
+
+/*
+ * Return a newly-allocated void specifier. The next member is set by the
+ * argument; other members are initialized to zero.
+ */
+struct cdecl_declspec *new_specifier(struct cdecl_declspec *next)
+{
+ struct cdecl_declspec *d, init = { next, CDECL_TYPE_VOID };
+
+ d = malloc_nofail(sizeof *d);
+ *d = init;
+
+ return d;
+}
+
+/*
+ * Return a newly-allocated declaration. The next member is set by the
+ * argument; other members are initialized to zero.
+ */
+struct cdecl *new_cdecl(struct cdecl *next)
+{
+ struct cdecl *d, init = { next };
+
+ d = malloc_nofail(sizeof *d);
+ *d = init;
+
+ return d;
+}