changeset 667:4680ed53cac1

int: add str2uXX_base macros as a way to convert numbers in other bases Currently unused. Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Thu, 21 Feb 2019 14:21:11 -0500
parents 7590cd6dee22
children 81b0f68b1185
files include/jeffpc/int.h
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/include/jeffpc/int.h	Thu Feb 21 14:19:35 2019 -0500
+++ b/include/jeffpc/int.h	Thu Feb 21 14:21:11 2019 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2018 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
+ * Copyright (c) 2016-2019 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -67,6 +67,12 @@
 
 #undef STR_TO_INT
 
+/* base [2, 36] */
+#define str2u64_base(s, i, b)	__str2u64((s), (i), (b))
+#define str2u32_base(s, i, b)	__str2u32((s), (i), (b))
+#define str2u16_base(s, i, b)	__str2u16((s), (i), (b))
+
+/* base 10 */
 #define str2u64(s, i)	__str2u64((s), (i), 10)
 #define str2u32(s, i)	__str2u32((s), (i), 10)
 #define str2u16(s, i)	__str2u16((s), (i), 10)