diff options
Diffstat (limited to 'examples/multimap.c')
| -rw-r--r-- | examples/multimap.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/multimap.c b/examples/multimap.c index 543b8b22..424ae606 100644 --- a/examples/multimap.c +++ b/examples/multimap.c @@ -35,7 +35,7 @@ struct OlympicsData { int year; const char *city, *country, *date; } ol_data[] = typedef struct { int year; cstr city, date; } OlympicLocation;
-int OlympicLocation_compare(OlympicLocation* a, OlympicLocation* b) {
+int OlympicLocation_cmp(OlympicLocation* a, OlympicLocation* b) {
return a->year - b->year;
}
@@ -44,14 +44,14 @@ OlympicLocation OlympicLocation_clone(OlympicLocation loc) { loc.date = cstr_clone(loc.date);
return loc;
}
-void OlympicLocation_del(OlympicLocation* self) {
- c_del(cstr, &self->city, &self->date);
+void OlympicLocation_drop(OlympicLocation* self) {
+ c_drop(cstr, &self->city, &self->date);
}
// Create a clist<OlympicLocation>, can be sorted by year.
#define i_val OlympicLocation
-#define i_cmp OlympicLocation_compare
-#define i_del OlympicLocation_del
+#define i_cmp OlympicLocation_cmp
+#define i_drop OlympicLocation_drop
#define i_from OlympicLocation_clone
#define i_tag OL
#include <stc/clist.h>
@@ -59,7 +59,7 @@ void OlympicLocation_del(OlympicLocation* self) { // Create a csmap<cstr, clist_OL> where key is country name
#define i_key_str
#define i_val clist_OL
-#define i_valdel clist_OL_del
+#define i_valdrop clist_OL_drop
#define i_valfrom clist_OL_clone
#define i_tag OL
#include <stc/csmap.h>
|
