mirror of
https://github.com/irssi/irssi.git
synced 2026-08-11 04:43:34 +02:00
Changed option handling in /commands. Irssi will now complain about
unknown options and missing option arguments. Renamed /SERVER -add, -remove and -list to /SERVER ADD, REMOVE and LIST. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@365 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
ca4226cca6
commit
a5d31a195d
34 changed files with 949 additions and 576 deletions
|
|
@ -247,7 +247,8 @@ void *gslist_foreach_find(GSList *list, FOREACH_FIND_FUNC func, void *data)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
char *gslist_to_string(GSList *list, int offset, const char *delimiter)
|
||||
/* `list' contains pointer to structure with a char* to string. */
|
||||
char *gslistptr_to_string(GSList *list, int offset, const char *delimiter)
|
||||
{
|
||||
GString *str;
|
||||
char **data, *ret;
|
||||
|
|
@ -266,6 +267,41 @@ char *gslist_to_string(GSList *list, int offset, const char *delimiter)
|
|||
return ret;
|
||||
}
|
||||
|
||||
/* `list' contains char* */
|
||||
char *gslist_to_string(GSList *list, const char *delimiter)
|
||||
{
|
||||
GString *str;
|
||||
char *ret;
|
||||
|
||||
str = g_string_new(NULL);
|
||||
while (list != NULL) {
|
||||
if (str->len != 0) g_string_append(str, delimiter);
|
||||
g_string_append(str, list->data);
|
||||
|
||||
list = list->next;
|
||||
}
|
||||
|
||||
ret = str->str;
|
||||
g_string_free(str, FALSE);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void hash_save_key(char *key, void *value, GSList **list)
|
||||
{
|
||||
*list = g_slist_append(*list, key);
|
||||
}
|
||||
|
||||
/* save all keys in hash table to linked list - you shouldn't remove any
|
||||
items while using this list, use g_slist_free() after you're done with it */
|
||||
GSList *hashtable_get_keys(GHashTable *hash)
|
||||
{
|
||||
GSList *list;
|
||||
|
||||
list = NULL;
|
||||
g_hash_table_foreach(hash, (GHFunc) hash_save_key, &list);
|
||||
return list;
|
||||
}
|
||||
|
||||
GList *glist_find_string(GList *list, const char *key)
|
||||
{
|
||||
for (list = list; list != NULL; list = list->next)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue