Пример #1
0
void llist_destroy(llist_t *l) {
  llentry_t *e_this;
  llentry_t *e_next;

  if (l == NULL)
    return;

  for (e_this = l->head; e_this != NULL; e_this = e_next) {
    e_next = e_this->next;
    llentry_destroy(e_this);
  }

  free(l);
}
Пример #2
0
static int plugin_unregister (llist_t *list, const char *name) /* {{{ */
{
	llentry_t *e;

	if (list == NULL)
		return (-1);

	e = llist_search (list, name);
	if (e == NULL)
		return (-1);

	llist_remove (list, e);

	sfree (e->key);
	destroy_callback (e->value);

	llentry_destroy (e);

	return (0);
} /* }}} int plugin_unregister */