aboutsummaryrefslogtreecommitdiff
path: root/lib/io
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2023-01-15 01:13:51 +0100
committerNathan Reiner <nathan@nathanreiner.xyz>2023-01-15 01:13:51 +0100
commit3f79b7bd553a52fca7a098f5195b406ff9970491 (patch)
tree99d0399141e7894219fe7a0deed1ccadb226b9c9 /lib/io
parent919450dc7d965c4067287e1ece3ceafdde8ff5a9 (diff)
add list and static library builder
Diffstat (limited to 'lib/io')
-rw-r--r--lib/io/io.c14
-rwxr-xr-xlib/io/testbin26504 -> 0 bytes
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/io/io.c b/lib/io/io.c
index 3b0ea96..43e05b4 100644
--- a/lib/io/io.c
+++ b/lib/io/io.c
@@ -23,6 +23,8 @@ void rstd(char *buf, unsigned long count)
void wstdf__(const char *buf, const void **args)
{
const char *start = buf;
+ char stoi_buf[32] = "";
+ int i;
for (; *buf; ++buf) {
if (*buf == '%') {
if (buf - start > 0)
@@ -36,6 +38,18 @@ void wstdf__(const char *buf, const void **args)
__wstdn(((const char **)args)[0], cstr_length(((const char**)args)[0]));
++args;
break;
+ case 'i':
+ for (i = 0; i < 32; ++i)
+ stoi_buf[i] = 0;
+ i64_to_cstr(((u64 *)args)[0], stoi_buf, 32);
+ __wstdn(stoi_buf, cstr_length(stoi_buf));
+ break;
+ case 'u':
+ for (i = 0; i < 32; ++i)
+ stoi_buf[i] = 0;
+ u64_to_cstr(((u64 *)args)[0], stoi_buf, 32);
+ __wstdn(stoi_buf, cstr_length(stoi_buf));
+ break;
case 'S':
sgr(((const char **)args)[0]);
++args;
diff --git a/lib/io/test b/lib/io/test
deleted file mode 100755
index b2a3047..0000000
--- a/lib/io/test
+++ /dev/null
Binary files differ