Annotation of parser3/src/main/pa_exception.C, revision 1.2

1.1       paf         1: /*
1.2     ! paf         2:   $Id: pa_exception.C,v 1.1 2001/01/30 11:51:07 paf Exp $
1.1       paf         3: */
                      4: 
                      5: #include <stdio.h>
                      6: #include <stdlib.h>
                      7: 
                      8: #include "pa_exception.h"
                      9: #include "pa_common.h"
                     10: 
1.2     ! paf        11: Exception::Exception()/* : 
1.1       paf        12:        ftype(0),
                     13:        fcode(0),
                     14:        fproblem_source(0),
1.2     ! paf        15:        fcomment("")*/ {
1.1       paf        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;
1.2     ! paf        30: 
        !            31:        if(comment_fmt) {
        !            32:                va_list args;
        !            33:                va_start(args, comment_fmt);
        !            34:                vsnprintf(fcomment, MAX_STRING, comment_fmt, args);
        !            35:                va_end(args);
        !            36:        } else 
        !            37:                fcomment[0]=0;
1.1       paf        38: 
                     39:        longjmp(mark, 1);
                     40: }

E-mail: