| 4164 | extern const char *const known_restrictions[]; /* symbols.c */ |
| 4165 | |
| 4166 | staticfn int |
| 4167 | optfn_symset( |
| 4168 | int optidx, int req, boolean negated UNUSED, |
| 4169 | char *opts, char *op) |
| 4170 | { |
| 4171 | if (req == do_init) { |
| 4172 | return optn_ok; |
| 4173 | } |
| 4174 | if (req == do_set) { |
| 4175 | if (op != empty_optstr) { |
| 4176 | if (gs.symset[PRIMARYSET].name) |
| 4177 | free((genericptr_t) gs.symset[PRIMARYSET].name), |
| 4178 | gs.symset[PRIMARYSET].name = 0; |
| 4179 | gs.symset[PRIMARYSET].name = dupstr(op); |
| 4180 | if (!read_sym_file(PRIMARYSET)) { |
| 4181 | clear_symsetentry(PRIMARYSET, TRUE); |
| 4182 | config_error_add( |
| 4183 | "Unable to load symbol set \"%s\" from \"%s\"", op, |
| 4184 | SYMBOLS); |
| 4185 | return optn_err; |
| 4186 | } else { |
| 4187 | if (gs.symset[PRIMARYSET].handling) { |
| 4188 | #ifndef ENHANCED_SYMBOLS |
| 4189 | if (gs.symset[PRIMARYSET].handling == H_UTF8) { |
| 4190 | config_error_add( |
| 4191 | "Unavailable symset handler \"%s\" for %s", |
| 4192 | known_handling[H_UTF8], op); |
| 4193 | load_symset("default", PRIMARYSET); |
| 4194 | } |
| 4195 | #endif |
| 4196 | } |
| 4197 | switch_symbols(gs.symset[PRIMARYSET].name != (char *) 0); |
| 4198 | go.opt_need_redraw = go.opt_need_glyph_reset = TRUE; |
| 4199 | go.opt_symset_changed = TRUE; |
| 4200 | } |
| 4201 | } else |
| 4202 | return optn_err; |
| 4203 | return optn_ok; |
| 4204 | } |
| 4205 | if (req == get_val) { |
| 4206 | Sprintf(opts, "%s", |
| 4207 | gs.symset[PRIMARYSET].name ? gs.symset[PRIMARYSET].name |
| 4208 | : "default"); |
| 4209 | if (gc.currentgraphics == PRIMARYSET && gs.symset[PRIMARYSET].name) |
| 4210 | Strcat(opts, ", active"); |
| 4211 | if (gs.symset[PRIMARYSET].handling) { |
| 4212 | Sprintf(eos(opts), ", handler=%s", |
| 4213 | known_handling[gs.symset[PRIMARYSET].handling]); |
| 4214 | } |
| 4215 | return optn_ok; |
| 4216 | } |
| 4217 | if (req == get_cnf_val) { |
| 4218 | Sprintf(opts, "%s", |
| 4219 | gs.symset[PRIMARYSET].name ? gs.symset[PRIMARYSET].name |
| 4220 | : "default"); |
| 4221 | return optn_ok; |
| 4222 | } |
| 4223 | if (req == do_handler) { |
nothing calls this directly
no test coverage detected