summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-05-09 21:17:16 -0700
committerKeith Packard <keithp@keithp.com>2012-05-09 21:17:16 -0700
commit3a94b338aaa48b656aae1bb3a5a9d64300c0a093 (patch)
tree167d2bd355bc9baf2d65fa351e8fc8cefe78b3ab /include
parentafc153a5b4fc58ae70dc214f61a71b1a8c855f06 (diff)
parentc91d00e0f330b9de604068e1bfcb0a307096434f (diff)
Merge remote-tracking branch 'whot/for-keith'
Diffstat (limited to 'include')
-rw-r--r--include/Xprintf.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/Xprintf.h b/include/Xprintf.h
index 414fd46fb..9e8cdc5dc 100644
--- a/include/Xprintf.h
+++ b/include/Xprintf.h
@@ -66,4 +66,16 @@ _X_ATTRIBUTE_PRINTF(2, 0);
#define vasprintf Xvasprintf
#endif
+/*
+ * These functions provide a portable implementation of the linux kernel
+ * scnprintf & vscnprintf routines that return the number of bytes actually
+ * copied during a snprintf, (excluding the final '\0').
+ */
+extern _X_EXPORT int
+Xscnprintf(char *s, int n, const char * _X_RESTRICT_KYWD fmt, ...)
+_X_ATTRIBUTE_PRINTF(3,4);
+extern _X_EXPORT int
+Xvscnprintf(char *s, int n, const char * _X_RESTRICT_KYWD fmt, va_list va)
+_X_ATTRIBUTE_PRINTF(3,0);
+
#endif /* XPRINTF_H */