+const char *Unparse(CYPool &pool, struct Type *type) {
+ if (type == NULL)
+ return "?";
+
+ const char *base(Unparse_(pool, type));
+ if (type->flags == 0)
+ return base;
+
+ #define iovec_(base, size) \
+ (struct iovec) {const_cast<char *>(base), size}
+
+ size_t size(strlen(base));
+ char buffer[7 + size];
+ size_t offset(0);
+
+ if ((type->flags & JOC_TYPE_INOUT) != 0)
+ buffer[offset++] = 'N';
+ if ((type->flags & JOC_TYPE_IN) != 0)
+ buffer[offset++] = 'n';
+ if ((type->flags & JOC_TYPE_BYCOPY) != 0)
+ buffer[offset++] = 'O';
+ if ((type->flags & JOC_TYPE_OUT) != 0)
+ buffer[offset++] = 'o';
+ if ((type->flags & JOC_TYPE_BYREF) != 0)
+ buffer[offset++] = 'R';
+ if ((type->flags & JOC_TYPE_CONST) != 0)
+ buffer[offset++] = 'r';
+ if ((type->flags & JOC_TYPE_ONEWAY) != 0)
+ buffer[offset++] = 'V';
+
+ memcpy(buffer + offset, base, size);
+ return pool.strmemdup(buffer, offset + size);
+}
+