Autcomplete defaults to string data

p_obj_autocomplete_new() can be used to create an autocompleter
that stores arbitrary data structures passing memory management
functions to get a string, copy and free
This commit is contained in:
James Booth
2012-05-20 00:54:17 +01:00
parent b02b52d86a
commit 2080a61663
4 changed files with 28 additions and 21 deletions

View File

@@ -41,7 +41,12 @@ static gchar * _search_from(PAutocomplete ac, GSList *curr);
static const char *_str_func_default(const char *orig);
static const char *_copy_func_default(const char *orig);
PAutocomplete p_autocomplete_new(PStrFunc str_func, PCopyFunc copy_func,
PAutocomplete p_autocomplete_new(void)
{
return p_obj_autocomplete_new(NULL, NULL, NULL);
}
PAutocomplete p_obj_autocomplete_new(PStrFunc str_func, PCopyFunc copy_func,
GDestroyNotify free_func)
{
PAutocomplete new = malloc(sizeof(struct p_autocomplete_t));