From 3868683b6131469a66e365496f93e5a8564e309a Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Wed, 8 Sep 2021 16:09:37 +0200 Subject: Adjusted demos.c and multimap.c to work with newstyle branch. --- examples/multimap.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'examples/multimap.c') diff --git a/examples/multimap.c b/examples/multimap.c index 03d4712d..eeb7a501 100644 --- a/examples/multimap.c +++ b/examples/multimap.c @@ -1,5 +1,3 @@ -#include -#include #include #include @@ -35,7 +33,6 @@ struct OlympicsData { int year; const char *city, *country, *date; } ol_data[] = {1924, "Chamonix", "France", "January 25 - February 5"}, }; - typedef struct { int year; cstr city, date; } OlympicLocation; int OlympicLocation_compare(OlympicLocation* a, OlympicLocation* b) { @@ -46,11 +43,18 @@ void OlympicLocation_del(OlympicLocation* self) { } // Create a clist, can be sorted by year. -using_clist(OL, OlympicLocation, OlympicLocation_compare, OlympicLocation_del); +#define i_tag OL +#define i_val OlympicLocation +#define i_cmp OlympicLocation_compare +#define i_valdel OlympicLocation_del +#include // Create a csmap where key is country -using_csmap_strkey(OL, clist_OL, clist_OL_del, c_no_clone); - +#define i_tag OL +#define i_key_str +#define i_val clist_OL +#define i_valdel clist_OL_del +#include int main() { -- cgit v1.2.3