X-Git-Url: http://andersk.mit.edu/gitweb/splint.git/blobdiff_plain/93307a76942c3d0e463af62442eef5a542ebdfb2..34f0c5e711b8f61f6376414948f4c116f1c5a22c:/src/ctype.c diff --git a/src/ctype.c b/src/ctype.c index cfd20bf..911c00b 100644 --- a/src/ctype.c +++ b/src/ctype.c @@ -2377,3 +2377,22 @@ ctype_widest (ctype c1, ctype c2) return c1; } } + +/*drl 11/28/2000 */ +/* requires that the type is an fixed array */ +/* return the size of the array */ + +int ctype_getArraySize (ctype c) +{ + ctentry cte = ctype_getCtentry (c); + ctbase ctb; + llassert ( (ctentry_getKind (cte) == CTK_COMPLEX) || (ctentry_getKind(cte) == CTK_ARRAY) ); + + ctb = cte->ctbase; + + llassert (ctbase_isDefined (ctb) ); + + llassert (ctb->type == CT_FIXEDARRAY); + + return (ctb->contents.farray->size); +}