Hello, so with the help of other people i did resolve the problem. I have tried a way to not make a lot of files, so I made a simple .cfg like this
Code:
VARIABLE=VALUE
... /* etc... */
...
and then i do this in the .c
Code:
char buf[512], var[512], val[512];
FILE *fp=fopen("/path/to/configfile", "r");
setenv("VARIABLE", "VALUE"); // Set a default
while(fgets(buf, 512, fp) != NULL)
{
if(sscanf(buf, "%[^=]=%s", var, val) != 2) continue;
setenv(var, val);
}
fclose(fp);
g_strdup_printf ("%s", ,getenv("VARIABLE"));
and then i have "VALUE" show on my screen. And it work ! So thanks all for helping/supporting me .