]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_hc.h
updating copy left. i am super fuckin busy with school, and trying to get life back...
[16.git] / src / lib / 16_hc.h
index 86c6ff12e2154670b3096ed8e75e6feba183c89b..010d04f29011292c3f5915b125fe7e6c6b178750 100755 (executable)
@@ -1,54 +1,70 @@
-/* Project 16 Source Code~
- * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123
- *
- * 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 <http://www.gnu.org/licenses/>, 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~\r
+ * Copyright (C) 2012-2019 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
+ *\r
+ * This file is part of Project 16.\r
+ *\r
+ * Project 16 is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * Project 16 is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>, or\r
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
+ * Fifth Floor, Boston, MA 02110-1301 USA.\r
+ *\r
+ */\r
+/*\r
+       heap check\r
+*/\r
+\r
+#ifndef __16HC__\r
+#define __16HC__\r
+\r
+#include "src/lib/16_head.h"\r
+\r
+typedef struct heapusage\r
+{\r
+       unsigned long h_free, h_total, h_used;\r
+       int heap_status;\r
+} hc_use_t;\r
+\r
+#ifdef __WATCOMC__\r
+#define NPTR __near\r
+#endif\r
+\r
+#ifdef __BORLANDC__\r
+#define NPTR\r
+\r
+#define _HEAPBADBEGIN   2       /* heap header is corrupted */\r
+#define _HEAPBADNODE    3       /* heap entry is corrupted */\r
+#define _HEAPBADPTR     5       /* invalid heap entry pointer (_heapwalk) */\r
+#endif\r
+\r
+//long HC_Newfarcoreleft();\r
+void NPTR* HC_LargestFreeBlock(size_t* Size);\r
+size_t HC_coreleft(void);\r
+void far* HC_LargestFarFreeBlock(dword* Size);\r
+unsigned long HC_farcoreleft(void);\r
+//size_t HC_GetFreeSize(void);\r
+unsigned long HC_GetFarFreeSize(void);\r
+size_t HC_GetNearFreeSize(void);\r
+\r
+void HC_heapdump(global_game_variables_t *gvar);\r
+void HCL_heapstatLogWrite(global_game_variables_t *gvar, int heap_status, byte *str);\r
+void HCL_heapstat(int heap_status);\r
+\r
+void HC_OpenDebug(global_game_variables_t *gvar);\r
+void HC_CloseDebug(global_game_variables_t *gvar);\r
+\r
+#ifdef __WATCOMC__\r
+unsigned long farcoreleft();\r
+unsigned long coreleft();\r
+#endif\r
+\r
+#endif /* __16HC__ */\r