mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-22 17:08:53 +02:00
indentation fixes.
This commit is contained in:
119
gcompletion.c
119
gcompletion.c
@@ -20,68 +20,80 @@
|
||||
#include "glib.h"
|
||||
#include <string.h>
|
||||
|
||||
static void completion_check_cache (GCompletion* cmp, gchar** new_prefix);
|
||||
static void completion_check_cache (GCompletion* cmp,
|
||||
gchar** new_prefix);
|
||||
|
||||
GCompletion*
|
||||
g_completion_new (GCompletionFunc func) {
|
||||
g_completion_new (GCompletionFunc func)
|
||||
{
|
||||
GCompletion* gcomp;
|
||||
|
||||
gcomp = g_new (GCompletion, 1);
|
||||
gcomp->items = NULL;
|
||||
gcomp->cache = NULL;
|
||||
gcomp->prefix = NULL;
|
||||
if ( func )
|
||||
gcomp->func = func;
|
||||
else
|
||||
gcomp->func = NULL;
|
||||
|
||||
return gcomp;
|
||||
}
|
||||
|
||||
void
|
||||
g_completion_add_items (GCompletion* cmp, GList* items) {
|
||||
g_completion_add_items (GCompletion* cmp,
|
||||
GList* items)
|
||||
{
|
||||
GList* it;
|
||||
|
||||
g_return_if_fail (cmp != NULL);
|
||||
g_return_if_fail (items != NULL);
|
||||
|
||||
/* optimize adding to cache? */
|
||||
if ( cmp->cache ) {
|
||||
if (cmp->cache)
|
||||
{
|
||||
g_list_free (cmp->cache);
|
||||
cmp->cache = NULL;
|
||||
}
|
||||
if ( cmp->prefix ) {
|
||||
|
||||
if (cmp->prefix)
|
||||
{
|
||||
g_free (cmp->prefix);
|
||||
cmp->prefix = NULL;
|
||||
}
|
||||
|
||||
it = items;
|
||||
while ( it ) {
|
||||
while (it)
|
||||
{
|
||||
cmp->items = g_list_prepend (cmp->items, it->data);
|
||||
it = it->next;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
g_completion_remove_items (GCompletion* cmp, GList* items) {
|
||||
g_completion_remove_items (GCompletion* cmp,
|
||||
GList* items)
|
||||
{
|
||||
GList* it;
|
||||
|
||||
g_return_if_fail (cmp != NULL);
|
||||
g_return_if_fail (items != NULL);
|
||||
|
||||
it = items;
|
||||
while ( cmp->items && it ) {
|
||||
while (cmp->items && it)
|
||||
{
|
||||
cmp->items = g_list_remove (cmp->items, it->data);
|
||||
it = it->next;
|
||||
}
|
||||
|
||||
it = items;
|
||||
while ( cmp->cache && it ) {
|
||||
while (cmp->cache && it)
|
||||
{
|
||||
cmp->cache = g_list_remove(cmp->cache, it->data);
|
||||
it = it->next;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
g_completion_clear_items (GCompletion* cmp) {
|
||||
g_completion_clear_items (GCompletion* cmp)
|
||||
{
|
||||
g_return_if_fail (cmp != NULL);
|
||||
|
||||
g_list_free (cmp->items);
|
||||
@@ -93,7 +105,9 @@ g_completion_clear_items (GCompletion* cmp) {
|
||||
}
|
||||
|
||||
static void
|
||||
completion_check_cache (GCompletion* cmp, gchar** new_prefix) {
|
||||
completion_check_cache (GCompletion* cmp,
|
||||
gchar** new_prefix)
|
||||
{
|
||||
register GList* list;
|
||||
register gint len;
|
||||
register gint i;
|
||||
@@ -103,22 +117,25 @@ completion_check_cache (GCompletion* cmp, gchar** new_prefix) {
|
||||
|
||||
if (!new_prefix)
|
||||
return;
|
||||
if ( !cmp->cache ) {
|
||||
if (!cmp->cache)
|
||||
{
|
||||
*new_prefix = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
len = strlen(cmp->prefix);
|
||||
list = cmp->cache;
|
||||
s = cmp->func?(*cmp->func)(list->data):(gchar*)list->data;
|
||||
s = cmp->func ? cmp->func (list->data) : (gchar*) list->data;
|
||||
postfix = s + len;
|
||||
plen = strlen (postfix);
|
||||
list = list->next;
|
||||
|
||||
while (list && plen) {
|
||||
s = cmp->func?(*cmp->func)(list->data):(gchar*)list->data;
|
||||
while (list && plen)
|
||||
{
|
||||
s = cmp->func ? cmp->func (list->data) : (gchar*) list->data;
|
||||
s += len;
|
||||
for (i=0; i < plen; ++i) {
|
||||
for (i = 0; i < plen; ++i)
|
||||
{
|
||||
if (postfix[i] != s[i])
|
||||
break;
|
||||
}
|
||||
@@ -132,7 +149,10 @@ completion_check_cache (GCompletion* cmp, gchar** new_prefix) {
|
||||
}
|
||||
|
||||
GList*
|
||||
g_completion_complete (GCompletion* cmp, gchar* prefix, gchar** new_prefix) {
|
||||
g_completion_complete (GCompletion* cmp,
|
||||
gchar* prefix,
|
||||
gchar** new_prefix)
|
||||
{
|
||||
gint plen, len;
|
||||
gint done = 0;
|
||||
GList* list;
|
||||
@@ -141,46 +161,60 @@ g_completion_complete (GCompletion* cmp, gchar* prefix, gchar** new_prefix) {
|
||||
g_return_val_if_fail (prefix != NULL, NULL);
|
||||
|
||||
len = strlen (prefix);
|
||||
if ( cmp->prefix && cmp->cache ) {
|
||||
if (cmp->prefix && cmp->cache)
|
||||
{
|
||||
plen = strlen (cmp->prefix);
|
||||
if ( plen <= len && !strncmp(prefix, cmp->prefix, plen) ) {
|
||||
if (plen <= len && !strncmp (prefix, cmp->prefix, plen))
|
||||
{
|
||||
/* use the cache */
|
||||
list = cmp->cache;
|
||||
while ( list ) {
|
||||
if ( strncmp(prefix, cmp->func?(*cmp->func)(list->data):(gchar*)list->data, len) ) {
|
||||
while (list)
|
||||
{
|
||||
if (strncmp (prefix,
|
||||
cmp->func ? cmp->func (list->data) : (gchar*) list->data,
|
||||
len))
|
||||
{
|
||||
list = g_list_remove_link (cmp->cache, list);
|
||||
if (list != cmp->cache)
|
||||
cmp->cache = list;
|
||||
} else
|
||||
}
|
||||
else
|
||||
list = list->next;
|
||||
}
|
||||
done = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!done) { /* normal code */
|
||||
if (!done)
|
||||
{
|
||||
/* normal code */
|
||||
g_list_free (cmp->cache);
|
||||
cmp->cache = NULL;
|
||||
list = cmp->items;
|
||||
while (*prefix && list) {
|
||||
if ( !strncmp(prefix, cmp->func?(*cmp->func)(list->data):(gchar*)list->data, len) )
|
||||
while (*prefix && list)
|
||||
{
|
||||
if (!strncmp (prefix,
|
||||
cmp->func ? cmp->func (list->data) : (gchar*) list->data,
|
||||
len))
|
||||
cmp->cache = g_list_prepend (cmp->cache, list->data);
|
||||
list = list->next;
|
||||
}
|
||||
}
|
||||
if ( cmp->prefix ) {
|
||||
if (cmp->prefix)
|
||||
{
|
||||
g_free (cmp->prefix);
|
||||
cmp->prefix = NULL;
|
||||
}
|
||||
if (cmp->cache)
|
||||
cmp->prefix = g_strdup (prefix);
|
||||
completion_check_cache (cmp, new_prefix);
|
||||
return *prefix?cmp->cache:cmp->items;
|
||||
|
||||
return *prefix ? cmp->cache : cmp->items;
|
||||
}
|
||||
|
||||
void
|
||||
g_completion_free (GCompletion* cmp) {
|
||||
g_completion_free (GCompletion* cmp)
|
||||
{
|
||||
g_return_if_fail (cmp != NULL);
|
||||
|
||||
g_completion_clear_items (cmp);
|
||||
@@ -188,11 +222,11 @@ g_completion_free (GCompletion* cmp) {
|
||||
}
|
||||
|
||||
#ifdef TEST_COMPLETION
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main (int argc, char* argv[]) {
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char* argv[])
|
||||
{
|
||||
FILE *file;
|
||||
gchar buf[1024];
|
||||
GList *list;
|
||||
@@ -202,25 +236,30 @@ int main (int argc, char* argv[]) {
|
||||
gint i;
|
||||
gchar *longp = NULL;
|
||||
|
||||
if ( argc < 3 ) {
|
||||
if (argc < 3)
|
||||
{
|
||||
g_warning ("Usage: %s filename prefix1 [prefix2 ...]\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ( !(file=fopen(argv[1], "r")) ) {
|
||||
file = fopen (argv[1], "r");
|
||||
if (!file)
|
||||
{
|
||||
g_warning ("Cannot open %s\n", argv[1]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
cmp = g_completion_new (NULL);
|
||||
list = g_list_alloc ();
|
||||
while (fgets(buf, 1024, file)) {
|
||||
while (fgets (buf, 1024, file))
|
||||
{
|
||||
list->data = g_strdup (buf);
|
||||
g_completion_add_items (cmp, list);
|
||||
}
|
||||
fclose (file);
|
||||
|
||||
for ( i= 2; i < argc; ++i) {
|
||||
for (i = 2; i < argc; ++i)
|
||||
{
|
||||
printf ("COMPLETING: %s\n", argv[i]);
|
||||
result = g_completion_complete (cmp, argv[i], &longp);
|
||||
g_list_foreach (result, (GFunc) printf, NULL);
|
||||
@@ -232,7 +271,7 @@ int main (int argc, char* argv[]) {
|
||||
g_list_foreach (cmp->items, (GFunc) g_free, NULL);
|
||||
g_completion_free (cmp);
|
||||
g_list_free (list);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
12
glib.h
12
glib.h
@@ -469,6 +469,7 @@ typedef struct _GDebugKey GDebugKey;
|
||||
typedef struct _GScannerConfig GScannerConfig;
|
||||
typedef struct _GScanner GScanner;
|
||||
typedef union _GValue GValue;
|
||||
typedef struct _GCompletion GCompletion;
|
||||
typedef struct _GRelation GRelation;
|
||||
typedef struct _GTuples GTuples;
|
||||
|
||||
@@ -497,6 +498,7 @@ typedef void (*GDestroyNotify) (gpointer data);
|
||||
typedef guint (*GHashFunc) (gconstpointer key);
|
||||
typedef gint (*GCompareFunc) (gconstpointer a,
|
||||
gconstpointer b);
|
||||
typedef gchar* (*GCompletionFunc) (gpointer);
|
||||
|
||||
struct _GList
|
||||
{
|
||||
@@ -880,6 +882,7 @@ void g_stack_trace (const gchar *progname,
|
||||
gint query);
|
||||
|
||||
|
||||
|
||||
/* String Chunks
|
||||
*/
|
||||
GStringChunk* g_string_chunk_new (gint size);
|
||||
@@ -1263,17 +1266,13 @@ gint g_scanner_stat_mode (const gchar *filename);
|
||||
|
||||
/* Completion */
|
||||
|
||||
typedef gchar* (*GCompletionFunc)(gpointer);
|
||||
|
||||
typedef struct _GCompletion GCompletion;
|
||||
|
||||
struct _GCompletion {
|
||||
struct _GCompletion
|
||||
{
|
||||
GList* items;
|
||||
GCompletionFunc func;
|
||||
|
||||
gchar* prefix;
|
||||
GList* cache;
|
||||
|
||||
};
|
||||
|
||||
GCompletion* g_completion_new (GCompletionFunc func);
|
||||
@@ -1287,6 +1286,7 @@ GList* g_completion_complete (GCompletion* cmp,
|
||||
gchar** new_prefix);
|
||||
void g_completion_free (GCompletion* cmp);
|
||||
|
||||
|
||||
/* GRelation: Indexed Relations. Imagine a really simple table in a
|
||||
* database. Relations are not ordered. This data type is meant for
|
||||
* maintaining a N-way mapping.
|
||||
|
@@ -20,68 +20,80 @@
|
||||
#include "glib.h"
|
||||
#include <string.h>
|
||||
|
||||
static void completion_check_cache (GCompletion* cmp, gchar** new_prefix);
|
||||
static void completion_check_cache (GCompletion* cmp,
|
||||
gchar** new_prefix);
|
||||
|
||||
GCompletion*
|
||||
g_completion_new (GCompletionFunc func) {
|
||||
g_completion_new (GCompletionFunc func)
|
||||
{
|
||||
GCompletion* gcomp;
|
||||
|
||||
gcomp = g_new (GCompletion, 1);
|
||||
gcomp->items = NULL;
|
||||
gcomp->cache = NULL;
|
||||
gcomp->prefix = NULL;
|
||||
if ( func )
|
||||
gcomp->func = func;
|
||||
else
|
||||
gcomp->func = NULL;
|
||||
|
||||
return gcomp;
|
||||
}
|
||||
|
||||
void
|
||||
g_completion_add_items (GCompletion* cmp, GList* items) {
|
||||
g_completion_add_items (GCompletion* cmp,
|
||||
GList* items)
|
||||
{
|
||||
GList* it;
|
||||
|
||||
g_return_if_fail (cmp != NULL);
|
||||
g_return_if_fail (items != NULL);
|
||||
|
||||
/* optimize adding to cache? */
|
||||
if ( cmp->cache ) {
|
||||
if (cmp->cache)
|
||||
{
|
||||
g_list_free (cmp->cache);
|
||||
cmp->cache = NULL;
|
||||
}
|
||||
if ( cmp->prefix ) {
|
||||
|
||||
if (cmp->prefix)
|
||||
{
|
||||
g_free (cmp->prefix);
|
||||
cmp->prefix = NULL;
|
||||
}
|
||||
|
||||
it = items;
|
||||
while ( it ) {
|
||||
while (it)
|
||||
{
|
||||
cmp->items = g_list_prepend (cmp->items, it->data);
|
||||
it = it->next;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
g_completion_remove_items (GCompletion* cmp, GList* items) {
|
||||
g_completion_remove_items (GCompletion* cmp,
|
||||
GList* items)
|
||||
{
|
||||
GList* it;
|
||||
|
||||
g_return_if_fail (cmp != NULL);
|
||||
g_return_if_fail (items != NULL);
|
||||
|
||||
it = items;
|
||||
while ( cmp->items && it ) {
|
||||
while (cmp->items && it)
|
||||
{
|
||||
cmp->items = g_list_remove (cmp->items, it->data);
|
||||
it = it->next;
|
||||
}
|
||||
|
||||
it = items;
|
||||
while ( cmp->cache && it ) {
|
||||
while (cmp->cache && it)
|
||||
{
|
||||
cmp->cache = g_list_remove(cmp->cache, it->data);
|
||||
it = it->next;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
g_completion_clear_items (GCompletion* cmp) {
|
||||
g_completion_clear_items (GCompletion* cmp)
|
||||
{
|
||||
g_return_if_fail (cmp != NULL);
|
||||
|
||||
g_list_free (cmp->items);
|
||||
@@ -93,7 +105,9 @@ g_completion_clear_items (GCompletion* cmp) {
|
||||
}
|
||||
|
||||
static void
|
||||
completion_check_cache (GCompletion* cmp, gchar** new_prefix) {
|
||||
completion_check_cache (GCompletion* cmp,
|
||||
gchar** new_prefix)
|
||||
{
|
||||
register GList* list;
|
||||
register gint len;
|
||||
register gint i;
|
||||
@@ -103,22 +117,25 @@ completion_check_cache (GCompletion* cmp, gchar** new_prefix) {
|
||||
|
||||
if (!new_prefix)
|
||||
return;
|
||||
if ( !cmp->cache ) {
|
||||
if (!cmp->cache)
|
||||
{
|
||||
*new_prefix = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
len = strlen(cmp->prefix);
|
||||
list = cmp->cache;
|
||||
s = cmp->func?(*cmp->func)(list->data):(gchar*)list->data;
|
||||
s = cmp->func ? cmp->func (list->data) : (gchar*) list->data;
|
||||
postfix = s + len;
|
||||
plen = strlen (postfix);
|
||||
list = list->next;
|
||||
|
||||
while (list && plen) {
|
||||
s = cmp->func?(*cmp->func)(list->data):(gchar*)list->data;
|
||||
while (list && plen)
|
||||
{
|
||||
s = cmp->func ? cmp->func (list->data) : (gchar*) list->data;
|
||||
s += len;
|
||||
for (i=0; i < plen; ++i) {
|
||||
for (i = 0; i < plen; ++i)
|
||||
{
|
||||
if (postfix[i] != s[i])
|
||||
break;
|
||||
}
|
||||
@@ -132,7 +149,10 @@ completion_check_cache (GCompletion* cmp, gchar** new_prefix) {
|
||||
}
|
||||
|
||||
GList*
|
||||
g_completion_complete (GCompletion* cmp, gchar* prefix, gchar** new_prefix) {
|
||||
g_completion_complete (GCompletion* cmp,
|
||||
gchar* prefix,
|
||||
gchar** new_prefix)
|
||||
{
|
||||
gint plen, len;
|
||||
gint done = 0;
|
||||
GList* list;
|
||||
@@ -141,46 +161,60 @@ g_completion_complete (GCompletion* cmp, gchar* prefix, gchar** new_prefix) {
|
||||
g_return_val_if_fail (prefix != NULL, NULL);
|
||||
|
||||
len = strlen (prefix);
|
||||
if ( cmp->prefix && cmp->cache ) {
|
||||
if (cmp->prefix && cmp->cache)
|
||||
{
|
||||
plen = strlen (cmp->prefix);
|
||||
if ( plen <= len && !strncmp(prefix, cmp->prefix, plen) ) {
|
||||
if (plen <= len && !strncmp (prefix, cmp->prefix, plen))
|
||||
{
|
||||
/* use the cache */
|
||||
list = cmp->cache;
|
||||
while ( list ) {
|
||||
if ( strncmp(prefix, cmp->func?(*cmp->func)(list->data):(gchar*)list->data, len) ) {
|
||||
while (list)
|
||||
{
|
||||
if (strncmp (prefix,
|
||||
cmp->func ? cmp->func (list->data) : (gchar*) list->data,
|
||||
len))
|
||||
{
|
||||
list = g_list_remove_link (cmp->cache, list);
|
||||
if (list != cmp->cache)
|
||||
cmp->cache = list;
|
||||
} else
|
||||
}
|
||||
else
|
||||
list = list->next;
|
||||
}
|
||||
done = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!done) { /* normal code */
|
||||
if (!done)
|
||||
{
|
||||
/* normal code */
|
||||
g_list_free (cmp->cache);
|
||||
cmp->cache = NULL;
|
||||
list = cmp->items;
|
||||
while (*prefix && list) {
|
||||
if ( !strncmp(prefix, cmp->func?(*cmp->func)(list->data):(gchar*)list->data, len) )
|
||||
while (*prefix && list)
|
||||
{
|
||||
if (!strncmp (prefix,
|
||||
cmp->func ? cmp->func (list->data) : (gchar*) list->data,
|
||||
len))
|
||||
cmp->cache = g_list_prepend (cmp->cache, list->data);
|
||||
list = list->next;
|
||||
}
|
||||
}
|
||||
if ( cmp->prefix ) {
|
||||
if (cmp->prefix)
|
||||
{
|
||||
g_free (cmp->prefix);
|
||||
cmp->prefix = NULL;
|
||||
}
|
||||
if (cmp->cache)
|
||||
cmp->prefix = g_strdup (prefix);
|
||||
completion_check_cache (cmp, new_prefix);
|
||||
return *prefix?cmp->cache:cmp->items;
|
||||
|
||||
return *prefix ? cmp->cache : cmp->items;
|
||||
}
|
||||
|
||||
void
|
||||
g_completion_free (GCompletion* cmp) {
|
||||
g_completion_free (GCompletion* cmp)
|
||||
{
|
||||
g_return_if_fail (cmp != NULL);
|
||||
|
||||
g_completion_clear_items (cmp);
|
||||
@@ -188,11 +222,11 @@ g_completion_free (GCompletion* cmp) {
|
||||
}
|
||||
|
||||
#ifdef TEST_COMPLETION
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main (int argc, char* argv[]) {
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char* argv[])
|
||||
{
|
||||
FILE *file;
|
||||
gchar buf[1024];
|
||||
GList *list;
|
||||
@@ -202,25 +236,30 @@ int main (int argc, char* argv[]) {
|
||||
gint i;
|
||||
gchar *longp = NULL;
|
||||
|
||||
if ( argc < 3 ) {
|
||||
if (argc < 3)
|
||||
{
|
||||
g_warning ("Usage: %s filename prefix1 [prefix2 ...]\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ( !(file=fopen(argv[1], "r")) ) {
|
||||
file = fopen (argv[1], "r");
|
||||
if (!file)
|
||||
{
|
||||
g_warning ("Cannot open %s\n", argv[1]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
cmp = g_completion_new (NULL);
|
||||
list = g_list_alloc ();
|
||||
while (fgets(buf, 1024, file)) {
|
||||
while (fgets (buf, 1024, file))
|
||||
{
|
||||
list->data = g_strdup (buf);
|
||||
g_completion_add_items (cmp, list);
|
||||
}
|
||||
fclose (file);
|
||||
|
||||
for ( i= 2; i < argc; ++i) {
|
||||
for (i = 2; i < argc; ++i)
|
||||
{
|
||||
printf ("COMPLETING: %s\n", argv[i]);
|
||||
result = g_completion_complete (cmp, argv[i], &longp);
|
||||
g_list_foreach (result, (GFunc) printf, NULL);
|
||||
@@ -232,7 +271,7 @@ int main (int argc, char* argv[]) {
|
||||
g_list_foreach (cmp->items, (GFunc) g_free, NULL);
|
||||
g_completion_free (cmp);
|
||||
g_list_free (list);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
12
glib/glib.h
12
glib/glib.h
@@ -469,6 +469,7 @@ typedef struct _GDebugKey GDebugKey;
|
||||
typedef struct _GScannerConfig GScannerConfig;
|
||||
typedef struct _GScanner GScanner;
|
||||
typedef union _GValue GValue;
|
||||
typedef struct _GCompletion GCompletion;
|
||||
typedef struct _GRelation GRelation;
|
||||
typedef struct _GTuples GTuples;
|
||||
|
||||
@@ -497,6 +498,7 @@ typedef void (*GDestroyNotify) (gpointer data);
|
||||
typedef guint (*GHashFunc) (gconstpointer key);
|
||||
typedef gint (*GCompareFunc) (gconstpointer a,
|
||||
gconstpointer b);
|
||||
typedef gchar* (*GCompletionFunc) (gpointer);
|
||||
|
||||
struct _GList
|
||||
{
|
||||
@@ -880,6 +882,7 @@ void g_stack_trace (const gchar *progname,
|
||||
gint query);
|
||||
|
||||
|
||||
|
||||
/* String Chunks
|
||||
*/
|
||||
GStringChunk* g_string_chunk_new (gint size);
|
||||
@@ -1263,17 +1266,13 @@ gint g_scanner_stat_mode (const gchar *filename);
|
||||
|
||||
/* Completion */
|
||||
|
||||
typedef gchar* (*GCompletionFunc)(gpointer);
|
||||
|
||||
typedef struct _GCompletion GCompletion;
|
||||
|
||||
struct _GCompletion {
|
||||
struct _GCompletion
|
||||
{
|
||||
GList* items;
|
||||
GCompletionFunc func;
|
||||
|
||||
gchar* prefix;
|
||||
GList* cache;
|
||||
|
||||
};
|
||||
|
||||
GCompletion* g_completion_new (GCompletionFunc func);
|
||||
@@ -1287,6 +1286,7 @@ GList* g_completion_complete (GCompletion* cmp,
|
||||
gchar** new_prefix);
|
||||
void g_completion_free (GCompletion* cmp);
|
||||
|
||||
|
||||
/* GRelation: Indexed Relations. Imagine a really simple table in a
|
||||
* database. Relations are not ordered. This data type is meant for
|
||||
* maintaining a N-way mapping.
|
||||
|
Reference in New Issue
Block a user