/test/language/ace/cecil.h

http://github.com/tybor/Liberty · C++ Header · 585 lines · 385 code · 59 blank · 141 comment · 99 complexity · 7a3e5ed75e2c77e6f33fe10f88229fcf MD5 · raw file

  1. #ifdef _BASE_H
  2. #define _HAD_BASE_H
  3. #endif
  4. /*
  5. -- ------------------------------------------------------------------------------------------------------------
  6. -- Copyright notice below. Please read.
  7. --
  8. -- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P. - University of Nancy 1 - FRANCE
  9. -- Copyright(C) 2003-2005: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
  10. --
  11. -- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
  12. --
  13. -- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
  14. -- documentation files (the "Software"), to deal in the Software without restriction, including without
  15. -- limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  16. -- the Software, and to permit persons to whom the Software is furnished to do so, subject to the following
  17. -- conditions:
  18. --
  19. -- The above copyright notice and this permission notice shall be included in all copies or substantial
  20. -- portions of the Software.
  21. --
  22. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
  23. -- LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
  24. -- EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  25. -- AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
  26. -- OR OTHER DEALINGS IN THE SOFTWARE.
  27. --
  28. -- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
  29. -- ------------------------------------------------------------------------------------------------------------
  30. */
  31. /*
  32. This file (SmartEiffel/sys/runtime/base.h) contains all basic Eiffel
  33. type definitions.
  34. This file is automatically included in the header for all modes of
  35. compilation: -boost, -no_check, -require_check, -ensure_check, ...
  36. This file is also included in the header of any cecil file (when the
  37. -cecil option is used).
  38. This file is also included in the header file of C++ wrappers (when
  39. using the external "C++" clause).
  40. */
  41. #ifndef _BASE_H
  42. #define _BASE_H
  43. #if defined(_MSC_VER) && (_MSC_VER >= 1400) /* VC8+ */
  44. # ifndef _CRT_SECURE_NO_DEPRECATE
  45. # define _CRT_SECURE_NO_DEPRECATE
  46. # endif
  47. # ifndef _CRT_NONSTDC_NO_DEPRECATE
  48. # define _CRT_NONSTDC_NO_DEPRECATE
  49. # endif
  50. #endif /* VC8+ */
  51. #include <stdio.h>
  52. #include <string.h>
  53. #include <math.h>
  54. #include <stdlib.h>
  55. #include <signal.h>
  56. #include <stddef.h>
  57. #include <stdarg.h>
  58. #include <limits.h>
  59. #include <float.h>
  60. #include <setjmp.h>
  61. #include <sys/types.h>
  62. #include <sys/stat.h>
  63. #include <fcntl.h>
  64. #if defined __USE_POSIX || defined __unix__ || defined _POSIX_C_SOURCE
  65. # include <unistd.h>
  66. #endif
  67. #if !defined(WIN32) && \
  68. (defined(WINVER) || defined(_WIN32_WINNT) || defined(_WIN32) || \
  69. defined(__WIN32__) || defined(__TOS_WIN__) || defined(_MSC_VER))
  70. # define WIN32 1
  71. #endif
  72. #ifdef WIN32
  73. # include <windows.h>
  74. #else
  75. # ifndef O_RDONLY
  76. # include <sys/file.h>
  77. # endif
  78. # ifndef O_RDONLY
  79. # define O_RDONLY 0000
  80. # endif
  81. #endif
  82. #if defined(_MSC_VER) && (_MSC_VER < 1600) /* MSVC older than v10 */
  83. typedef signed char int8_t;
  84. typedef signed short int16_t;
  85. typedef signed int int32_t;
  86. typedef signed __int64 int64_t;
  87. typedef unsigned char uint8_t;
  88. typedef unsigned short uint16_t;
  89. typedef unsigned int uint32_t;
  90. typedef unsigned __int64 uint64_t;
  91. # define PRId8 "d"
  92. # define PRId16 "d"
  93. # define PRId32 "d"
  94. # define PRId64 "I64d"
  95. # define INT8_C(c) c
  96. # define INT16_C(c) c
  97. # define INT32_C(c) c
  98. # define INT64_C(c) c ## i64
  99. #elif defined(__WATCOMC__) && (__WATCOMC__ <= 1220) /* WATCOM 12.2 or lower */
  100. typedef signed char int8_t;
  101. typedef signed short int16_t;
  102. typedef signed long int int32_t;
  103. typedef signed __int64 int64_t;
  104. typedef unsigned char uint8_t;
  105. typedef unsigned short uint16_t;
  106. typedef unsigned long int uint32_t;
  107. typedef unsigned __int64 uint64_t;
  108. # define PRId8 "d"
  109. # define PRId16 "d"
  110. # define PRId32 "d"
  111. # define PRId64 "Ld"
  112. # define INT8_C(c) c
  113. # define INT16_C(c) c
  114. # define INT32_C(c) c ## L
  115. # define INT64_C(c) c ## i64
  116. #elif defined(__BORLANDC__) && (__BORLANDC__ < 0x600) /* Borland before 6.0 */
  117. typedef signed char int8_t;
  118. typedef signed short int16_t;
  119. typedef signed long int int32_t;
  120. typedef signed __int64 int64_t;
  121. typedef unsigned char uint8_t;
  122. typedef unsigned short uint16_t;
  123. typedef unsigned long int uint32_t;
  124. typedef unsigned __int64 uint64_t;
  125. # define PRId8 "d"
  126. # define PRId16 "d"
  127. # define PRId32 "ld"
  128. # define PRId64 "I64Ld"
  129. # define INT8_C(c) c
  130. # define INT16_C(c) c
  131. # define INT32_C(c) c ## L
  132. # define INT64_C(c) c ## i64
  133. #elif defined(__FreeBSD__) && (__FreeBSD__ < 5) /* FreeBSD before 5.0 */ && !defined (_SYS_INTTYPES_H_)
  134. typedef signed char int8_t;
  135. typedef signed short int16_t;
  136. typedef signed long int int32_t;
  137. typedef signed long long int int64_t;
  138. typedef unsigned char uint8_t;
  139. typedef unsigned short uint16_t;
  140. typedef unsigned long int uint32_t;
  141. typedef unsigned long long int uint64_t;
  142. #elif defined(__CYGWIN__) && defined(__BIT_TYPES_DEFINED__) /* Cygwin defines intxx_t in sys/types.h instead of inttypes.h */
  143. # include <cygwin/version.h>
  144. # if defined(CYGWIN_VERSION_DLL_MAJOR) && (CYGWIN_VERSION_DLL_MAJOR<1005)
  145. typedef unsigned char uint8_t;
  146. typedef __uint16_t uint16_t;
  147. typedef __uint32_t uint32_t;
  148. typedef __uint64_t uint64_t;
  149. # endif
  150. #elif defined(SASC)
  151. # error("Too old SAS/C compiler, sorry.");
  152. #elif defined(__SASC__)
  153. # if (__SASC__ < 750 ) /* SAS/C before 7.50 */
  154. typedef signed char int8_t;
  155. typedef signed short int16_t;
  156. typedef signed long int int32_t;
  157. typedef signed long long int int64_t;
  158. typedef unsigned char uint8_t;
  159. typedef unsigned short uint16_t;
  160. typedef unsigned long int uint32_t;
  161. typedef unsigned long long int uint64_t;
  162. # endif
  163. #else
  164. # include <inttypes.h>
  165. # if !defined(INT8_MAX) && defined(INT16_MAX)
  166. /* int8_t is not mandatory */
  167. typedef int_least8_t int8_t;
  168. # endif
  169. #endif
  170. #if !defined(PRId16)
  171. # define PRId8 "d"
  172. # define PRId16 "d"
  173. # define PRId32 "ld"
  174. # define PRId64 "lld"
  175. #elif !defined(PRId8)
  176. # define PRId8 "d"
  177. #endif
  178. #if !defined(INT16_C)
  179. # define INT8_C(c) c
  180. # define INT16_C(c) c
  181. # define INT32_C(c) c ## L
  182. # define INT64_C(c) c ## LL
  183. #elif !defined(INT8_C)
  184. # define INT8_C(c) c
  185. #endif
  186. #if !defined(INT16_MIN)
  187. # define INT8_MIN (-INT8_C(127)-1)
  188. # define INT8_MAX (INT8_C(127))
  189. # define INT16_MIN (-INT16_C(32767)-1)
  190. # define INT16_MAX (INT16_C(32767))
  191. # define INT32_MIN (-INT32_C(2147483647)-1)
  192. # define INT32_MAX (INT32_C(2147483647))
  193. # define INT64_MIN (-INT64_C(9223372036854775807)-1)
  194. # define INT64_MAX (INT64_C(9223372036854775807))
  195. #elif !defined(INT8_MIN)
  196. # define INT8_MIN (-INT8_C(127)-1)
  197. #endif
  198. /*
  199. Endian stuff
  200. */
  201. #if defined(BSD) && (BSD >= 199103)
  202. # include <machine/endian.h>
  203. #elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA)
  204. /* bi-endian processor, current mode should be find in machine/endian.h file */
  205. # include <machine/endian.h>
  206. #elif defined(linux)
  207. # include <endian.h>
  208. #endif
  209. #if !defined(BYTE_ORDER) && defined(__BYTE_ORDER)
  210. # define BYTE_ORDER __BYTE_ORDER
  211. #endif
  212. #if !defined(LITTLE_ENDIAN) && defined(__LITTLE_ENDIAN)
  213. # define LITTLE_ENDIAN __LITTLE_ENDIAN
  214. #endif
  215. #if !defined(BIG_ENDIAN) && defined(__BIG_ENDIAN)
  216. # define BIG_ENDIAN __BIG_ENDIAN
  217. #endif
  218. #if !defined(LITTLE_ENDIAN)
  219. # define LITTLE_ENDIAN 1234 /* LSB first (vax, pc) */
  220. #endif
  221. #if !defined(BIG_ENDIAN)
  222. # define BIG_ENDIAN 4321 /* MSB first (IBM, net) */
  223. #endif
  224. #if !defined(PDP_ENDIAN)
  225. # define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */
  226. #endif
  227. #if !defined(BYTE_ORDER) && defined(BIT_ZERO_ON_RIGHT)
  228. # define BYTE_ORDER LITTLE_ENDIAN
  229. #elif !defined(BYTE_ORDER) && defined(BIT_ZERO_ON_LEFT)
  230. # define BYTE_ORDER BIG_ENDIAN
  231. #elif !defined(BYTE_ORDER)
  232. /* ARM */
  233. # if defined(__ARMEL__)
  234. # define BYTE_ORDER LITTLE_ENDIAN
  235. # elif defined(__ARMEB__)
  236. # define BYTE_ORDER BIG_ENDIAN
  237. # elif defined(__arm__)
  238. # error "ARMs are bi-endian processors. Endianness is unknown for this system, please drop an e-mail to SmartEiffel@loria.fr"
  239. # endif
  240. /* HP RISC */
  241. # if defined(__hppa__) || defined(__hppa) || defined(__hp9000) || \
  242. defined(__hp9000s300) || defined(hp9000s300) || \
  243. defined(__hp9000s700) || defined(hp9000s700) || \
  244. defined(__hp9000s800) || defined(hp9000s800) || defined(hp9000s820)
  245. # define BYTE_ORDER BIG_ENDIAN
  246. # endif
  247. /* IBM */
  248. # if defined(ibm032) || defined(ibm370) || defined(_IBMR2) || \
  249. defined(IBM370) || defined(__MVS__)
  250. # define BYTE_ORDER BIG_ENDIAN
  251. # endif
  252. /* Intel x86 */
  253. # if defined(i386) || defined(__i386__) || defined(__i386) || \
  254. defined(_M_IX86) || defined(_X86_) || defined(__THW_INTEL) || \
  255. defined(sun386)
  256. # define BYTE_ORDER LITTLE_ENDIAN
  257. # endif
  258. /* Intel Itanium */
  259. # if defined(__ia64__) || defined(_IA64) || defined(__IA64__) || \
  260. defined(_M_IA64)
  261. # define BYTE_ORDER LITTLE_ENDIAN
  262. # endif
  263. /* Nationnal Semiconductor 32000 serie */
  264. # if defined(ns32000)
  265. # define BYTE_ORDER LITTLE_ENDIAN
  266. # endif
  267. /* Motorola 68000 */
  268. # if defined(mc68000) || defined(is68k) || defined(macII) || defined(m68k)
  269. # define BYTE_ORDER BIG_ENDIAN
  270. # endif
  271. /* MIPS */
  272. # if defined(MIPSEL) || defined(_MIPSEL)
  273. # define BYTE_ORDER LITTLE_ENDIAN
  274. # elif defined(MIPSEB) || defined(_MIPSEB)
  275. # define BYTE_ORDER BIG_ENDIAN
  276. # elif defined(__mips__) || defined(__mips) || defined(__MIPS__)
  277. # error "MIPS are bi-endian processors. Endianness is unknown for this system, please drop an e-mail to SmartEiffel@loria.fr"
  278. # endif
  279. /* Power PC */
  280. /* this processor is bi-endian, how to know if little-endian is set? */
  281. # if defined(__powerpc) || defined(__powerpc__) || defined(__POWERPC__) || \
  282. defined(__ppc__) || defined(__ppc) || defined(_M_PPC) || \
  283. defined(__PPC) || defined(__PPC__)
  284. # define BYTE_ORDER BIG_ENDIAN
  285. # endif
  286. /* Pyramid 9810 */
  287. # if defined(pyr)
  288. # define BYTE_ORDER BIG_ENDIAN
  289. # endif
  290. /* RS/6000 */
  291. # if defined(__THW_RS6000) || defined(_IBMR2) || defined(_POWER) || \
  292. defined(_ARCH_PWR) || defined(_ARCH_PWR2)
  293. # define BYTE_ORDER BIG_ENDIAN
  294. # endif
  295. /* SPARC */
  296. # if defined(__sparc__) || defined(sparc) || defined(__sparc)
  297. # define BYTE_ORDER BIG_ENDIAN
  298. # endif
  299. /* CCI Tahoe */
  300. # if defined(tahoe)
  301. # define BYTE_ORDER BIG_ENDIAN
  302. # endif
  303. /* VAX */
  304. # if defined(vax) || defined(VAX) || defined(__vax__) || defined(_vax_) || \
  305. defined(__vax) || defined(__VAX)
  306. # define BYTE_ORDER LITTLE_ENDIAN
  307. # endif
  308. /* ELATE is a virtual OS with a little endian Virtual Processor */
  309. # if defined(__ELATE__)
  310. # define BYTE_ORDER LITTLE_ENDIAN
  311. # endif
  312. /* Miscellaneous little endian */
  313. # if defined(wrltitan)
  314. # define BYTE_ORDER LITTLE_ENDIAN
  315. # endif
  316. /* Miscellaneous big endian */
  317. # if defined(apollo) || defined(__convex__) || defined(_CRAY) || defined(sel)
  318. # define BYTE_ORDER BIG_ENDIAN
  319. # endif
  320. #endif
  321. #if !defined(BYTE_ORDER)
  322. # error "Unknown byte order. Add your system in above macros once you know your system type. Please drop an e-mail to SmartEiffel@loria.fr"
  323. #endif
  324. #if (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN)
  325. # error "Only little-endian and big-endian are valid at this time. Please drop an e-mail to SmartEiffel@loria.fr"
  326. #endif
  327. /*
  328. Byte swapping stuff
  329. */
  330. extern void copy_swap_16(const uint16_t *src, uint16_t *dest, int count);
  331. /* Because ANSI C EXIT_* are not always defined: */
  332. #ifndef EXIT_FAILURE
  333. # define EXIT_FAILURE 1
  334. #endif
  335. #ifndef EXIT_SUCCESS
  336. # define EXIT_SUCCESS 0
  337. #endif
  338. /*
  339. On Linux glibc systems, we need to use sig.* versions of jmp_buf,
  340. setjmp and longjmp to preserve the signal handling context.
  341. Currently, the way I figured to detect this is if _SIGSET_H_types has
  342. been defined in /usr/include/setjmp.h.
  343. NOTE: with gcc, -ansi is used for SmartEiffel generated files EXCEPT in
  344. -no_split mode. ANSI only recognizes the non-sig versions.
  345. */
  346. #if (defined(_SIGSET_H_types) && !defined(__STRICT_ANSI__))
  347. # define JMP_BUF sigjmp_buf
  348. # define SETJMP(x) sigsetjmp( (x), 1)
  349. # define LONGJMP siglongjmp
  350. #else
  351. # define JMP_BUF jmp_buf
  352. # define SETJMP(x) setjmp( (x) )
  353. # define LONGJMP longjmp
  354. #endif
  355. /*
  356. Type to store reference objects Id:
  357. */
  358. typedef int Tid;
  359. typedef struct S0 T0;
  360. struct S0{Tid id;};
  361. /*
  362. The default channel used to print runtime error messages:
  363. */
  364. #define SE_ERR stderr
  365. /*
  366. Eiffel type INTEGER_8 is #1:
  367. */
  368. typedef int8_t T1;
  369. #define EIF_INTEGER_8 T1
  370. #define M1 (INT8_C(0))
  371. #define EIF_INTEGER_8_BITS (CHAR_BIT)
  372. #define EIF_MINIMUM_INTEGER_8 (INT8_MIN)
  373. #define EIF_MAXIMUM_INTEGER_8 (INT8_MAX)
  374. /*
  375. Eiffel type INTEGER_16 is #10:
  376. */
  377. typedef int16_t T10;
  378. #define EIF_INTEGER_16 T10
  379. #define M10 (INT16_C(0))
  380. #define EIF_INTEGER_16_BITS (CHAR_BIT*sizeof(T10t))
  381. #define EIF_MINIMUM_INTEGER_16 (INT16_MIN) /*-32768*/
  382. #define EIF_MAXIMUM_INTEGER_16 (INT16_MAX) /*+32767*/
  383. /*
  384. Eiffel type INTEGER or INTEGER_32 is #2:
  385. */
  386. typedef int32_t T2;
  387. #define EIF_INTEGER T2
  388. #define EIF_INTEGER_32 T2
  389. #define M2 (INT32_C(0))
  390. #define EIF_INTEGER_BITS ((T2)(CHAR_BIT*sizeof(T2)))
  391. #define EIF_INTEGER_32_BITS EIF_INTEGER_BITS
  392. #define EIF_MINIMUM_INTEGER (INT32_MIN)
  393. #define EIF_MAXIMUM_INTEGER (INT32_MAX)
  394. /*
  395. Eiffel type INTEGER_64 is #11:
  396. */
  397. typedef int64_t T11;
  398. #define EIF_INTEGER_64 T11
  399. #define M11 (INT64_C(0))
  400. #define EIF_INTEGER_64_BITS (CHAR_BIT*sizeof(T11))
  401. #define EIF_MINIMUM_INTEGER_64 (INT64_MIN)
  402. #define EIF_MAXIMUM_INTEGER_64 (INT64_MAX)
  403. /*
  404. Eiffel type CHARACTER is #3:
  405. */
  406. typedef unsigned char T3;
  407. #define EIF_CHARACTER T3
  408. #define M3 (0)
  409. #define EIF_CHARACTER_BITS (CHAR_BIT)
  410. #define EIF_MINIMUM_CHARACTER_CODE (0)
  411. #define EIF_MAXIMUM_CHARACTER_CODE (255)
  412. #define T3code(x) ((T10)(x))
  413. #define T3to_integer(x) ((signed char)(x))
  414. #define T3to_integer_8(x) ((signed char)(x))
  415. #define T3to_bit(x) (x)
  416. /*
  417. Eiffel type REAL_32 is #4:
  418. */
  419. typedef float T4;
  420. typedef T4 real32_t;
  421. #define EIF_REAL_32 T4
  422. #define M4 (0.0)
  423. #define EIF_MINIMUM_REAL_32 (-(FLT_MAX))
  424. #define EIF_MAXIMUM_REAL_32 (FLT_MAX)
  425. /*
  426. Eiffel type REAL or REAL_64 is #5:
  427. */
  428. typedef double T5;
  429. typedef T5 real64_t;
  430. #define EIF_REAL_64 T5
  431. #define M5 (0.0)
  432. #define EIF_MINIMUM_REAL_64 (-(DBL_MAX))
  433. #define EIF_MINIMUM_REAL (EIF_MINIMUM_REAL_64)
  434. #define EIF_MAXIMUM_REAL_64 (DBL_MAX)
  435. #define EIF_MAXIMUM_REAL (EIF_MAXIMUM_REAL_64)
  436. /*
  437. Eiffel type REAL_EXTENDED is #12:
  438. */
  439. typedef long double T12;
  440. typedef T12 real_extended_t;
  441. #define EIF_REAL_EXTENDED T12
  442. #define M12 (0.0)
  443. #define EIF_MINIMUM_REAL_EXTENDED (-(DBL_MAX))
  444. #define EIF_MAXIMUM_REAL_EXTENDED (DBL_MAX)
  445. /*
  446. Eiffel type BOOLEAN is #6:
  447. */
  448. typedef char T6;
  449. #define EIF_BOOLEAN T6
  450. #define M6 (0)
  451. #define EIF_BOOLEAN_BITS (CHAR_BIT)
  452. /*
  453. Eiffel type POINTER is #8:
  454. */
  455. typedef void* T8;
  456. #define EIF_POINTER T8
  457. /* Sometimes, NULL is defined as 0 */
  458. #define M8 ((void*)NULL)
  459. #define EIF_POINTER_BITS (CHAR_BIT*sizeof(void*))
  460. /*
  461. To use type STRING on the C side:
  462. */
  463. #define EIF_STRING T7*
  464. /*
  465. Some Other EIF_* defined in ETL:
  466. */
  467. #define eif_access(x) ((char*)(x))
  468. #define EIF_REFERENCE T0*
  469. #define EIF_OBJ T0*
  470. #define EIF_OBJECT EIF_OBJ
  471. /*
  472. Wrappers for `malloc' and `calloc':
  473. */
  474. void* se_malloc(size_t size);
  475. void* se_calloc(size_t nmemb, size_t size);
  476. void* se_realloc(void* src, size_t size);
  477. /*
  478. die method.
  479. */
  480. void se_die(int code);
  481. /*
  482. Runtime hooks. They allow different runtime modules to be quite independant. In time, they will also allow
  483. thread-safe operations.
  484. Currently known modules:
  485. - boost
  486. - no_check
  487. - sedb
  488. - gc
  489. - print stack
  490. - profile
  491. - plugins
  492. However, currently only profile uses this method. It will be extended to other modules later.
  493. The currently defined hooks are described in the enum below (the names should be self-explanatory).
  494. */
  495. typedef enum {
  496. SE_HANDLE_EXCEPTION_SET, /* called when an exception handler is set, prior to SETJMP */
  497. SE_HANDLE_EXCEPTION_CLEAR, /* called when a feature with an exception handler normally returns */
  498. SE_HANDLE_EXCEPTION_THROWN, /* called when an exception is thrown, prior to the LONGJMP */
  499. SE_HANDLE_ENTER_GC, /* called when gc_start() begins */
  500. SE_HANDLE_EXIT_GC, /* called when gc_start() ends */
  501. SE_HANDLE_ENTER_PRINT_STACK, /* called when se_print_run_time_stack() begins */
  502. SE_HANDLE_EXIT_PRINT_STACK, /* called when se_print_run_time_stack() ends */
  503. SE_HANDLE_NO_MORE_MEMORY, /* called by se_alloc() and co */
  504. SE_HANDLE_SEDB_BREAK, /* called when sedb stops the program */
  505. SE_HANDLE_SEDB_CONTINUE, /* called when sedb continues the program */
  506. SE_HANDLE_RUNTIME_ERROR, /* called when a runtime error is raised and not caught by an exception. Cannot be raised in boost mode. */
  507. SE_HANDLE_DIE_WITH_CODE, /* called when the program is stopped by the die_with_code feature. The data points to the int code. */
  508. SE_HANDLE_NORMAL_EXIT /* called when the program correctly terminates. The data is null. */
  509. } se_handler_action_t;
  510. extern int handlers_count;
  511. typedef void se_runtime_handler_t(se_handler_action_t action, void*data);
  512. void register_handler(se_runtime_handler_t*handler);
  513. void _handle(se_handler_action_t action, void*data);
  514. #define handle(action,data) do{if(handlers_count>0)_handle(action,data);}while(0)
  515. #endif /* #ifndef _BASE_H */
  516. #ifndef _HAD_BASE_H
  517. extern void*eiffel_root_object;
  518. typedef T3*T9;
  519. #endif
  520. /* Available Eiffel routines via -cecil:
  521. */
  522. T2 se_call(void* C);