static void load_history() { ExtlTab tab; int i, n; if(!extl_read_savefile("saved_queryhist", &tab)) return; n=extl_table_get_n(tab); for(i=n; i>=1; i--){ char *s=NULL; if(extl_table_geti_s(tab, i, &s)){ mod_query_history_push(s); free(s); } } extl_unref_table(tab); }
/*EXTL_DOC * Set a text property for a window. The fields of \var{tab} starting from * 1 should be the different null-separated parts of the property. * See the \code{XSetTextProperty}(3) manual page for more information. */ EXTL_EXPORT void ioncore_x_set_text_property(int win, int atom, ExtlTab tab) { char **list; int i, n=extl_table_get_n(tab); list=ALLOC_N(char*, n); if(list==NULL) return; for(i=0; i<n; i++){ list[i]=NULL; extl_table_geti_s(tab, i+1, &(list[i])); } xwindow_set_text_property(win, atom, (const char **)list, n); XFreeStringList(list); }