From bd25716a6cc27c9bcde752183e948fe8b36fd2d2 Mon Sep 17 00:00:00 2001 From: short <> Date: Tue, 5 Nov 2002 11:07:12 +0000 Subject: [PATCH] +CAPTIVE_MEMZERO() --- src/libcaptive/include/captive/macros.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/libcaptive/include/captive/macros.h b/src/libcaptive/include/captive/macros.h index 58d0971..ffc300c 100644 --- a/src/libcaptive/include/captive/macros.h +++ b/src/libcaptive/include/captive/macros.h @@ -24,6 +24,7 @@ #include #include #include +#include /* for memset() */ G_BEGIN_DECLS @@ -126,6 +127,16 @@ G_BEGIN_DECLS */ #define captive_va_arg(objp,ap) ((objp)=va_arg((ap),typeof(objp))) + +/** + * CAPTIVE_MEMZERO: + * @objp: Pointer to the variable to be cleared. + * + * Clears the sizeof(*@objp) bytes of the given pointer with memset(). + * Pass _pointer_ to the object to be cleared. + */ +#define CAPTIVE_MEMZERO(objp) (memset((objp),0,sizeof(*(objp)))) + G_END_DECLS -- 1.8.3.1