diff options
| author | Jon Santmyer <jon@jonsantmyer.com> | 2026-09-05 20:24:13 -0400 |
|---|---|---|
| committer | Jon Santmyer <jon@jonsantmyer.com> | 2026-09-05 20:24:13 -0400 |
| commit | 779b7fc1fe91e5a355b6e15de882d46b26ab2270 (patch) | |
| tree | c62da25a0a0b02488550e856921350fd94668c2b /lib | |
| parent | 73cbb23130f634bf52ac92da063efd3e6016f8ee (diff) | |
| download | jove-kernel-779b7fc1fe91e5a355b6e15de882d46b26ab2270.tar.gz jove-kernel-779b7fc1fe91e5a355b6e15de882d46b26ab2270.tar.bz2 jove-kernel-779b7fc1fe91e5a355b6e15de882d46b26ab2270.zip | |
working syscalls.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/printf.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/printf.c b/lib/printf.c index 4c26fe4..4e64d7b 100644 --- a/lib/printf.c +++ b/lib/printf.c @@ -100,6 +100,10 @@ vsnprintf( case 'i': goto int_conversion; break; + /*custom formatters for jove.*/ + case 'P': + goto path_conversion; + break; } string_conversion: { @@ -132,6 +136,17 @@ int_conversion: } stri += advance; } continue; +path_conversion: + { + uint16_t *obj_path = va_arg(ap, uint16_t*); + size_t obj_pathlen = va_arg(ap, size_t); + for(size_t i = 0; i < obj_pathlen; i++) { + uint16_t subdir = obj_path[i]; + int advance = convert_as_int(str, size, stri, 3, subdir, 10, 1); + stri += advance; + SPRINTF_PUTC(str, size, stri, '/'); + } + } continue; } if(str && stri < size) str[stri] = 0; return stri; |
