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

Function df_number

src/mcp/test_impact_diff.c:66–82  ·  view source on GitHub ↗

A decimal number at *p, bounded by end. false when there is none or it is * out of range. */

Source from the content-addressed store, hash-verified

64/* A decimal number at *p, bounded by end. false when there is none or it is
65 * out of range. */
66static bool df_number(const char **p, const char *end, int *out) {
67 const char *q = *p;
68 long value = 0;
69 while (q < end && *q >= '0' && *q <= '9') {
70 value = value * DF_DECIMAL + (*q - '0');
71 if (value > DF_LINE_MAX) {
72 return false;
73 }
74 q++;
75 }
76 if (q == *p) {
77 return false;
78 }
79 *p = q;
80 *out = (int)value;
81 return true;
82}
83
84/* "start[,count]" after a '-' or '+' in a hunk header. No count means 1. */
85static bool df_range(const char **p, const char *end, char sign, int *start, int *count) {

Callers 1

df_rangeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected