gnutls_mem.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation
00003  *
00004  * Author: Nikos Mavrogiannopoulos
00005  *
00006  * This file is part of GNUTLS.
00007  *
00008  * The GNUTLS library is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Lesser General Public License
00010  * as published by the Free Software Foundation; either version 2.1 of
00011  * the License, or (at your option) any later version.
00012  *
00013  * This library is distributed in the hope that it will be useful, but
00014  * WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with this library; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
00021  * USA
00022  *
00023  */
00024 
00025 #ifndef GNUTLS_MEM_H
00026 # define GNUTLS_MEM_H
00027 
00028 #ifdef USE_DMALLOC
00029 # include <dmalloc.h>
00030 #endif
00031 
00032 typedef void svoid;             /* for functions that allocate using MHD_gnutls_secure_malloc */
00033 
00034 #ifdef HAVE_ALLOCA
00035 # ifdef HAVE_ALLOCA_H
00036 #  include <alloca.h>
00037 # endif
00038 # ifndef MHD_gnutls_alloca
00039 #  define MHD_gnutls_alloca alloca
00040 #  define MHD_gnutls_afree(x)
00041 # endif
00042 #else
00043 # ifndef MHD_gnutls_alloca
00044 #  define MHD_gnutls_alloca MHD_gnutls_malloc
00045 #  define MHD_gnutls_afree MHD_gnutls_free
00046 # endif
00047 #endif /* HAVE_ALLOCA */
00048 
00049 extern int (*MHD__gnutls_is_secure_memory) (const void *);
00050 
00051 /* this realloc function will return ptr if size==0, and
00052  * will free the ptr if the new allocation failed.
00053  */
00054 void *MHD_gtls_realloc_fast (void *ptr, size_t size);
00055 
00056 svoid *MHD_gtls_secure_calloc (size_t nmemb, size_t size);
00057 
00058 void *MHD_gtls_calloc (size_t nmemb, size_t size);
00059 char *MHD_gtls_strdup (const char *);
00060 
00061 #endif /* GNUTLS_MEM_H */

Generated on Fri Feb 27 18:31:59 2009 for GNU libmicrohttpd by  doxygen 1.5.7.1