summaryrefslogtreecommitdiff
path: root/lib/atox.c
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-04-08 10:39:48 -0400
committerFreya Murphy <freya@freyacat.org>2025-04-08 10:39:48 -0400
commit8a19547957a86bed3f58c9abc1ac218d04698faf (patch)
treeed7ccc6f3a8902915dfe6c9bf763fc45d752b3c4 /lib/atox.c
parentfmt (diff)
downloadcomus-8a19547957a86bed3f58c9abc1ac218d04698faf.tar.gz
comus-8a19547957a86bed3f58c9abc1ac218d04698faf.tar.bz2
comus-8a19547957a86bed3f58c9abc1ac218d04698faf.zip
break apart c libaray
Diffstat (limited to 'lib/atox.c')
-rw-r--r--lib/atox.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/lib/atox.c b/lib/atox.c
deleted file mode 100644
index c4bef59..0000000
--- a/lib/atox.c
+++ /dev/null
@@ -1,30 +0,0 @@
-#include <stdlib.h>
-#include <ctype.h>
-
-#define ATOX(name, type) \
- type name(const char *s) \
- { \
- for (; isspace(*s); s++) \
- ; \
- int neg = 0; \
- switch (*s) { \
- case '-': \
- neg = 1; \
- /* fallthrough */ \
- case '+': \
- s++; \
- break; \
- } \
- type num = 0; \
- for (; *s == '0'; s++) \
- ; \
- for (; isdigit(*s); s++) { \
- num *= 10; \
- num += *s - '0'; \
- } \
- return num * (neg ? -1 : 1); \
- }
-
-ATOX(atoi, int)
-ATOX(atol, long int)
-ATOX(atoll, long long int)