summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/new_list.c
diff options
context:
space:
mode:
authortylov <[email protected]>2023-07-12 19:39:59 +0200
committertylov <[email protected]>2023-07-12 21:01:46 +0200
commitebe5abc29d51c643520301e42124365477f44957 (patch)
treef1188f5c649f4244c384484ae584894280396272 /misc/examples/new_list.c
parent715a02ba8155de2f7d446e8d7d2ae305c27996b9 (diff)
downloadSTC-modified-ebe5abc29d51c643520301e42124365477f44957.tar.gz
STC-modified-ebe5abc29d51c643520301e42124365477f44957.zip
Changed docs and examples to use i_key* template parameters instead of i_val* for all non-maps.
Renamed c_ASSERT() to c_assert() and added optional message parameter to c_static_assert().
Diffstat (limited to 'misc/examples/new_list.c')
-rw-r--r--misc/examples/new_list.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/misc/examples/new_list.c b/misc/examples/new_list.c
index 5ffdaca2..ee250b2b 100644
--- a/misc/examples/new_list.c
+++ b/misc/examples/new_list.c
@@ -9,7 +9,7 @@ typedef struct {
clist_pnt pntlist;
} MyStruct;
-#define i_val int
+#define i_key int
#define i_tag i32
#define i_is_forward
#include <stc/clist.h>
@@ -20,20 +20,20 @@ int point_cmp(const Point* a, const Point* b) {
return c ? c : a->y - b->y;
}
-#define i_val Point
+#define i_key Point
#define i_cmp point_cmp
#define i_is_forward
#define i_tag pnt
#include <stc/clist.h>
-#define i_val float
+#define i_key float
#define i_native_cmp // use < and == operators for comparison
#include <stc/clist.h>
void MyStruct_drop(MyStruct* s);
#define i_type MyList
-#define i_val MyStruct
-#define i_valdrop MyStruct_drop // define drop function
+#define i_key MyStruct
+#define i_keydrop MyStruct_drop // define drop function
#define i_no_clone // must explicitely exclude or define cloning support because of drop.
#include <stc/clist.h>