20 lines
472 B
C
20 lines
472 B
C
#include "conf.h"
|
|
#include <stdio.h>
|
|
|
|
// Example usage
|
|
int main(void) {
|
|
Config *cfg = config_load("config.ini");
|
|
if (!cfg) {
|
|
fprintf(stderr, "Failed to load config.ini\n");
|
|
return 1;
|
|
}
|
|
|
|
const char *user = config_get(cfg, "username");
|
|
const char *pass = config_get(cfg, "password");
|
|
|
|
printf("Username: %s\n", user ? user : "(not set)");
|
|
printf("Password: %s\n", pass ? pass : "(not set)");
|
|
|
|
config_free(cfg);
|
|
return 0;
|
|
}
|