summaryrefslogtreecommitdiff
path: root/pk.h.in
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-03-19 18:15:52 -0400
committerJonathan Bradley <jcb@pikum.xyz>2025-03-20 12:01:56 -0400
commit9cd55867de91013bdbfe0d73112df504eb7963ba (patch)
tree35c7d25805c10a61dd65bd80febedb81e82c50bf /pk.h.in
parentbc7e78b1766e8d9c9af1d47c207d084e161db98d (diff)
pkuuid.h: first-pass + bump version to 0.4.1
Diffstat (limited to 'pk.h.in')
-rw-r--r--pk.h.in21
1 files changed, 21 insertions, 0 deletions
diff --git a/pk.h.in b/pk.h.in
index db5a720..94129ab 100644
--- a/pk.h.in
+++ b/pk.h.in
@@ -184,6 +184,24 @@
* `pk_tmr.e` end the end time.
* You could then call the `pk_tmr_duration...` convenience macros as needed.
*
+********************************************************************************
+* pkuuid.h: define PK_IMPL_UUID before including pk.h to enable ad-hoc.
+*
+* Provides a 16-byte unsigned char array struct for uuids.
+*
+* The following definitions (shown with defaults) can be overridden:
+* PK_UUID_CLOCK CLOCK_TAI (preferred, if available)
+* PK_UUID_CLOCK CLOCK_REALTIME (fallback)
+*
+* The `PK_UUID_CLOCK` macro has minimal built-in fallback logic.
+* The uuidv7 specification states that the timestamp portion of the uuid must be
+* a unix epoch, leap seconds EXCLUDED. Only `CLOCK_TAI` meets this requirement
+* on Linux.
+*
+* Note that this currectly calls `srand()` once at startup, and calls `rand()`
+* 2 times for each uuidv7 to fill 74 bits with random data (with an XOR for the
+* remaining 10 bits).
+*
*******************************************************************************/
#define PK_VERSION "@@PK_VERSION@@"
@@ -207,4 +225,7 @@
# ifndef PK_IMPL_STN
# define PK_IMPL_STN
# endif
+# ifndef PK_IMPL_UUID
+# define PK_IMPL_UUID
+# endif
#endif