1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| void aide(GtkWidget *w,gpointer d)
{
gchar *home;
FILE *config;
home=getenv("HOME");
home=g_strdup_printf("%s%s",home,"/.Rniamo/Preferences/preferences");
config=fopen((const char *)home,"r");printf("%s",(char *)home);
int i=1;
while(fscanf(config,"%*c")!='/')
i++;
fseek(config,0,SEEK_SET);
char *nav;
nav=malloc(i*sizeof(char));
while(fscanf(config,"%*c")!='/')
{
fseek(config,-1,SEEK_CUR);
fscanf(config,"%c",&(nav[i]));
}
printf("%s",nav);
system("nav");
free(nav);
g_free(home);
fclose(config);
} |
Partager