1 #include <Exception.oh>
2 #define Exception__maxBacktraceSize 21
3 typeof(Exception__GetThreadState) Exception__GetThreadState;
4 
5 /* run-time meta data */
6 static RT0__ModuleDesc _mid;
7 RT0__StructDesc _td_Exception__Exception = { (RT0__Struct[]){&_td_Exception__ExceptionDesc}, NULL, NULL, &_mid, (OOC_CHAR8*)"Exception", 8, -1, 0, RT0__strPointer };
8 RT0__StructDesc _td_Exception__ExceptionDesc = { (RT0__Struct[]){&_td_Exception__ExceptionDesc}, (void*[]){(void*)Exception__ExceptionDesc_INIT,(void*)Exception__ExceptionDesc_GetMessage,(void*)Exception__ExceptionDesc_WriteBacktrace,(void*)Exception__ExceptionDesc_Name}, NULL, &_mid, (OOC_CHAR8*)"ExceptionDesc", 184, 0, 0, RT0__strRecord };
9 RT0__StructDesc _td_Exception__4465 = { (RT0__Struct[]){&RT0__ptr}, NULL, NULL, &_mid, NULL, 168, 21, 0, RT0__strArray };
10 RT0__StructDesc _td_Exception__Checked = { (RT0__Struct[]){&_td_Exception__CheckedDesc}, NULL, NULL, &_mid, (OOC_CHAR8*)"Checked", 8, -1, 0, RT0__strPointer };
11 RT0__StructDesc _td_Exception__CheckedDesc = { (RT0__Struct[]){&_td_Exception__ExceptionDesc,&_td_Exception__CheckedDesc}, (void*[]){(void*)Exception__ExceptionDesc_INIT,(void*)Exception__ExceptionDesc_GetMessage,(void*)Exception__ExceptionDesc_WriteBacktrace,(void*)Exception__ExceptionDesc_Name}, NULL, &_mid, (OOC_CHAR8*)"CheckedDesc", 184, 1, 0, RT0__strRecord };
12 RT0__StructDesc _td_Exception__Unchecked = { (RT0__Struct[]){&_td_Exception__UncheckedDesc}, NULL, NULL, &_mid, (OOC_CHAR8*)"Unchecked", 8, -1, 0, RT0__strPointer };
13 RT0__StructDesc _td_Exception__UncheckedDesc = { (RT0__Struct[]){&_td_Exception__ExceptionDesc,&_td_Exception__UncheckedDesc}, (void*[]){(void*)Exception__ExceptionDesc_INIT,(void*)Exception__ExceptionDesc_GetMessage,(void*)Exception__ExceptionDesc_WriteBacktrace,(void*)Exception__ExceptionDesc_Name}, NULL, &_mid, (OOC_CHAR8*)"UncheckedDesc", 184, 1, 0, RT0__strRecord };
14 RT0__StructDesc _td_Exception__ContextPtr = { (RT0__Struct[]){NULL}, NULL, NULL, &_mid, (OOC_CHAR8*)"ContextPtr", 8, -1, 0, RT0__strPointer };
15 RT0__StructDesc _td_Exception__ParseError = { (RT0__Struct[]){&_td_Exception__ParseErrorDesc}, NULL, NULL, &_mid, (OOC_CHAR8*)"ParseError", 8, -1, 0, RT0__strPointer };
16 RT0__StructDesc _td_Exception__ParseErrorDesc = { (RT0__Struct[]){&_td_Exception__ExceptionDesc,&_td_Exception__ParseErrorDesc}, (void*[]){(void*)Exception__ParseErrorDesc_INIT,(void*)Exception__ExceptionDesc_GetMessage,(void*)Exception__ExceptionDesc_WriteBacktrace,(void*)Exception__ExceptionDesc_Name}, NULL, &_mid, (OOC_CHAR8*)"ParseErrorDesc", 192, 1, 0, RT0__strRecord };
17 RT0__StructDesc _td_Exception__ThreadStatePtr = { (RT0__Struct[]){NULL}, NULL, NULL, &_mid, (OOC_CHAR8*)"ThreadStatePtr", 8, -1, 0, RT0__strPointer };
18 static RT0__ModuleDesc _mid = { (OOC_CHAR8*)"Exception", (RT0__Struct[]) { &_td_Exception__Exception, &_td_Exception__ExceptionDesc, &_td_Exception__Checked, &_td_Exception__CheckedDesc, &_td_Exception__Unchecked, &_td_Exception__UncheckedDesc, &_td_Exception__ContextPtr, &_td_Exception__ParseError, &_td_Exception__ParseErrorDesc, &_td_Exception__ThreadStatePtr, NULL }, 0 };
19 
OOC_Exception_open(RT0__Module client)20 extern void OOC_Exception_open(RT0__Module client) {
21   if (_mid.openCount == 0) {
22     OOC_RT0_open(&_mid);
23     OOC_Object_open(&_mid);
24     OOC_RT0_open(&_mid);
25     OOC_Object_open(&_mid);
26 
27     RT0__RegisterModule(&_mid);
28     OOC_Exception_init();
29   }
30   _mid.openCount++;
31 }
OOC_Exception_close(RT0__Module client)32 extern void OOC_Exception_close(RT0__Module client) {
33   _mid.openCount--;
34   if (_mid.openCount == 0) {
35     OOC_Exception_destroy();
36     RT0__UnregisterModule(&_mid);
37 
38     OOC_RT0_close(&_mid);
39     OOC_Object_close(&_mid);
40     OOC_RT0_close(&_mid);
41     OOC_Object_close(&_mid);
42   }
43 }
44 
45 /* --- */
46