From 193a7be520502f24e995b71768dd89c37b3776eb Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Tue, 13 Jun 2023 22:19:05 +0000 Subject: Fix iter_func type; add tain_earliest Signed-off-by: Laurent Bercot --- src/include/skalibs/functypes.h | 2 +- src/include/skalibs/tai.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src/include') diff --git a/src/include/skalibs/functypes.h b/src/include/skalibs/functypes.h index 958b16f..b015f53 100644 --- a/src/include/skalibs/functypes.h +++ b/src/include/skalibs/functypes.h @@ -19,7 +19,7 @@ typedef cmp_func *cmp_func_ref ; typedef void *dtok_func (uint32_t, void *) ; typedef dtok_func *dtok_func_ref ; -typedef int iter_func (char *, void *) ; +typedef int iter_func (void *, void *) ; typedef iter_func *iter_func_ref ; typedef void free_func (void *) ; diff --git a/src/include/skalibs/tai.h b/src/include/skalibs/tai.h index 8bf2386..0e38b8c 100644 --- a/src/include/skalibs/tai.h +++ b/src/include/skalibs/tai.h @@ -125,6 +125,12 @@ extern int tain_sub (tain *, tain const *, tain const *) ; extern int tain_less (tain const *, tain const *) gccattr_pure ; #define tain_future(deadline) tain_less(&STAMP, (deadline)) +extern void tain_earliest1 (tain *, tain const *) ; +extern void tain_earliestv (tain *, tain const *const *, unsigned int) ; +#define tain_array(...) ((tain const *const[]){__VA_ARGS__}) +#define tain_earliestn(t, n, ...) tain_earliestv(t, tain_array(__VA_ARGS__), (n)) +#define tain_earliest(t, ...) tain_earliestn(t, sizeof(tain_array(__VA_ARGS__))/sizeof(tain const *), __VA_ARGS__) + #define TAIN_PACK 12 extern void tain_pack (char *, tain const *) ; extern void tain_unpack (char const *, tain *) ; -- cgit v1.2.3