From c3e026c3034d5d51f011a75b191f46c3891069cf Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 22 Dec 2008 09:50:40 +0000 Subject: Create POSIX like sftp functions. This breaks the API and will be libssh 0.3. git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@195 7dcaeef0-15fb-0310-b436-a5af3365683c --- include/libssh/priv.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/libssh/priv.h') diff --git a/include/libssh/priv.h b/include/libssh/priv.h index 3df07b7b..c7afb423 100644 --- a/include/libssh/priv.h +++ b/include/libssh/priv.h @@ -636,6 +636,12 @@ int ssh_handle_packets(SSH_SESSION *session); #define enter_function() _enter_function(session) #define leave_function() _leave_function(session) +/** Zero a structure */ +#define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x)) + +/** Zero a structure given a pointer to the structure */ +#define ZERO_STRUCTP(x) do { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); } while(0) + #ifdef HAVE_LIBGCRYPT /* gcrypt_missing.c */ int my_gcry_dec2bn(bignum *bn, const char *data); -- cgit