#include "libxml.h"
#include <string.h>
-
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
-#ifdef HAVE_TIME_H
-#include <time.h>
-#endif
-
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#else
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-#endif
-
-#ifdef HAVE_CTYPE_H
#include <ctype.h>
-#endif
+#include <time.h>
/* #define DEBUG_MEMORY */
MEMHDR *p;
unsigned idx;
int nb = 0;
-#if defined(HAVE_LOCALTIME) && defined(HAVE_STRFTIME)
time_t currentTime;
char buf[500];
struct tm * tstruct;
-#endif
#endif
FILE *old_fp = fp;
}
#ifdef MEM_LIST
-#if defined(HAVE_LOCALTIME) && defined(HAVE_STRFTIME)
currentTime = time(NULL);
tstruct = localtime(¤tTime);
strftime(buf, sizeof(buf) - 1, "%I:%M:%S %p", tstruct);
fprintf(fp," %s\n\n", buf);
-#endif
fprintf(fp," MEMORY ALLOCATED : %lu, MAX was %lu\n",
/**
* xmlInitMemory:
*
+ * DEPRECATED: This function will be made private. Call xmlInitParser to
+ * initialize the library.
+ *
* Initialize the memory layer.
*
* Returns 0 on success
int
xmlInitMemory(void)
{
-#ifdef HAVE_STDLIB_H
char *breakpoint;
-#endif
#ifdef DEBUG_MEMORY
xmlGenericError(xmlGenericErrorContext,
"xmlInitMemory()\n");
xmlMemInitialized = 1;
xmlMemMutex = xmlNewMutex();
-#ifdef HAVE_STDLIB_H
breakpoint = getenv("XML_MEM_BREAKPOINT");
if (breakpoint != NULL) {
sscanf(breakpoint, "%ud", &xmlMemStopAtBlock);
}
-#endif
-#ifdef HAVE_STDLIB_H
breakpoint = getenv("XML_MEM_TRACE");
if (breakpoint != NULL) {
sscanf(breakpoint, "%p", &xmlMemTraceBlockAt);
}
-#endif
#ifdef DEBUG_MEMORY
xmlGenericError(xmlGenericErrorContext,
/**
* xmlCleanupMemory:
*
+ * DEPRECATED: This function will be made private. Call xmlCleanupParser
+ * to free global state but see the warnings there. xmlCleanupParser
+ * should be only called once at program exit. In most cases, you don't
+ * have call cleanup functions at all.
+ *
* Free up all the memory allocated by the library for its own
* use. This should not be called by user level code.
*/
return(0);
}
-#define bottom_xmlmemory
-#include "elfgcchack.h"