DEPRECATED: Diffusion C Classic API  5.9.4
 All Data Structures Files Functions Pages
llist.h
1 /*
2  * Copyright © 2014, 2015 Push Technology Ltd., All Rights Reserved.
3  *
4  * Use is subject to license terms.
5  *
6  * NOTICE: All information contained herein is, and remains the
7  * property of Push Technology. The intellectual and technical
8  * concepts contained herein are proprietary to Push Technology and
9  * may be covered by U.S. and Foreign Patents, patents in process, and
10  * are protected by trade secret or copyright law.
11  */
12 #ifndef _llist_h_
13 #define _llist_h_ 1
14 
15 #include <pthread.h>
16 
17 typedef struct _lnode {
18  void *data;
19  long data_length;
20  struct _lnode *prev;
21  struct _lnode *next;
22 } LNODE;
23 
24 typedef struct _llist {
25  int size;
26  struct _lnode *first;
27  struct _lnode *last;
28  pthread_mutex_t _mutex;
29 } LLIST;
30 
31 extern LLIST *llist_create(void);
32 extern void llist_destroy(LLIST *list, int free_data);
33 extern LLIST *llist_duplicate(const LLIST *src, void *(*copy_func)(void *, unsigned long));
34 extern LNODE *llist_append(LLIST *list, const void *data);
35 extern LNODE *llist_append_string(LLIST *list, const char *data);
36 extern LNODE *llist_append_length(LLIST *list, const void *data, const long length);
37 extern void llist_unlink(LLIST *list, LNODE *node);
38 extern void llist_remove(LLIST *list, LNODE *node);
39 extern LNODE *llist_get(LLIST *list, int index);
40 extern LNODE *llist_find(LLIST *list, void *data, int(*comparitor)(void *, void *));
41 extern int llist_compare_strings(void *a, void *b);
42 extern int llist_compare_pointers(void *a, void *b);
43 extern void llist_shuffle(LLIST *list);
44 
45 #endif
Definition: llist.h:17
Definition: llist.h:24