| 4236 | } |
| 4237 | |
| 4238 | staticfn int |
| 4239 | optfn_term_cols( |
| 4240 | int optidx, int req, boolean negated, |
| 4241 | char *opts, char *op) |
| 4242 | { |
| 4243 | int retval = optn_ok; |
| 4244 | long ltmp; |
| 4245 | |
| 4246 | if (req == do_init) { |
| 4247 | return optn_ok; |
| 4248 | } |
| 4249 | if (req == do_set) { |
| 4250 | /* WINCAP2 |
| 4251 | * term_cols:amount */ |
| 4252 | |
| 4253 | if ((op = string_for_opt(opts, negated)) != empty_optstr) { |
| 4254 | ltmp = atol(op); |
| 4255 | /* just checks atol() sanity, not logical window size sanity |
| 4256 | */ |
| 4257 | if (ltmp <= 0L || ltmp >= (long) LARGEST_INT) { |
| 4258 | config_error_add("Invalid %s: %ld", allopt[optidx].name, |
| 4259 | ltmp); |
| 4260 | retval = optn_err; |
| 4261 | } else { |
| 4262 | iflags.wc2_term_cols = (int) ltmp; |
| 4263 | } |
| 4264 | } |
| 4265 | return retval; |
| 4266 | } |
| 4267 | if (req == get_val || req == get_cnf_val) { |
| 4268 | if (iflags.wc2_term_cols) |
| 4269 | Sprintf(opts, "%d", iflags.wc2_term_cols); |
| 4270 | else if (req == get_cnf_val) |
| 4271 | opts[0] = '\0'; |
| 4272 | else |
| 4273 | Strcpy(opts, defopt); |
| 4274 | return optn_ok; |
| 4275 | } |
| 4276 | return optn_ok; |
| 4277 | } |
| 4278 | |
| 4279 | staticfn int |
| 4280 | optfn_term_rows( |
nothing calls this directly
no test coverage detected