/* returns 0 on success */ int owl_keymap_init(owl_keymap *km, const char *name, const char *desc, void (*default_fn)(owl_input), void (*prealways_fn)(owl_input), void (*postalways_fn)(owl_input)) { if (!name || !desc) return(-1); if ((km->name = g_strdup(name)) == NULL) return(-1); if ((km->desc = g_strdup(desc)) == NULL) return(-1); if (0 != owl_list_create(&km->bindings)) return(-1); km->parent = NULL; km->default_fn = default_fn; km->prealways_fn = prealways_fn; km->postalways_fn = postalways_fn; return(0); }
void owl_errqueue_init(owl_errqueue *eq) { owl_list_create(&(eq->errlist)); }
void owl_zbuddylist_create(owl_zbuddylist *zb) { owl_list_create(&(zb->zusers)); }
void owl_buddylist_init(owl_buddylist *bl) { owl_list_create(&(bl->buddies)); }
/* remove all buddies from the list */ void owl_buddylist_clear(owl_buddylist *bl) { owl_list_cleanup(&(bl->buddies), (void (*)(void *))owl_buddy_delete); owl_list_create(&(bl->buddies)); }