/* translation of file "../main.k" */ /* generated by: * @(#)$Author: Kimwitu version: V4_6 (c) 1990-1996 University of Twente $ */ #define KC_FUNCTIONS_main #define KIMW_FUNCTIONS_main /* 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 #ifdef KC_STDC # include #endif #include "k.h" /* included stuff */ #line 2 "../main.k" /* * The Termprocessor Kimwitu * * Copyright (c) 1991 University of Twente, Dept TIOS. * All rights reserved. * */ #line 29 "main.c" #line 14 "../main.k" #include "defs.h" #if ! (defined(lint) || defined(SABER) || defined(CODECENTER)) #ifndef KIMWITUCOPYRIGHT # define KIMWITUCOPYRIGHT "@(#) Kimwitu version: (unknown) (c) 1990 University of Twente"; #endif #ifndef RCSMAKEID # define RCSMAKEID "@(#) Makefile version unknown" #endif static char kimwc_cAccesSid[] = "@(#)$Id: main.k,v 1.40 1998/03/18 17:52:27 belinfan Rel $"; static char kimwitu_release[] = KIMWITURELEASE; /* defined in Makefile */ static char kimwitu_version[] = KIMWITUVERSIONSTRING; /* defined in Makefile */ static char Makefile_AccesSid[] = RCSMAKEID; /* defined in Makefile */ char kimwitu_copyright[] = KIMWITUCOPYRIGHT; /* defined in Makefile */ /* used in gen.k */ #else char kimwitu_copyright[] = "KIMWITUCOPYRIGHT"; /* defined in Makefile */ /* used in gen.k */ #endif #ifdef __cplusplus # define KC__CLINKAGE "C" #else # define KC__CLINKAGE #endif #if defined(_WIN32) && ! defined (__GNUC__) # include # define mktemp _mktemp # define open _open # define O_RDONLY _O_RDONLY # define read _read # define close _close #endif /* next include files needed for hpux open (says the man-page) */ /* next include files needed for fstat */ #if defined(hpux) || defined(KC_USE_STAT) # include # include # if defined(_WIN32) && ! defined (__GNUC__) # define fstat _fstat # define stat _stat # endif #endif #include /* for signal/sigvec */ #include #ifdef SIGHOLD /* must be SVR4 */ # define signal sigset /* use reliable signals on SVR4 */ #endif /* string(s) stuff */ #include #if ((! defined(KC_STDC) ) && defined(sun)) extern char *sprintf(); #endif extern int yyparse KC__P((void)); extern void yyrestart KC__P(( FILE* )); extern void do_NORMAL KC__P(( void )); #if ! (defined(_WIN32) && ! defined (__GNUC__)) extern KC__CLINKAGE int read KC__P(( int fildes, char *buf, unsigned int nbyte )); #endif extern KC__CLINKAGE int close KC__P(( int fildes )); #ifndef KC_STDC extern int link KC__P(( char *path1, char *path2 )); extern int unlink KC__P(( char *path )); extern int memcmp KC__P(( void*, void*, size_t )); extern void exit KC__P(( int )); #endif #include "unpk.h" #include "gutil.h" #define MALLOC emalloc #define FREE efree #ifndef efree # ifdef lint # define efree(kc_p) # else # define efree(kc_p) free((kc_malloc_t)(kc_p)) # endif #endif #define STDINPUTNAME "stdin" extern FILE *yyin; static char Thetempcfile[15]; static char Thetemphfile[15]; /* * the following (3) variables are used by processargs and prepare_for_next_file */ static char **inputfilenames = 0; static int no_inputfiles = 0; static int current_inputfile; static boolean g_overwriteAlways = False; #line 132 "main.c" #line 126 "../main.k" casestring g_progname; static char *progname_initvalue = "kc"; FILE *g_hfile, *g_cfile; char *g_hfilename; char *g_cfilename; static boolean verbose = False; #line 142 "main.c" #line 616 "../main.k" extern KC__CLINKAGE char *mktemp KC__P(( char* )); #line 146 "main.c" #line 647 "../main.k" # define MYBUFSIZ 8*BUFSIZ #line 150 "main.c" #line 700 "../main.k" #ifdef KC_STDC extern KC__CLINKAGE int rename KC__P((const char*, const char*)); #endif #line 156 "main.c" #line 724 "../main.k" #ifdef KC_STDC extern KC__CLINKAGE int remove KC__P((const char*)); #endif #line 162 "main.c" /* end included stuff */ #include "main.h" static char *get_basename KC__P((char *s)); static void processargs KC__P((int argc, char *argv[])); static int prepare_for_next_file KC__P((void)); static void do_parse KC__P((void)); static void make_tempfile_names KC__P((char *Thetempcfile, char *Thetemphfile, char **tmp_cfilename, char **tmp_hfilename)); static void reset_tempfiles KC__P((char *Thetempcfile, char *Thetemphfile)); static int different KC__P((int f1, int f2, char *fn1, char *fn2)); static void erename KC__P((char *oldfilename, char *newfilename)); static void eremove KC__P((char *filename)); static void compare_and_delete_or_move KC__P((char *tmp_filename, char *filename, boolean overwriteAlways)); static phylumdeclarations f_add_predefined_phyla KC__P((phylumdeclarations p)); static phylumdeclaration v_predefined_int KC__P((void)); static phylumdeclaration v_predefined_float KC__P((void)); static phylumdeclaration v_predefined_casestring KC__P((void)); static phylumdeclaration v_predefined_nocasestring KC__P((void)); static phylumdeclaration v_predefined_voidptr KC__P((void)); static casestring make_pg_filename KC__P((char *s)); static void set_signals KC__P((void)); static void reset_signals KC__P((void)); static void block_signals KC__P((void)); static void cleanup_and_die KC__P((int i)); static void cleanup_and_abort KC__P((int i)); static void cleanup KC__P((void)); static char *get_basename #ifdef KC_USE_PROTOTYPES (char *s) #else (s) char *s; #endif #line 137 "../main.k" { char *basename = strrchr( s, '/'); if (basename == NULL) { basename = s; } else { basename++; } return basename; #line 145 "../main.k" } #line 207 "main.c" static void processargs #ifdef KC_USE_PROTOTYPES (int argc, char *argv[]) #else (argc, argv) int argc; char *argv[]; #endif #line 150 "../main.k" { int i; int len; char *basename; g_progname = mkcasestring(get_basename(argv[0])); for( i=1; i < argc; i++ ) { if (strcmp(argv[i], "--version") == 0) { (void)fflush( stdout ); (void)fprintf( stderr, "%s: version %s\n", get_basename(argv[0]), kimwitu_version ); (void)fflush( stderr ); leave(0); } } inputfilenames = ecalloc(argc - 1, sizeof(char*)); no_inputfiles = 0; for( i=1; i < argc; i++ ) { if (strcmp(argv[i], "--overwrite") == 0) { g_overwriteAlways = True; } else { len = strlen(argv[i]); basename = get_basename( argv[i] ); if ( ! (argv[i][len-1] == 'k') && (argv[i][len-2] == '.') ) { v_report( NonFatal( NoFileLine(), Problem2S( "input file must have '.k' suffix:", argv[i] ))); } else if ( (strcmp(basename, "k.k") == 0) || (strcmp(basename, "rk.k") == 0) || (strcmp(basename, "csgiok.k") == 0) || (strcmp(basename, "stdin.k") == 0) ) { v_report( NonFatal( NoFileLine(), Problem2S( "reserved file basename 'k.k', 'rk.k', 'csgiok.k', 'stdin.k' not allowed:", argv[i] ))); } else if ((yyin = fopen(argv[i], "r"))== NULL){ v_report( NonFatal( NoFileLine(), Problem2S( "cannot open ", argv[i] ))); } else { (void)fclose(yyin); inputfilenames[no_inputfiles] = argv[i]; no_inputfiles++; } } } if ( gp_no_fatal_problems ) { if ( no_inputfiles > 0 ) { current_inputfile = 0; pg_filename = make_pg_filename( inputfilenames[current_inputfile] ); if ((yyin = fopen(inputfilenames[current_inputfile], "r"))== NULL){ v_report( Fatal( NoFileLine(), Problem2S( "cannot open ", inputfilenames[current_inputfile] ))); } pg_lineno = 1; pg_column = 0; pg_charpos = 0; } else if (argc == 1 ) { /*EMPTY*/ } } else { leave(1); } #line 209 "../main.k" } #line 279 "main.c" static int prepare_for_next_file #ifdef KC_USE_PROTOTYPES (void) #else () #endif #line 212 "../main.k" { if ( current_inputfile < no_inputfiles-1 ) { current_inputfile++; pg_filename = make_pg_filename( inputfilenames[current_inputfile] ); pg_lineno = 1; pg_column = 0; pg_charpos = 0; (void)fclose(yyin); if ((yyin = fopen(inputfilenames[current_inputfile], "r"))== NULL){ v_report( Fatal( NoFileLine(), Problem2S( "cannot open ", inputfilenames[current_inputfile] ))); } yyrestart(yyin); return 1; } do_NORMAL(); if ( no_inputfiles > 0 ) (void)fclose( yyin ); return 0; #line 230 "../main.k" } #line 309 "main.c" static void do_parse #ifdef KC_USE_PROTOTYPES (void) #else () #endif #line 256 "../main.k" { includefile Theincheader = IncludeFile( mkcasestring(INC_HEADER)); includefile Theincfile = IncludeFile( mkcasestring(INC_CODE)); ID Thebase_uview = Id( Str( mkcasestring( "base_uview" ))); ID Thebase_view = Id( Str( mkcasestring( "base_view" ))); ID Thebase_rview = Id( Str( mkcasestring( "base_rview" ))); ID Thekc_not_uniq = Id( Str( mkcasestring( "kc_not_uniq" ))); ID Thekc_uniq_nullary_operator = Id( Str( mkcasestring( "kc_uniq_nullary_operator" ))); ID Theuniq = Id( Str( mkcasestring( "uniq" ))); Thephylumdeclarations = f_add_predefined_phyla( Nilphylumdeclarations() ); Therwdeclarations = Nilrwdeclarations(); Theunparsedeclarations = Nilunparsedeclarations(); Theargsnumbers = Nilargsnumbers(); Thefndeclarations = Nilfndeclarations(); Theincheader->inc_type = include_header; Theincfile->inc_type = include_file; IncludeFile( mkcasestring(INC_KC_TYPES_HEADER))->inc_type = include_header; IncludeFile( mkcasestring(INC_KIMW_TYPES_HEADER))->newinclude = IncludeFile( mkcasestring(INC_KC_TYPES_HEADER)); IncludeFile( mkcasestring(INC_KC_TYPES))->inc_type = include_file; IncludeFile( mkcasestring(INC_KIMW_TYPES))->newinclude = IncludeFile( mkcasestring(INC_KC_TYPES)); IncludeFile( mkcasestring(INC_KC_REWRITE_HEADER))->inc_type = include_header; IncludeFile( mkcasestring(INC_KIMW_REWRITE_HEADER))->newinclude = IncludeFile( mkcasestring(INC_KC_REWRITE_HEADER)); IncludeFile( mkcasestring(INC_KC_REWRITE))->inc_type = include_file; IncludeFile( mkcasestring(INC_KIMW_REWRITE))->newinclude = IncludeFile( mkcasestring(INC_KC_REWRITE)); IncludeFile( mkcasestring(INC_KC_CSGIO_HEADER))->inc_type = include_header; IncludeFile( mkcasestring(INC_KIMW_CSGIO_HEADER))->newinclude = IncludeFile( mkcasestring(INC_KC_CSGIO_HEADER)); IncludeFile( mkcasestring(INC_KC_CSGIO))->inc_type = include_file; IncludeFile( mkcasestring(INC_KIMW_CSGIO))->newinclude = IncludeFile( mkcasestring(INC_KC_CSGIO)); IncludeFile( mkcasestring(INC_KC_UNPARSE_HEADER))->inc_type = include_header; IncludeFile( mkcasestring(INC_KIMW_UNPARSE_HEADER))->newinclude = IncludeFile( mkcasestring(INC_KC_UNPARSE_HEADER)); IncludeFile( mkcasestring(INC_KC_UNPARSE))->inc_type = include_file; IncludeFile( mkcasestring(INC_KIMW_UNPARSE))->newinclude = IncludeFile( mkcasestring(INC_KC_UNPARSE)); v_defoccur( Thebase_uview, ITPredefinedUView() ); v_defoccur( Thebase_view, ITPredefinedUView() ); v_defoccur( Thebase_rview, ITPredefinedRView() ); v_defoccur( Theuniq, ITPredefinedStorageClass() ); Theuviewnames = Consviewnames( Thebase_uview, Nilviewnames() ); Theuviewnames = Consviewnames( Thebase_view, Theuviewnames ); Therviewnames = Consviewnames( Thebase_rview, Nilviewnames() ); Thestorageclasses = Consstorageclasses( Theuniq, Consstorageclasses( Thekc_uniq_nullary_operator, Consstorageclasses( Thekc_not_uniq, Nilstorageclasses() ))); do { (void)yyparse(); FnFile( pg_filename )->fns = Thefndeclarations; Thefndeclarations = Nilfndeclarations(); IncludeFile( pg_filename )->inc[(int)include_header] = Theincheader->inc[(int)Theincheader->inc_type]; IncludeFile( pg_filename )->inc[(int)include_file] = Theincfile->inc[(int)Theincfile->inc_type]; IncludeFile( pg_filename )->inc_type = include_both; Theincheader->inc[(int)Theincheader->inc_type] = Nilincludedeclarations(); Theincfile->inc[(int)Theincfile->inc_type] = Nilincludedeclarations(); } while( prepare_for_next_file() ); if (! gp_no_fatal_problems) { leave(1); } #line 313 "../main.k" } #line 378 "main.c" int main #ifdef KC_USE_PROTOTYPES (int argc, char *argv[]) #else (argc, argv) int argc; char *argv[]; #endif #line 318 "../main.k" { phylumdeclarationsroot proot; char *tmp_cfilename, *tmp_hfilename; #ifdef YYDEBUG extern int yydebug; yydebug = 1; #endif g_hfile = 0; g_cfile = 0; g_progname = mkcasestring( progname_initvalue ); reset_tempfiles(Thetempcfile, Thetemphfile); pg_filename = make_pg_filename( STDINPUTNAME ); gp_no_fatal_problems = True; pg_uviewshavebeendefined = False; pg_rviewshavebeendefined = False; pg_storageclasseshavebeendefined = False; pg_lineno = 0; pg_column = 0; pg_charpos = 0; processargs(argc, argv); set_signals(); pg_lineno = 1; pg_column = 0; pg_charpos = 0; do_parse(); pg_lineno = 0; pg_column = 0; pg_charpos = 0; Thebindingidmarks = 0; unparse_phylumdeclarations( Thephylumdeclarations, v_null_printer, view_init_stacks ); unparse_phylumdeclarations( Thephylumdeclarations, v_null_printer, view_check_count ); unparse_phylumdeclarations( Thephylumdeclarations, v_null_printer, view_check ); unparse_rwdeclarations( Therwdeclarations, v_null_printer, view_check ); { #line 378 "../main.k" fnfiles kc_fe_selvar_1 = Thefnfiles ; #line 378 "../main.k" /*SUPPRESS 622*/ assert_fnfiles(kc_fe_selvar_1, "foreach_list_expression"); #line 455 "main.c" while( kc_fe_selvar_1->prod_sel == sel_Consfnfiles ) { fnfile kc_selvar_0_1 = kc_fe_selvar_1->u.Consfnfiles.fnfile_1; { #line 378 "../main.k" { #line 378 "../main.k" /*SUPPRESS 622*/ assert_fnfile(kc_selvar_0_1, "with_expression (1)"); #line 467 "main.c" { #line 378 "../main.k" fnfile a_fnfile = kc_selvar_0_1; #line 378 "../main.k" unparse_fndeclarations( a_fnfile->fns, v_null_printer, view_check ); #line 475 "main.c" } } #line 479 "main.c" } kc_fe_selvar_1 = kc_fe_selvar_1->u.Consfnfiles.fnfiles_1; #line 378 "../main.k" /*SUPPRESS 622*/ assert_fnfiles(kc_fe_selvar_1, "sublist_of_foreach_list_expression"); #line 486 "main.c" } } #line 381 "../main.k" unparse_unparsedeclarations( Theunparsedeclarations, v_null_printer, view_check ); unparse_unparsedeclarations( Theunparsedeclarations, v_null_printer, view_check_viewnames ); unparse_phylumdeclarations( Thephylumdeclarations, v_null_printer, view_check_uniq ); unparse_phylumdeclarations( Thephylumdeclarations, v_null_printer, view_make_patternreps ); unparse_rwdeclarations( Therwdeclarations, v_null_printer, view_make_patternreps ); { #line 390 "../main.k" fnfiles kc_fe_selvar_1 = Thefnfiles ; #line 390 "../main.k" /*SUPPRESS 622*/ assert_fnfiles(kc_fe_selvar_1, "foreach_list_expression"); #line 506 "main.c" while( kc_fe_selvar_1->prod_sel == sel_Consfnfiles ) { fnfile kc_selvar_0_1 = kc_fe_selvar_1->u.Consfnfiles.fnfile_1; { #line 390 "../main.k" { #line 390 "../main.k" /*SUPPRESS 622*/ assert_fnfile(kc_selvar_0_1, "with_expression (1)"); #line 518 "main.c" { #line 390 "../main.k" fnfile a_fnfile = kc_selvar_0_1; #line 390 "../main.k" unparse_fndeclarations( a_fnfile->fns, v_null_printer, view_make_patternreps ); #line 526 "main.c" } } #line 530 "main.c" } kc_fe_selvar_1 = kc_fe_selvar_1->u.Consfnfiles.fnfiles_1; #line 390 "../main.k" /*SUPPRESS 622*/ assert_fnfiles(kc_fe_selvar_1, "sublist_of_foreach_list_expression"); #line 537 "main.c" } } #line 393 "../main.k" unparse_unparsedeclarations( Theunparsedeclarations, v_null_printer, view_make_patternreps ); if ( ! gp_no_fatal_problems ) { leave( 1 ); } proot = PhylumDeclarations( Thephylumdeclarations ); if (length_argsnumbers(Theargsnumbers) == 0) { Theargsnumbers = Consargsnumbers( 0, Theargsnumbers ); } make_tempfile_names(Thetempcfile, Thetemphfile, &tmp_cfilename, &tmp_hfilename); if ((g_hfile = fopen(tmp_hfilename, "w")) == NULL) v_report( Fatal( NoFileLine(), Problem2S( "cannot create temporary k.h file:", tmp_hfilename ))); if ((g_cfile = fopen(tmp_cfilename, "w")) == NULL) v_report( Fatal( NoFileLine(), Problem2S( "cannot create temporary k.c file:", tmp_cfilename ))); v_hfile_printer( "k.h", view_printer_reset ); v_cfile_printer( "k.c", view_printer_reset ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_k_h ); unparse_phylumdeclarationsroot( proot, v_cfile_printer, view_gen_k_c ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_alloc_h ); unparse_phylumdeclarationsroot( proot, v_cfile_printer, view_gen_alloc_c ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_enumphyla_h ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_enumoperators_h ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_nodetypedefs_h ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_operatormap_type_h ); unparse_phylumdeclarationsroot( proot, v_cfile_printer, view_gen_copy_attributes_c ); unparse_phylumdeclarationsroot( proot, v_cfile_printer, view_gen_phylummap_c ); unparse_phylumdeclarationsroot( proot, v_cfile_printer, view_gen_operatormap_c ); unparse_storageclasses( Thestorageclasses, v_cfile_printer, view_gen_uniqmap_c ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_yaccstacktype_h ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_noofoperators_h ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_booleans_h ); unparse_includedeclarations( IncludeFile(mkcasestring(INC_KC_TYPES_HEADER))->inc[(int)IncludeFile(mkcasestring(INC_KC_TYPES_HEADER))->inc_type], v_hfile_printer, view_gen_includes ); unparse_includedeclarations( IncludeFile(mkcasestring(INC_KC_TYPES))->inc[(int)IncludeFile(mkcasestring(INC_KC_TYPES))->inc_type], v_cfile_printer, view_gen_includes ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_initialization_h ); unparse_phylumdeclarationsroot( proot, v_cfile_printer, view_gen_initialization_c ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_assertmacros_h ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_operatordecls_h ); unparse_phylumdeclarationsroot( proot, v_cfile_printer, view_gen_operatordefs_c ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_error_decls_h ); unparse_phylumdeclarationsroot( proot, v_cfile_printer, view_gen_error_defs_c ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_nodetypes_h ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_freedecls_h ); unparse_phylumdeclarationsroot( proot, v_cfile_printer, view_gen_freedefs_c ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_eqdecls_h ); unparse_phylumdeclarationsroot( proot, v_cfile_printer, view_gen_eqdefs_c ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_printdecls_h ); unparse_phylumdeclarationsroot( proot, v_cfile_printer, view_gen_printdefs_c ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_printdotdecls_h ); unparse_phylumdeclarationsroot( proot, v_cfile_printer, view_gen_printdotdefs_c ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_listdecls_h ); unparse_phylumdeclarationsroot( proot, v_cfile_printer, view_gen_listdefs_c ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_copydecls_h ); unparse_phylumdeclarationsroot( proot, v_cfile_printer, view_gen_copydefs_c ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_end_k_h ); if (fclose( g_cfile ) == EOF) { v_report( Fatal( NoFileLine(), Problem2S( "writing temporary k.c file failed:", tmp_cfilename ))); } g_cfile = 0; if (fclose( g_hfile ) == EOF) { v_report( Fatal( NoFileLine(), Problem2S( "writing temporary k.h file failed:", tmp_hfilename ))); } g_hfile = 0; compare_and_delete_or_move(tmp_cfilename, "k.c", g_overwriteAlways); compare_and_delete_or_move(tmp_hfilename, "k.h", g_overwriteAlways); reset_tempfiles(Thetempcfile, Thetemphfile); make_tempfile_names(Thetempcfile, Thetemphfile, &tmp_cfilename, &tmp_hfilename); if ((g_hfile = fopen(tmp_hfilename, "w")) == NULL) v_report( Fatal( NoFileLine(), Problem2S( "cannot create temporary csgiok.h file:", tmp_hfilename ))); if ((g_cfile = fopen(tmp_cfilename, "w")) == NULL) v_report( Fatal( NoFileLine(), Problem2S( "cannot create temporary csgiok.c file:", tmp_cfilename ))); v_hfile_printer( "csgiok.h", view_printer_reset ); v_cfile_printer( "csgiok.c", view_printer_reset ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_csgio_start_h ); unparse_includedeclarations( IncludeFile(mkcasestring(INC_KC_CSGIO_HEADER))->inc[(int)IncludeFile(mkcasestring(INC_KC_CSGIO_HEADER))->inc_type], v_hfile_printer, view_gen_includes ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_csgio_h ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_csgio_end_h ); unparse_phylumdeclarationsroot( proot, v_cfile_printer, view_gen_csgio_start_c ); unparse_includedeclarations( IncludeFile(mkcasestring(INC_KC_CSGIO))->inc[(int)IncludeFile(mkcasestring(INC_KC_CSGIO))->inc_type], v_cfile_printer, view_gen_includes ); unparse_phylumdeclarationsroot( proot, v_cfile_printer, view_gen_csgio_c ); if (fclose( g_cfile ) == EOF) { v_report( Fatal( NoFileLine(), Problem2S( "writing temporary csgiok.c file failed:", tmp_cfilename ))); } g_cfile = 0; if (fclose( g_hfile ) == EOF) { v_report( Fatal( NoFileLine(), Problem2S( "writing temporary csgiok.h file failed:", tmp_hfilename ))); } g_hfile = 0; compare_and_delete_or_move(tmp_cfilename, "csgiok.c", g_overwriteAlways); compare_and_delete_or_move(tmp_hfilename, "csgiok.h", g_overwriteAlways); reset_tempfiles(Thetempcfile, Thetemphfile); make_tempfile_names(Thetempcfile, Thetemphfile, &tmp_cfilename, &tmp_hfilename); if ((g_hfile = fopen(tmp_hfilename, "w")) == NULL) v_report( Fatal( NoFileLine(), Problem2S( "cannot create temporary unpk.h file:", tmp_hfilename ))); if ((g_cfile = fopen(tmp_cfilename, "w")) == NULL) v_report( Fatal( NoFileLine(), Problem2S( "cannot create temporary unpk.c file:", tmp_cfilename ))); v_hfile_printer( "unpk.h", view_printer_reset ); v_cfile_printer( "unpk.c", view_printer_reset ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_unpk_h ); unparse_includedeclarations( IncludeFile(mkcasestring(INC_KC_UNPARSE_HEADER))->inc[(int)IncludeFile(mkcasestring(INC_KC_UNPARSE_HEADER))->inc_type], v_hfile_printer, view_gen_includes ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_unparsedecls_h ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_end_unpk_h ); unparse_phylumdeclarationsroot( proot, v_cfile_printer, view_gen_unpk_c ); unparse_includedeclarations( IncludeFile(mkcasestring(INC_KC_UNPARSE))->inc[(int)IncludeFile(mkcasestring(INC_KC_UNPARSE))->inc_type], v_cfile_printer, view_gen_includes ); unparse_phylumdeclarationsroot( proot, v_cfile_printer, view_gen_default_types_unpk_c ); unparse_phylumdeclarationsroot( proot, v_cfile_printer, view_gen_unparsedefs_c ); if (fclose( g_cfile ) == EOF) { v_report( Fatal( NoFileLine(), Problem2S( "writing temporary unpk.c file failed:", tmp_cfilename ))); } g_cfile = 0; if (fclose( g_hfile ) == EOF) { v_report( Fatal( NoFileLine(), Problem2S( "writing temporary unpk.h file failed:", tmp_hfilename ))); } g_hfile = 0; compare_and_delete_or_move(tmp_cfilename, "unpk.c", g_overwriteAlways); compare_and_delete_or_move(tmp_hfilename, "unpk.h", g_overwriteAlways); reset_tempfiles(Thetempcfile, Thetemphfile); make_tempfile_names(Thetempcfile, Thetemphfile, &tmp_cfilename, &tmp_hfilename); if ((g_hfile = fopen(tmp_hfilename, "w")) == NULL) v_report( Fatal( NoFileLine(), Problem2S( "cannot create temporary rk.h file:", tmp_hfilename ))); if ((g_cfile = fopen(tmp_cfilename, "w")) == NULL) v_report( Fatal( NoFileLine(), Problem2S( "cannot create temporary rk.c file:", tmp_cfilename ))); v_hfile_printer( "rk.h", view_printer_reset ); v_cfile_printer( "rk.c", view_printer_reset ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_rewritek_h ); unparse_includedeclarations( IncludeFile(mkcasestring(INC_KC_REWRITE_HEADER))->inc[(int)IncludeFile(mkcasestring(INC_KC_REWRITE_HEADER))->inc_type], v_hfile_printer, view_gen_includes ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_rewritedecls_h ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_end_rewritek_h ); unparse_phylumdeclarationsroot( proot, v_cfile_printer, view_gen_rewritek_c ); unparse_includedeclarations( IncludeFile(mkcasestring(INC_KC_REWRITE))->inc[(int)IncludeFile(mkcasestring(INC_KC_REWRITE))->inc_type], v_cfile_printer, view_gen_includes ); unparse_phylumdeclarationsroot( proot, v_cfile_printer, view_gen_rewritedefs_c ); if (fclose( g_cfile ) == EOF) { v_report( Fatal( NoFileLine(), Problem2S( "writing temporary rk.c file failed:", tmp_cfilename ))); } g_cfile = 0; if (fclose( g_hfile ) == EOF) { v_report( Fatal( NoFileLine(), Problem2S( "writing temporary rk.h file failed:", tmp_hfilename ))); } g_hfile = 0; compare_and_delete_or_move(tmp_cfilename, "rk.c", g_overwriteAlways); compare_and_delete_or_move(tmp_hfilename, "rk.h", g_overwriteAlways); reset_tempfiles(Thetempcfile, Thetemphfile); { #line 569 "../main.k" fnfiles kc_fe_selvar_1 = Thefnfiles ; #line 569 "../main.k" /*SUPPRESS 622*/ assert_fnfiles(kc_fe_selvar_1, "foreach_list_expression"); #line 724 "main.c" while( kc_fe_selvar_1->prod_sel == sel_Consfnfiles ) { fnfile kc_selvar_0_1 = kc_fe_selvar_1->u.Consfnfiles.fnfile_1; { #line 569 "../main.k" { #line 569 "../main.k" /*SUPPRESS 622*/ assert_fnfile(kc_selvar_0_1, "with_expression (1)"); #line 736 "main.c" { #line 569 "../main.k" fnfile a_fnfile = kc_selvar_0_1; #line 569 "../main.k" { #line 570 "../main.k" fnfile kc_selvar_1_1 = a_fnfile ; #line 570 "../main.k" /*SUPPRESS 622*/ assert_fnfile(kc_selvar_1_1, "with_expression (1)"); #line 751 "main.c" if (( kc_selvar_1_1->prod_sel == sel_FnFile)) { #line 571 "../main.k" casestring a_filename = kc_selvar_1_1->u.FnFile.casestring_1; #line 571 "../main.k" g_hfilename = f_mk_filename( a_filename, 'h' ); g_cfilename = f_mk_filename( a_filename, 'c' ); pg_filename = a_filename; make_tempfile_names(Thetempcfile, Thetemphfile, &tmp_cfilename, &tmp_hfilename); if ((g_hfile = fopen(tmp_hfilename, "w")) == NULL) v_report( Fatal( NoFileLine(), Problem4S( "cannot create temporary ", g_hfilename," file:", tmp_hfilename ))); if ((g_cfile = fopen(tmp_cfilename, "w")) == NULL) v_report( Fatal( NoFileLine(), Problem4S( "cannot create temporary ", g_cfilename," file:", tmp_cfilename ))); v_hfile_printer( g_hfilename, view_printer_reset ); v_cfile_printer( g_cfilename, view_printer_reset ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_fns_start_h ); unparse_includedeclarations( IncludeFile( a_filename )->inc[(int)include_header], v_hfile_printer, view_gen_includes ); unparse_fndeclarations( a_fnfile->fns, v_hfile_printer, view_gen_fnk_h ); unparse_phylumdeclarationsroot( proot, v_hfile_printer, view_gen_fns_end_h ); unparse_phylumdeclarationsroot( proot, v_cfile_printer, view_gen_fns_start_c ); unparse_includedeclarations( IncludeFile( a_filename )->inc[(int)include_file], v_cfile_printer, view_gen_includes ); unparse_phylumdeclarationsroot( proot, v_cfile_printer, view_gen_fns_owninclude_c ); unparse_fndeclarations( a_fnfile->fns, v_cfile_printer, view_gen_fnkdecls_c ); unparse_fndeclarations( a_fnfile->fns, v_cfile_printer, view_gen_fnk_c ); if (fclose( g_cfile ) == EOF) { v_report( Fatal( NoFileLine(), Problem4S( "writing temporary ", g_cfilename, " file failed:", tmp_cfilename ))); } g_cfile = 0; if (fclose( g_hfile ) == EOF) { v_report( Fatal( NoFileLine(), Problem4S( "writing temporary ", g_hfilename, " file failed:", tmp_hfilename ))); } g_hfile = 0; compare_and_delete_or_move(tmp_cfilename, g_cfilename, g_overwriteAlways); compare_and_delete_or_move(tmp_hfilename, g_hfilename, g_overwriteAlways); reset_tempfiles(Thetempcfile, Thetemphfile); FREE((kc_voidptr_t) g_hfilename ); FREE((kc_voidptr_t) g_cfilename ); #line 793 "main.c" } else { kc_no_default_in_with( "main", __LINE__, __FILE__ ); return (int)0; } } #line 608 "../main.k" #line 800 "main.c" } } #line 804 "main.c" } kc_fe_selvar_1 = kc_fe_selvar_1->u.Consfnfiles.fnfiles_1; #line 569 "../main.k" /*SUPPRESS 622*/ assert_fnfiles(kc_fe_selvar_1, "sublist_of_foreach_list_expression"); #line 811 "main.c" } } #line 609 "../main.k" leave( 0 ); exit( 0 ); return( 0 ); #line 613 "../main.k" } #line 822 "main.c" static void make_tempfile_names #ifdef KC_USE_PROTOTYPES (char *Thetempcfile, char *Thetemphfile, char **tmp_cfilename, char **tmp_hfilename) #else (Thetempcfile, Thetemphfile, tmp_cfilename, tmp_hfilename) char *Thetempcfile; char *Thetemphfile; char **tmp_cfilename; char **tmp_hfilename; #endif #line 619 "../main.k" { (void) strcpy(Thetempcfile, ".kc.c.XXXXXX"); (void) strcpy(Thetemphfile, ".kc.h.XXXXXX"); (void) mktemp(Thetempcfile); (void) mktemp(Thetemphfile); *tmp_cfilename = Thetempcfile; *tmp_hfilename = Thetemphfile; #line 626 "../main.k" } #line 844 "main.c" static void reset_tempfiles #ifdef KC_USE_PROTOTYPES (char *Thetempcfile, char *Thetemphfile) #else (Thetempcfile, Thetemphfile) char *Thetempcfile; char *Thetemphfile; #endif #line 629 "../main.k" { (void) strcpy(Thetempcfile, ""); (void) strcpy(Thetemphfile, ""); #line 632 "../main.k" } #line 860 "main.c" static int different #ifdef KC_USE_PROTOTYPES (int f1, int f2, char *fn1, char *fn2) #else (f1, f2, fn1, fn2) int f1; int f2; char *fn1; char *fn2; #endif #line 650 "../main.k" { char buf1[MYBUFSIZ], buf2[MYBUFSIZ]; int characters_read1, characters_read2; #ifdef KC_USE_STAT struct stat stbuf1, stbuf2; if (fstat(f1, &stbuf1) != 0) { perror("kc: error"); v_report( NonFatal( NoFileLine(), Problem2S( "error stat'ing", fn1 ))); } if (fstat(f2, &stbuf2) != 0) { perror("kc: error"); v_report( NonFatal( NoFileLine(), Problem2S( "error stat'ing", fn2 ))); } if (stbuf1.st_size != stbuf2.st_size) { return 1; } #endif while( ! kc_zero_constant ) { if ((characters_read1 = read(f1, buf1, MYBUFSIZ)) == -1) { perror("kc: error"); v_report( Fatal( NoFileLine(), Problem2S( "error while reading from", fn1 ))); } if ((characters_read2 = read(f2, buf2, MYBUFSIZ)) == -1) { perror("kc: error"); v_report( Fatal( NoFileLine(), Problem2S( "error while reading from", fn2 ))); } if (characters_read1 == 0) { if (characters_read2 == 0) return 0; else return 1; } else { if (characters_read2 == 0) return 1; else if ( (characters_read1 != characters_read2) || (memcmp(buf1, buf2, characters_read1) != 0) ) return 1; } } /*NOTREACHED*/ # undef MYBUFSIZ #line 692 "../main.k" } #line 917 "main.c" static void erename #ifdef KC_USE_PROTOTYPES (char *oldfilename, char *newfilename) #else (oldfilename, newfilename) char *oldfilename; char *newfilename; #endif #line 705 "../main.k" { #ifndef KC_STDC if (link(oldfilename, newfilename) != 0) { perror("kc: error"); v_report( NonFatal( NoFileLine(), Problem4S( "could not create", newfilename, "by linking", oldfilename ))); } if (unlink(oldfilename) != 0) { perror("kc: error"); v_report( NonFatal( NoFileLine(), Problem2S( "error while unlinking", oldfilename ))); } #else if (rename(oldfilename, newfilename) != 0) { perror("kc: error"); v_report( NonFatal( NoFileLine(), Problem4S( "error while renaming", oldfilename, "to", newfilename ))); } #endif #line 721 "../main.k" } #line 946 "main.c" static void eremove #ifdef KC_USE_PROTOTYPES (char *filename) #else (filename) char *filename; #endif #line 729 "../main.k" { #ifndef KC_STDC if (unlink(filename) != 0) { perror("kc: error"); v_report( NonFatal( NoFileLine(), Problem2S( "error while unlinking", filename ))); } #else if (remove(filename) != 0) { perror("kc: error"); v_report( NonFatal( NoFileLine(), Problem2S( "error while removing", filename ))); } #endif #line 741 "../main.k" } #line 970 "main.c" static void compare_and_delete_or_move #ifdef KC_USE_PROTOTYPES (char *tmp_filename, char *filename, boolean overwriteAlways) #else (tmp_filename, filename, overwriteAlways) char *tmp_filename; char *filename; boolean overwriteAlways; #endif #line 744 "../main.k" { int tmp_file, file; int they_are_different; if ((file = open(filename, O_RDONLY)) == -1) { erename(tmp_filename, filename); } else if ((tmp_file = open(tmp_filename, O_RDONLY)) == -1) { perror("kc: error"); v_report( Fatal( NoFileLine(), Problem2S( "could not open temporary file", tmp_filename ))); } else { they_are_different = overwriteAlways || different(tmp_file, file, tmp_filename, filename); if (close(tmp_file) == -1) { perror("kc: error"); v_report( NonFatal( NoFileLine(), Problem2S( "error while closing", tmp_filename ))); } if (close(file) == -1) { perror("kc: error"); v_report( NonFatal( NoFileLine(), Problem2S( "error while closing", filename ))); } if (they_are_different) { eremove(filename); erename(tmp_filename, filename); } else { eremove(tmp_filename); } } #line 768 "../main.k" } #line 1008 "main.c" static phylumdeclarations f_add_predefined_phyla #ifdef KC_USE_PROTOTYPES (phylumdeclarations p) #else (p) phylumdeclarations p; #endif #line 771 "../main.k" { return Consphylumdeclarations( v_predefined_voidptr(), Consphylumdeclarations( v_predefined_int(), Consphylumdeclarations( v_predefined_float(), Consphylumdeclarations( v_predefined_casestring(), Consphylumdeclarations( v_predefined_nocasestring(), p ) ) ) ) ); #line 784 "../main.k" } #line 1033 "main.c" static phylumdeclaration v_predefined_int #ifdef KC_USE_PROTOTYPES (void) #else () #endif #line 787 "../main.k" { ID int_pid, int_oid, int_sto; alternative int_alternative; phylumdeclaration int_phylumdeclaration; int_pid = Id( Str( mkcasestring( "int" ) )); int_sto = Id( Str( mkcasestring( "uniq" ) )); int_oid = Id( Str( mkcasestring( "_Int" ) )); int_alternative = Alternative( int_oid, Nilarguments() ); int_phylumdeclaration = PhylumDeclaration( int_pid, PositiveStorageOption( int_sto ), PredefinedAlternatives( Consalternatives( int_alternative, Nilalternatives() )), CcodeOption( Nilattributes(), NilCtexts() ) ); v_defoccur( int_oid, ITPredefinedOperator( int_alternative, int_pid ) ); v_defoccur( int_pid, ITPredefinedBigatomPhylum( int_phylumdeclaration ) ); return int_phylumdeclaration; #line 804 "../main.k" } #line 1062 "main.c" static phylumdeclaration v_predefined_float #ifdef KC_USE_PROTOTYPES (void) #else () #endif #line 807 "../main.k" { ID float_pid, float_oid, float_sto; alternative float_alternative; phylumdeclaration float_phylumdeclaration; float_pid = Id( Str( mkcasestring( "float" ) )); float_sto = Id( Str( mkcasestring( "uniq" ) )); float_oid = Id( Str( mkcasestring( "_Real" ) )); float_alternative = Alternative( float_oid, Nilarguments() ); float_phylumdeclaration = PhylumDeclaration( float_pid, PositiveStorageOption( float_sto ), PredefinedAlternatives( Consalternatives( float_alternative, Nilalternatives() )), CcodeOption( Nilattributes(), NilCtexts() ) ); v_defoccur( float_oid, ITPredefinedOperator( float_alternative, float_pid ) ); v_defoccur( float_pid, ITPredefinedBigatomPhylum( float_phylumdeclaration ) ); return float_phylumdeclaration; #line 824 "../main.k" } #line 1091 "main.c" static phylumdeclaration v_predefined_casestring #ifdef KC_USE_PROTOTYPES (void) #else () #endif #line 827 "../main.k" { ID casestring_pid, casestring_oid, casestring_sto; alternative casestring_alternative; phylumdeclaration casestring_phylumdeclaration; casestring_pid = Id( Str( mkcasestring( "casestring" ) )); casestring_sto = Id( Str( mkcasestring( "uniq" ) )); casestring_oid = Id( Str( mkcasestring( "_Str" ) )); casestring_alternative = Alternative( casestring_oid, Nilarguments() ); casestring_phylumdeclaration = PhylumDeclaration( casestring_pid, PositiveStorageOption( casestring_sto ), PredefinedAlternatives( Consalternatives( casestring_alternative, Nilalternatives() )), CcodeOption( Nilattributes(), NilCtexts() ) ); v_defoccur( casestring_oid, ITPredefinedOperator( casestring_alternative, casestring_pid ) ); v_defoccur( casestring_pid, ITPredefinedPhylum( casestring_phylumdeclaration ) ); return casestring_phylumdeclaration; #line 844 "../main.k" } #line 1120 "main.c" static phylumdeclaration v_predefined_nocasestring #ifdef KC_USE_PROTOTYPES (void) #else () #endif #line 847 "../main.k" { ID nocasestring_pid, nocasestring_oid, nocasestring_sto; alternative nocasestring_alternative; phylumdeclaration nocasestring_phylumdeclaration; nocasestring_pid = Id( Str( mkcasestring( "nocasestring" ) )); nocasestring_sto = Id( Str( mkcasestring( "uniq" ) )); nocasestring_oid = Id( Str( mkcasestring( "NoCaseStr" ) )); nocasestring_alternative = Alternative( nocasestring_oid, Nilarguments() ); nocasestring_phylumdeclaration = PhylumDeclaration( nocasestring_pid, PositiveStorageOption( nocasestring_sto ), PredefinedAlternatives( Consalternatives( nocasestring_alternative, Nilalternatives() )), CcodeOption( Nilattributes(), NilCtexts() ) ); v_defoccur( nocasestring_oid, ITPredefinedOperator( nocasestring_alternative, nocasestring_pid ) ); v_defoccur( nocasestring_pid, ITPredefinedPhylum( nocasestring_phylumdeclaration ) ); return nocasestring_phylumdeclaration; #line 864 "../main.k" } #line 1149 "main.c" static phylumdeclaration v_predefined_voidptr #ifdef KC_USE_PROTOTYPES (void) #else () #endif #line 867 "../main.k" { ID voidptr_pid, voidptr_oid, voidptr_sto; alternative voidptr_alternative; phylumdeclaration voidptr_phylumdeclaration; voidptr_pid = Id( Str( mkcasestring( "voidptr" ) )); voidptr_sto = Id( Str( mkcasestring( "uniq" ) )); voidptr_oid = Id( Str( mkcasestring( "_VoidPtr" ) )); voidptr_alternative = Alternative( voidptr_oid, Nilarguments() ); voidptr_phylumdeclaration = PhylumDeclaration( voidptr_pid, PositiveStorageOption( voidptr_sto ), PredefinedAlternatives( Consalternatives( voidptr_alternative, Nilalternatives() )), CcodeOption( Nilattributes(), NilCtexts() ) ); v_defoccur( voidptr_oid, ITPredefinedOperator( voidptr_alternative, voidptr_pid ) ); v_defoccur( voidptr_pid, ITPredefinedPhylum( voidptr_phylumdeclaration ) ); return voidptr_phylumdeclaration; #line 884 "../main.k" } #line 1178 "main.c" static casestring make_pg_filename #ifdef KC_USE_PROTOTYPES (char *s) #else (s) char *s; #endif #line 888 "../main.k" { return mkcasestring(s); #line 900 "../main.k" } #line 1202 "main.c" static void set_signals #ifdef KC_USE_PROTOTYPES (void) #else () #endif #line 905 "../main.k" { #ifdef SIGHUP signal(SIGHUP, cleanup_and_die); #endif #ifdef SIGINT signal(SIGINT, cleanup_and_die); #endif #ifdef SIGTERM signal(SIGTERM, cleanup_and_die); #endif #ifdef SIGQUIT signal(SIGQUIT, cleanup_and_die); #endif #ifdef SIGBUS signal(SIGBUS, cleanup_and_abort); #endif #ifdef SIGSEGV signal(SIGSEGV, cleanup_and_abort); #endif #ifdef SIGILL signal(SIGILL, cleanup_and_abort); #endif #ifdef SIGIOT signal(SIGIOT, cleanup_and_abort); #endif #ifdef SIGABRT signal(SIGABRT, cleanup_and_abort); #endif #line 935 "../main.k" } #line 1244 "main.c" static void reset_signals #ifdef KC_USE_PROTOTYPES (void) #else () #endif #line 941 "../main.k" { #ifdef SIGHUP signal(SIGHUP, SIG_DFL); #endif #ifdef SIGINT signal(SIGINT, SIG_DFL); #endif #ifdef SIGTERM signal(SIGTERM, SIG_DFL); #endif #ifdef SIGQUIT signal(SIGQUIT, SIG_DFL); #endif #ifdef SIGBUS signal(SIGBUS, SIG_DFL); #endif #ifdef SIGSEGV signal(SIGSEGV, SIG_DFL); #endif #ifdef SIGILL signal(SIGILL, SIG_DFL); #endif #ifdef SIGIOT signal(SIGIOT, SIG_DFL); #endif #ifdef SIGABRT signal(SIGABRT, SIG_DFL); #endif #line 971 "../main.k" } #line 1286 "main.c" static void block_signals #ifdef KC_USE_PROTOTYPES (void) #else () #endif #line 975 "../main.k" { #line 976 "../main.k" } #line 1299 "main.c" static void cleanup_and_die #ifdef KC_USE_PROTOTYPES (int i) #else (i) int i; #endif #line 980 "../main.k" { fprintf(stderr, "%s: received signal, cleaning up\n", g_progname->name); leave(1); #line 987 "../main.k" } #line 1318 "main.c" static void cleanup_and_abort #ifdef KC_USE_PROTOTYPES (int i) #else (i) int i; #endif #line 990 "../main.k" { perror("kc: something horrible happened:"); fprintf(stderr, "%s: received signal, cleaning up\n", g_progname->name); leave(1); #line 994 "../main.k" } #line 1334 "main.c" static void cleanup #ifdef KC_USE_PROTOTYPES (void) #else () #endif #line 998 "../main.k" { block_signals(); if (g_cfile) { if (fclose( g_cfile ) == EOF) { v_report( Fatal( NoFileLine(), Problem2S( "writing temporary file failed:", Thetempcfile ))); } g_cfile = 0; } if (g_hfile) { if (fclose( g_hfile ) == EOF) { v_report( Fatal( NoFileLine(), Problem2S( "writing temporary file failed:", Thetemphfile ))); } g_hfile = 0; } if (Thetempcfile && (strcmp(Thetempcfile, "") != 0) && ((g_cfile = fopen(Thetempcfile, "r")) != NULL)) { (void)fclose( g_cfile ); if (verbose) printf("removing %s\n", Thetempcfile); eremove(Thetempcfile); } if (Thetemphfile && (strcmp(Thetemphfile, "") != 0) && ((g_hfile = fopen(Thetemphfile, "r")) != NULL)) { (void)fclose( g_hfile ); if (verbose) printf("removing %s\n", Thetemphfile); eremove(Thetemphfile); } #line 1029 "../main.k" } #line 1377 "main.c" void leave #ifdef KC_USE_PROTOTYPES (int status) #else (status) int status; #endif #line 1033 "../main.k" { cleanup(); if (gp_no_fatal_problems) { exit( (status==0) ? 0 : status ); } else { exit( (status==0) ? 1 : status ); } #line 1041 "../main.k" } #line 1397 "main.c"