24 lines
634 B
C
24 lines
634 B
C
#include <stdlib.h>
|
|
#include "../common/data.h"
|
|
#include "../common/c_extra.h"
|
|
|
|
int main(int argc, char **argv) {
|
|
if (argc <= 1) {
|
|
printf("Usage: %s config_file\n", argv[0]);
|
|
return;
|
|
}
|
|
int buffer_size = 0;
|
|
char *memory;
|
|
if ((buffer_size = fileToMemory(&memory, argv[1])) >= 0) {
|
|
struct Table *config_table = newTable(32);
|
|
int *offset;
|
|
offset = 0;
|
|
printf("loading in config file...\n");
|
|
loadConfig_r(config_table, memory, buffer_size, &offset);
|
|
printf("loaded, spitting out contents:\n\n");
|
|
dumpTable(config_table, 0);
|
|
} else {
|
|
printf("ERR: couldn't open file for reading\n");
|
|
}
|
|
}
|