+ if (pp_cache_size >= pp_cache_alloc) {
+ pp_cache_alloc = pp_cache_alloc * 2 + 64;
+ pp_cache = realloc(pp_cache, pp_cache_alloc
+ * sizeof(pp_cache[0]));
+ my_assert_not(pp_cache, NULL);
+ memset(pp_cache + pp_cache_size, 0,
+ (pp_cache_alloc - pp_cache_size)
+ * sizeof(pp_cache[0]));
+ }
+
+ ret = parse_protostr(proto, &pp_cache[pp_cache_size]);
+ if (ret < 0)
+ return -1;
+
+ pp_cache_size++;
+ return 0;
+}
+
+static void build_pp_cache(FILE *fhdr)
+{
+ int ret;
+
+ rewind(fhdr);
+
+ ret = do_protostrs(fhdr, hdrfn);
+ if (ret < 0)
+ exit(1);
+
+ qsort(pp_cache, pp_cache_size, sizeof(pp_cache[0]), pp_name_cmp);
+}
+
+static const struct parsed_proto *proto_parse(FILE *fhdr, const char *sym)
+{
+ const struct parsed_proto *pp_ret;
+ struct parsed_proto pp_search;
+
+ if (pp_cache == NULL)
+ build_pp_cache(fhdr);