-static inline void dump_decl_arg(int fd, decl_arg *a) {
- dump_decl_type(fd, a->type);
- if (a->type->type != PSI_T_FUNCTION) {
+static inline void dump_decl_arg(int fd, decl_arg *a, unsigned level) {
+ if (a->type->type == PSI_T_FUNCTION) {
+ dump_decl_type(fd, a->type->real.func->func->type, level);
+ dprintf(fd, " (");
+ dump_decl_var(fd, a->var);
+ dprintf(fd, ")(");
+ if (a->type->real.func->args) {
+ size_t j;
+
+ for (j = 0; j < a->type->real.func->args->count; ++j) {
+ if (j) {
+ dprintf(fd, ", ");
+ }
+ dump_decl_arg(fd, a->type->real.func->args->args[j], level+1);
+ }
+ if (a->type->real.func->args->varargs) {
+ dprintf(fd, ", ...");
+ }
+ }
+ dprintf(fd, ")");
+ } else {
+ dump_decl_type(fd, a->type, level);