[Frugalware-darcs] setup: util.c: new function: glist4dialog()

VMiklos vmiklos at frugalware.org
Wed Mar 29 23:53:39 CEST 2006


[util.c: new function: glist4dialog()
VMiklos <vmiklos at frugalware.org>**20051104171105
 usefull when you have a glist, and you want to use it with dialog_menu()
] {
hunk ./src/util.c 95
+char **glist4dialog(GList *list, char *blank)
+{
+	int i;
+	char **array;
+
+	MALLOC(array, 2*g_list_length(list)*sizeof(char*));
+	
+	for (i=0; i<2*g_list_length(list); i=i+2)
+	{
+		array[i] = (char*)g_list_nth_data(list, i/2);
+		array[i+1] = blank;
+	}
+	return(array);
+}
+
hunk ./src/util.h 14
+char **glist4dialog(GList *list, char *blank);
}


More information about the Frugalware-darcs mailing list