(index ("read-property" 0) ("read-ini" 494) ("write-ini" 963) ("default-section" 1757) ("property-separator" 2005) ("property-separator-patt" 2234) ("property-value-map" 2473) ("allow-empty-values?" 2783) ("allow-bare-properties?" 3034))
(def (sig (procedure "(read-property [port])" (id read-property))) (p "Reads a single INI property from " (tt "port") ". If it is a section header, returns a symbol. If it is a property or property/value pair, a pair is returned. Invalid properties will signal an error.") (p "Numeric values and quoted strings are read as Scheme data; everything else is treated as a string. Any such string mapped by the " (tt "property-value-map") " parameter will be replaced by its corresponding value."))
(def (sig (procedure "(read-ini [file-or-port])" (id read-ini))) (p "Reads configuration directives from " (tt "file-or-port") " until " (tt "#!eof") ", returning an alist of alists corresponding hierarchically to the source INI's SECTION -> PROPERTY -> VALUE structure.") (p "Properties appearing before any section heading are associated with the key given by the " (tt "default-section") " parameter.") (p "If " (tt "file-or-port") " is a port, it is not closed."))
(def (sig (procedure "(write-ini alist [file-or-port])" (id write-ini))) (p "Writes " (tt "alist") " as INI directives to " (tt "file-or-port") ".") (p "A symbol at the head of " (tt "alist") " signifies a section of that name. The write order of sections and properties is reverse that of " (tt "alist") ".") (p "The " (tt "property-separator") " parameter specifies the character or string with which to separate property names & values when writing.") (p "The " (tt "property-separator-patt") " parameter specifies the regex speparator pattern for which to separate property names & values when reading.") (p "Any value mapped to by the " (tt "property-value-map") " parameter will be replaced by its first corresponding key.") (p "If " (tt "file-or-port") " is a port, it is not closed."))
(def (sig (parameter "(default-section [name])" (id default-section))) (p "Specifies the default alist key (usually a symbol) under which properties without a section label will be placed by " (tt "read-ini") ". Defaults to " (tt "'default") "."))
(def (sig (parameter "(property-separator [char-or-string])" (id property-separator))) (p "Specifies the character or string to be used by " (tt "write-ini") " to separate property names & values. Defaults to " (tt "#\\=") "."))
(def (sig (parameter "(property-separator-patt [string-or-regex])" (id property-separator-patt))) (p "Specifies the string or regex to be used by " (tt "read-ini") " to separate property names & values. Defaults to " (tt "\" * *\"") "."))
(def (sig (parameter "(property-value-map [alist])" (id property-value-map))) (p "Specifies an alist mapping strings to Scheme values, used to translate INI values to & from Scheme data when reading & writing INI files.") (p "The default map is simply:") (pre "   '((\"true\"  . #t)\n     (\"false\" . #f))"))
(def (sig (parameter "(allow-empty-values? [boolean])" (id allow-empty-values?))) (p "Specifies whether the empty string should be treated as a valid property value. If " (tt "#f") ", an empty value will signal an error. Defaults to " (tt "#f") "."))
(def (sig (parameter "(allow-bare-properties? [boolean])" (id allow-bare-properties?))) (p "Specifies whether \"bare\" properties (those without a value) should be allowed. If " (tt "#f") ", a line not following \"key separator value\" format will signal an error. Defaults to " (tt "#f") "."))
