alloc.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #ifndef __ALLOC
  2. #define __ALLOC
  3. #include <default.h>
  4. /* Begin Auto-Generated Part */
  5. #define H_NULL 0
  6. #define NULL ((void*)0)
  7. #ifndef __HAVE_size_t
  8. #define __HAVE_size_t
  9. typedef unsigned long size_t;
  10. #endif
  11. #ifndef __HAVE_Bool
  12. #define __HAVE_Bool
  13. enum Bool{FALSE,TRUE};
  14. #endif
  15. #ifndef __HAVE_HANDLE
  16. #define __HAVE_HANDLE
  17. typedef unsigned short HANDLE;
  18. #endif
  19. #ifndef __HAVE_alloca
  20. #define __HAVE_alloca
  21. void *alloca(long)__ATTR_GCC__;
  22. #endif
  23. extern void *calloc_throw(short asm("d0"),short asm("d1"))__ATTR_LIB_ASM__;
  24. #ifndef __HAVE_calloc
  25. #define __HAVE_calloc
  26. extern void *calloc(short asm("d0"),short asm("d1"))__ATTR_LIB_ASM__;
  27. #endif
  28. #define free _rom_call(void,(void*),A3)
  29. #define FreeHandles _rom_call(short,(void),23B)
  30. #define HeapAlloc _rom_call(HANDLE,(long),90)
  31. #define HeapAllocESTACK _rom_call(HANDLE,(long),91)
  32. #define HeapAllocHigh _rom_call(HANDLE,(long),92)
  33. #define HeapAllocHighThrow _rom_call(HANDLE,(long),94)
  34. #define HeapAllocPtr _rom_call(void*,(long),A2)
  35. extern void *HeapAllocPtrThrow(long asm("a0"))__ATTR_LIB_ASM__;
  36. #define HeapAllocThrow _rom_call(HANDLE,(long),93)
  37. #define HeapAvail _rom_call(unsigned long,(void),8F)
  38. #define HeapCompress _rom_call(void,(void),95)
  39. #define HeapDeref _rom_call(void*,(HANDLE),96)
  40. #define HeapEnd _rom_call(void*,(void),A1)
  41. #define HeapFree _rom_call(void,(HANDLE),97)
  42. #define HeapFreeIndir _rom_call(void,(HANDLE*),98)
  43. #define HeapFreePtr _rom_call(void,(void*),A3)
  44. #define HeapGetHandle _rom_call(HANDLE,(void),239)
  45. #define HeapGetLock _rom_call(short,(HANDLE),9B)
  46. #define HeapLock _rom_call(HANDLE,(HANDLE),9A)
  47. #define HeapMax _rom_call(unsigned long,(void),9C)
  48. #define HeapMoveHigh _rom_call(HANDLE,(HANDLE),A0)
  49. #define HeapPtrToHandle _rom_call(HANDLE,(void*),23A)
  50. #define HeapRealloc _rom_call(HANDLE,(HANDLE,long),9D)
  51. extern HANDLE HeapReallocThrow(HANDLE asm("d0"),long asm("a0"))__ATTR_LIB_ASM__;
  52. #define HeapSize _rom_call(unsigned long,(HANDLE),9E)
  53. #define HeapUnlock _rom_call(HANDLE,(HANDLE),9F)
  54. #define HLock _rom_call(void*,(HANDLE),99)
  55. extern void *malloc_throw(long asm("a0"))__ATTR_LIB_ASM__;
  56. #define malloc _rom_call(void*,(long),A2)
  57. extern HANDLE PtrToHandle(void* asm("a0"))__ATTR_LIB_ASM__;
  58. extern void *realloc_throw(void* asm("a0"),long asm("d0"))__ATTR_LIB_ASM__;
  59. #ifndef __HAVE_realloc
  60. #define __HAVE_realloc
  61. extern void *realloc(void* asm("a0"),long asm("d0"))__ATTR_LIB_ASM__;
  62. #endif
  63. #if MIN_AMS>=101
  64. #define hStrAppend _rom_call_hack(void,(HANDLE,unsigned char*),45F,(((((unsigned char*)_rom_call_addr(110)+0x526))+*((signed short*)_rom_call_addr(110)+0x526/2))),200)
  65. #if MIN_AMS>=200
  66. enum HeapWalkCmds{H_WALK_VERIFY=0,H_WALK_STATUS=1,H_WALK_DUMP=2
  67. #if MIN_AMS>=204
  68. ,H_WALK_SYM=3
  69. #endif
  70. };
  71. #define HeapShuffle _rom_call(void,(void),474)
  72. #define HeapWalk _rom_call(short,(short),12C)
  73. #endif
  74. #endif
  75. /* End Auto-Generated Part */
  76. #endif