Edinburgh Speech Tools  2.1-release
EST_error.h File Reference
#include <stdarg.h>
#include <stdio.h>
#include <setjmp.h>
#include "EST_unix.h"
Include dependency graph for EST_error.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MAX_ERROR_MESSAGE_LENGTH   1024
 
#define _rxp_S_(X)   #X
 
#define _rxp_s_(X)   _rxp_S_(X)
 
#define EST_bug
 
#define EST_exit(N)   exit(N)
 
#define EST_error
 
#define EST_warning
 
#define EST_sys_error
 
#define est_error_throw()   (est_errjmp ? longjmp(*est_errjmp,1) : (void)EST_exit(-1))
 
#define est_error()   est_error_throw()
 
#define CATCH_ERRORS_SKEL(INIT, CLEANUP)
 
#define CATCH_ERRORS()
 
#define CATCH_ERRORS_QUIET()
 
#define END_CATCH_ERRORS()
 

Typedefs

typedef void(* EST_error_handler) (const char *format,...)
 

Enumerations

enum  EST_error_behaviour { est_errors_checked = 0, est_errors_allowed = 1, est_errors_never = 2 }
 

Functions

void EST_errors_default ()
 
void EST_errors_quiet ()
 
void EST_quiet_error_fn (const char *format,...)
 
void EST_quiet_sys_error_fn (const char *format,...)
 

Variables

const char * EST_error_where
 
char * EST_error_message
 
EST_error_handler EST_bug_func
 
EST_error_handler EST_error_func
 
EST_error_handler EST_sys_error_func
 
EST_error_handler EST_warning_func
 
EST_error_handler old_error_function
 
EST_error_handler old_sys_error_function
 
FILE * EST_error_stream
 
FILE * EST_warning_stream
 
jmp_buf * est_errjmp
 
long errjmp_ok
 

Macro Definition Documentation

#define MAX_ERROR_MESSAGE_LENGTH   1024

Definition at line 61 of file EST_error.h.

#define _rxp_S_ (   X)    #X

Definition at line 87 of file EST_error.h.

#define _rxp_s_ (   X)    _rxp_S_(X)

Definition at line 88 of file EST_error.h.

#define EST_bug
Value:
(EST_error_where = __FILE__ ", line " _rxp_s_(__LINE__)),\
const char * EST_error_where
Definition: EST_error.c:47
#define _rxp_s_(X)
Definition: EST_error.h:88
EST_error_handler EST_bug_func
Definition: EST_error.c:192

Definition at line 90 of file EST_error.h.

#define EST_exit (   N)    exit(N)

Definition at line 103 of file EST_error.h.

#define EST_error
Value:
EST_error_handler EST_error_func
Definition: EST_error.c:193
const char * EST_error_where
Definition: EST_error.c:47
NULL
Definition: EST_WFST.cc:55

Definition at line 104 of file EST_error.h.

#define EST_warning
Value:
const char * EST_error_where
Definition: EST_error.c:47
EST_error_handler EST_warning_func
Definition: EST_error.c:195
NULL
Definition: EST_WFST.cc:55

Definition at line 106 of file EST_error.h.

#define EST_sys_error
Value:
const char * EST_error_where
Definition: EST_error.c:47
NULL
Definition: EST_WFST.cc:55
EST_error_handler EST_sys_error_func
Definition: EST_error.c:194

Definition at line 108 of file EST_error.h.

#define est_error_throw ( )    (est_errjmp ? longjmp(*est_errjmp,1) : (void)EST_exit(-1))

Definition at line 112 of file EST_error.h.

#define est_error ( )    est_error_throw()

Definition at line 113 of file EST_error.h.

