mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-01 23:45:48 +03:00
coap_insert() now appends every item at the list's end, sorting must be done explicitly using LL_SORT. As a side-effect, the new implementation makes valgrind happy :-)
32 lines
756 B
C
32 lines
756 B
C
/* coap_list.h -- CoAP list structures
|
|
*
|
|
* Copyright (C) 2010,2011,2015 Olaf Bergmann <bergmann@tzi.org>
|
|
*
|
|
* This file is part of the CoAP library libcoap. Please see
|
|
* README for terms of use.
|
|
*/
|
|
|
|
#ifndef _COAP_LIST_H_
|
|
#define _COAP_LIST_H_
|
|
|
|
#include "utlist.h"
|
|
|
|
typedef struct coap_list_t {
|
|
struct coap_list_t *next;
|
|
char data[];
|
|
} coap_list_t;
|
|
|
|
/**
|
|
* Adds node to given queue, ordered by specified order function. Returns 1
|
|
* when insert was successful, 0 otherwise.
|
|
*/
|
|
int coap_insert(coap_list_t **queue, coap_list_t *node);
|
|
|
|
/* destroys specified node */
|
|
int coap_delete(coap_list_t *node);
|
|
|
|
/* removes all items from given queue and frees the allocated storage */
|
|
void coap_delete_list(coap_list_t *queue);
|
|
|
|
#endif /* _COAP_LIST_H_ */
|