Commit 3c9bc31e authored by Chris Müller's avatar Chris Müller

Small modifications in list implementation.

parent 14488161
crystal
Crystal
=======
General-purpose standard library for c
\ No newline at end of file
General-purpose standard library for C
......@@ -47,7 +47,7 @@ cry_list_new(void)
void
cry_list_free(struct CryList* list, cry_free_handler handler)
cry_list_free(struct CryList* list, cry_free_function handler)
{
assert(list != 0);
......@@ -144,3 +144,5 @@ cry_list_prepend(struct CryList* list, pointer data)
}
......@@ -24,7 +24,7 @@
struct CryList;
struct CryList* cry_list_new(void);
void cry_list_free(struct CryList* list, cry_free_handler handler);
void cry_list_free(struct CryList* list, cry_free_function handler);
size_t cry_list_size(struct CryList* list);
pointer cry_list_head(struct CryList* list);
......@@ -34,4 +34,10 @@ void cry_list_append(struct CryList* list, pointer data);
void cry_list_prepend(struct CryList* list, pointer data);
/*
struct CryList* cry_list_filter(struct CryList* list, cry_predicate_function predicate, pointer context);
struct CryList* cry_list_map(struct CryList* list, cry_mapping_function mapping, pointer context);
*/
#endif // CRYSTAL_STRUCTURES_LIST_H
......@@ -21,7 +21,9 @@
#include <standard.h>
typedef void (*cry_free_handler)(pointer data);
typedef int (*cry_item_handler)(pointer data);
typedef void (*cry_free_function)(pointer data);
typedef int (*cry_predicate_function)(pointer element, pointer context);
#endif // CRYSTAL_STRUCTURES_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment