Annotation of parser3/src/main/pa_exception.C, revision 1.1
1.1 ! paf 1: /*
! 2: $Id: pa_exception.C,v 1.3 2001/01/29 22:34:58 paf Exp $
! 3: */
! 4:
! 5: #include <stdio.h>
! 6: #include <stdlib.h>
! 7:
! 8: #include "pa_exception.h"
! 9: #include "pa_common.h"
! 10:
! 11: Exception::Exception() :
! 12: ftype(0),
! 13: fcode(0),
! 14: fproblem_source(0),
! 15: fcomment("") {
! 16: }
! 17:
! 18: void Exception::die(char *acomment) {
! 19: // FIX: log(LOG_ERROR, acomment)
! 20: fprintf(stderr, "die: %s\n", acomment);
! 21: exit(1);
! 22: }
! 23:
! 24: void Exception::raise(const String *atype, const String *acode,
! 25: const String *aproblem_source,
! 26: const char *comment_fmt, ...) {
! 27: ftype=atype;
! 28: fcode=acode;
! 29: fproblem_source=aproblem_source;
! 30:
! 31: va_list args;
! 32: va_start(args, comment_fmt);
! 33: vsnprintf(fcomment, MAX_STRING, comment_fmt, args);
! 34: va_end(args);
! 35:
! 36: longjmp(mark, 1);
! 37: }
E-mail: