/[public]/psiconv/trunk/program/psiconv/psiconv.c
ViewVC logotype

Diff of /psiconv/trunk/program/psiconv/psiconv.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 152 Revision 180
52#include "magick-aux.h" 52#include "magick-aux.h"
53#endif 53#endif
54 54
55#include "psiconv/data.h" 55#include "psiconv/data.h"
56#include "psiconv/parse.h" 56#include "psiconv/parse.h"
57#include "psiconv/configuration.h"
57#include "gen.h" 58#include "gen.h"
58#include "psiconv.h" 59#include "psiconv.h"
59 60
60static void print_help(void); 61static void print_help(void);
61static void print_version(void); 62static void print_version(void);
130 int c,i,res; 131 int c,i,res;
131 psiconv_buffer buf; 132 psiconv_buffer buf;
132 psiconv_file file; 133 psiconv_file file;
133 psiconv_fileformat ff; 134 psiconv_fileformat ff;
134 135
135 psiconv_verbosity = PSICONV_VERB_WARN; 136 psiconv_config config = psiconv_config_default();
137 psiconv_config_read(NULL,&config);
136 138
137 fileformat_list = psiconv_list_new(sizeof(struct psiconv_fileformat_s)); 139 fileformat_list = psiconv_list_new(sizeof(struct psiconv_fileformat_s));
138 init_txt(); 140 init_txt();
139 init_html(); 141 init_html();
140 init_html4(); 142 init_html4();
147 if (c == -1) 149 if (c == -1)
148 break; 150 break;
149 switch(c) { 151 switch(c) {
150 case 'h': print_help(); exit(0); 152 case 'h': print_help(); exit(0);
151 case 'V': print_version(); exit(0); 153 case 'V': print_version(); exit(0);
152 case 'v': if (psiconv_verbosity < PSICONV_VERB_PROGRESS) 154 case 'v': if (config->verbosity < PSICONV_VERB_PROGRESS)
153 psiconv_verbosity = PSICONV_VERB_PROGRESS; 155 config->verbosity = PSICONV_VERB_PROGRESS;
154 break; 156 break;
155 case 'd': psiconv_verbosity = PSICONV_VERB_DEBUG; break; 157 case 'd': config->verbosity = PSICONV_VERB_DEBUG; break;
156 case 's': psiconv_verbosity = PSICONV_VERB_FATAL; break; 158 case 's': config->verbosity = PSICONV_VERB_FATAL; break;
157 case 'o': outputfilename = strdup(optarg); break; 159 case 'o': outputfilename = strdup(optarg); break;
158 case 'T': type = strdup(optarg); break; 160 case 'T': type = strdup(optarg); break;
159 case 'u': encoding_type = PSICONV_ENCODING_UTF8; break; 161 case 'u': encoding_type = PSICONV_ENCODING_UTF8; break;
160 case '?': case ':': fputs("Try `-h' for more information\n",stderr); 162 case '?': case ':': fputs("Try `-h' for more information\n",stderr);
161 exit(1); 163 exit(1);
194 if (fclose(f)) { 196 if (fclose(f)) {
195 perror(inputfilename); 197 perror(inputfilename);
196 exit(1); 198 exit(1);
197 } 199 }
198 200
199 if (psiconv_parse(buf,&file) || (file->type == psiconv_unknown_file)) 201 if (psiconv_parse(config,buf,&file) || (file->type == psiconv_unknown_file))
200 { 202 {
201 fprintf(stderr,"Parse error\n"); 203 fprintf(stderr,"Parse error\n");
202 exit(1); 204 exit(1);
203 } 205 }
204 206

Legend:
Removed from v.152  
changed lines
  Added in v.180

frodo@frodo.looijaard.name
ViewVC Help
Powered by ViewVC 1.1.26