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

Function pl_push

internal/cbm/pdf/pdf_text.c:802–819  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

800} pagelist_t;
801
802static bool pl_push(pdf_doc_t *d, pagelist_t *l, pdf_val_t *node, pdf_val_t *res, pdf_val_t *box) {
803 if (l->n == l->cap) {
804 int ncap = l->cap ? l->cap * 2 : PDF_OPS_MIN;
805 pdf_pageref_t *g =
806 (pdf_pageref_t *)cbm_realloc(CBM_MEM_CLASS_EXTRACT, l->v, (size_t)ncap * sizeof(*g));
807 if (!g) {
808 d->nomem = true;
809 return false;
810 }
811 l->v = g;
812 l->cap = ncap;
813 }
814 l->v[l->n].node = node;
815 l->v[l->n].res = res;
816 l->v[l->n].box = box;
817 l->n++;
818 return true;
819}
820
821/* dict.get(key, dflt): a present key wins even when its value is null. */
822static pdf_val_t *dget_or(const pdf_val_t *dict, const char *key, pdf_val_t *dflt) {

Callers 1

collect_pagesFunction · 0.70

Calls 1

cbm_reallocFunction · 0.85

Tested by

no test coverage detected