Main Page | Class List | Directories | File List | Class Members | File Members

pike_error.h File Reference

#include <stdarg.h>
#include "machine.h"
#include "svalue.h"
#include "errors.h"

Go to the source code of this file.

Classes

struct  ONERROR
struct  JMP_BUF

Defines

#define HAVE_AND_USE_SETJMP
#define LOW_JMP_BUF   jmp_buf
#define LOW_SETJMP(X)   setjmp(X)
#define LOW_LONGJMP(X, Y)   longjmp(X, Y)
#define Pike_fatal   (fprintf(stderr,msg_fatal_error,__FILE__,__LINE__),debug_fatal)
#define fatal   Pike_fatal
#define THROW_ERROR   10
#define THROW_THREAD_EXIT   20
#define THROW_THREAD_KILLED   30
#define THROW_EXIT   40
#define THROW_MAX_SEVERITY   100
#define OED_FPRINTF(X)
#define DEBUG_LINE_ARGS
#define SETJMP(X)   LOW_SETJMP((init_recovery(&X, 0)->recovery))
#define SETJMP_SP(jmp, stack_pop_levels)   LOW_SETJMP((init_recovery(&jmp, stack_pop_levels)->recovery))
#define UNSETJMP(X)   Pike_interpreter.recoveries=X.previous
#define SET_ONERROR(X, Y, Z)
#define UNSET_ONERROR(X)   Pike_interpreter.recoveries && (Pike_interpreter.recoveries->onerror=X.previous)
#define ASSERT_ONERROR(X)
#define CALL_AND_UNSET_ONERROR(X)
#define PIKE_ERROR(NAME, TEXT, SP, ARGS)   new_error(NAME, TEXT, SP, ARGS, NULL, 0)
#define SIMPLE_ARG_TYPE_ERROR(FUNC, ARG, EXPECT)
#define SIMPLE_BAD_ARG_ERROR(FUNC, ARG, EXPECT)
#define SIMPLE_ARG_ERROR(FUNC, ARG, PROBLEM)
#define SIMPLE_WRONG_NUM_ARGS_ERROR(FUNC, ARG)   wrong_number_of_args_error (FUNC, args, ARG)
#define SIMPLE_TOO_FEW_ARGS_ERROR(FUNC, ARG)   wrong_number_of_args_error (FUNC, args, ARG)
#define SIMPLE_OUT_OF_MEMORY_ERROR(FUNC, AMOUNT)   resource_error(FUNC, Pike_sp-args, args, "memory", AMOUNT, msg_out_of_mem)
#define SIMPLE_DIVISION_BY_ZERO_ERROR(FUNC)   math_error(FUNC, Pike_sp-args, args, 0, msg_div_by_zero)
#define check_recovery_context()   ((void)0)
#define exception_try
#define exception_catch_if   else if
#define exception_catch(e)   exception_catch_if(exception->severity = (e))
#define exception_catch_all   exception_catch_if(1)
#define exception_semicatch_all   exception_catch_if((__exception_rethrow = 1))
#define rethrow   pike_throw()
#define exception_endtry
#define ERR_EXT_DECLARE

Typedefs

typedef void(* error_call )(void *)
typedef ONERROR ONERROR
typedef JMP_BUF JMP_BUF

Functions

