#include "process_args.h" #include #include FILE *lrs_ifp; FILE *lrs_ofp; void lrs_overflow (int ignored) { fprintf (stderr, "lrs_overflow called. exiting\n"); exit(1); } void process_args(int argc, char **argv,char *docstring){ if (argc > 1 && argv[1][0]=='-' && argv[1][1]=='h') { fprintf(stderr,docstring); fprintf(stderr,"\n\nusage: %s [infile] [outfile]\n",argv[0]); exit(1); } if (argc > 1){ freopen(argv[1],"r",stdin); } if (argc > 2){ freopen(argv[2],"w",stdout); } lrs_ifp = stdin; lrs_ofp = stdout; }