summaryrefslogtreecommitdiff
path: root/usr/sdk/inc
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-12-21 19:19:37 -0500
committerIan Moffett <ian@osmora.org>2025-12-21 19:19:37 -0500
commit21cc24baa135c1a2b882ba67c1e0b2cf9e64edfc (patch)
tree104d8d4cb5ca2799891fe013ab85297753410ac4 /usr/sdk/inc
parenta4e1392ee8d1895365248399cc885e073a390076 (diff)
usr: sdk: Add vsnprintf() family helpers
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'usr/sdk/inc')
-rw-r--r--usr/sdk/inc/sdk/string.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/usr/sdk/inc/sdk/string.h b/usr/sdk/inc/sdk/string.h
index 0f7ff27..965f66a 100644
--- a/usr/sdk/inc/sdk/string.h
+++ b/usr/sdk/inc/sdk/string.h
@@ -6,7 +6,8 @@
#ifndef _SDK_STRING_H_
#define _SDK_STRING_H_ 1
- #include <sdk/types.h>
+#include <sdk/types.h>
+#include <sdk/stdarg.h>
/*
* Returns the length of a string
@@ -39,4 +40,23 @@ void *memcpy(void *dest, const void *src, USIZE count);
*/
char *itoa(QUAD value, char *buf, int base);
+/*
+ * Write a formatted string to a buffer
+ *
+ * @s: Target buffer
+ * @size: Maximum buffer size
+ * @fmt: Format string
+ * @<...>: Args
+ */
+int snprintf(char *s, USIZE size, const char *fmt, ...);
+
+/*
+ * Write a formatted string to a buffer using a va_list
+ *
+ * @s: Target buffer
+ * @size: Maximum buffer size
+ * @ap: Args pointer
+ */
+int vsnprintf(char *s, USIZE size, const char *fmt, va_list ap);
+
#endif /* !_SDK_STRING_H_ */