/* * Paul Heidelman * Case Western Reserve University * EECS 337 Fall 2009 * Homework 2 */ #include #include #include #include typedef struct list_entry list_entry_t; struct list_entry { void *key; void *value; list_entry_t *next; }; typedef struct { list_entry_t *list; int (*cmp)(const void *, const void *); /* Comparison function */ } list_head_t; list_head_t *list_init(int (*cmp)(const void *, const void *)); list_entry_t *list_insert(list_head_t *head, void *key, void *value); void *list_search(list_head_t *head, void *key); void list_delete(list_head_t *head); int cmp_double(double *a, double *b); int cmp_string(const void *a, const void *b);