+ ctype res;
+ res = cttable_addDerived (CTK_ARRAY, ctbase_makeFixedArray (c, size), c);
+ return res;
+}
+
+/*
+** In C, array terms appear backwards:
+**
+** int a[5][7]
+**
+** declares an array of 5 elements, each of which is
+** an array of 7 int's.
+**
+** We represent this as,
+**
+** array (array (int, 7), 5)
+**
+** Hence, the rightmost declaration is the innermost type.
+*/
+
+ctype ctype_makeInnerFixedArray (ctype c, size_t size)
+{
+ ctype res;
+
+ DPRINTF (("makeinnerfixed: %s / %d", ctype_unparse (c), size));
+
+ if (ctype_isFixedArray (c))
+ {
+ ctype cb = ctype_baseArrayPtr (c);
+ size_t osize = ctype_getArraySize (c);
+
+ res = ctype_makeFixedArray (ctype_makeInnerFixedArray (cb, size), osize);
+ DPRINTF (("res 1: %s", ctype_unparse (res)));
+ }
+ else if (ctype_isArray (c))
+ {
+ ctype cb = ctype_baseArrayPtr (c);
+
+ res = ctype_makeArray (ctype_makeInnerFixedArray (cb, size));
+ DPRINTF (("res 2: %s", ctype_unparse (res)));
+ }
+ else
+ {
+ res = ctype_makeFixedArray (c, size);
+ DPRINTF (("res 3: %s", ctype_unparse (res)));
+ }
+
+ DPRINTF (("Make inner fixed array: %s / base: %s",
+ ctype_unparse (res), ctype_unparse (ctype_baseArrayPtr (res))));
+ return res;
+}
+
+ctype ctype_makeInnerArray (ctype c)
+{
+ ctype res;
+
+ DPRINTF (("Make inner array: %s", ctype_unparse (c)));
+
+ if (ctype_isFixedArray (c))
+ {
+ ctype cb = ctype_baseArrayPtr (c);
+ size_t osize = ctype_getArraySize (c);
+
+ res = ctype_makeFixedArray (ctype_makeInnerArray (cb), osize);
+ }
+ else if (ctype_isArray (c))
+ {
+ ctype cb = ctype_baseArrayPtr (c);
+ res = ctype_makeArray (ctype_makeInnerArray (cb));
+ }
+ else
+ {
+ res = ctype_makeArray (c);
+ }
+
+ DPRINTF (("Make inner array: %s", ctype_unparse (res)));
+ return res;