diff options
Diffstat (limited to 'Utilities/cmcurl/memdebug.h')
-rw-r--r-- | Utilities/cmcurl/memdebug.h | 57 |
1 files changed, 37 insertions, 20 deletions
diff --git a/Utilities/cmcurl/memdebug.h b/Utilities/cmcurl/memdebug.h index 42574cf..a4ce7e5 100644 --- a/Utilities/cmcurl/memdebug.h +++ b/Utilities/cmcurl/memdebug.h @@ -2,18 +2,18 @@ #ifndef _CURL_MEDEBUG_H #define _CURL_MEDEBUG_H /*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. - * + * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. @@ -31,6 +31,8 @@ #include "setup.h" +#include <curl/curl.h> + #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif @@ -48,24 +50,24 @@ extern FILE *logfile; /* memory functions */ -void *curl_domalloc(size_t size, int line, const char *source); -void *curl_docalloc(size_t elements, size_t size, int line, const char *source); -void *curl_dorealloc(void *ptr, size_t size, int line, const char *source); -void curl_dofree(void *ptr, int line, const char *source); -char *curl_dostrdup(const char *str, int line, const char *source); -void curl_memdebug(const char *logname); -void curl_memlimit(long limit); +CURL_EXTERN void *curl_domalloc(size_t size, int line, const char *source); +CURL_EXTERN void *curl_docalloc(size_t elements, size_t size, int line, const char *source); +CURL_EXTERN void *curl_dorealloc(void *ptr, size_t size, int line, const char *source); +CURL_EXTERN void curl_dofree(void *ptr, int line, const char *source); +CURL_EXTERN char *curl_dostrdup(const char *str, int line, const char *source); +CURL_EXTERN void curl_memdebug(const char *logname); +CURL_EXTERN void curl_memlimit(long limit); /* file descriptor manipulators */ -int curl_socket(int domain, int type, int protocol, int line , const char *); -int curl_sclose(int sockfd, int, const char *source); -int curl_accept(int s, void *addr, void *addrlen, - int line, const char *source); +CURL_EXTERN int curl_socket(int domain, int type, int protocol, int line , const char *); +CURL_EXTERN int curl_sclose(int sockfd, int, const char *source); +CURL_EXTERN int curl_accept(int s, void *addr, void *addrlen, + int line, const char *source); /* FILE functions */ -FILE *curl_fopen(const char *file, const char *mode, int line, - const char *source); -int curl_fclose(FILE *file, int line, const char *source); +CURL_EXTERN FILE *curl_fopen(const char *file, const char *mode, int line, + const char *source); +CURL_EXTERN int curl_fclose(FILE *file, int line, const char *source); #ifndef MEMDEBUG_NODEFINES @@ -83,11 +85,26 @@ int curl_fclose(FILE *file, int line, const char *source); #define accept(sock,addr,len)\ curl_accept(sock,addr,len,__LINE__,__FILE__) +#if defined(getaddrinfo) && defined(__osf__) +/* OSF/1 and Tru64 have getaddrinfo as a define already, so we cannot define + our macro as for other platforms. Instead, we redefine the new name they + define getaddrinfo to become! */ +#define ogetaddrinfo(host,serv,hint,res) \ + curl_dogetaddrinfo(host,serv,hint,res,__LINE__,__FILE__) +#else +#undef getaddrinfo #define getaddrinfo(host,serv,hint,res) \ curl_dogetaddrinfo(host,serv,hint,res,__LINE__,__FILE__) +#endif + +#ifdef HAVE_GETNAMEINFO +#undef getnameinfo #define getnameinfo(sa,salen,host,hostlen,serv,servlen,flags) \ curl_dogetnameinfo(sa,salen,host,hostlen,serv,servlen,flags, __LINE__, \ __FILE__) +#endif + +#undef freeaddrinfo #define freeaddrinfo(data) \ curl_dofreeaddrinfo(data,__LINE__,__FILE__) |