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

Function f_a85

internal/cbm/pdf/pdf_obj.c:2523–2548  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2521}
2522
2523static void f_a85(pdf_doc_t *d, const unsigned char *in, size_t n, pdf_buf_t *out) {
2524 unsigned char *t = (unsigned char *)cbm_alloc(CBM_MEM_CLASS_EXTRACT, n ? n : 1);
2525 if (!t) {
2526 d->nomem = true;
2527 out->fail = true;
2528 return;
2529 }
2530 size_t k = 0;
2531 for (size_t i = 0; i < n; i++) {
2532 if (!is_ws(in[i])) {
2533 t[k++] = in[i];
2534 }
2535 }
2536 size_t s0 = 0;
2537 if (k >= 2 && t[0] == '<' && t[1] == '~') {
2538 s0 = 2;
2539 }
2540 const unsigned char *e = cbm_memmem(t + s0, k - s0, "~>", 2);
2541 size_t m = e ? (size_t)(e - (t + s0)) : k - s0;
2542 if (!a85_strict(t + s0, m, out) && !out->fail) {
2543 if (!a85_strict(t + s0, m - m % PDF_A85_GROUP, out) && !out->fail) {
2544 out->n = 0;
2545 }
2546 }
2547 cbm_free(CBM_MEM_CLASS_EXTRACT, t);
2548}
2549
2550static void f_ahx(const unsigned char *in, size_t n, pdf_buf_t *out) {
2551 const unsigned char *gt = (const unsigned char *)memchr(in, '>', n);

Callers 1

decode_filtersFunction · 0.85

Calls 5

cbm_allocFunction · 0.85
is_wsFunction · 0.85
cbm_memmemFunction · 0.85
a85_strictFunction · 0.85
cbm_freeFunction · 0.85

Tested by

no test coverage detected