diff options
author | Jeremy Allison <jra@samba.org> | 2001-04-10 21:07:04 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-04-10 21:07:04 +0000 |
commit | 9c9ce2f6135185d55184c864befb5b6e894af9c2 (patch) | |
tree | 04f30b4fd26331e1d032b3654e3f8327f544195d /source3/tdb | |
parent | 6d96224f81039756180d496a95b121768953f5ed (diff) | |
download | samba-9c9ce2f6135185d55184c864befb5b6e894af9c2.tar.gz samba-9c9ce2f6135185d55184c864befb5b6e894af9c2.tar.bz2 samba-9c9ce2f6135185d55184c864befb5b6e894af9c2.zip |
Added HAVE_STDARG_H to tdbutil.c
Jeremy.
(This used to be commit e404e001990409eacf2e620d2269c2b162fa938b)
Diffstat (limited to 'source3/tdb')
-rw-r--r-- | source3/tdb/tdbutil.c | 56 |
1 files changed, 51 insertions, 5 deletions
diff --git a/source3/tdb/tdbutil.c b/source3/tdb/tdbutil.c index 643f56c97b..4df7f9004e 100644 --- a/source3/tdb/tdbutil.c +++ b/source3/tdb/tdbutil.c @@ -120,22 +120,45 @@ TDB_DATA tdb_fetch_by_string(TDB_CONTEXT *tdb, char *keystr) /* useful pair of routines for packing/unpacking data consisting of integers and strings */ +#ifdef HAVE_STDARG_H size_t tdb_pack(char *buf, int bufsize, char *fmt, ...) { +#else /* HAVE_STDARG_H */ + size_t tdb_pack(va_alist) +va_dcl +{ + char *buf, *fmt; + int bufsize; +#endif /* HAVE_STDARG_H */ + va_list ap; uint16 w; uint32 d; int i; void *p; int len; char *s; + char c; +#ifdef HAVE_STDARG_H char *buf0 = buf; char *fmt0 = fmt; int bufsize0 = bufsize; - va_list ap; - char c; va_start(ap, fmt); - +#else /* HAVE_STDARG_H */ + char *buf0; + char *fmt0; + int bufsize0; + + va_start(ap); + buf = va_arg(ap,char *); + bufsize = va_arg(ap,int); + fmt = va_arg(ap,char *); + + buf0 = buf; + fmt0 = fmt; + bufsize0 = bufsize; +#endif /* HAVE_STDARG_H */ + while (*fmt) { switch ((c = *fmt++)) { case 'w': @@ -207,21 +230,44 @@ size_t tdb_pack(char *buf, int bufsize, char *fmt, ...) /* useful pair of routines for packing/unpacking data consisting of integers and strings */ +#ifdef HAVE_STDARG_H int tdb_unpack(char *buf, int bufsize, char *fmt, ...) { +#else /* HAVE_STDARG_H */ + int tdb_unpack(va_alist) +va_dcl +{ + char *buf, *fmt; + int bufsize; +#endif /* HAVE_STDARG_H */ + va_list ap; uint16 *w; uint32 *d; int len; int *i; void **p; char *s, **b; + char c; +#ifdef HAVE_STDARG_H char *buf0 = buf; char *fmt0 = fmt; int bufsize0 = bufsize; - va_list ap; - char c; va_start(ap, fmt); +#else /* HAVE_STDARG_H */ + char *buf0; + char *fmt0; + int bufsize0; + + va_start(ap); + buf = va_arg(ap,char *); + bufsize = va_arg(ap,int); + fmt = va_arg(ap,char *); + + buf0 = buf; + fmt0 = fmt; + bufsize0 = bufsize; +#endif /* HAVE_STDARG_H */ while (*fmt) { switch ((c=*fmt++)) { |