… | |
… | |
42 | #include "psiconv.h" |
42 | #include "psiconv.h" |
43 | |
43 | |
44 | static void print_help(void); |
44 | static void print_help(void); |
45 | static void print_version(void); |
45 | static void print_version(void); |
46 | static void strtoupper(char *str); |
46 | static void strtoupper(char *str); |
47 | |
|
|
48 | int psiconv_verbosity = PSICONV_VERB_WARN; |
|
|
49 | |
47 | |
50 | void print_help(void) |
48 | void print_help(void) |
51 | { |
49 | { |
52 | psiconv_fileformat ff; |
50 | psiconv_fileformat ff; |
53 | int i,j; |
51 | int i,j; |
… | |
… | |
113 | int c,i,res; |
111 | int c,i,res; |
114 | psiconv_buffer buf; |
112 | psiconv_buffer buf; |
115 | psiconv_file file; |
113 | psiconv_file file; |
116 | psiconv_fileformat ff; |
114 | psiconv_fileformat ff; |
117 | |
115 | |
|
|
116 | psiconv_verbosity = PSICONV_VERB_WARN; |
|
|
117 | |
118 | fileformat_list = psiconv_list_new(sizeof(struct psiconv_fileformat_s)); |
118 | fileformat_list = psiconv_list_new(sizeof(struct psiconv_fileformat_s)); |
119 | init_txt(); |
119 | init_txt(); |
120 | init_html(); |
120 | init_html(); |
121 | init_html4(); |
121 | init_html4(); |
122 | init_rtf(); |
122 | init_rtf(); |
… | |
… | |
131 | case 'V': print_version(); exit(0); |
131 | case 'V': print_version(); exit(0); |
132 | case 'v': if (psiconv_verbosity < PSICONV_VERB_PROGRESS) |
132 | case 'v': if (psiconv_verbosity < PSICONV_VERB_PROGRESS) |
133 | psiconv_verbosity = PSICONV_VERB_PROGRESS; |
133 | psiconv_verbosity = PSICONV_VERB_PROGRESS; |
134 | break; |
134 | break; |
135 | case 'd': psiconv_verbosity = PSICONV_VERB_DEBUG; break; |
135 | case 'd': psiconv_verbosity = PSICONV_VERB_DEBUG; break; |
136 | case 's': psiconv_verbosity = PSICONV_VERB_SILENT; break; |
136 | case 's': psiconv_verbosity = PSICONV_VERB_FATAL; break; |
137 | case 'e': exact = 1; break; |
137 | case 'e': exact = 1; break; |
138 | case 'o': outputfilename = strdup(optarg); break; |
138 | case 'o': outputfilename = strdup(optarg); break; |
139 | case 'T': type = strdup(optarg); break; |
139 | case 'T': type = strdup(optarg); break; |
140 | case '?': case ':': fputs("Try `-h' for more information\n",stderr); |
140 | case '?': case ':': fputs("Try `-h' for more information\n",stderr); |
141 | exit(1); |
141 | exit(1); |
… | |
… | |
148 | fputs("I can only convert one file!\n" |
148 | fputs("I can only convert one file!\n" |
149 | "Try `-h' for more information\n",stderr); |
149 | "Try `-h' for more information\n",stderr); |
150 | exit(1); |
150 | exit(1); |
151 | } else if (optind == argc-1) |
151 | } else if (optind == argc-1) |
152 | inputfilename = strdup(argv[optind]); |
152 | inputfilename = strdup(argv[optind]); |
|
|
153 | |
153 | |
154 | |
154 | /* Open inputfile for reading */ |
155 | /* Open inputfile for reading */ |
155 | |
156 | |
156 | if (strlen(inputfilename) != 0) { |
157 | if (strlen(inputfilename) != 0) { |
157 | if(stat(inputfilename,&fbuf) < 0) { |
158 | if(stat(inputfilename,&fbuf) < 0) { |