… | |
… | |
60 | result = malloc(sizeof(*result)); |
60 | result = malloc(sizeof(*result)); |
61 | *result = default_config; |
61 | *result = default_config; |
62 | return result; |
62 | return result; |
63 | } |
63 | } |
64 | |
64 | |
65 | psiconv_config_free(psiconv_config config) |
65 | void psiconv_config_free(psiconv_config config) |
66 | { |
66 | { |
67 | free(config); |
67 | free(config); |
68 | } |
68 | } |
69 | |
69 | |
70 | void psiconv_config_parse_statement(const char *filename, |
70 | void psiconv_config_parse_statement(const char *filename, |
… | |
… | |
73 | psiconv_config *config) |
73 | psiconv_config *config) |
74 | { |
74 | { |
75 | int charnr; |
75 | int charnr; |
76 | |
76 | |
77 | if (!(strcasecmp(var,"verbosity"))) { |
77 | if (!(strcasecmp(var,"verbosity"))) { |
78 | if ((value >= 1) && (value <= 4)) |
78 | if ((value >= 1) && (value <= 5)) |
79 | (*config)->verbosity = value; |
79 | (*config)->verbosity = value; |
80 | else |
80 | else |
81 | psiconv_error(*config,0,0,"Configuration file %s, line %d: " |
81 | psiconv_error(*config,0,0,"Configuration file %s, line %d: " |
82 | "Verbosity should be between 1 and 5",filename,linenr); |
82 | "Verbosity should be between 1 and 5",filename,linenr); |
83 | } else if (!(strcasecmp(var,"color"))) { |
83 | } else if (!(strcasecmp(var,"color"))) { |
… | |
… | |
113 | } else if (!(strcasecmp(var,"characterset"))) { |
113 | } else if (!(strcasecmp(var,"characterset"))) { |
114 | if ((value >= 0) && (value <= 1)) |
114 | if ((value >= 0) && (value <= 1)) |
115 | psiconv_unicode_select_characterset(*config,value); |
115 | psiconv_unicode_select_characterset(*config,value); |
116 | else |
116 | else |
117 | psiconv_error(*config,0,0,"Configuration file %s, line %d: " |
117 | psiconv_error(*config,0,0,"Configuration file %s, line %d: " |
118 | "CharacterSet should be between 0 and 0", |
118 | "CharacterSet should be between 0 and 1", |
119 | filename,linenr); |
119 | filename,linenr); |
120 | } else if (!(strcasecmp(var,"unknownunicodechar"))) { |
120 | } else if (!(strcasecmp(var,"unknownunicodechar"))) { |
121 | if ((value >= 1) && (value < 0x10000)) |
121 | if ((value >= 1) && (value < 0x10000)) |
122 | (*config)->unknown_unicode_char = value; |
122 | (*config)->unknown_unicode_char = value; |
123 | else |
123 | else |
… | |
… | |
357 | } |
357 | } |
358 | |
358 | |
359 | psiconv_config_parse_file(filename,config); |
359 | psiconv_config_parse_file(filename,config); |
360 | free(filename); |
360 | free(filename); |
361 | } |
361 | } |
|
|
362 | free(path); |
362 | } |
363 | } |