comparison 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
comparison
equal deleted inserted replaced
756:12dc6bdff8c1 757:ae23c8826efb
147 "Id: %-3s %s", i->id, (i->desc ? i->desc : "")); 147 "Id: %-3s %s", i->id, (i->desc ? i->desc : ""));
148 } 148 }
149 scr_LogPrint(LPRINT_LOGNORM, "End of events list."); 149 scr_LogPrint(LPRINT_LOGNORM, "End of events list.");
150 } 150 }
151 151
152 // evs_geteventscomplist()
153 // Return a singly-linked-list of events ids, for the completion system.
154 // Note: the caller should free the list (and data) after use.
155 GSList *evs_geteventscomplist(void)
156 {
157 GSList *evidlist = NULL, *p;
158 eviqs *i;
159
160 for (p = evs_list; p; p = g_slist_next(p)) {
161 i = p->data;
162 evidlist = g_slist_append(evidlist, g_strdup(i->id));
163 }
164
165 // Last item is the "list" subcommand.
166 evidlist = g_slist_append(evidlist, g_strdup("list"));
167 return evidlist;
168 }
169
152 /* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */ 170 /* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */