diff options
author | pdw <> | 2002-03-24 16:22:26 +0000 |
---|---|---|
committer | pdw <> | 2002-03-24 16:22:26 +0000 |
commit | 3004ea063cbb186a63af99a2e13d7cb09f23360d (patch) | |
tree | d617af0ad0619334f899d3405350edb9b1b2407b /sorted_list.h | |
download | iftop-3004ea063cbb186a63af99a2e13d7cb09f23360d.zip |
iftop
Diffstat (limited to 'sorted_list.h')
-rw-r--r-- | sorted_list.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sorted_list.h b/sorted_list.h new file mode 100644 index 0000000..734e69b --- /dev/null +++ b/sorted_list.h @@ -0,0 +1,25 @@ +/* + * sorted_list.h: + * + */ + +#ifndef __SORTED_LIST_H_ /* include guard */ +#define __SORTED_LIST_H_ + +typedef struct sorted_list_node_tag { + struct sorted_list_node_tag* next; + void* data; +} sorted_list_node; + +typedef struct { + sorted_list_node root; + int (*compare)(void*, void*); +} sorted_list_type; + +void sorted_list_initialise(sorted_list_type* list); +void sorted_list_insert(sorted_list_type* list, void* item); +sorted_list_node* sorted_list_next_item(sorted_list_type* list, sorted_list_node* prev); +void sorted_list_destroy(sorted_list_type* list); + + +#endif /* __SORTED_LIST_H_ */ |