PageRenderTime 69ms CodeModel.GetById 43ms app.highlight 20ms RepoModel.GetById 1ms app.codeStats 1ms

/test/language/unclassified/test_overload01.h

http://github.com/tybor/Liberty
C++ Header | 773 lines | 501 code | 63 blank | 209 comment | 101 complexity | 145a757e7d3c57f182eb5065270fd325 MD5 | raw file
  1#ifdef __cplusplus
  2extern "C" {
  3#endif
  4/*
  5ANSI C code generated by SmartEiffel The GNU Eiffel Compiler, Eiffel tools and libraries
  6Release 2.4 (??? June ??th 2008) [????]
  7Copyright (C), 1994-2002 - INRIA - LORIA - ESIAL UHP Nancy 1 - FRANCE
  8Copyright (C), 2003-2005 - INRIA - LORIA - IUT Charlemagne Nancy 2 - FRANCE
  9D.COLNET, P.RIBET, C.ADRIAN, V.CROIZIER F.MERIZEN - SmartEiffel@loria.fr
 10http://SmartEiffel.loria.fr
 11C Compiler options used: -pipe -Os
 12*/
 13
 14/*
 15-- ------------------------------------------------------------------------------------------------------------
 16-- Copyright notice below. Please read.
 17--
 18-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P.       - University of Nancy 1 - FRANCE
 19-- Copyright(C) 2003-2005: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
 20--
 21-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
 22--
 23-- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 24-- documentation files (the "Software"), to deal in the Software without restriction, including without
 25-- limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
 26-- the Software, and to permit persons to whom the Software is furnished to do so, subject to the following
 27-- conditions:
 28--
 29-- The above copyright notice and this permission notice shall be included in all copies or substantial
 30-- portions of the Software.
 31--
 32-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 33-- LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
 34-- EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
 35-- AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
 36-- OR OTHER DEALINGS IN THE SOFTWARE.
 37--
 38-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
 39-- ------------------------------------------------------------------------------------------------------------
 40*/
 41/*
 42  This file (SmartEiffel/sys/runtime/base.h) contains all basic Eiffel
 43  type definitions.
 44  This file is automatically included in the header for all modes of
 45  compilation: -boost, -no_check, -require_check, -ensure_check, ...
 46  This file is also included in the header of any cecil file (when the
 47  -cecil option is used).
 48  This file is also included in the header file of C++ wrappers (when
 49  using the external "C++" clause).
 50*/
 51
 52#ifndef _BASE_H
 53#define _BASE_H
 54
 55#if defined(_MSC_VER) && (_MSC_VER >= 1400)       /* VC8+ */
 56# ifndef _CRT_SECURE_NO_DEPRECATE
 57#  define _CRT_SECURE_NO_DEPRECATE
 58# endif
 59# ifndef _CRT_NONSTDC_NO_DEPRECATE
 60#  define _CRT_NONSTDC_NO_DEPRECATE
 61# endif
 62#endif   /* VC8+ */
 63
 64#include <stdio.h>
 65#include <string.h>
 66#include <math.h>
 67#include <stdlib.h>
 68#include <signal.h>
 69#include <stddef.h>
 70#include <stdarg.h>
 71#include <limits.h>
 72#include <float.h>
 73#include <setjmp.h>
 74#include <sys/types.h>
 75#include <sys/stat.h>
 76#include <fcntl.h>
 77#if defined __USE_POSIX || defined __unix__ || defined _POSIX_C_SOURCE
 78#  include <unistd.h>
 79#endif
 80#if !defined(WIN32) && \
 81       (defined(WINVER) || defined(_WIN32_WINNT) || defined(_WIN32) || \
 82	defined(__WIN32__) || defined(__TOS_WIN__) || defined(_MSC_VER))
 83#  define WIN32 1
 84#endif
 85#ifdef WIN32
 86#  include <windows.h>
 87#else
 88#  ifndef O_RDONLY
 89#    include <sys/file.h>
 90#  endif
 91#  ifndef O_RDONLY
 92#    define O_RDONLY 0000
 93#  endif
 94#endif
 95
 96#if defined(_MSC_VER) && (_MSC_VER < 1600) /* MSVC older than v10 */
 97typedef signed char int8_t;
 98typedef signed short int16_t;
 99typedef signed int int32_t;
100typedef signed __int64 int64_t;
101typedef unsigned char uint8_t;
102typedef unsigned short uint16_t;
103typedef unsigned int uint32_t;
104typedef unsigned __int64 uint64_t;
105#  define PRId8 "d"
106#  define PRId16 "d"
107#  define PRId32 "d"
108#  define PRId64 "I64d"
109#  define INT8_C(c) c
110#  define INT16_C(c) c
111#  define INT32_C(c) c
112#  define INT64_C(c) c ## i64
113#elif defined(__WATCOMC__) && (__WATCOMC__ <= 1220) /* WATCOM 12.2 or lower */
114typedef signed char int8_t;
115typedef signed short int16_t;
116typedef signed long int int32_t;
117typedef signed __int64 int64_t;
118typedef unsigned char uint8_t;
119typedef unsigned short uint16_t;
120typedef unsigned long int uint32_t;
121typedef unsigned __int64 uint64_t;
122#  define PRId8 "d"
123#  define PRId16 "d"
124#  define PRId32 "d"
125#  define PRId64 "Ld"
126#  define INT8_C(c) c
127#  define INT16_C(c) c
128#  define INT32_C(c) c ## L
129#  define INT64_C(c) c ## i64
130#elif defined(__BORLANDC__) && (__BORLANDC__ < 0x600) /* Borland before 6.0 */
131typedef signed char int8_t;
132typedef signed short int16_t;
133typedef signed long int int32_t;
134typedef signed __int64 int64_t;
135typedef unsigned char uint8_t;
136typedef unsigned short uint16_t;
137typedef unsigned long int uint32_t;
138typedef unsigned __int64 uint64_t;
139#  define PRId8 "d"
140#  define PRId16 "d"
141#  define PRId32 "ld"
142#  define PRId64 "I64Ld"
143#  define INT8_C(c) c
144#  define INT16_C(c) c
145#  define INT32_C(c) c ## L
146#  define INT64_C(c) c ## i64
147#elif defined(__FreeBSD__) && (__FreeBSD__ < 5) /* FreeBSD before 5.0 */ && !defined (_SYS_INTTYPES_H_)
148typedef signed char int8_t;
149typedef signed short int16_t;
150typedef signed long int int32_t;
151typedef signed long long int int64_t;
152typedef unsigned char uint8_t;
153typedef unsigned short uint16_t;
154typedef unsigned long int uint32_t;
155typedef unsigned long long int uint64_t;
156#elif defined(__CYGWIN__) && defined(__BIT_TYPES_DEFINED__) /* Cygwin defines intxx_t in sys/types.h instead of inttypes.h */
157#  include <cygwin/version.h>
158#  if defined(CYGWIN_VERSION_DLL_MAJOR) && (CYGWIN_VERSION_DLL_MAJOR<1005)
159typedef unsigned char uint8_t;
160typedef __uint16_t uint16_t;
161typedef __uint32_t uint32_t;
162typedef __uint64_t uint64_t;
163#  endif
164#elif defined(SASC)
165#    error("Too old SAS/C compiler, sorry.");
166#elif defined(__SASC__)
167#  if (__SASC__ < 750 ) /*  SAS/C before 7.50 */
168typedef signed char int8_t;
169typedef signed short int16_t;
170typedef signed long int int32_t;
171typedef signed long long int int64_t;
172typedef unsigned char uint8_t;
173typedef unsigned short uint16_t;
174typedef unsigned long int uint32_t;
175typedef unsigned long long int uint64_t;
176#  endif
177#else
178#  include <inttypes.h>
179#  if !defined(INT8_MAX) && defined(INT16_MAX)
180/* int8_t is not mandatory */
181typedef int_least8_t int8_t;
182#  endif
183#endif
184
185#if !defined(PRId16)
186#  define PRId8 "d"
187#  define PRId16 "d"
188#  define PRId32 "ld"
189#  define PRId64 "lld"
190#elif !defined(PRId8)
191#  define PRId8 "d"
192#endif
193#if !defined(INT16_C)
194#  define INT8_C(c) c
195#  define INT16_C(c) c
196#  define INT32_C(c) c ## L
197#  define INT64_C(c) c ## LL
198#elif !defined(INT8_C)
199#  define INT8_C(c) c
200#endif
201#if !defined(INT16_MIN)
202#  define INT8_MIN (-INT8_C(127)-1)
203#  define INT8_MAX (INT8_C(127))
204#  define INT16_MIN (-INT16_C(32767)-1)
205#  define INT16_MAX (INT16_C(32767))
206#  define INT32_MIN (-INT32_C(2147483647)-1)
207#  define INT32_MAX (INT32_C(2147483647))
208#  define INT64_MIN (-INT64_C(9223372036854775807)-1)
209#  define INT64_MAX (INT64_C(9223372036854775807))
210#elif !defined(INT8_MIN)
211#  define INT8_MIN (-INT8_C(127)-1)
212#endif
213
214
215/*
216  Endian stuff
217*/
218#if defined(BSD) && (BSD >= 199103)
219#  include <machine/endian.h>
220#elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA)
221/* bi-endian processor, current mode should be find in machine/endian.h file */
222#  include <machine/endian.h>
223#elif defined(linux)
224#  include <endian.h>
225#endif
226
227
228
229#if !defined(BYTE_ORDER) && defined(__BYTE_ORDER)
230#  define BYTE_ORDER      __BYTE_ORDER
231#endif
232
233#if !defined(LITTLE_ENDIAN) && defined(__LITTLE_ENDIAN)
234#  define LITTLE_ENDIAN      __LITTLE_ENDIAN
235#endif
236
237#if !defined(BIG_ENDIAN) && defined(__BIG_ENDIAN)
238#  define BIG_ENDIAN      __BIG_ENDIAN
239#endif
240
241#if !defined(LITTLE_ENDIAN)
242#  define LITTLE_ENDIAN   1234    /* LSB first (vax, pc) */
243#endif
244#if !defined(BIG_ENDIAN)
245#  define BIG_ENDIAN      4321    /* MSB first (IBM, net) */
246#endif
247#if !defined(PDP_ENDIAN)
248#  define PDP_ENDIAN      3412    /* LSB first in word, MSW first in long */
249#endif
250
251#if !defined(BYTE_ORDER) && defined(BIT_ZERO_ON_RIGHT)
252#  define BYTE_ORDER      LITTLE_ENDIAN
253#elif !defined(BYTE_ORDER) && defined(BIT_ZERO_ON_LEFT)
254#  define BYTE_ORDER      BIG_ENDIAN
255#elif !defined(BYTE_ORDER)
256
257/* ARM */
258#  if defined(__ARMEL__)
259#    define BYTE_ORDER      LITTLE_ENDIAN
260#  elif defined(__ARMEB__)
261#    define BYTE_ORDER      BIG_ENDIAN
262#  elif defined(__arm__)
263#    error "ARMs are bi-endian processors. Endianness is unknown for this system, please drop an e-mail to SmartEiffel@loria.fr"
264#  endif
265
266/* HP RISC */
267#  if defined(__hppa__) || defined(__hppa) || defined(__hp9000) || \
268      defined(__hp9000s300) || defined(hp9000s300) || \
269      defined(__hp9000s700) || defined(hp9000s700) || \
270      defined(__hp9000s800) || defined(hp9000s800) || defined(hp9000s820)
271#    define BYTE_ORDER      BIG_ENDIAN
272#  endif
273
274/* IBM */
275#  if defined(ibm032) || defined(ibm370) || defined(_IBMR2) || \
276      defined(IBM370) || defined(__MVS__)
277#    define BYTE_ORDER      BIG_ENDIAN
278#  endif
279
280/* Intel x86 */
281#  if defined(i386) || defined(__i386__) || defined(__i386) || \
282      defined(_M_IX86) || defined(_X86_) || defined(__THW_INTEL) || \
283      defined(sun386)
284#    define BYTE_ORDER      LITTLE_ENDIAN
285#  endif
286
287/* Intel Itanium */
288#  if defined(__ia64__) || defined(_IA64) || defined(__IA64__) || \
289      defined(_M_IA64)
290#    define BYTE_ORDER      LITTLE_ENDIAN
291#  endif
292
293/* Nationnal Semiconductor 32000 serie */
294#  if  defined(ns32000)
295#    define BYTE_ORDER      LITTLE_ENDIAN
296#  endif
297
298/* Motorola 68000 */
299#  if defined(mc68000) || defined(is68k) || defined(macII) || defined(m68k)
300#    define BYTE_ORDER      BIG_ENDIAN
301#  endif
302
303/* MIPS */
304#  if defined(MIPSEL) || defined(_MIPSEL)
305#    define BYTE_ORDER      LITTLE_ENDIAN
306#  elif defined(MIPSEB) || defined(_MIPSEB)
307#    define BYTE_ORDER      BIG_ENDIAN
308#  elif defined(__mips__) || defined(__mips) || defined(__MIPS__)
309#    error "MIPS are bi-endian processors. Endianness is unknown for this system, please drop an e-mail to SmartEiffel@loria.fr"
310#  endif
311
312/* Power PC */
313/* this processor is bi-endian, how to know if little-endian is set? */
314#  if defined(__powerpc) || defined(__powerpc__) || defined(__POWERPC__) || \
315      defined(__ppc__) || defined(__ppc) || defined(_M_PPC) || \
316      defined(__PPC) || defined(__PPC__)
317#    define BYTE_ORDER      BIG_ENDIAN
318#  endif
319
320/* Pyramid 9810 */
321#  if defined(pyr)
322#    define BYTE_ORDER      BIG_ENDIAN
323#  endif
324
325/* RS/6000 */
326#  if defined(__THW_RS6000) || defined(_IBMR2) || defined(_POWER) || \
327      defined(_ARCH_PWR) || defined(_ARCH_PWR2)
328#    define BYTE_ORDER      BIG_ENDIAN
329#  endif
330
331/* SPARC */
332#  if defined(__sparc__) || defined(sparc) || defined(__sparc)
333#    define BYTE_ORDER      BIG_ENDIAN
334#  endif
335
336/* CCI Tahoe */
337#  if defined(tahoe)
338#    define BYTE_ORDER      BIG_ENDIAN
339#  endif
340
341/* VAX */
342#  if defined(vax) || defined(VAX) || defined(__vax__) || defined(_vax_) || \
343      defined(__vax) || defined(__VAX)
344#    define BYTE_ORDER      LITTLE_ENDIAN
345#  endif
346
347/* ELATE is a virtual OS with a little endian Virtual Processor */
348#  if defined(__ELATE__)
349#    define BYTE_ORDER      LITTLE_ENDIAN
350#  endif
351
352/* Miscellaneous little endian */
353#  if defined(wrltitan)
354#    define BYTE_ORDER      LITTLE_ENDIAN
355#  endif
356
357/* Miscellaneous big endian */
358#  if defined(apollo) || defined(__convex__) || defined(_CRAY) || defined(sel)
359#    define BYTE_ORDER      BIG_ENDIAN
360#  endif
361#endif
362
363
364#if !defined(BYTE_ORDER)
365#  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"
366#endif
367#if (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN)
368#  error "Only little-endian and big-endian are valid at this time. Please drop an e-mail to SmartEiffel@loria.fr"
369#endif
370
371
372/*
373  Byte swapping stuff
374*/
375extern void copy_swap_16(const uint16_t *src, uint16_t *dest, int count);
376
377
378/* Because ANSI C EXIT_* are not always defined: */
379#ifndef EXIT_FAILURE
380#  define EXIT_FAILURE 1
381#endif
382#ifndef EXIT_SUCCESS
383#  define EXIT_SUCCESS 0
384#endif
385
386/*
387   On Linux glibc systems, we need to use sig.* versions of jmp_buf,
388   setjmp and longjmp to preserve the signal handling context.
389   Currently, the way I figured to detect this is if _SIGSET_H_types has
390   been defined in /usr/include/setjmp.h.
391
392   NOTE: with gcc, -ansi is used for SmartEiffel generated files EXCEPT in
393   -no_split mode. ANSI only recognizes the non-sig versions.
394*/
395#if (defined(_SIGSET_H_types) && !defined(__STRICT_ANSI__))
396#  define JMP_BUF    sigjmp_buf
397#  define SETJMP(x)  sigsetjmp( (x), 1)
398#  define LONGJMP    siglongjmp
399#else
400#  define JMP_BUF    jmp_buf
401#  define SETJMP(x)  setjmp( (x) )
402#  define LONGJMP    longjmp
403#endif
404
405/*
406   Type to store reference objects Id:
407 */
408typedef int Tid;
409typedef struct S0 T0;
410struct S0{Tid id;};
411
412/*
413   The default channel used to print runtime error messages:
414*/
415#define SE_ERR stderr
416
417/*
418   Eiffel type INTEGER_8 is #1:
419*/
420typedef int8_t T1;
421#define EIF_INTEGER_8 T1
422#define M1 (INT8_C(0))
423#define EIF_INTEGER_8_BITS (CHAR_BIT)
424#define EIF_MINIMUM_INTEGER_8 (INT8_MIN)
425#define EIF_MAXIMUM_INTEGER_8 (INT8_MAX)
426
427/*
428  Eiffel type INTEGER_16 is #10:
429*/
430typedef int16_t T10;
431#define EIF_INTEGER_16 T10
432#define M10 (INT16_C(0))
433#define EIF_INTEGER_16_BITS (CHAR_BIT*sizeof(T10t))
434#define EIF_MINIMUM_INTEGER_16 (INT16_MIN) /*-32768*/
435#define EIF_MAXIMUM_INTEGER_16 (INT16_MAX) /*+32767*/
436
437/*
438  Eiffel type INTEGER or INTEGER_32 is #2:
439*/
440typedef int32_t T2;
441#define EIF_INTEGER T2
442#define EIF_INTEGER_32 T2
443#define M2 (INT32_C(0))
444#define EIF_INTEGER_BITS ((T2)(CHAR_BIT*sizeof(T2)))
445#define EIF_INTEGER_32_BITS EIF_INTEGER_BITS
446#define EIF_MINIMUM_INTEGER (INT32_MIN)
447#define EIF_MAXIMUM_INTEGER (INT32_MAX)
448
449/*
450  Eiffel type INTEGER_64 is #11:
451*/
452typedef int64_t T11;
453#define EIF_INTEGER_64 T11
454#define M11 (INT64_C(0))
455#define EIF_INTEGER_64_BITS (CHAR_BIT*sizeof(T11))
456#define EIF_MINIMUM_INTEGER_64 (INT64_MIN)
457#define EIF_MAXIMUM_INTEGER_64 (INT64_MAX)
458
459/*
460  Eiffel type CHARACTER is #3:
461*/
462typedef unsigned char T3;
463#define EIF_CHARACTER T3
464#define M3 (0)
465#define EIF_CHARACTER_BITS (CHAR_BIT)
466#define EIF_MINIMUM_CHARACTER_CODE (0)
467#define EIF_MAXIMUM_CHARACTER_CODE (255)
468#define T3code(x) ((T10)(x))
469#define T3to_integer(x) ((signed char)(x))
470#define T3to_integer_8(x) ((signed char)(x))
471#define T3to_bit(x) (x)
472
473/*
474  Eiffel type REAL_32 is #4:
475*/
476typedef float T4;
477typedef T4 real32_t;
478#define EIF_REAL_32 T4
479#define M4 (0.0)
480#define EIF_MINIMUM_REAL_32 (-(FLT_MAX))
481#define EIF_MAXIMUM_REAL_32 (FLT_MAX)
482
483/*
484  Eiffel type REAL or REAL_64 is #5:
485*/
486typedef double T5;
487typedef T5 real64_t;
488#define EIF_REAL_64 T5
489#define M5 (0.0)
490#define EIF_MINIMUM_REAL_64 (-(DBL_MAX))
491#define EIF_MINIMUM_REAL (EIF_MINIMUM_REAL_64)
492#define EIF_MAXIMUM_REAL_64 (DBL_MAX)
493#define EIF_MAXIMUM_REAL (EIF_MAXIMUM_REAL_64)
494
495/*
496  Eiffel type REAL_EXTENDED is #12:
497*/
498typedef long double T12;
499typedef T12 real_extended_t;
500#define EIF_REAL_EXTENDED T12
501#define M12 (0.0)
502#define EIF_MINIMUM_REAL_EXTENDED (-(DBL_MAX))
503#define EIF_MAXIMUM_REAL_EXTENDED (DBL_MAX)
504
505/*
506  Eiffel type BOOLEAN is #6:
507*/
508typedef char T6;
509#define EIF_BOOLEAN T6
510#define M6 (0)
511#define EIF_BOOLEAN_BITS (CHAR_BIT)
512
513/*
514   Eiffel type POINTER is #8:
515*/
516typedef void* T8;
517#define EIF_POINTER T8
518/* Sometimes, NULL is defined as 0 */
519#define M8 ((void*)NULL)
520#define EIF_POINTER_BITS (CHAR_BIT*sizeof(void*))
521
522/*
523  To use type STRING on the C side:
524*/
525#define EIF_STRING T7*
526
527/*
528  Some Other EIF_* defined in ETL:
529*/
530#define eif_access(x) ((char*)(x))
531#define EIF_REFERENCE T0*
532#define EIF_OBJ T0*
533#define EIF_OBJECT EIF_OBJ
534
535/*
536   Wrappers for `malloc' and `calloc':
537*/
538void* se_malloc(size_t size);
539void* se_calloc(size_t nmemb, size_t size);
540void* se_realloc(void* src, size_t size);
541
542/*
543   die method.
544 */
545void se_die(int code);
546
547/*
548    Runtime hooks. They allow different runtime modules to be quite independant. In time, they will also allow
549    thread-safe operations.
550
551    Currently known modules:
552      - boost
553      - no_check
554      - sedb
555      - gc
556      - print stack
557      - profile
558      - plugins
559
560    However, currently only profile uses this method. It will be extended to other modules later.
561
562    The currently defined hooks are described in the enum below (the names should be self-explanatory).
563 */
564typedef enum {
565  SE_HANDLE_EXCEPTION_SET, /* called when an exception handler is set, prior to SETJMP */
566  SE_HANDLE_EXCEPTION_CLEAR, /* called when a feature with an exception handler normally returns */
567  SE_HANDLE_EXCEPTION_THROWN, /* called when an exception is thrown, prior to the LONGJMP */
568  SE_HANDLE_ENTER_GC, /* called when gc_start() begins */
569  SE_HANDLE_EXIT_GC, /* called when gc_start() ends */
570  SE_HANDLE_ENTER_PRINT_STACK, /* called when se_print_run_time_stack() begins */
571  SE_HANDLE_EXIT_PRINT_STACK, /* called when se_print_run_time_stack() ends */
572  SE_HANDLE_NO_MORE_MEMORY, /* called by se_alloc() and co */
573  SE_HANDLE_SEDB_BREAK, /* called when sedb stops the program */
574  SE_HANDLE_SEDB_CONTINUE, /* called when sedb continues the program */
575  SE_HANDLE_RUNTIME_ERROR, /* called when a runtime error is raised and not caught by an exception. Cannot be raised in boost mode. */
576  SE_HANDLE_DIE_WITH_CODE, /* called when the program is stopped by the die_with_code feature. The data points to the int code. */
577  SE_HANDLE_NORMAL_EXIT /* called when the program correctly terminates. The data is null. */
578} se_handler_action_t;
579
580extern int handlers_count;
581typedef void se_runtime_handler_t(se_handler_action_t action, void*data);
582void register_handler(se_runtime_handler_t*handler);
583void _handle(se_handler_action_t action, void*data);
584
585#define handle(action,data) do{if(handlers_count>0)_handle(action,data);}while(0)
586
587#endif /* #ifndef _BASE_H */
588#define SE_BOOST 1
589/*
590-- ------------------------------------------------------------------------------------------------------------
591-- Copyright notice below. Please read.
592--
593-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P.       - University of Nancy 1 - FRANCE
594-- Copyright(C) 2003-2005: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
595--
596-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
597--
598-- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
599-- documentation files (the "Software"), to deal in the Software without restriction, including without
600-- limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
601-- the Software, and to permit persons to whom the Software is furnished to do so, subject to the following
602-- conditions:
603--
604-- The above copyright notice and this permission notice shall be included in all copies or substantial
605-- portions of the Software.
606--
607-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
608-- LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
609-- EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
610-- AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
611-- OR OTHER DEALINGS IN THE SOFTWARE.
612--
613-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
614-- ------------------------------------------------------------------------------------------------------------
615*/
616#include <errno.h>
617
618#define text_file_read_open(p) (fopen(((char*)(p)),"r"))
619#define text_file_write_open(p) (fopen(((char*)(p)),"w"))
620#define text_file_write_append(p) (fopen(((char*)(p)),"a"))
621#define text_file_read_write_open(p) (fopen(((char*)(p)),"r+"))
622#define text_file_read_write_append(p) (fopen(((char*)(p)),"a+"))
623#define binary_file_read_open(p) (fopen(((char*)(p)),"rb"))
624#define binary_file_write_open(p) (fopen(((char*)(p)),"wb"))
625#define binary_file_write_append(p) (fopen(((char*)(p)),"ab"))
626#define io_fclose(p) (fclose((FILE*)(p)))
627#define io_flush(p) (fflush((FILE*)(p)))
628#define io_getc(f) (getc(((FILE*)(f))))
629#define io_putc(b, f) (putc((b),((FILE*)(f))))
630#define io_ungetc(b, f) (ungetc((b), (FILE*)(f)))
631#define io_fread(b, n, f) (fread((void *)(b),(size_t)(1), (size_t)(n),(FILE*)(f)))
632#define io_fwrite(b, n, f) (fwrite((void *)(b),(size_t)(1), (size_t)(n),(FILE*)(f)))
633#define io_feof(f) (feof(((FILE*)(f))))
634#define io_rename(o, n) (rename(((char*)(o)),((char*)(n))))
635#define io_remove(f) (remove(((char*)(f))))
636#define io_fseek(f, o) (fseek((FILE*)(f),(o),SEEK_SET))
637#define io_ftell(f) ((EIF_INTEGER_64)ftell((FILE*)(f)))
638
639#if defined __USE_POSIX || defined __unix__ || defined _POSIX_C_SOURCE
640#  define read_stdin(b, s) (read(STDIN_FILENO, b, s))
641#else
642   extern int read_stdin(EIF_CHARACTER *buffer, int size);
643#endif
644
645extern void io_copy(char*source, char*target);
646extern int io_file_exists(char*source);
647extern int io_same_physical_file(char*path1,char*path2);
648/* C Header Pass 1: */
649typedef struct S53 T53;
650typedef struct S7 T7;
651typedef struct S49 T49;
652typedef struct S25 T25;
653/* C Header Pass 2: */
654typedef T3*T9;
655#define M9 NULL
656/* C Header Pass 3: */
657/* C Header Pass 4: */
658struct S53{T2 _value;};
659extern T53 M53;
660struct S7{T9 _storage;T2 _count;T2 _capacity;};
661extern T7 M7;
662struct S49{T2 _buffer_position;T9 _buffer;T2 _capacity;};
663extern T49 M49;
664struct S25{T2 _assertion_level;T8 _external_object;};
665extern T25 M25;
666extern char*s26_0;
667extern char*s26_212160365;
668extern char*s26_48390502;
669extern char*s26_1690381566;
670extern char*s26_1992063831;
671extern char*s26_1325941860;
672extern char*s26_113001857;
673extern char*s26_2167877;
674extern char*s26_718083334;
675extern char*s26_1075456615;
676extern char*s26_265093627;
677extern char*s26_1682790378;
678/*
679-- ------------------------------------------------------------------------------------------------------------
680-- Copyright notice below. Please read.
681--
682-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P.       - University of Nancy 1 - FRANCE
683-- Copyright(C) 2003-2005: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
684--
685-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
686--
687-- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
688-- documentation files (the "Software"), to deal in the Software without restriction, including without
689-- limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
690-- the Software, and to permit persons to whom the Software is furnished to do so, subject to the following
691-- conditions:
692--
693-- The above copyright notice and this permission notice shall be included in all copies or substantial
694-- portions of the Software.
695--
696-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
697-- LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
698-- EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
699-- AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
700-- OR OTHER DEALINGS IN THE SOFTWARE.
701--
702-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
703-- ------------------------------------------------------------------------------------------------------------
704*/
705#define SE_BOOST 1
706void se_print_run_time_stack (void);
707void se_signal_handler(int sig);
708/*INTEGER_32*/void r2append_in(T2 C,T0* a1);
709/*INTEGER_32*/T3 r2decimal_digit(T2 C);
710/*INTEGER_32*/T2 r2max(T2 C,T2 a1);
711/*NATIVE_ARRAY[CHARACTER]*/T9 r9realloc(T9 C,T2 a1,T2 a2);
712/*NATIVE_ARRAY[CHARACTER]*/void r9copy_from(T9 C,T9 a1,T2 a2);
713/*NATIVE_ARRAY[CHARACTER]*/void r9clear_all(T9 C,T2 a1);
714/*STRING*/void r7swap(T7* C,T2 a1,T2 a2);
715/*STRING*/T3 r7item(T7* C,T2 a1);
716/*STRING*/void r7copy(T7* C,T0* a1);
717/*STRING*/void r7put(T7* C,T3 a1,T2 a2);
718/*STRING*/void r7extend(T7* C,T3 a1);
719/*STRING*/void r7ensure_capacity(T7* C,T2 a1);
720/*COUNTER*/void r53increment(T53* C);
721extern T0*oBC13std_output;
722extern int fBC13std_output;
723/*STD_OUTPUT*/T0* r49std_output(void);
724/*STD_OUTPUT*/void r49filtered_flush(T49* C);
725/*STD_OUTPUT*/void r49filtered_put_character(T49* C,T3 a1);
726/*STD_OUTPUT*/void r49se_atexit(void);
727/*STD_OUTPUT*/void r49make(T49* C);
728/*STD_OUTPUT*/void r49write_buffer(T49* C);
729/*STD_OUTPUT*/void r49flush(T49* C);
730/*STD_OUTPUT*/void r49put_string(T49* C,T0* a1);
731/*TEST_OVERLOAD01*/void r25default_create(T25* C);
732/*TEST_OVERLOAD01*/T0* r25std_output(void);
733extern T0*oBC26assert_counter;
734/*TEST_OVERLOAD01*/T0* r25assertion_flag(T25* C);
735/*TEST_OVERLOAD01*/void r25label_assert(T25* C,T0* a1,T6 a2);
736/*TEST_OVERLOAD01*/T2 r25value(T25* C);
737/* Extra external prototype for line 44 of /home/cyril/SmartEiffel/se/trunk/test_suite/language/unclassified/test_overload01.e:*/
738void cpp25cpp_set_value(T8 a1,T2 a2);
739/*TEST_OVERLOAD01*/void r25cpp_set_value(T8 a1,T2 a2);
740/* Extra external prototype for line 51 of /home/cyril/SmartEiffel/se/trunk/test_suite/language/unclassified/test_overload01.e:*/
741T8 cpp25cpp_new(void);
742/*TEST_OVERLOAD01*/T8 r25cpp_new(void);
743/* Extra external prototype for line 37 of /home/cyril/SmartEiffel/se/trunk/test_suite/language/unclassified/test_overload01.e:*/
744T2 cpp25cpp_value(T8 a1);
745/*TEST_OVERLOAD01*/T2 r25cpp_value(T8 a1);
746/*TEST_OVERLOAD01*/void r25set_value(T25* C,T2 a1);
747extern T0*ms26_718083334;
748extern T0*ms26_2167877;
749extern T0*ms26_1992063831;
750extern T0*ms26_1325941860;
751extern T0*ms26_0;
752extern T0*ms26_1690381566;
753extern T0*ms26_113001857;
754extern T0*ms26_265093627;
755extern T0*ms26_212160365;
756extern T0*ms26_48390502;
757extern T0*ms26_1682790378;
758extern T0*ms26_1075456615;
759T0*se_ms(int c,char*e);
760T0*se_string(char*e);
761void se_msi1(void);
762extern T25*eiffel_root_object;
763extern int se_argc;
764extern char**se_argv;
765#define SE_MAXID 164
766extern T7*g[];
767void se_atexit(void);
768void initialize_eiffel_runtime(int argc,char*argv[]);
769int main(int argc,char*argv[]);
770
771#ifdef __cplusplus
772}
773#endif