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 | |
parent | 254fa34ddc06718ce951b32e4640afb8d9914da3 (diff) | |
download | gnome-common-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
-rw-r--r-- | support/ChangeLog | 6 | ||||
-rw-r--r-- | support/easy-vsnprintf.c | 30 | ||||
-rw-r--r-- | support/vsnprintf.c | 1 |
3 files changed, 37 insertions, 0 deletions
diff --git a/support/ChangeLog b/support/ChangeLog index c8d7dfd..a16d760 100644 --- a/support/ChangeLog +++ b/support/ChangeLog @@ -1,3 +1,9 @@ +1998-03-09 Raja R Harinath <harinath@cs.umn.edu> + + * easy-vsnprintf.c: New file. Provides (v)snprintf as simple + wrappers to `__vsnprintf'. + * vsnprintf.c: New file. Empty for now. + Sun Mar 8 17:13:33 1998 Tom Tromey <tromey@cygnus.com> * Makefile.am: Rewrote. Library now named libgnomesupport, now diff --git a/support/easy-vsnprintf.c b/support/easy-vsnprintf.c new file mode 100644 index 0000000..b50df74 --- /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; +} diff --git a/support/vsnprintf.c b/support/vsnprintf.c new file mode 100644 index 0000000..6119346 --- /dev/null +++ b/support/vsnprintf.c @@ -0,0 +1 @@ +#error "Fill in the code" |