PMOD_EXPORT DECLSPEC (noreturn) void debug_fatal(const char *fmt
PMOD_EXPORT ATTRIBUTE ((noreturn))
PMOD_EXPORT void pike_gdb_breakpoint (INT32 args)
PMOD_EXPORT JMP_BUFinit_recovery (JMP_BUF *r, size_t stack_pop_levels DEBUG_LINE_ARGS)
PMOD_EXPORT void push_error (const char *description)
PMOD_EXPORT void Pike_vsnprintf (char *str, size_t size, const char *fmt, va_list ap)
PMOD_EXPORT void exit_on_error (const void *msg)
PMOD_EXPORT void fatal_on_error (const void *msg)
PMOD_EXPORT void wrong_number_of_args_error (const char *name, int args, int expected) ATTRIBUTE((noreturn))
void init_error (void)
void cleanup_error (void)

Variables

PMOD_EXPORT const char msg_fatal_error []
PMOD_EXPORT struct svalue throw_value
int throw_severity
PMOD_EXPORT const char * text
PMOD_EXPORT const char struct
svalue
oldsp
PMOD_EXPORT const char struct
svalue INT32 
args
PMOD_EXPORT const char struct
svalue INT32 const char * 
file
void const char * func
void const char struct svaluebase_sp
void const char struct svalue
int const char * 
fmt
PMOD_EXPORT const char struct
svalue int const char * 
desc
PMOD_EXPORT struct svalue
int struct svalue
val
PMOD_EXPORT struct svalue
int struct svalue struct svalue
ind
PMOD_EXPORT struct svalue
int int 
which_arg
PMOD_EXPORT struct svalue
int int const char * 
expected_type
PMOD_EXPORT struct svalue
int int const char struct
svalue
got
PMOD_EXPORT void struct svalue
int struct svalue
number
PMOD_EXPORT void struct svalue
int const char * 
resource_type
PMOD_EXPORT void struct svalue
int const char size_t 
howmuch
PMOD_EXPORT void struct svalue
int const char * 
permission_type
PMOD_EXPORT const char msg_bad_arg []
PMOD_EXPORT const char msg_bad_arg_2 []
PMOD_EXPORT const char msg_out_of_mem []
PMOD_EXPORT const char msg_div_by_zero []


Define Documentation

#define ASSERT_ONERROR  ) 
 

#define CALL_AND_UNSET_ONERROR  ) 
 

Value:

do {            \
     X.func(X.arg);                             \
     UNSET_ONERROR(X);                          \
  }while(0)

PMOD_EXPORT void check_recovery_context void   )     ((void)0)
 

#define DEBUG_LINE_ARGS
 

#define ERR_EXT_DECLARE
 

#define exception_catch  )     exception_catch_if(exception->severity = (e))
 

#define exception_catch_all   exception_catch_if(1)
 

#define exception_catch_if   else if
 

#define exception_endtry
 

Value:

else \
                __exception_rethrow = 1; \
            if(__is_exception) { \
                free_svalue(&throw_value); \
                throw_value.type = T_INT; \
            } \
            else \
                UNSETJMP(exception); \
            if(__exception_rethrow) \
                rethrow; \
        } \
        while(0)

#define exception_semicatch_all   exception_catch_if((__exception_rethrow = 1))
 

#define exception_try
 

Value:

do \
        { \
            int __exception_rethrow, __is_exception; \
            JMP_BUF exception; \
            __is_exception = SETJMP(exception); \
            __exception_rethrow = 0; \
            if(__is_exception) /* rethrow needs this */ \
                UNSETJMP(exception); \
            if(!__is_exception)

#define fatal   Pike_fatal
 

#define HAVE_AND_USE_SETJMP
 

#define LOW_JMP_BUF   jmp_buf
 

#define LOW_LONGJMP X,
 )     longjmp(X, Y)
 

#define LOW_SETJMP  )     setjmp(X)
 

#define OED_FPRINTF  ) 
 

#define PIKE_ERROR NAME,
TEXT,
SP,
ARGS   )     new_error(NAME, TEXT, SP, ARGS, NULL, 0)
 

#define Pike_fatal   (fprintf(stderr,msg_fatal_error,__FILE__,__LINE__),debug_fatal)
 

#define rethrow   pike_throw()
 

#define SET_ONERROR X,
Y,
 ) 
 

Value:

do{ \
     X.func=(error_call)(Y); \
     X.arg=(void *)(Z); \
     if(!Pike_interpreter.recoveries) break; \
     X.previous=Pike_interpreter.recoveries->onerror; \
     Pike_interpreter.recoveries->onerror=&X; \
  }while(0)

#define SETJMP  )     LOW_SETJMP((init_recovery(&X, 0)->recovery))
 

#define SETJMP_SP jmp,
stack_pop_levels   )     LOW_SETJMP((init_recovery(&jmp, stack_pop_levels)->recovery))
 

#define SIMPLE_ARG_ERROR FUNC,
ARG,
PROBLEM   ) 
 

Value:

bad_arg_error (FUNC, Pike_sp-args, args, ARG, NULL, Pike_sp+ARG-1-args, \
                 msg_bad_arg_2, ARG, FUNC, PROBLEM)

#define SIMPLE_ARG_TYPE_ERROR FUNC,
ARG,
EXPECT   ) 
 

Value:

