From 310311aadfee8ac1a94599f76f7012024e1b2474 Mon Sep 17 00:00:00 2001 From: "dmose%mozilla.org" Date: Fri, 29 Sep 2000 00:45:52 +0000 Subject: [PATCH] Infrastructure for internal use by the LDAP code. a=r=(not built) git-svn-id: svn://10.0.0.236/trunk@80114 18797224-902f-48f8-a5cc-f745e15eee43 --- .../directory/xpcom/base/src/nsLDAPInternal.h | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 mozilla/directory/xpcom/base/src/nsLDAPInternal.h diff --git a/mozilla/directory/xpcom/base/src/nsLDAPInternal.h b/mozilla/directory/xpcom/base/src/nsLDAPInternal.h new file mode 100644 index 00000000000..1234d5d2f5d --- /dev/null +++ b/mozilla/directory/xpcom/base/src/nsLDAPInternal.h @@ -0,0 +1,21 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + */ +#include "nsLDAP.h" +#include "nspr.h" + +// frees all elements of an XPIDL out array of a given size using +// freeFunc(), then frees the array itself using nsMemory::Free(). +// Thanks to for suggesting this form, which can be +// used to NS_RELEASE entire arrays before freeing as well. +// +#define NSLDAP_FREE_XPIDL_ARRAY(size, array, freeFunc) \ + for ( PRUint32 __iter__ = (size) ; __iter__ > 0 ; ) \ + freeFunc((array)[--__iter__]); \ + nsMemory::Free(array); + +// XXXdmose should this really be DEBUG-only? +// +#ifdef DEBUG +extern PRLogModuleInfo *gLDAPLogModule; // defn in nsLDAPProtocolModule.cpp +#endif