-static /*@observer@*/ ctbase ctype_getCtbase (ctype c)
-{
- /*@+enumint@*/
- if (c >= 0 && c < cttab.size)
- {
- return (cttab.entries[c]->ctbase);
- }
- else
- {
- if (c == CTK_UNKNOWN)
- llbuglit ("ctype_getCtbase: ctype unknown");
- if (c == CTK_INVALID)
- llbuglit ("ctype_getCtbase: ctype invalid");
- if (c == CTK_DNE)
- llbuglit ("ctype_getCtbase: ctype dne");
- if (c == CTK_ELIPS)
- llbuglit ("ctype_getCtbase: elips marker");
-
- llfatalbug (message ("ctype_getCtbase: ctype out of range: %d", c));
- BADEXIT;
- }
-
- /*@=enumint@*/
-}
-
-static /*@notnull@*/ /*@observer@*/ ctbase
-ctype_getCtbaseSafe (ctype c)
-{
- ctbase res = ctype_getCtbase (c);
-
- llassert (ctbase_isDefined (res));
- return res;
-}
-
-/*
-** ctentry
-*/
-
-static ctentry
-ctype_getCtentry (ctype c)
-{
- static /*@only@*/ ctentry errorEntry = NULL;
-
- if (cttab.size == 0)
- {
- if (errorEntry == NULL)
- {
- errorEntry = ctentry_makeNew (CTK_UNKNOWN, ctbase_undefined);
- }
-
- return errorEntry;
- }
-
- /*@+enumint@*/
- if (c >= CTK_PLAIN && c < cttab.size)
- {
- return (cttab.entries[c]);
- }
- else if (c == CTK_UNKNOWN)
- llcontbuglit ("ctype_getCtentry: ctype unknown");
- else if (c == CTK_INVALID)
- llcontbuglit ("ctype_getCtentry: ctype invalid (ctype_undefined)");
- else if (c == CTK_DNE)
- llcontbuglit ("ctype_getCtentry: ctype dne");
- else if (c == CTK_ELIPS)
- llcontbuglit ("ctype_getCtentry: ctype elipsis");
- else if (c == CTK_MISSINGPARAMS)
- llcontbuglit ("ctype_getCtentry: ctype missing params");
- else
- llbug (message ("ctype_getCtentry: ctype out of range: %d", c));
-
- return (cttab.entries[ctype_unknown]);
- /*@=enumint@*/
-}
-