diff options
author | Raja R Harinath <harinath@src.gnome.org> | 1998-03-10 00:12:35 +0000 |
---|---|---|
committer | Raja R Harinath <harinath@src.gnome.org> | 1998-03-10 00:12:35 +0000 |
commit | 3b0c85e411a302e60991b3d8f418cf93dd0d4d69 (patch) | |
tree | 870a9359fdfa51c43c429e10c1e4edcdea77fa42 /support/easy-vsnprintf.c | |
parent | 254fa34ddc06718ce951b32e4640afb8d9914da3 (diff) | |
download | shared-mime-info-3b0c85e411a302e60991b3d8f418cf93dd0d4d69.tar.gz |
New file. Provides (v)snprintf as simple wrappers to `__vsnprintf'. New
* easy-vsnprintf.c: New file. Provides (v)snprintf as simple
wrappers to `__vsnprintf'.
* vsnprintf.c: New file. Empty for now.
- Hari
svn path=/trunk/; revision=124
Diffstat (limited to 'support/easy-vsnprintf.c')
-rw-r--r-- | support/easy-vsnprintf.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/support/easy-vsnprintf.c b/support/easy-vsnprintf.c new file mode 100644 index 00000000..b50df741 --- /dev/null +++ b/support/easy-vsnprintf.c @@ -0,0 +1,30 @@ +/* (v)snprintf in terms of __(v)snprintf + * + * Useful with Solaris 2.5 libc, which appears to have the `__*' versions + * of (v)snprintf. + * + * This file is in the public domain + * (in case it matters) + */ + +#include <stdarg.h> +#include <stdlib.h> + +extern int __vsnprintf (char *, size_t, const char *, va_list); + +int +vsnprintf (char *string, size_t maxlen, const char *format, va_list args) +{ + return __vsnprintf (string, maxlen, format, args); +} + +int +snprintf (char *string, size_t maxlen, const char *format, ...) +{ + va_list args; + int retval; + va_start(args, format); + retval = vsnprintf (string, maxlen, format, args); + va_end(args); + return retval; +} |