1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 * -*- */ 2 3 /* coap_list.h -- CoAP list structures 4 * 5 * Copyright (C) 2010,2011,2015 Olaf Bergmann <bergmann@tzi.org> 6 * 7 * This file is part of the CoAP library libcoap. Please see README for terms of 8 * use. 9 */ 10 11 #ifndef _COAP_LIST_H_ 12 #define _COAP_LIST_H_ 13 14 #include "utlist.h" 15 16 typedef struct coap_list_t { 17 struct coap_list_t *next; 18 char data[]; 19 } coap_list_t; 20 21 /** 22 * Adds node to given queue, ordered by specified order function. Returns 1 23 * when insert was successful, 0 otherwise. 24 */ 25 int coap_insert(coap_list_t **queue, coap_list_t *node); 26 27 /* destroys specified node */ 28 int coap_delete(coap_list_t *node); 29 30 /* removes all items from given queue and frees the allocated storage */ 31 void coap_delete_list(coap_list_t *queue); 32 33 #endif /* _COAP_LIST_H_ */ 34