summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/forfilter.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-12-29 00:28:50 +0100
committerTyge Løvset <[email protected]>2022-12-29 00:28:50 +0100
commit0761c13f316cc98ae7756f3527931aa86bed5016 (patch)
treee90777558956fcf91d6b1c958e0c3a6fb0ab007f /misc/examples/forfilter.c
parentd623c6c85071b9af5d607bb5d9aceceaea05220a (diff)
downloadSTC-modified-0761c13f316cc98ae7756f3527931aa86bed5016.tar.gz
STC-modified-0761c13f316cc98ae7756f3527931aa86bed5016.zip
Restructuring of some headers into include/algo folder. Some API changes *_replace*() functions have been renamed, and a few minor API changes.
Diffstat (limited to 'misc/examples/forfilter.c')
-rw-r--r--misc/examples/forfilter.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/misc/examples/forfilter.c b/misc/examples/forfilter.c
index 32154904..c0a4ccad 100644
--- a/misc/examples/forfilter.c
+++ b/misc/examples/forfilter.c
@@ -2,7 +2,8 @@
#define i_extern
#include <stc/cstr.h>
#include <stc/csview.h>
-#include <stc/views.h>
+#include <stc/algo/filter.h>
+#include <stc/algo/crange.h>
#define i_type IVec
#define i_val int
@@ -63,12 +64,13 @@ void demo2(void)
c_AUTO (IVec, vector) {
puts("demo2:");
- c_FORFILTER (x, crange, crange_literal(INT64_MAX)
+ c_FORFILTER (x, crange, crange_LITERAL(INT64_MAX)
, c_FLT_SKIPWHILE(x, *x.ref != 11)
&& *x.ref % 2 != 0
, c_FLT_TAKE(x, 5))
IVec_push(&vector, *x.ref * *x.ref);
- c_FOREACH (x, IVec, vector) printf(" %d", *x.ref);
+ c_FOREACH (x, IVec, vector)
+ printf(" %d", *x.ref);
puts("");
}
}