/* @(#)open_files.c 2.1 93/05/18 */ /******************************************************************************/ /* function : open_files.c */ /* */ /* subsystem : chgen */ /* */ /* input : */ /* */ /* output : (opens all output files) */ /* */ /* returns : void */ /* */ /* author : Steve Smith / Craig Smith */ /* */ /* created : July, 1991 */ /* */ /* revisions : */ /* */ /* description : This routine simply opens all output files. The open of the */ /* schema text file is not included here (it is opened by the */ /* main). This is done so that output files can be opened */ /* after parsing and validation are complete. Thus, if the */ /* schema doesn't pass validation, no output files are created. */ /* */ /******************************************************************************/ /******************************************************************************/ /* Modified 5/7/96 by Genlog to open pr_log.c if cli_log == TRUE */ /******************************************************************************/ #include #include #include "chgen_define.h" #include "chgen_externs.h" void open_files() { static char rcsid[] = "$Id: open_files.c,v 1.3.4.1 1999/05/04 17:00:16 jkarner Exp $"; if ((schh_fp=fopen(sch_header_file_name, "w")) == NULL ) { printf("%CHGEN-F-ERROPNOUT, can not create output file %s\n", sch_header_file_name); exit(1); } if ((prload_fp=fopen("pr_load.c", "w")) == NULL ) { printf("%CHGEN-F-ERROPNOUT, can not create output file pr_load.c\n"); exit(1); } if ((prdump_fp=fopen("pr_dump.c", "w")) == NULL ) { printf("%CHGEN-F-ERROPNOUT, can not create output file pr_dump.c\n"); exit(1); } if ((prfree_fp=fopen("pr_free.c", "w")) == NULL ) { printf("%CHGEN-F-ERROPNOUT, can not create output file pr_free.c\n"); exit(1); } if ((prdel_fp=fopen("pr_delete.c", "w")) == NULL ) { printf("%CHGEN-F-ERROPNOUT, can not create output file pr_delete.c\n"); exit(1); } if ((prstats_fp=fopen("pr_stats.c", "w")) == NULL ) { printf("%CHGEN-F-ERROPNOUT, can not create output file pr_stats.c\n"); exit(1); } if (cli_log == TRUE) { if ((prlog_fp=fopen("pr_log.c", "w")) == NULL) { printf("%CHGEN-F-ERROPNOUT, can not create output file pr_log.c\n"); exit(1); } } return; }