getconf is 'n C program wat NAME = WAARDE pare kan haal uit 'n konfigurasielêer.
Monster:
# include
# include
# include
include "getconf.h"
int main (int argc, char * argv [])
{
struct config c;
char * Vars [MAX_LINES];
char * Vals [MAX_LINES];
char * configfile = "getconf_test.conf";
int lyne;
int tel;
lyne = open_file (configfile);
As (lyne <0)
{
fprintf (stderr,, configfile "Kon nie config lêer% sn lees");
uitgang (EXIT_FAILURE);
}
get_config (& c);
vir (telling = 0; tel
* (VARs + tel) = (char *) malloc (StrLen (c.var [telling]));
* (Vals + tel) = (char *) malloc (StrLen (c.val [telling]));
strcpy (* (VARs + telling), c.var [telling]);
strcpy (* (Vals + telling), c.val [telling]);
printf ("Veranderlike:% sttValue:% sn" * (VARs + tel), * (Vals + tel));
}
/ * Nou opruim * /
vir (telling = 0; tel
gratis (Vars [telling]);
gratis (Vals [telling]);
}
0 terugkeer;
}
Sagteware besonderhede:
Weergawe: 0.1
Upload datum: 2 Jun 15
Lisensie: Gratis
Populariteit: 2
Kommentaar nie gevind