bad_arg_error(FUNC, Pike_sp-args, args, ARG, EXPECT, Pike_sp+ARG-1-args,\
                 msg_bad_arg, ARG, FUNC, EXPECT)

#define SIMPLE_BAD_ARG_ERROR FUNC,
ARG,
EXPECT   ) 
 

Value:

bad_arg_error(FUNC, Pike_sp-args, args, ARG, EXPECT, Pike_sp+ARG-1-args,\
                 msg_bad_arg, ARG, FUNC, EXPECT)

#define SIMPLE_DIVISION_BY_ZERO_ERROR FUNC   )     math_error(FUNC, Pike_sp-args, args, 0, msg_div_by_zero)
 

#define SIMPLE_OUT_OF_MEMORY_ERROR FUNC,
AMOUNT   )     resource_error(FUNC, Pike_sp-args, args, "memory", AMOUNT, msg_out_of_mem)
 

#define SIMPLE_TOO_FEW_ARGS_ERROR FUNC,
ARG   )     wrong_number_of_args_error (FUNC, args, ARG)
 

#define SIMPLE_WRONG_NUM_ARGS_ERROR FUNC,
ARG   )     wrong_number_of_args_error (FUNC, args, ARG)
 

#define THROW_ERROR   10
 

#define THROW_EXIT   40
 

#define THROW_MAX_SEVERITY   100
 

#define THROW_THREAD_EXIT   20
 

#define THROW_THREAD_KILLED   30
 

#define UNSET_ONERROR  )     Pike_interpreter.recoveries && (Pike_interpreter.recoveries->onerror=X.previous)
 

#define UNSETJMP  )     Pike_interpreter.recoveries=X.previous
 


Typedef Documentation

typedef void(* error_call)(void *)
 

typedef struct JMP_BUF JMP_BUF
 

typedef struct ONERROR ONERROR
 


Function Documentation

PMOD_EXPORT void struct svalue int const char const char ATTRIBUTE (noreturn)   ) 
 

void cleanup_error void   ) 
 

PMOD_EXPORT DECLSPEC noreturn   )  const
 

PMOD_EXPORT void exit_on_error const void *  msg  ) 
 

PMOD_EXPORT void fatal_on_error const void *  msg  ) 
 

void init_error void   ) 
 

PMOD_EXPORT JMP_BUF* init_recovery JMP_BUF r,
size_t stack_pop_levels  DEBUG_LINE_ARGS
 

PMOD_EXPORT void pike_gdb_breakpoint INT32  args  ) 
 

PMOD_EXPORT void Pike_vsnprintf char *  str,
size_t  size,
const char *  fmt,
va_list  ap
 

PMOD_EXPORT void push_error const char *  description  ) 
 

PMOD_EXPORT void wrong_number_of_args_error const char *  name,
int  args,
int  expected
 


Variable Documentation

PMOD_EXPORT void struct svalue int args
 

PMOD_EXPORT void struct svalue * base_sp
 

PMOD_EXPORT void struct svalue int const char const char * desc
 

PMOD_EXPORT struct svalue int int const char* expected_type
 

PMOD_EXPORT const char struct svalue INT32 const char* file
 

void const char struct svalue int const char* fmt
 

PMOD_EXPORT const char * func
 

PMOD_EXPORT struct svalue int int const char struct svalue* got
 

PMOD_EXPORT void struct svalue int const char size_t howmuch
 

PMOD_EXPORT struct svalue int struct svalue struct svalue* ind
 

PMOD_EXPORT const char msg_bad_arg[]
 

PMOD_EXPORT const char msg_bad_arg_2[]
 

PMOD_EXPORT const char msg_div_by_zero[]
 

PMOD_EXPORT const char msg_fatal_error[]
 

PMOD_EXPORT const char msg_out_of_mem[]
 

PMOD_EXPORT void struct svalue int struct svalue* number
 

PMOD_EXPORT const char struct svalue* oldsp
 

PMOD_EXPORT void struct svalue int const char* permission_type
 

PMOD_EXPORT void struct svalue int const char* resource_type
 

PMOD_EXPORT const char* text
 

int throw_severity
 

PMOD_EXPORT struct svalue throw_value
 

PMOD_EXPORT struct svalue int struct svalue* val
 

PMOD_EXPORT struct svalue int int which_arg
 


Generated on Fri Jul 22 23:44:30 2005 for Pike by  doxygen 1.3.9.1