diff mcabber/src/events.c @ 757:ae23c8826efb

Improve completion for the "/event" command
author Mikael Berthe <mikael@lilotux.net>
date Tue, 14 Mar 2006 12:43:23 +0100
parents 584db5f21e43
children 46304b773a44
line wrap: on
line diff
--- a/mcabber/src/events.c	Tue Mar 14 12:22:35 2006 +0100
+++ b/mcabber/src/events.c	Tue Mar 14 12:43:23 2006 +0100
@@ -149,4 +149,22 @@
   scr_LogPrint(LPRINT_LOGNORM, "End of events list.");
 }
 
+//  evs_geteventscomplist()
+// Return a singly-linked-list of events ids, for the completion system.
+// Note: the caller should free the list (and data) after use.
+GSList *evs_geteventscomplist(void)
+{
+  GSList *evidlist = NULL, *p;
+  eviqs *i;
+
+  for (p = evs_list; p; p = g_slist_next(p)) {
+    i = p->data;
+    evidlist = g_slist_append(evidlist, g_strdup(i->id));
+  }
+
+  // Last item is the "list" subcommand.
+  evidlist = g_slist_append(evidlist, g_strdup("list"));
+  return evidlist;
+}
+
 /* vim: set expandtab cindent cinoptions=>2\:2(0:  For Vim users... */