/* translation of file "../error.k" */
/* generated by:
 *	@(#)$Author: Kimwitu version: V4_6 (c) 1990-1996 University of Twente $
 */
#define KC_FUNCTIONS_error
#define KIMW_FUNCTIONS_error /* for backwards compatibility */
/* define our own macro if we have a 'standard' (ansi) C(++) compiler */
#ifndef KC_NO_STDC
# if defined(__STDC__) || defined(__cplusplus) || defined(_WIN32)
#  define KC_STDC
# endif
#endif
#include <stdio.h>
#ifdef KC_STDC
# include <stdlib.h>
#endif
#include "k.h"
/* included stuff */
#line 2 "../error.k"
/*
 * The Termprocessor Kimwitu
 *
 * Copyright (c) 1991 University of Twente, Dept TIOS.
 * All rights reserved.
 *
 */

#line 29 "error.c"
#line 14 "../error.k"
#if ! (defined(lint) || defined(SABER) || defined(CODECENTER))
  static char error_kAccesSid[] = "@(#)$Id: error.k,v 1.28 1998/03/18 17:52:27 belinfan Rel $";
#endif

#line 35 "error.c"
#line 35 "../error.k"
boolean gp_no_fatal_problems;

#line 39 "error.c"
#line 38 "../error.k"
#ifndef KC_STDC
  extern void exit(/* int */);
#endif

#line 45 "error.c"
#line 319 "../error.k"
#define QUOTEDBACKSLASH '\\'

#line 49 "error.c"
#line 323 "../error.k"
#ifndef KC_MAX_STRING_LEN
# define KC_MAX_STRING_LEN 200
#endif /* !KC_MAX_STRING_LEN */

viewnameoption ug_viewnameopt;

#line 57 "error.c"
/* end included stuff */

#include "error.h"
static void v_stderr_printer KC__P((char *s, view v)); 
static void v_file_printer KC__P((char *s, view v, int *lineno, char **filename, int *no_of_printed_string_chars, boolean *doit, FILE *file, void (*printer_fn)(char *dummy1, uview dummy2))); 
static void v_stdout_printer KC__P((char *s, view v)); 
problem Problem1S
#ifdef KC_USE_PROTOTYPES
(char *s1)
#else
(s1) char *s1;
#endif
#line 78 "../error.k"
{
	return Problem1( mkcasestring( s1 ));

#line 80 "../error.k"
}
#line 76 "error.c"

problem Problem1S1we
#ifdef KC_USE_PROTOTYPES
(char *s1, withexpression we)
#else
(s1, we) char *s1;
withexpression we;
#endif
#line 82 "../error.k"
{
	return Problem1we( mkcasestring( s1 ), we );

#line 84 "../error.k"
}
#line 91 "error.c"

problem Problem1S1ID
#ifdef KC_USE_PROTOTYPES
(char *s1, ID id)
#else
(s1, id) char *s1;
ID id;
#endif
#line 86 "../error.k"
{
	return Problem1ID( mkcasestring( s1 ), id );

#line 88 "../error.k"
}
#line 106 "error.c"

problem Problem1S1tID
#ifdef KC_USE_PROTOTYPES
(char *s1, ID id)
#else
(s1, id) char *s1;
ID id;
#endif
#line 90 "../error.k"
{
	return Problem1tID( mkcasestring( s1 ), id );

#line 92 "../error.k"
}
#line 121 "error.c"

problem Problem1S1ID1S1ID
#ifdef KC_USE_PROTOTYPES
(char *s1, ID id1, char *s2, ID id2)
#else
(s1, id1, s2, id2) char *s1;
ID id1;
char *s2;
ID id2;
#endif
#line 95 "../error.k"
{
	return Problem1ID1ID( mkcasestring( s1 ), id1, mkcasestring( s2 ), id2 );

#line 97 "../error.k"
}
#line 138 "error.c"

problem Problem1S1t1S1ID
#ifdef KC_USE_PROTOTYPES
(char *s1, IDtype id1, char *s2, ID id2)
#else
(s1, id1, s2, id2) char *s1;
IDtype id1;
char *s2;
ID id2;
#endif
#line 99 "../error.k"
{
	return Problem1t1ID( mkcasestring( s1 ), id1, mkcasestring( s2 ), id2 );

#line 101 "../error.k"
}
#line 155 "error.c"

problem Problem1S1INT
#ifdef KC_USE_PROTOTYPES
(char *s1, INT i1)
#else
(s1, i1) char *s1;
INT i1;
#endif
#line 104 "../error.k"
{
	return Problem1INT( mkcasestring( s1 ), i1 );

#line 106 "../error.k"
}
#line 170 "error.c"

