MCPcopy Create free account
hub / github.com/apache/cloudberry / ini_get

Function ini_get

gpcontrib/gpcloud/lib/ini.cpp:331–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331const char* ini_get(ini_t *ini, const char *section, const char *key) {
332 const char *current_section = "";
333 char *val;
334 char *p = ini->data;
335
336 if (*p == '\0') {
337 p = next(ini, p);
338 }
339
340 while (p < ini->end) {
341 if (*p == '[') {
342 /* Handle section */
343 current_section = p + 1;
344
345 } else {
346 /* Handle key */
347 val = next(ini, p);
348 if (!section || !strcmpci(section, current_section)) {
349 if (!strcmpci(p, key)) {
350 return val;
351 }
352 }
353 p = val;
354 }
355
356 p = next(ini, p);
357 }
358
359 return NULL;
360}
361
362int ini_sget(
363 ini_t *ini, const char *section, const char *value,

Callers 2

ini_sgetFunction · 0.85
GetMethod · 0.85

Calls 2

strcmpciFunction · 0.85
nextFunction · 0.70

Tested by

no test coverage detected