1995-08-09 08:06:35 -07:00
|
|
|
/***********************************************************************/
|
|
|
|
/* */
|
1996-04-30 07:53:58 -07:00
|
|
|
/* Objective Caml */
|
1995-08-09 08:06:35 -07:00
|
|
|
/* */
|
|
|
|
/* Xavier Leroy, projet Cristal, INRIA Rocquencourt */
|
|
|
|
/* */
|
1996-04-30 07:53:58 -07:00
|
|
|
/* Copyright 1996 Institut National de Recherche en Informatique et */
|
1999-11-17 10:59:06 -08:00
|
|
|
/* en Automatique. All rights reserved. This file is distributed */
|
|
|
|
/* under the terms of the GNU Library General Public License. */
|
1995-08-09 08:06:35 -07:00
|
|
|
/* */
|
|
|
|
/***********************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
1995-05-04 03:15:53 -07:00
|
|
|
#ifndef _fail_
|
|
|
|
#define _fail_
|
|
|
|
|
|
|
|
|
|
|
|
#include <setjmp.h>
|
|
|
|
#include "misc.h"
|
|
|
|
#include "mlvalues.h"
|
|
|
|
|
|
|
|
#define OUT_OF_MEMORY_EXN 0 /* "Out_of_memory" */
|
|
|
|
#define SYS_ERROR_EXN 1 /* "Sys_error" */
|
|
|
|
#define FAILURE_EXN 2 /* "Failure" */
|
|
|
|
#define INVALID_EXN 3 /* "Invalid_argument" */
|
|
|
|
#define END_OF_FILE_EXN 4 /* "End_of_file" */
|
|
|
|
#define ZERO_DIVIDE_EXN 5 /* "Division_by_zero" */
|
|
|
|
#define NOT_FOUND_EXN 6 /* "Not_found" */
|
|
|
|
#define MATCH_FAILURE_EXN 7 /* "Match_failure" */
|
1997-05-15 06:26:08 -07:00
|
|
|
#define STACK_OVERFLOW_EXN 8 /* "Stack_overflow" */
|
1998-11-20 07:36:27 -08:00
|
|
|
#define SYS_BLOCKED_IO 9 /* "Sys_blocked_io" */
|
2000-12-04 07:37:05 -08:00
|
|
|
#define ASSERT_FAILURE_EXN 10 /* "Assert_failure" */
|
1995-05-04 03:15:53 -07:00
|
|
|
|
1996-02-04 04:11:20 -08:00
|
|
|
#ifdef POSIX_SIGNALS
|
|
|
|
struct longjmp_buffer {
|
|
|
|
sigjmp_buf buf;
|
|
|
|
};
|
|
|
|
#else
|
1995-05-04 03:15:53 -07:00
|
|
|
struct longjmp_buffer {
|
|
|
|
jmp_buf buf;
|
|
|
|
};
|
1996-02-04 04:11:20 -08:00
|
|
|
#define sigsetjmp(buf,save) setjmp(buf)
|
|
|
|
#define siglongjmp(buf,val) longjmp(buf,val)
|
|
|
|
#endif
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2001-08-28 07:47:48 -07:00
|
|
|
CAMLextern struct longjmp_buffer * external_raise;
|
1995-05-04 03:15:53 -07:00
|
|
|
extern value exn_bucket;
|
|
|
|
|
2001-08-28 07:47:48 -07:00
|
|
|
CAMLextern void mlraise (value bucket) Noreturn;
|
|
|
|
CAMLextern void raise_constant (value tag) Noreturn;
|
|
|
|
CAMLextern void raise_with_arg (value tag, value arg) Noreturn;
|
|
|
|
CAMLextern void raise_with_string (value tag, char * msg) Noreturn;
|
|
|
|
CAMLextern void failwith (char *) Noreturn;
|
|
|
|
CAMLextern void invalid_argument (char *) Noreturn;
|
|
|
|
CAMLextern void raise_out_of_memory (void) Noreturn;
|
|
|
|
CAMLextern void raise_stack_overflow (void) Noreturn;
|
|
|
|
CAMLextern void raise_sys_error (value) Noreturn;
|
|
|
|
CAMLextern void raise_end_of_file (void) Noreturn;
|
|
|
|
CAMLextern void raise_zero_divide (void) Noreturn;
|
|
|
|
CAMLextern void raise_not_found (void) Noreturn;
|
|
|
|
CAMLextern void init_exceptions (void);
|
|
|
|
CAMLextern void array_bound_error (void) Noreturn;
|
|
|
|
CAMLextern void raise_sys_blocked_io (void) Noreturn;
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2001-08-28 07:47:48 -07:00
|
|
|
CAMLextern void (*caml_reset_sigmask)(void);
|
1998-11-02 07:08:40 -08:00
|
|
|
|
1995-05-04 03:15:53 -07:00
|
|
|
#endif /* _fail_ */
|