MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / length_value

Function length_value

internal/cbm/pdf/pdf_obj.c:1171–1186  ·  view source on GitHub ↗

A stream's /Length through its references (at most PDF_MAX_RESOLVE, as * pdf_resolve). */

Source from the content-addressed store, hash-verified

1169/* A stream's /Length through its references (at most PDF_MAX_RESOLVE, as
1170 * pdf_resolve). */
1171static pdf_val_t *length_value(pdf_doc_t *d, pdf_val_t *v) {
1172 for (int depth = 0; v && v->kind == PV_REF; depth++) {
1173 pdf_xent_t *e = xent(d, v->ref_num);
1174 if (depth >= PDF_MAX_RESOLVE || !e || e->loading || e->not_length) {
1175 return NULL;
1176 }
1177 if (e->cached) {
1178 v = e->obj;
1179 } else if (e->type == 1) {
1180 v = length_object(d, v->ref_num);
1181 } else {
1182 v = pdf_get(d, v->ref_num);
1183 }
1184 }
1185 return v;
1186}
1187
1188/* The object at off (or off + hdr), a stream with its raw bytes when one
1189 * follows. NULL: no matching header there. */

Callers 1

parse_indirect_atFunction · 0.85

Calls 3

xentFunction · 0.85
length_objectFunction · 0.85
pdf_getFunction · 0.85

Tested by

no test coverage detected