commit - 20412cdab5e17485a4a49f22a7d4369c6558d46d
commit + a091668f694a14e7da6415d8056c770d72993198
blob - 6bb8bea40ec6e4ee7dd15e4a0647653f5696a6b7
blob + ec84c6ef47cf4155338902214bcea5f70a826315
--- pdf.c
+++ pdf.c
if (item) {
fontinfo->descendantFonts = item;
}
- }
- else { // xref error
- goto end;
}
}
- end:
return fontinfo;
}
h_pprintln(stdout, item);
// just continue for now
- goto end;
+ return;
}
// it currently only handles the case where /Contents is
// a direct object that happens to be an array.
if (contents == NULL)
- goto end;
+ return;
if (contents->token_type == TT_SEQUENCE) {
size_t numelts = contents->seq->used;
size_t bufsz = 0;
entry = resolve(aux, entry);
// XXX check that entry is a stream object of the expected type
if (!entry) // TODO: Failure ==> xref error -- Figure out how to handle
- goto end;
+ return;
HParsedToken *res_strm = H_INDEX_TOKEN(entry, 1);
HParseResult *bstrm_r = H_CAST(HParseResult, res_strm);
if ( (bstrm_r) && (bstrm_r->ast) ) {
if (tstrm)
myNode->pn.textStream = tstrm->ast;
}
-
-end: ;
}
h_pprintln(stdout, item);
// just continue for now
- goto end;
+ return;
}
}
if ( ! parsed ) {
fprintf(stdout, "parse_pagetree: Required page node count missing or corrupt!\n");
- goto end; // Should just be a warning?
+ return; // Should just be a warning?
}
myNode->pt.numPages = H_CAST_SINT(item);
}
if ( ! parsed ) {
fprintf(stdout, "parse_pagetree: This tree node has no pages!\n");
- goto end; // Nothing more to do here
+ return;
}
} // end loop
-
-end:
return;
}
// Ensure the reference is to the catalog dictionary
dict_t = resolve(aux, root);
if (!dict_t) { // TODO: Failure ==> xref error -- Figure out how to handle
- goto end;
+ return;
}
aux->catalog.catalog = get_dictoftype(dict_t, NULL, "Catalog", aux); // catalog dictionary token
// Catalog found -- Now get the root of the page tree associated with the catalog
ptRef = dictentry(catalog, "Pages"); // indirect reference to a dictionary
if ( (ptRef == NULL) || (ptRef->token_type != TT_Ref) ) {
- goto end;
+ return;
}
aux->catalog.pRoot = ptRef; // indirect reference to the page tree
/* resolve and process the page tree root reference to extract the dictionary --> Page Tree Object */
dict_t = resolve(aux, ptRef); // page tree root node
if (!dict_t) {
- goto end;
+ return;
}
// make sure the retrieved token is a dictionary of /Type "Pages"
dict_t = get_dictoftype(dict_t, NULL, "Pages", aux); // page tree root dictionary (parent is NULL)
if (!dict_t) {
- goto end; // Nothing more to do here
+ return; // Nothing more to do here
}
ptRoot = H_CAST(Dict, dict_t);
parse_pagetree(aux, &aux->catalog.pgTree, ptRef, ptRoot, NULL, NULL);
}
else { // looks like the field "Type:Catalog" is a hint, not a requirement for a valid pdf
- goto end;
+ return;
}
-
- end:
- return;
}
/*