Mercurial > dropbear
view list.c @ 1635:c9b5017b0a7b
drop obsolete definition for MAX_KEXHASHBUF (#65)
The last code to make use of MAX_KEXHASHBUF was removed in 2005:
https://github.com/mkj/dropbear/commit/736f370dce614b717193f45d084e9e009de723ce
Signed-off-by: Andre McCurdy <[email protected]>
author | Andre McCurdy <armccurdy@gmail.com> |
---|---|
date | Wed, 20 Mar 2019 08:01:41 -0700 |
parents | d68d61e7056a |
children |
line wrap: on
line source
#include "includes.h" #include "dbutil.h" #include "list.h" void list_append(m_list *list, void *item) { m_list_elem *elem; elem = m_malloc(sizeof(*elem)); elem->item = item; elem->list = list; elem->next = NULL; if (!list->first) { list->first = elem; elem->prev = NULL; } else { elem->prev = list->last; list->last->next = elem; } list->last = elem; } m_list * list_new() { m_list *ret = m_malloc(sizeof(m_list)); ret->first = ret->last = NULL; return ret; } void * list_remove(m_list_elem *elem) { void *item = elem->item; m_list *list = elem->list; if (list->first == elem) { list->first = elem->next; } if (list->last == elem) { list->last = elem->prev; } if (elem->prev) { elem->prev->next = elem->next; } if (elem->next) { elem->next->prev = elem->prev; } m_free(elem); return item; }