+/* Obtains a caseproto for a case described by SC. The caller
+ must not modify or unref the returned case prototype. */
+const struct caseproto *
+subcase_get_proto (const struct subcase *sc_)
+{
+ struct subcase *sc = (struct subcase *) sc_;
+
+ if (sc->proto == NULL)
+ {
+ size_t i;
+
+ sc->proto = caseproto_create ();
+ for (i = 0; i < sc->n_fields; i++)
+ sc->proto = caseproto_add_width (sc->proto, sc->fields[i].width);
+ }
+ return sc->proto;
+}
+