2 #ifndef _CURL_MEDEBUG_H
3 #define _CURL_MEDEBUG_H
34 #ifdef HAVE_SYS_TYPES_H
35 #include <sys/types.h>
38 #ifdef HAVE_SYS_SOCKET_H
39 #include <sys/socket.h>
46 #define logfile curl_debuglogfile
51 void *curl_domalloc(
size_t size,
int line,
const char *
source);
52 void *curl_docalloc(
size_t elements,
size_t size,
int line,
const char *
source);
53 void *curl_dorealloc(
void *ptr,
size_t size,
int line,
const char *
source);
54 void curl_dofree(
void *ptr,
int line,
const char *
source);
55 char *curl_dostrdup(
const char *str,
int line,
const char *
source);
57 void curl_memlimit(
long limit);
60 int curl_socket(
int domain,
int type,
int protocol,
int line ,
const char *);
61 int curl_sclose(
int sockfd,
int,
const char *
source);
62 int curl_accept(
int s,
void *
addr,
void *addrlen,
63 int line,
const char *
source);
66 FILE *curl_fopen(
const char *file,
const char *
mode,
int line,
68 int curl_fclose(FILE *file,
int line,
const char *
source);
70 #ifndef MEMDEBUG_NODEFINES
74 #define strdup(ptr) curl_dostrdup(ptr, __LINE__, __FILE__)
75 #define malloc(size) curl_domalloc(size, __LINE__, __FILE__)
76 #define calloc(nbelem,size) curl_docalloc(nbelem, size, __LINE__, __FILE__)
77 #define realloc(ptr,size) curl_dorealloc(ptr, size, __LINE__, __FILE__)
78 #define free(ptr) curl_dofree(ptr, __LINE__, __FILE__)
80 #define socket(domain,type,protocol)\
81 curl_socket(domain,type,protocol,__LINE__,__FILE__)
83 #define accept(sock,addr,len)\
84 curl_accept(sock,addr,len,__LINE__,__FILE__)
86 #define getaddrinfo(host,serv,hint,res) \
87 curl_getaddrinfo(host,serv,hint,res,__LINE__,__FILE__)
88 #define freeaddrinfo(data) \
89 curl_freeaddrinfo(data,__LINE__,__FILE__)
93 #define sclose(sockfd) curl_sclose(sockfd,__LINE__,__FILE__)
96 #define closesocket(sockfd) curl_sclose(sockfd,__LINE__,__FILE__)
99 #define fopen(file,mode) curl_fopen(file,mode,__LINE__,__FILE__)
100 #define fclose(file) curl_fclose(file,__LINE__,__FILE__)
GLuint GLuint GLsizei GLenum type
GLsizei GLsizei GLcharARB * source
GLenum const GLvoid * addr