#define CATCH_ERRORS_SKEL (   INIT,
  CLEANUP 
)
Value:
{ \
INIT \
jmp_buf *old_errjmp = est_errjmp; \
int old_errjmp_ok = errjmp_ok; \
est_errjmp = (jmp_buf *)malloc(sizeof(jmp_buf)); \
int jmp_val = setjmp(*est_errjmp); \
if (jmp_val) { free(est_errjmp); est_errjmp = old_errjmp; errjmp_ok = old_errjmp_ok; CLEANUP} \
if (jmp_val)
long errjmp_ok
Definition: EST_error.c:204
jmp_buf * est_errjmp
Definition: EST_error.c:203
getString int
Definition: EST_item_aux.cc:50

Definition at line 115 of file EST_error.h.

#define CATCH_ERRORS ( )
Value:
const int est_err_quiet=0; \
, \
;)
#define CATCH_ERRORS_SKEL(INIT, CLEANUP)
Definition: EST_error.h:115

Definition at line 126 of file EST_error.h.

#define CATCH_ERRORS_QUIET ( )
Value:
const int est_err_quiet=1; \
, \
)
void(* EST_error_handler)(const char *format,...)
Definition: EST_error.h:63
EST_error_handler EST_error_func
Definition: EST_error.c:193
void EST_quiet_sys_error_fn(const char *format,...)
Definition: EST_error.c:159
#define CATCH_ERRORS_SKEL(INIT, CLEANUP)
Definition: EST_error.h:115
EST_error_handler EST_sys_error_func
Definition: EST_error.c:194
EST_error_handler old_error_function
Definition: EST_error.c:197
void EST_quiet_error_fn(const char *format,...)
Definition: EST_error.c:95
EST_error_handler old_sys_error_function
Definition: EST_error.c:198

Definition at line 132 of file EST_error.h.

#define END_CATCH_ERRORS ( )
Value:
free(est_errjmp); \
est_errjmp = old_errjmp; \
errjmp_ok = old_errjmp_ok; \
if (est_err_quiet) { \
} \
} while (0)
EST_error_handler EST_error_func
Definition: EST_error.c:193
long errjmp_ok
Definition: EST_error.c:204
EST_error_handler EST_sys_error_func
Definition: EST_error.c:194
jmp_buf * est_errjmp
Definition: EST_error.c:203
EST_error_handler old_error_function
Definition: EST_error.c:197
EST_error_handler old_sys_error_function
Definition: EST_error.c:198

Definition at line 144 of file EST_error.h.

Typedef Documentation

typedef void(* EST_error_handler) (const char *format,...)

Definition at line 63 of file EST_error.h.

Enumeration Type Documentation

Defines the attitude of a call to possible fatal errors. Passing one of these values to a function tells it how much care it needs to take to avoid calls to EST_error.

These need snappier names. the numbers are their for historical reasons

Enumerator
est_errors_checked 

Function will not normally return an error unless something really bad has gone wrong. For feature lookup, will return default value if feature doesn't exist

est_errors_allowed 

Function will throw errors when feature doesn't exist.

est_errors_never 

No fatal errors allowed. Function must catch all EST_error calls. Will always return a default value.

Definition at line 161 of file EST_error.h.

Function Documentation

void EST_errors_default ( )

Definition at line 178 of file EST_error.c.

void EST_errors_quiet ( )

Definition at line 185 of file EST_error.c.

void EST_quiet_error_fn ( const char *  format,
  ... 
)

Definition at line 95 of file EST_error.c.

void EST_quiet_sys_error_fn ( const char *  format,
  ... 
)

Definition at line 159 of file EST_error.c.

Variable Documentation

const char* EST_error_where

Definition at line 47 of file EST_error.c.

char* EST_error_message

Definition at line 49 of file EST_error.c.

EST_error_handler EST_bug_func

Definition at line 192 of file EST_error.c.

EST_error_handler EST_error_func

Definition at line 193 of file EST_error.c.

EST_error_handler EST_sys_error_func

Definition at line 194 of file EST_error.c.

EST_error_handler EST_warning_func

Definition at line 195 of file EST_error.c.

EST_error_handler old_error_function

Definition at line 197 of file EST_error.c.

EST_error_handler old_sys_error_function

Definition at line 198 of file EST_error.c.

FILE* EST_error_stream

Definition at line 200 of file EST_error.c.

FILE* EST_warning_stream

Definition at line 201 of file EST_error.c.

jmp_buf* est_errjmp

Definition at line 203 of file EST_error.c.

long errjmp_ok

Definition at line 204 of file EST_error.c.