示例#1
0
文件: keymap.c 项目: andersk/barnowl
/* 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);
}
示例#2
0
void owl_errqueue_init(owl_errqueue *eq)
{
  owl_list_create(&(eq->errlist));
}
示例#3
0
void owl_zbuddylist_create(owl_zbuddylist *zb)
{
  owl_list_create(&(zb->zusers));
}
示例#4
0
void owl_buddylist_init(owl_buddylist *bl)
{
  owl_list_create(&(bl->buddies));
}
示例#5
0
/* 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));
}