Revert "Revert "and added files""
[bcm963xx.git] / userapps / opensource / net-snmp / include / net-snmp / library / data_list.h
1 /*
2  * netsnmp_data_list.h
3  *
4  * $Id: data_list.h,v 5.0.2.1 2003/03/14 17:37:35 rstory Exp $
5  *
6  * External definitions for functions and variables in netsnmp_data_list.c.
7  */
8
9 #ifndef DATA_LIST_H
10 #define DATA_LIST_H
11
12 #ifdef __cplusplus
13 extern          "C" {
14 #endif
15
16 #include <net-snmp/library/snmp_impl.h>
17 #include <net-snmp/library/tools.h>
18
19     typedef void    (Netsnmp_Free_List_Data) (void *);
20
21     typedef struct netsnmp_data_list_s {
22         struct netsnmp_data_list_s *next;
23         char           *name;
24         void           *data;   /* The pointer to the data passed on. */
25         Netsnmp_Free_List_Data *free_func;      /* must know how to free netsnmp_data_list->data */
26     } netsnmp_data_list;
27
28
29     NETSNMP_INLINE netsnmp_data_list *netsnmp_create_data_list(const char *,
30                                                        void *,
31                                                        Netsnmp_Free_List_Data
32                                                        *);
33     void            netsnmp_add_list_data(netsnmp_data_list **head,
34                                           netsnmp_data_list *node);
35     void           *netsnmp_get_list_data(netsnmp_data_list *head,
36                                           const char *node);
37     void            netsnmp_free_list_data(netsnmp_data_list *head);    /* single */
38     void            netsnmp_free_all_list_data(netsnmp_data_list *head);        /* multiple */
39     int             netsnmp_remove_list_node(netsnmp_data_list **realhead,
40                                              const char *name);
41     NETSNMP_INLINE void    *netsnmp_get_list_node(netsnmp_data_list *head,
42                                           const char *name);
43
44
45 #ifdef __cplusplus
46 }
47 #endif
48 #endif