• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 /*
12  * examples/coap_list.[ch] are DEPRECATED.  You should be using
13  * struct coap_optlist_t instead with the following functions which are a part
14  * of libcoap.
15  *
16  * coap_new_optlist()
17  * coap_insert_optlist()
18  * coap_delete_optlist()
19  * coap_add_optlist_pdu()
20  *
21  * See 'man coap_pdu_setup' for further information.
22  *
23  * examples/coap_list.[ch] files will be removed in a future release
24  * They are left here to support building backward compatibility of old versions
25  * of coap-client
26  */
27 
28 #ifndef COAP_LIST_H_
29 #define COAP_LIST_H_
30 
31 #include <coap2/utlist.h>
32 
33 typedef struct coap_list_t {
34   struct coap_list_t *next;
35   char data[];
36 } coap_list_t;
37 
38 /**
39  * Adds node to given queue, ordered by specified order function. Returns 1
40  * when insert was successful, 0 otherwise.
41  */
42 int coap_insert(coap_list_t **queue, coap_list_t *node);
43 
44 /* destroys specified node */
45 int coap_delete(coap_list_t *node);
46 
47 /* removes all items from given queue and frees the allocated storage */
48 void coap_delete_list(coap_list_t *queue);
49 
50 #endif /* COAP_LIST_H_ */
51