Differences From Artifact [035be18ade]:
- File
configf.scm
— part of check-in
[669204e634]
at
2017-04-26 14:29:42
on branch v1.64
— MTA fix
CherryPicked backout 70a3. (user: ritikaag, size: 33411) [annotate] [blame] [check-ins using]
To Artifact [23b5854111]:
- File configf.scm — part of check-in [8e05d02c79] at 2017-05-15 17:41:18 on branch v1.64 — Get numbers from the configs using protected call with default (user: mrwellan, size: 33929) [annotate] [blame] [check-ins using] [more...]
︙ | |||
423 424 425 426 427 428 429 430 431 432 433 434 435 436 | 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 | + + + + + + + + + + + + + | (cadr match) #f)) )) #f)) (define configf:lookup config-lookup) (define configf:read-file read-config) ;; safely look up a value that is expected to be a number, return ;; a default (#f unless provided) ;; (define (configf:lookup-number cfdat section varname #!key (default #f)) (let* ((val (configf:lookup *configdat* section varname)) (res (if val (string->number (string-substitute "\\s+" "" val #t)) #f))) (cond (res res) (val (debug:print 0 *default-log-port* "ERROR: no number found for [" section "], " varname ", got: " val)) (else default)))) (define (configf:section-vars cfgdat section) (let ((sectdat (hash-table-ref/default cfgdat section '()))) (if (null? sectdat) '() (map car sectdat)))) |
︙ |