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

Function numidx_cmp

internal/cbm/pdf/pdf_obj.c:1239–1246  ·  view source on GitHub ↗

(number, position) pairs, sorted to find the first of a number. */

Source from the content-addressed store, hash-verified

1237
1238/* (number, position) pairs, sorted to find the first of a number. */
1239static int numidx_cmp(const void *x, const void *y) {
1240 const pdf_numidx_t *a = (const pdf_numidx_t *)x;
1241 const pdf_numidx_t *b = (const pdf_numidx_t *)y;
1242 if (a->num != b->num) {
1243 return a->num < b->num ? -1 : 1;
1244 }
1245 return a->idx < b->idx ? -1 : a->idx > b->idx ? 1 : 0;
1246}
1247
1248/* The first pair of `num` in a sorted array; n when none. */
1249static int numidx_first(const pdf_numidx_t *v, int n, int64_t num) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected