D 2014-11-24T20:11:49.962 L Manual\sfor\slc_process_file P 9233a0d12d01e1c3fc24e6878b205498b5a77ebc U rkeene W 2783
int lc_process_file(const char *appname, const char *pathname, lc_conf_type_t type);
#include <libconfig.h> #include <stdlib.h> #include <stdio.h> int main(int argc, char **argv) { int lc_p_ret, lc_rv_ret; char *filename = NULL; lc_rv_ret = lc_register_var("File", LC_VAR_STRING, &filename, 'f'); if (lc_rv_ret != 0) { fprintf(stderr, "Error registering variable: %i.\n", lc_geterrno()); return(EXIT_FAILURE); } lc_p_ret = lc_process_file("example", "/data/extra.conf", LC_CONF_APACHE); lc_cleanup(); if (lc_p_ret != 0) { fprintf(stderr, "Error processing configuration file: \ %s\n", lc_geterrstr()); return(EXIT_FAILURE); } if (filename != NULL) { printf("File specified was: %s\n", filename); } else { printf("No filename specified.\n"); } return(EXIT_SUCCESS); }
Z dffa7737d47ed136c8c872b23b7108c9