problem Problem1S1int1S
#ifdef KC_USE_PROTOTYPES
(char *s1, int i1, char *s2)
#else
(s1, i1, s2) char *s1;
int i1;
char *s2;
#endif
#line 109 "../error.k"
{
	return Problem1int1( mkcasestring( s1 ), i1, mkcasestring( s2 ) );

#line 111 "../error.k"
}
#line 186 "error.c"

problem Problem1S1INT1S1ID
#ifdef KC_USE_PROTOTYPES
(char *s1, INT i1, char *s2, ID id2)
#else
(s1, i1, s2, id2) char *s1;
INT i1;
char *s2;
ID id2;
#endif
#line 114 "../error.k"
{
	return Problem1INT1ID( mkcasestring( s1 ), i1, mkcasestring( s2 ), id2 );

#line 116 "../error.k"
}
#line 203 "error.c"

problem Problem1S1ID1S1ID1S1ID
#ifdef KC_USE_PROTOTYPES
(char *s1, ID id1, char *s2, ID id2, char *s3, ID id3)
#else
(s1, id1, s2, id2, s3, id3) char *s1;
ID id1;
char *s2;
ID id2;
char *s3;
ID id3;
#endif
#line 119 "../error.k"
{
	return Problem1ID1ID1ID( mkcasestring( s1 ), id1, mkcasestring( s2 ), id2, mkcasestring( s3 ), id3 );

#line 121 "../error.k"
}
#line 222 "error.c"

problem Problem1S1INT1S1ID1S1ID
#ifdef KC_USE_PROTOTYPES
(char *s1, INT i1, char *s2, ID id2, char *s3, ID id3)
#else
(s1, i1, s2, id2, s3, id3) char *s1;
INT i1;
char *s2;
ID id2;
char *s3;
ID id3;
#endif
#line 124 "../error.k"
{
	return Problem1INT1ID1ID( mkcasestring( s1 ), i1, mkcasestring( s2 ), id2, mkcasestring( s3 ), id3 );

#line 126 "../error.k"
}
#line 241 "error.c"

problem Problem1S1storageoption1S1ID
#ifdef KC_USE_PROTOTYPES
(char *s1, storageoption so, char *s2, ID id)
#else
(s1, so, s2, id) char *s1;
storageoption so;
char *s2;
ID id;
#endif
#line 129 "../error.k"
{
	return Problem1storageoption1ID( mkcasestring( s1 ), so, mkcasestring( s2 ), id );

#line 131 "../error.k"
}
#line 258 "error.c"

problem Problem2S
#ifdef KC_USE_PROTOTYPES
(char *s1, char *s2)
#else
(s1, s2) char *s1;
char *s2;
#endif
#line 133 "../error.k"
{
	return Problem2( mkcasestring( s1 ), mkcasestring( s2 ));

#line 135 "../error.k"
}
#line 273 "error.c"

problem ProblemSC
#ifdef KC_USE_PROTOTYPES
(char *s1, casestring s2)
#else
(s1, s2) char *s1;
casestring s2;
#endif
#line 137 "../error.k"
{
	return Problem2( mkcasestring( s1 ), s2 );

#line 139 "../error.k"
}
#line 288 "error.c"

problem Problem3S
#ifdef KC_USE_PROTOTYPES
(char *s1, char *s2, char *s3)
#else
(s1, s2, s3) char *s1;
char *s2;
char *s3;
#endif
#line 141 "../error.k"
{
	return Problem3( mkcasestring( s1 ), mkcasestring( s2 ), mkcasestring( s3 ));

#line 143 "../error.k"
}
#line 304 "error.c"

problem Problem4S
#ifdef KC_USE_PROTOTYPES
(char *s1, char *s2, char *s3, char *s4)
#else
(s1, s2, s3, s4) char *s1;
char *s2;
char *s3;
char *s4;
#endif
#line 145 "../error.k"
{
	return Problem4( mkcasestring( s1 ), mkcasestring( s2 ), mkcasestring( s3 ), mkcasestring( s4 ) );

#line 147 "../error.k"
}
#line 321 "error.c"

problem Problem3S1int1S
#ifdef KC_USE_PROTOTYPES
(char *s1, char *s2, char *s3, int i1, char *s4)
#else
(s1, s2, s3, i1, s4) char *s1;
char *s2;
char *s3;
int i1;
char *s4;
#endif
#line 150 "../error.k"
{
	return Problem3int1( mkcasestring( s1 ), mkcasestring( s2 ), mkcasestring( s3 ), i1, mkcasestring( s4 ) );

#line 152 "../error.k"
}
#line 339 "error.c"

