X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_hc.h;h=2b77b5387bded0f3accca8fa00ecb9cc45165529;hb=b8c9d5fcb2b66420bc673f54b14cc5d0ea5283ed;hp=4d0375e2f72f96eeb779a593934abee2b9481d1a;hpb=631d2bde47de81ead5300f7aca378447387f254c;p=16.git
diff --git a/src/lib/16_hc.h b/src/lib/16_hc.h
index 4d0375e2..2b77b538 100755
--- a/src/lib/16_hc.h
+++ b/src/lib/16_hc.h
@@ -1,54 +1,70 @@
-/* Project 16 Source Code~
- * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover
- *
- * This file is part of Project 16.
- *
- * Project 16 is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * Project 16 is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see , or
- * write to the Free Software Foundation, Inc., 51 Franklin Street,
- * Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-/*
- heap test stuff
-*/
-
-#ifndef __16HC__
-#define __16HC__
-
-#include "src/lib/16_head.h"
-
-#ifdef __BORLANDC__
-void * LargestFreeBlock(size_t* Size);
-#endif
-#ifdef __WATCOMC__
-void __near* LargestFreeBlock(size_t* Size);
-#endif
-size_t _coreleft(void);
-void far* LargestFarFreeBlock(size_t* Size);
-size_t _farcoreleft(void);
-void huge* LargestHugeFreeBlock(size_t* Size);
-size_t _hugecoreleft(void);
-//void __based(__self)* LargestBasedFreeBlock(size_t* Size);
-//size_t _basedcoreleft(void);
-size_t GetFreeSize(void);
-size_t GetFarFreeSize(void);
-size_t GetNearFreeSize(void);
-void heapdump(global_game_variables_t *gvar);
-void heapstat(global_game_variables_t *gvar, int heap_status, byte *str);
-void heapstat0(int heap_status);
-
-void HC_OpenDebug(global_game_variables_t *gvar);
-void HC_CloseDebug(global_game_variables_t *gvar);
-
-#endif /* __16HC__ */
+/* Project 16 Source Code~
+ * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover
+ *
+ * This file is part of Project 16.
+ *
+ * Project 16 is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Project 16 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see , or
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,
+ * Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+/*
+ heap check
+*/
+
+#ifndef __16HC__
+#define __16HC__
+
+#include "src/lib/16_head.h"
+
+typedef struct heapusage
+{
+ unsigned long h_free, h_total, h_used;
+ int heap_status;
+} hc_use_t;
+
+#ifdef __WATCOMC__
+#define NPTR __near
+#endif
+
+#ifdef __BORLANDC__
+#define NPTR
+
+#define _HEAPBADBEGIN 2 /* heap header is corrupted */
+#define _HEAPBADNODE 3 /* heap entry is corrupted */
+#define _HEAPBADPTR 5 /* invalid heap entry pointer (_heapwalk) */
+#endif
+
+//long HC_Newfarcoreleft();
+void NPTR* HC_LargestFreeBlock(size_t* Size);
+size_t HC_coreleft(void);
+void far* HC_LargestFarFreeBlock(dword* Size);
+unsigned long HC_farcoreleft(void);
+//size_t HC_GetFreeSize(void);
+unsigned long HC_GetFarFreeSize(void);
+size_t HC_GetNearFreeSize(void);
+
+void HC_heapdump(global_game_variables_t *gvar);
+void HCL_heapstatLogWrite(global_game_variables_t *gvar, int heap_status, byte *str);
+void HCL_heapstat(int heap_status);
+
+void HC_OpenDebug(global_game_variables_t *gvar);
+void HC_CloseDebug(global_game_variables_t *gvar);
+
+#ifdef __WATCOMC__
+unsigned long farcoreleft();
+unsigned long coreleft();
+#endif
+
+#endif /* __16HC__ */