4 * Revision 1.1 2001/04/04 05:43:39 wang
5 * First commit: compiles on Linux, Amiga, Windows, Windows CE, generic gcc
7 * Revision 1.2 1999/11/26 13:13:47 bnv
8 * Changed: To use the new macros
10 * Revision 1.1 1998/07/02 17:34:50 bnv
25 /* --- Global variable --- */
26 Lstr errmsg
; /* initialise string from beggining */
28 /* ---------------- RxHaltTrap ----------------- */
32 if (_Proc
[_rx_proc
].condition
& SC_HALT
)
33 RxSignalCondition(SC_HALT
);
35 Lerror(ERR_PROG_INTERRUPT
,0);
38 /* ---------------- RxSignalCondition -------------- */
40 RxSignalCondition( int cnd
)
46 /*///////// first we need to terminate all the interpret strings */
49 cndstr
= _Proc
[_rx_proc
].lbl_error
;
52 cndstr
= _Proc
[_rx_proc
].lbl_halt
;
55 cndstr
= _Proc
[_rx_proc
].lbl_novalue
;
58 cndstr
= _Proc
[_rx_proc
].lbl_notready
;
61 cndstr
= _Proc
[_rx_proc
].lbl_syntax
;
64 leaf
= BinFind(&_labels
,cndstr
);
65 if (leaf
==NULL
|| ((RxFunc
*)(leaf
->value
))->label
==UNKNOWN_LABEL
) {
66 if (cnd
==SC_SYNTAX
) /* disable the error handling */
67 _Proc
[_rx_proc
].condition
&= ~SC_SYNTAX
;
68 Lerror(ERR_UNEXISTENT_LABEL
,1,cndstr
);
70 func
= (RxFunc
*)(leaf
->value
);
71 RxSetSpecialVar(SIGLVAR
,TraceCurline(NULL
,FALSE
));
72 Rxcip
= (CIPTYPE
*)((byte huge
*)Rxcodestart
+ (size_t)(func
->label
));
73 longjmp(_error_trap
,JMP_CONTINUE
);
74 } /* RxSignalCondition */
76 /* ------------------ Rerror ------------------- */
78 Rerror( int errno
, int subno
, ... )
84 if (_Proc
[_rx_proc
].condition
& SC_SYNTAX
) {
85 RxSetSpecialVar(RCVAR
,errno
);
86 if (symbolptr
==NULL
) /* we are in intepret */
87 RxSignalCondition(SC_SYNTAX
);
88 else { /* we are in compile */
90 longjmp(_error_trap
,JMP_ERROR
);
93 line
= TraceCurline(&rxf
,TRUE
);
94 if (symbolptr
==NULL
) /* we are in intepret */
95 RxSetSpecialVar(SIGLVAR
,line
);
99 Lerrortext(&errmsg
,errno
,subno
,&ap
);
103 fprintf(STDERR
," +++ Ooops unknown error %d.%d +++\n",errno
,subno
);
108 "Error %d running %s, line %d: %s\n",
115 "Error %d.%d running %s, line %d: %s\n",
127 PUTS(LSTR(rxf
->filename
));
131 Lerrortext(&errmsg
,errno
,subno
,NULL
);
132 Lprint(NULL
,&errmsg
);
136 RxReturnCode
= errno
;
137 longjmp(_exit_trap
,JMP_EXIT
);