aboutsummaryrefslogtreecommitdiff
path: root/chad/experimental/timespec.h
diff options
context:
space:
mode:
authorEmil Williams2026-02-20 23:14:51 +0000
committerEmil Williams2026-02-20 23:14:51 +0000
commit5977e472ae122bd8135b7428d9093652d51a2cba (patch)
tree3ba84f26033306a2bc147100d02b350b900f1c20 /chad/experimental/timespec.h
parent88e12f4a22111903fc23488898f073502639635c (diff)
downloadlibchad-5977e472ae122bd8135b7428d9093652d51a2cba.tar.xz
libchad-5977e472ae122bd8135b7428d9093652d51a2cba.tar.zst
per notes
Diffstat (limited to 'chad/experimental/timespec.h')
-rw-r--r--chad/experimental/timespec.h18
1 files changed, 2 insertions, 16 deletions
diff --git a/chad/experimental/timespec.h b/chad/experimental/timespec.h
index f72f431..075e0b0 100644
--- a/chad/experimental/timespec.h
+++ b/chad/experimental/timespec.h
@@ -1,8 +1,8 @@
#ifndef TIMESPEC_H
#define TIMESPEC_H
/* ripped partly from glibc */
+
#include <time.h>
-#include <chad/experimental/macros.h>
#include <chad/terry.h>
/* -- pontentially over designed and undertested. */
@@ -15,21 +15,7 @@ typedef struct timespec timespec_t;
static const timespec_t one_second = {1, 0}, zero_seconds = {0, 0};
-f64 timespec_to_f64(timespec_t ts);
-f32 timespec_to_f32(timespec_t ts);
-double timespec_to_double(timespec_t ts);
-float timespec_to_float(timespec_t ts);
-
-#ifdef TERRY_SMALL_FLOAT_IMPRECISE
-#define from_timespec(ts,to) _Generic((to), double *: double_from_timespec, float *: float_from_timespec)(ts,to)
-#else
-#define from_timespec(ts,to) _Generic((to), f64 *: f64_from_timespec, f32 *: f32_from_timespec, double *: double_from_timespec, float *: float_from_timespec)(ts,to)
-#endif
-
-void f64_from_timespec(timespec_t ts, f64 * r);
-void f32_from_timespec(timespec_t ts, f32 * r);
-void double_from_timespec(timespec_t ts, double * r);
-void float_from_timespec(timespec_t ts, float * r);
+double timespec2unix(timespec_t ts);
timespec_t timespec_add(timespec_t a, timespec_t b);
timespec_t timespec_sub(timespec_t a, timespec_t b);