chickadee » toml

TOML

A Chicken wrapper for the TOML configuration language

Requirements

r7rs rfc3339 coops

Usage

(import toml)

Loading TOML configuration

(table-from-file FILENAME) --> <TomlTable>syntax

Loads FILENAME contents as a TOML configuration.

(table-from-string STRING) --> <TomlTable>syntax

Loads the contents of STRING as TOML configuration.

Tables

(toml-self-key TOMLTABLE) --> stringsyntax

Returns the key, if any, to which TOMLTABLE is assigned.

(toml-key-exists? TOMLTABLE KEY) --> boolsyntax

Checks if KEY exists in TOMLTABLE.

(toml-count-key-vals TOMLTABLE) --> intsyntax
(toml-count-arrays TOMLTABLE) --> intsyntax
(toml-count-tables TOMLTABLE) --> intsyntax

Returns the number of key-value entries, arrays, or tables respectively in TOMLTABLE.

(toml-key-at TOMLTABLE INDEX) --> stringsyntax

Returns the table key at position INDEX in TOMLTABLE.

(toml-string TOMLTABLE KEY) --> stringsyntax
(toml-bool TOMLTABLE KEY) --> boolsyntax
(toml-int TOMLTABLE KEY) --> intsyntax
(toml-double TOMLTABLE KEY) --> doublesyntax
(toml-timestamp TOMLTABLE KEY) --> rfc3339syntax
(toml-array TOMLTABLE KEY) --> <TomlArray>syntax
(toml-table TOMLTABLE KEY) --> <TomlTable>syntax

Returns the element of the given type in TOMLTABLE at KEY.

Arrays

(toml-self-key TOMLARRAY) --> stringsyntax

Returns the key, if any, to which TOMLARRAY is assigned.

(toml-count-entries TOMLARRAY) --> intsyntax

Returns the number of entries in TOMLARRAY.

(toml-string TOMLARRAY KEY) --> stringsyntax
(toml-bool TOMLARRAY KEY) --> boolsyntax
(toml-int TOMLARRAY KEY) --> intsyntax
(toml-double TOMLARRAY KEY) --> doublesyntax
(toml-timestamp TOMLARRAY KEY) --> rfc3339syntax
(toml-array TOMLARRAY KEY) --> <TomlArray>syntax
(toml-table TOMLARRAY KEY) --> <TomlTable>syntax

Returns the element of the given type in TOMLARRAY at KEY.

About this egg

Authors

Daniel Ziltener

CK Tan

Repository

The repository of the Chicken wrapper can be found at https://gitea.lyrion.ch/Chicken/toml.

The repository of the C implementation being wrapped can be found at https://github.com/cktan/tomlc99.

Version History

0.8
updated the tomlc99 dependency
0.7
fixed an issue with timestamp parsing
0.6
first version of the wrapper

License

MIT License

Copyright (c) Daniel Ziltener https://gitea.lyrion.ch/Chicken/toml

Copyright (c) CK Tan https://github.com/cktan/tomlc99

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Contents »