source: app/src/dgp/common.cc @ 0214596

help
Last change on this file since 0214596 was 0214596, checked in by pawelk <pawelk@…>, 16 years ago

Dodalismy do pakietu utt komponent dgp (brak configow i innych bajerow).

git-svn-id: svn://atos.wmid.amu.edu.pl/utt@24 e293616e-ec6a-49c2-aa92-f4a8b91c5d16

  • Property mode set to 100644
File size: 812 bytes
Line 
1#include <stdlib.h>
2#include <string.h>
3#include "common.h"
4
5FILE* inputf=stdin;
6FILE* outputf=stdout;
7FILE* failedf=stdout;
8bool copy_processed=0;
9
10void process_common_options(gengetopt_args_info args)
11{
12  if(args.help_given)
13      cmdline_parser_print_help ();
14
15  if(args.input_given)
16    if(!(inputf=fopen(args.input_arg,"r")))
17    {
18      fprintf(stderr,"No such file: %s.\n", args.input_arg);
19      exit(1);
20    }
21 
22  if(args.output_given)
23    if(!(outputf=fopen(args.output_arg,"w")))
24    {
25      fprintf(stderr,"Cannot open output file: %s.\n", args.output_arg);
26      exit(1);
27    }
28 
29  if(args.failed_given)
30      if(!(failedf=fopen(args.failed_arg,"w")))
31      {
32        fprintf(stderr,"Cannot open output file: %s.\n", args.failed_arg);
33        exit(1);
34      }
35
36
37  if(args.copy_given)
38    copy_processed=true;
39}
Note: See TracBrowser for help on using the repository browser.