MCPcopy Create free account
hub / github.com/Tencent/phxsql / handler

Function handler

phxcomm/configparser/inih-master/examples/ini_xmacros.c:20–30  ·  view source on GitHub ↗

process a line of the INI file, storing valid values into config struct */

Source from the content-addressed store, hash-verified

18
19/* process a line of the INI file, storing valid values into config struct */
20int handler(void *user, const char *section, const char *name, const char *value) {
21 config *cfg = (config *) user;
22
23 if (0)
24 ;
25#define CFG(s, n, default) else if (strcmp(section, #s)==0 && \
26 strcmp(name, #n)==0) cfg->s##_##n = strdup(value);
27#include "config.def"
28
29 return 1;
30}
31
32/* print all the variables in the config, one per line */
33void dump_config(config *cfg) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected