@@ -25,11 +25,16 @@ (declare (uses mtargs)) (use regex regex-case) (module configfmod -* + ( + lookup + configf:lookup + get-section + configf:get-section + ) (import scheme chicken extras files @@ -203,10 +208,12 @@ (if match ;; (and match (list? match)(> (length match) 1)) (cadr match) #f)) )) #f)) + +(define lookup configf:lookup) ;; use to have definitive setting: ;; [foo] ;; var yes ;; @@ -234,10 +241,12 @@ '() (map car sectdat)))) (define (configf:get-section cfgdat section) (hash-table-ref/default cfgdat section '())) + +(define get-section configf:get-section) (define (configf:set-section-var cfgdat section var val) (let ((sectdat (configf:get-section cfgdat section))) (hash-table-set! cfgdat section (configf:assoc-safe-add sectdat var val))))