il2cpp-api-types.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. #pragma once
  2. #include <stdint.h>
  3. #include <stddef.h>
  4. struct Il2CppClass;
  5. struct Il2CppType;
  6. struct EventInfo;
  7. struct MethodInfo;
  8. struct FieldInfo;
  9. struct PropertyInfo;
  10. struct Il2CppAssembly;
  11. struct Il2CppArray;
  12. struct Il2CppDelegate;
  13. struct Il2CppDomain;
  14. struct Il2CppImage;
  15. struct Il2CppException;
  16. struct Il2CppProfiler;
  17. struct Il2CppObject;
  18. struct Il2CppReflectionMethod;
  19. struct Il2CppReflectionType;
  20. struct Il2CppString;
  21. struct Il2CppThread;
  22. struct Il2CppAsyncResult;
  23. enum Il2CppProfileFlags
  24. {
  25. IL2CPP_PROFILE_NONE = 0,
  26. IL2CPP_PROFILE_APPDOMAIN_EVENTS = 1 << 0,
  27. IL2CPP_PROFILE_ASSEMBLY_EVENTS = 1 << 1,
  28. IL2CPP_PROFILE_MODULE_EVENTS = 1 << 2,
  29. IL2CPP_PROFILE_CLASS_EVENTS = 1 << 3,
  30. IL2CPP_PROFILE_JIT_COMPILATION = 1 << 4,
  31. IL2CPP_PROFILE_INLINING = 1 << 5,
  32. IL2CPP_PROFILE_EXCEPTIONS = 1 << 6,
  33. IL2CPP_PROFILE_ALLOCATIONS = 1 << 7,
  34. IL2CPP_PROFILE_GC = 1 << 8,
  35. IL2CPP_PROFILE_THREADS = 1 << 9,
  36. IL2CPP_PROFILE_REMOTING = 1 << 10,
  37. IL2CPP_PROFILE_TRANSITIONS = 1 << 11,
  38. IL2CPP_PROFILE_ENTER_LEAVE = 1 << 12,
  39. IL2CPP_PROFILE_COVERAGE = 1 << 13,
  40. IL2CPP_PROFILE_INS_COVERAGE = 1 << 14,
  41. IL2CPP_PROFILE_STATISTICAL = 1 << 15,
  42. IL2CPP_PROFILE_METHOD_EVENTS = 1 << 16,
  43. IL2CPP_PROFILE_MONITOR_EVENTS = 1 << 17,
  44. IL2CPP_PROFILE_IOMAP_EVENTS = 1 << 18, /* this should likely be removed, too */
  45. IL2CPP_PROFILE_GC_MOVES = 1 << 19,
  46. IL2CPP_PROFILE_FILEIO = 1 << 20
  47. };
  48. enum Il2CppProfileFileIOKind
  49. {
  50. IL2CPP_PROFILE_FILEIO_WRITE = 0,
  51. IL2CPP_PROFILE_FILEIO_READ
  52. };
  53. enum Il2CppGCEvent
  54. {
  55. IL2CPP_GC_EVENT_START,
  56. IL2CPP_GC_EVENT_MARK_START,
  57. IL2CPP_GC_EVENT_MARK_END,
  58. IL2CPP_GC_EVENT_RECLAIM_START,
  59. IL2CPP_GC_EVENT_RECLAIM_END,
  60. IL2CPP_GC_EVENT_END,
  61. IL2CPP_GC_EVENT_PRE_STOP_WORLD,
  62. IL2CPP_GC_EVENT_POST_STOP_WORLD,
  63. IL2CPP_GC_EVENT_PRE_START_WORLD,
  64. IL2CPP_GC_EVENT_POST_START_WORLD
  65. };
  66. enum Il2CppStat
  67. {
  68. IL2CPP_STAT_NEW_OBJECT_COUNT,
  69. IL2CPP_STAT_INITIALIZED_CLASS_COUNT,
  70. //IL2CPP_STAT_GENERIC_VTABLE_COUNT,
  71. //IL2CPP_STAT_USED_CLASS_COUNT,
  72. IL2CPP_STAT_METHOD_COUNT,
  73. //IL2CPP_STAT_CLASS_VTABLE_SIZE,
  74. IL2CPP_STAT_CLASS_STATIC_DATA_SIZE,
  75. IL2CPP_STAT_GENERIC_INSTANCE_COUNT,
  76. IL2CPP_STAT_GENERIC_CLASS_COUNT,
  77. IL2CPP_STAT_INFLATED_METHOD_COUNT,
  78. IL2CPP_STAT_INFLATED_TYPE_COUNT,
  79. //IL2CPP_STAT_DELEGATE_CREATIONS,
  80. //IL2CPP_STAT_MINOR_GC_COUNT,
  81. //IL2CPP_STAT_MAJOR_GC_COUNT,
  82. //IL2CPP_STAT_MINOR_GC_TIME_USECS,
  83. //IL2CPP_STAT_MAJOR_GC_TIME_USECS
  84. };
  85. enum Il2CppRuntimeUnhandledExceptionPolicy
  86. {
  87. IL2CPP_UNHANDLED_POLICY_LEGACY,
  88. IL2CPP_UNHANDLED_POLICY_CURRENT
  89. };
  90. struct Il2CppStackFrameInfo
  91. {
  92. const MethodInfo *method;
  93. };
  94. typedef struct
  95. {
  96. void* (*malloc_func)(size_t size);
  97. void* (*aligned_malloc_func)(size_t size, size_t alignment);
  98. void (*free_func)(void *ptr);
  99. void (*aligned_free_func)(void *ptr);
  100. void* (*calloc_func)(size_t nmemb, size_t size);
  101. void* (*realloc_func)(void *ptr, size_t size);
  102. void* (*aligned_realloc_func)(void *ptr, size_t size, size_t alignment);
  103. } Il2CppMemoryCallbacks;
  104. #if !__SNC__ // SNC doesn't like the following define: "warning 1576: predefined meaning of __has_feature discarded"
  105. #ifndef __has_feature // clang specific __has_feature check
  106. #define __has_feature(x) 0 // Compatibility with non-clang compilers.
  107. #endif
  108. #endif
  109. #if _MSC_VER
  110. typedef wchar_t Il2CppChar;
  111. #elif __has_feature(cxx_unicode_literals)
  112. typedef char16_t Il2CppChar;
  113. #else
  114. typedef uint16_t Il2CppChar;
  115. #endif
  116. #if _MSC_VER
  117. typedef wchar_t Il2CppNativeChar;
  118. #define IL2CPP_NATIVE_STRING(str) L##str
  119. #else
  120. typedef char Il2CppNativeChar;
  121. #define IL2CPP_NATIVE_STRING(str) str
  122. #endif
  123. typedef void (*il2cpp_register_object_callback)(Il2CppObject** arr, int size, void* userdata);
  124. typedef void (*il2cpp_WorldChangedCallback)();
  125. typedef void (*Il2CppFrameWalkFunc) (const Il2CppStackFrameInfo *info, void *user_data);
  126. typedef void (*Il2CppProfileFunc) (Il2CppProfiler* prof);
  127. typedef void (*Il2CppProfileMethodFunc) (Il2CppProfiler* prof, const MethodInfo *method);
  128. typedef void (*Il2CppProfileAllocFunc) (Il2CppProfiler* prof, Il2CppObject *obj, Il2CppClass *klass);
  129. typedef void (*Il2CppProfileGCFunc) (Il2CppProfiler* prof, Il2CppGCEvent event, int generation);
  130. typedef void (*Il2CppProfileGCResizeFunc) (Il2CppProfiler* prof, int64_t new_size);
  131. typedef void (*Il2CppProfileFileIOFunc) (Il2CppProfiler* prof, Il2CppProfileFileIOKind kind, int count);
  132. typedef const Il2CppNativeChar* (*Il2CppSetFindPlugInCallback)(const Il2CppNativeChar*);
  133. typedef void (*Il2CppLogCallback)(const char*);
  134. struct Il2CppManagedMemorySnapshot;
  135. typedef void (*Il2CppMethodPointer)();
  136. typedef uintptr_t il2cpp_array_size_t;
  137. #define ARRAY_LENGTH_AS_INT32(a) ((int32_t)a)