void v_report
#ifdef KC_USE_PROTOTYPES
(error e)
#else
(e) error e;
#endif
#line 302 "../error.k"
{
	unparse_error( e, v_stderr_printer, view_error );

#line 304 "../error.k"
}
#line 353 "error.c"

static void v_stderr_printer
#ifdef KC_USE_PROTOTYPES
(char *s, view v)
#else
(s, v) char *s;
view v;
#endif
#line 308 "../error.k"
{	KC_LINTUSE(v);
	(void)fflush( stdout );
	(void)fprintf( stderr, "%s", s );
	(void)fflush( stderr );

#line 312 "../error.k"
}
#line 370 "error.c"

static void v_file_printer
#ifdef KC_USE_PROTOTYPES
(char *s, view v, int *lineno, char **filename, int *no_of_printed_string_chars, boolean *doit, FILE *file, void (*printer_fn)(char *dummy1, uview dummy2))
#else
(s, v, lineno, filename, no_of_printed_string_chars, doit, file, printer_fn) char *s;
view v;
int *lineno;
char **filename;
int *no_of_printed_string_chars;
boolean *doit;
FILE *file;
void (*printer_fn)();
#endif
#line 334 "../error.k"
{	char c;

	/*SUPPRESS 622*/
	assert(file != 0);

	switch( (int)v ) {
	case (int) view_no_of_printed_string_chars_reset:
	    *no_of_printed_string_chars = 0;
	    break;
	case (int)view_printer_reset:
	    *lineno = 1;
	    *filename = s;
	    break;
	case (int)view_printer_outputfileline:
	    (void)fprintf( file, "\n" ); *lineno = *lineno +1;
	    (void)fprintf( file, "#line %d \"%s\"\n", (*lineno)+1, *filename ); *lineno = *lineno +1;
	    break;
	default:
	    while(/*SUPPRESS 254*/ (c=*s++)) {
		switch( c ) {
		case '\0': return;
		case '\n': 
		           *lineno = *lineno +1;
		     
	        default:
			 if (v == view_gen_unpstr_c) {
			    if (*no_of_printed_string_chars >= KC_MAX_STRING_LEN) {
			        if (*doit) {
				   (void)fprintf( file, "\", " );
				   unparse_viewnameoption( ug_viewnameopt, printer_fn, view_gen_unparsedefs_other_c );
				   (void)fprintf( file, " );\n		  (*kc_printer)(\"" );
			           *lineno = *lineno +1;
				   *no_of_printed_string_chars = 0;
				   *doit = False;
				} else {
			           switch( c ) {
				   case '\\':
				   case '\n':
					break;
				   default:
					*doit = True;
			    }  }   }
			    *no_of_printed_string_chars = *no_of_printed_string_chars +1;
			 } else if (v == view_filename) {
			 	


				if (c == QUOTEDBACKSLASH) { 
					(void)putc( c, file );
				}
			}
			 (void)putc( c, file );
}	}   }   
#line 386 "../error.k"
}
#line 441 "error.c"

static void v_stdout_printer
#ifdef KC_USE_PROTOTYPES
(char *s, view v)
#else
(s, v) char *s;
view v;
#endif
#line 389 "../error.k"
{	static int lineno = 0;
	static char *filename;
	static int no_of_printed_string_chars = 0; 
	static boolean doit = False;

	v_file_printer( s, v, &lineno, &filename, &no_of_printed_string_chars, &doit, stdout, v_stdout_printer );

#line 395 "../error.k"
}
#line 460 "error.c"

void v_hfile_printer
#ifdef KC_USE_PROTOTYPES
(char *s, view v)
#else
(s, v) char *s;
view v;
#endif
#line 398 "../error.k"
{	static int lineno;
	static char *filename;
	static int no_of_printed_string_chars = 0; 
	static boolean doit = False;

	v_file_printer( s, v, &lineno, &filename, &no_of_printed_string_chars, &doit, g_hfile, v_hfile_printer );

#line 404 "../error.k"
}
#line 479 "error.c"

void v_cfile_printer
#ifdef KC_USE_PROTOTYPES
(char *s, view v)
#else
(s, v) char *s;
view v;
#endif
#line 407 "../error.k"
{	static int lineno;
	static char *filename;
	static int no_of_printed_string_chars = 0; 
	static boolean doit = False;

	v_file_printer( s, v, &lineno, &filename, &no_of_printed_string_chars, &doit, g_cfile, v_cfile_printer );

#line 413 "../error.k"
}
#line 498 "error.c"

void v_null_printer
#ifdef KC_USE_PROTOTYPES
(char *s, view v)
#else
(s, v) char *s;
view v;
#endif
#line 417 "../error.k"
{	KC_LINTUSE(s); KC_LINTUSE(v);

#line 418 "../error.k"
}
#line 512 "error.c"

