diff options
author | Jeremy Allison <jra@samba.org> | 2001-04-13 19:12:06 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-04-13 19:12:06 +0000 |
commit | 2ef68c7e92d4661664f0410509f7cb551e74a198 (patch) | |
tree | 7a3ea392bf8664e28ad46b2edb1afd750335ccc9 /source3/tdb/tdbutil.c | |
parent | 14748b0bf56239695cadb6aa40d9095259ebb6e2 (diff) | |
download | samba-2ef68c7e92d4661664f0410509f7cb551e74a198.tar.gz samba-2ef68c7e92d4661664f0410509f7cb551e74a198.tar.bz2 samba-2ef68c7e92d4661664f0410509f7cb551e74a198.zip |
Merge of Andrew's changes in 2.2.
Jeremy.
(This used to be commit fc76681812b1469208ad6c8847afdfc68bc6db49)
Diffstat (limited to 'source3/tdb/tdbutil.c')
-rw-r--r-- | source3/tdb/tdbutil.c | 50 |
1 files changed, 2 insertions, 48 deletions
diff --git a/source3/tdb/tdbutil.c b/source3/tdb/tdbutil.c index 27aac560e0..d683d70c46 100644 --- a/source3/tdb/tdbutil.c +++ b/source3/tdb/tdbutil.c @@ -120,44 +120,21 @@ 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 = 0; + int len; char *s; char c; -#ifdef HAVE_STDARG_H char *buf0 = buf; char *fmt0 = fmt; int bufsize0 = bufsize; 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++)) { @@ -230,44 +207,21 @@ va_dcl /* 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 = 0; + 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_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++)) { |