fixing egg build process

This commit is contained in:
Daniel Ziltener 2022-09-05 21:43:24 +02:00
parent 5dc271b32c
commit 09d198a4eb
6 changed files with 400 additions and 392 deletions

View file

@ -1,14 +1,18 @@
## ##
# Toml # Toml
# #
# @file # @file
# @version 0.1 # @version 0.1
.PHONY: salmonella .PHONY: salmonella
salmonella: salmonella:
rm -rf report rm -rf report
rm -f toml*.so rm -f toml*.so
salmonella --keep-repo --repo-dir=./petri-dish; \ salmonella --keep-repo --repo-dir=./petri-dish; \
salmonella-html-report ./salmonella.log report salmonella-html-report ./salmonella.log report
# end tomlc99/toml.c:
git clone https://github.com/cktan/tomlc99.git
cd tomlc99; git checkout e4107c455491925b8982c22df1ce37c0ccb7d4e4
# end

3
init-tomlc99.sh Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env sh
make tomlc99/toml.c

View file

@ -1,241 +1,239 @@
(import (chicken base) (import (chicken base)
scheme scheme
(scheme base) (scheme base)
(srfi 69) (chicken foreign)
(chicken foreign) (chicken memory)
(chicken memory) (chicken gc)
(chicken gc) (chicken format)
(chicken format) rfc3339
rfc3339 coops
foreigners coops-primitive-objects)
coops
coops-primitive-objects) (foreign-declare "#include <toml.h>")
(foreign-declare "#include <toml.h>") (define (zeropad n)
(if (< n 10)
(define (zeropad n) (sprintf "0~S" n)
(if (< n 10) (sprintf "~S" n)))
(sprintf "0~S" n)
(sprintf "~S" n))) (define (set-toml-table-finalizer ttable)
(set-finalizer! ttable
(define (set-toml-table-finalizer ttable) (lambda (obj)
(set-finalizer! ttable ((foreign-lambda* void ((c-pointer ttp))
(lambda (obj) "toml_free(ttp);")
((foreign-lambda* void ((c-pointer ttp)) (ptr ttable)))))
"toml_free(ttp);")
(ptr ttable))))) (define-class <TomlArray> ()
((ptr :accessor ptr :initform #f)))
(define-class <TomlArray> ()
((ptr :accessor ptr :initform #f))) (define-class <TomlTable> ()
((ptr :accessor ptr :initform #f)))
(define-class <TomlTable> ()
((ptr :accessor ptr :initform #f)))
(define-method (toml-self-key (tarr <TomlArray>))
((foreign-lambda* c-string ((c-pointer tarr))
(define-method (toml-self-key (tarr <TomlArray>)) "C_return(toml_array_key(tarr));")
((foreign-lambda* c-string ((c-pointer tarr)) (ptr tarr)))
"C_return(toml_array_key(tarr));")
(ptr tarr))) (define-method (toml-count-entries (tarr <TomlArray>))
((foreign-lambda* int ((c-pointer tarr))
(define-method (toml-count-entries (tarr <TomlArray>)) "C_return(toml_array_nelem(tarr));")
((foreign-lambda* int ((c-pointer tarr)) (ptr tarr)))
"C_return(toml_array_nelem(tarr));")
(ptr tarr))) (define-method (toml-string (tarr <TomlArray>) (index <integer>))
((foreign-primitive ((c-pointer tarr)
(define-method (toml-string (tarr <TomlArray>) (index <integer>)) (int index))
((foreign-primitive ((c-pointer tarr) "toml_datum_t datum = toml_string_at(tarr, index);"
(int index)) "C_word* s = C_alloc(C_SIZEOF_STRING(strlen(datum.u.s)));"
"toml_datum_t datum = toml_string_at(tarr, index);" "C_word data[3] = { C_SCHEME_UNDEFINED, C_k, C_string2(&s, datum.u.s) };"
"C_word* s = C_alloc(C_SIZEOF_STRING(strlen(datum.u.s)));" "free(datum.u.s);"
"C_word data[3] = { C_SCHEME_UNDEFINED, C_k, C_string2(&s, datum.u.s) };" "C_values(3, data);")
"free(datum.u.s);" (ptr tarr) index))
"C_values(3, data);")
(ptr tarr) index)) (define-method (toml-bool (tarr <TomlArray>) (index <integer>))
((foreign-lambda* bool ((c-pointer tarr)
(define-method (toml-bool (tarr <TomlArray>) (index <integer>)) (int index))
((foreign-lambda* bool ((c-pointer tarr) "C_return(toml_bool_at(tarr, index).u.b);")
(int index)) (ptr tarr) index))
"C_return(toml_bool_at(tarr, index).u.b);")
(ptr tarr) index)) (define-method (toml-int (tarr <TomlArray>) (index <integer>))
((foreign-lambda* int ((c-pointer tarr)
(define-method (toml-int (tarr <TomlArray>) (index <integer>)) (int index))
((foreign-lambda* int ((c-pointer tarr) "C_return(toml_int_at(tarr, index).u.i);")
(int index)) (ptr tarr) index))
"C_return(toml_int_at(tarr, index).u.i);")
(ptr tarr) index)) (define-method (toml-double (tarr <TomlArray>) (index <integer>))
((foreign-lambda* double ((c-pointer tarr)
(define-method (toml-double (tarr <TomlArray>) (index <integer>)) (int index))
((foreign-lambda* double ((c-pointer tarr) "C_return(toml_double_at(tarr, index).u.d);")
(int index)) (ptr tarr) index))
"C_return(toml_double_at(tarr, index).u.d);")
(ptr tarr) index)) (define-method (toml-timestamp (tarr <TomlArray>) (index <integer>))
(let*-values (((Y M D h m s millis z)
(define-method (toml-timestamp (tarr <TomlArray>) (index <integer>)) ((foreign-primitive ((c-pointer tarr)
(let*-values (((Y M D h m s millis z) (int index))
((foreign-primitive ((c-pointer tarr) "toml_datum_t datum = toml_timestamp_at(tarr, index);"
(int index)) "toml_timestamp_t* stamp = datum.u.ts;"
"toml_datum_t datum = toml_timestamp_at(tarr, index);" "C_word* s = C_alloc(C_SIZEOF_STRING(strlen(stamp->z)));"
"toml_timestamp_t* stamp = datum.u.ts;" "C_word data[10] = { C_SCHEME_UNDEFINED, C_k, "
"C_word* s = C_alloc(C_SIZEOF_STRING(strlen(stamp->z)));" "C_fix(stamp->year ? *stamp->year : 0), C_fix(stamp->month ? *stamp->month : 0), C_fix(stamp->day ? *stamp->day : 0), "
"C_word data[10] = { C_SCHEME_UNDEFINED, C_k, " "C_fix(stamp->hour ? *stamp->hour : 0), C_fix(stamp->minute ? *stamp->minute : 0),"
"C_fix(stamp->year ? *stamp->year : 0), C_fix(stamp->month ? *stamp->month : 0), C_fix(stamp->day ? *stamp->day : 0), " "C_fix(stamp->second ? *stamp->second : 0), C_fix(stamp->millisec ? *stamp->second : 0), "
"C_fix(stamp->hour ? *stamp->hour : 0), C_fix(stamp->minute ? *stamp->minute : 0)," "C_string2(&s, stamp->z ?: \"Z\") } ;"
"C_fix(stamp->second ? *stamp->second : 0), C_fix(stamp->millisec ? *stamp->second : 0), " "free(datum.u.ts);"
"C_string2(&s, stamp->z ?: \"Z\") } ;" "C_values(10, data);")
"free(datum.u.ts);" (ptr tarr) index))
"C_values(10, data);") ((rfcstr) (sprintf "~A-~A-~AT~A:~A:~A.~A~A"
(ptr tarr) index)) Y (zeropad M) (zeropad D)
((rfcstr) (sprintf "~A-~A-~AT~A:~A:~A.~A~A" (zeropad h) (zeropad m) (zeropad s)
Y (zeropad M) (zeropad D) millis z)))
(zeropad h) (zeropad m) (zeropad s) (string->rfc3339 rfcstr)))
millis z)))
(string->rfc3339 rfcstr))) (define-method (toml-array (tarr <TomlArray>) (index <integer>))
(make <TomlArray> 'ptr
(define-method (toml-array (tarr <TomlArray>) (index <integer>)) ((foreign-lambda* c-pointer ((c-pointer tarr)
(make <TomlArray> 'ptr (int index))
((foreign-lambda* c-pointer ((c-pointer tarr) "C_return(toml_array_at(tarr, index));")
(int index)) (ptr tarr) index)))
"C_return(toml_array_at(tarr, index));")
(ptr tarr) index))) (define-method (toml-table (tarr <TomlArray>) (index <integer>))
(make <TomlTable> 'ptr
(define-method (toml-table (tarr <TomlArray>) (index <integer>)) ((foreign-lambda* c-pointer ((c-pointer tarr)
(make <TomlTable> 'ptr (int index))
((foreign-lambda* c-pointer ((c-pointer tarr) "C_return(toml_table_at(tarr, index));")
(int index)) (ptr tarr) index)))
"C_return(toml_table_at(tarr, index));")
(ptr tarr) index)))
(define (table-from-file filename)
(let ((ttp ((foreign-lambda* c-pointer ((c-string fname))
(define (table-from-file filename) "FILE* fp = fopen(fname, \"r\");"
(let ((ttp ((foreign-lambda* c-pointer ((c-string fname)) "char errbuf[200];"
"FILE* fp = fopen(fname, \"r\");" "toml_table_t* conf = toml_parse_file(fp, errbuf, sizeof(errbuf));"
"char errbuf[200];" "fclose(fp);"
"toml_table_t* conf = toml_parse_file(fp, errbuf, sizeof(errbuf));" "C_return(conf);")
"fclose(fp);" filename)))
"C_return(conf);") (when (not (eq? ttp 0))
filename))) (let ((tomltable (make <TomlTable> 'ptr ttp)))
(when (not (eq? ttp 0)) (set-toml-table-finalizer tomltable)
(let ((tomltable (make <TomlTable> 'ptr ttp))) tomltable))))
(set-toml-table-finalizer tomltable)
tomltable)))) (define (table-from-string str)
(let ((ttp ((foreign-lambda* c-pointer ((c-string confdata))
(define (table-from-string str) "char errbuf[200];"
(let ((ttp ((foreign-lambda* c-pointer ((c-string confdata)) "toml_table_t* conf = toml_parse(confdata, errbuf, sizeof(errbuf));"
"char errbuf[200];" "C_return(conf);")
"toml_table_t* conf = toml_parse(confdata, errbuf, sizeof(errbuf));" str)))
"C_return(conf);") (when (not (eq? ttp 0))
str))) (let ((tomltable (make <TomlTable> 'ptr ttp)))
(when (not (eq? ttp 0)) (set-toml-table-finalizer tomltable)
(let ((tomltable (make <TomlTable> 'ptr ttp))) tomltable))))
(set-toml-table-finalizer tomltable)
tomltable)))) (define (set-toml-datum-string-finalizer tdatum)
(set-finalizer! tdatum
(define (set-toml-datum-string-finalizer tdatum) (lambda (obj)
(set-finalizer! tdatum ((foreign-lambda* void ((c-pointer tdat))
(lambda (obj) "free(tdat);")
((foreign-lambda* void ((c-pointer tdat)) (ptr tdatum)))))
"free(tdat);")
(ptr tdatum))))) (define-method (toml-self-key (ttbl <TomlTable>))
((foreign-lambda* c-string ((c-pointer ttbl))
(define-method (toml-self-key (ttbl <TomlTable>)) "C_return(toml_table_key(ttbl));")
((foreign-lambda* c-string ((c-pointer ttbl)) (ptr ttbl)))
"C_return(toml_table_key(ttbl));")
(ptr ttbl))) (define-method (toml-key-exists? (ttbl <TomlTable>) (key <string>))
(= 1
(define-method (toml-key-exists? (ttbl <TomlTable>) (key <string>)) ((foreign-lambda* int ((c-pointer ttbl)
(= 1 (c-string key))
((foreign-lambda* int ((c-pointer ttbl) "C_return(toml_key_exists(ttbl, key));")
(c-string key)) (ptr ttbl) key)))
"C_return(toml_key_exists(ttbl, key));")
(ptr ttbl) key))) (define-method (toml-count-key-vals (ttbl <TomlTable>))
((foreign-lambda* int ((c-pointer ttbl))
(define-method (toml-count-key-vals (ttbl <TomlTable>)) "C_return(toml_table_nkval(ttbl));")
((foreign-lambda* int ((c-pointer ttbl)) (ptr ttbl)))
"C_return(toml_table_nkval(ttbl));")
(ptr ttbl))) (define-method (toml-count-arrays (ttbl <TomlTable>))
((foreign-lambda* int ((c-pointer ttbl))
(define-method (toml-count-arrays (ttbl <TomlTable>)) "C_return(toml_table_narr(ttbl));")
((foreign-lambda* int ((c-pointer ttbl)) (ptr ttbl)))
"C_return(toml_table_narr(ttbl));")
(ptr ttbl))) (define-method (toml-count-tables (ttbl <TomlTable>))
((foreign-lambda* int ((c-pointer ttbl))
(define-method (toml-count-tables (ttbl <TomlTable>)) "C_return(toml_table_ntab(ttbl));")
((foreign-lambda* int ((c-pointer ttbl)) (ptr ttbl)))
"C_return(toml_table_ntab(ttbl));")
(ptr ttbl))) (define-method (toml-key-at (ttbl <TomlTable>) (index <integer>))
((foreign-lambda* c-string ((c-pointer ttbl)
(define-method (toml-key-at (ttbl <TomlTable>) (index <integer>)) (int index))
((foreign-lambda* c-string ((c-pointer ttbl) "C_return(toml_key_in(ttbl, index));")
(int index)) (ptr ttbl) index))
"C_return(toml_key_in(ttbl, index));")
(ptr ttbl) index)) (define-method (toml-string (ttbl <TomlTable>) (key <string>))
((foreign-primitive ((c-pointer ttbl)
(define-method (toml-string (ttbl <TomlTable>) (key <string>)) (c-string key))
((foreign-primitive ((c-pointer ttbl) "toml_datum_t datum = toml_string_in(ttbl, key);"
(c-string key)) "C_word* s = C_alloc(C_SIZEOF_STRING(strlen(datum.u.s)));"
"toml_datum_t datum = toml_string_in(ttbl, key);" "C_word data[3] = { C_SCHEME_UNDEFINED, C_k, C_string2(&s, datum.u.s) };"
"C_word* s = C_alloc(C_SIZEOF_STRING(strlen(datum.u.s)));" "free(datum.u.s);"
"C_word data[3] = { C_SCHEME_UNDEFINED, C_k, C_string2(&s, datum.u.s) };" "C_values(3, data);")
"free(datum.u.s);" (ptr ttbl) key))
"C_values(3, data);")
(ptr ttbl) key)) (define-method (toml-bool (ttbl <TomlTable>) (key <string>))
((foreign-lambda* bool ((c-pointer ttbl)
(define-method (toml-bool (ttbl <TomlTable>) (key <string>)) (c-string key))
((foreign-lambda* bool ((c-pointer ttbl) "C_return(toml_bool_in(ttbl, key).u.b);")
(c-string key)) (ptr ttbl) key))
"C_return(toml_bool_in(ttbl, key).u.b);")
(ptr ttbl) key)) (define-method (toml-int (ttbl <TomlTable>) (key <string>))
((foreign-lambda* int ((c-pointer ttbl)
(define-method (toml-int (ttbl <TomlTable>) (key <string>)) (c-string key))
((foreign-lambda* int ((c-pointer ttbl) "C_return(toml_int_in(ttbl, key).u.i);")
(c-string key)) (ptr ttbl) key))
"C_return(toml_int_in(ttbl, key).u.i);")
(ptr ttbl) key)) (define-method (toml-double (ttbl <TomlTable>) (key <string>))
((foreign-lambda* double ((c-pointer ttbl)
(define-method (toml-double (ttbl <TomlTable>) (key <string>)) (c-string key))
((foreign-lambda* double ((c-pointer ttbl) "C_return(toml_double_in(ttbl, key).u.d);")
(c-string key)) (ptr ttbl) key))
"C_return(toml_double_in(ttbl, key).u.d);")
(ptr ttbl) key)) (define-method (toml-timestamp (ttbl <TomlTable>) (key <string>))
(let*-values (((Y M D h m s millis z)
(define-method (toml-timestamp (ttbl <TomlTable>) (key <string>)) ((foreign-primitive ((c-pointer ttbl)
(let*-values (((Y M D h m s millis z) (c-string key))
((foreign-primitive ((c-pointer ttbl) "toml_datum_t datum = toml_timestamp_in(ttbl, key);"
(c-string key)) "toml_timestamp_t* stamp = datum.u.ts;"
"toml_datum_t datum = toml_timestamp_in(ttbl, key);" "C_word* s = C_alloc(C_SIZEOF_STRING(strlen(stamp->z)));"
"toml_timestamp_t* stamp = datum.u.ts;" "C_word data[10] = { C_SCHEME_UNDEFINED, C_k, "
"C_word* s = C_alloc(C_SIZEOF_STRING(strlen(stamp->z)));" "C_fix(stamp->year ? *stamp->year : 0), C_fix(stamp->month ? *stamp->month : 0), C_fix(stamp->day ? *stamp->day : 0), "
"C_word data[10] = { C_SCHEME_UNDEFINED, C_k, " "C_fix(stamp->hour ? *stamp->hour : 0), C_fix(stamp->minute ? *stamp->minute : 0),"
"C_fix(stamp->year ? *stamp->year : 0), C_fix(stamp->month ? *stamp->month : 0), C_fix(stamp->day ? *stamp->day : 0), " "C_fix(stamp->second ? *stamp->second : 0), C_fix(stamp->millisec ? *stamp->second : 0), "
"C_fix(stamp->hour ? *stamp->hour : 0), C_fix(stamp->minute ? *stamp->minute : 0)," "C_string2(&s, stamp->z ?: \"Z\") } ;"
"C_fix(stamp->second ? *stamp->second : 0), C_fix(stamp->millisec ? *stamp->second : 0), " "free(datum.u.ts);"
"C_string2(&s, stamp->z ?: \"Z\") } ;" "C_values(10, data);")
"free(datum.u.ts);" (ptr ttbl) key))
"C_values(10, data);") ((rfcstr) (sprintf "~A-~A-~AT~A:~A:~A.~A~A"
(ptr ttbl) key)) Y (zeropad M) (zeropad D)
((rfcstr) (sprintf "~A-~A-~AT~A:~A:~A.~A~A" (zeropad h) (zeropad m) (zeropad s)
Y (zeropad M) (zeropad D) millis z)))
(zeropad h) (zeropad m) (zeropad s) (string->rfc3339 rfcstr)))
millis z)))
(string->rfc3339 rfcstr))) (define-method (toml-array (ttbl <TomlTable>) (key <string>))
(make <TomlArray> 'ptr
(define-method (toml-array (ttbl <TomlTable>) (key <string>)) ((foreign-lambda* c-pointer ((c-pointer ttbl)
(make <TomlArray> 'ptr (c-string key))
((foreign-lambda* c-pointer ((c-pointer ttbl) "C_return(toml_array_in(ttbl, key));")
(c-string key)) (ptr ttbl) key)))
"C_return(toml_array_in(ttbl, key));")
(ptr ttbl) key))) (define-method (toml-table (ttbl <TomlTable>) (key <string>))
(make <TomlTable> 'ptr
(define-method (toml-table (ttbl <TomlTable>) (key <string>)) ((foreign-lambda* c-pointer ((c-pointer ttbl)
(make <TomlTable> 'ptr (c-string key))
((foreign-lambda* c-pointer ((c-pointer ttbl) "C_return(toml_table_in(ttbl, key));")
(c-string key)) (ptr ttbl) key)))
"C_return(toml_table_in(ttbl, key));")
(ptr ttbl) key)))

View file

@ -1,16 +1,19 @@
;; -*- mode: scheme -*- ;; -*- mode: scheme -*-
((author "Daniel Ziltener") ((author "Daniel Ziltener")
(synopsis "A Chicken binding to read TOML configuration files") (synopsis "A Chicken binding to read TOML configuration files")
(category parsing) (category parsing)
(license "MIT") (license "MIT")
(version "0.5.0") (version "0.6")
(dependencies r7rs rfc3339 coops) (dependencies r7rs rfc3339 coops)
(test-dependencies srfi-64 srfi-152) (test-dependencies srfi-64 srfi-152)
(components (components
(c-object tomlc99/toml (generated-source-file tomlc99/toml.c
(source "tomlc99/toml.c")) (custom-build "init-tomlc99.sh"))
(extension toml (c-object tomlc99/toml
(objects tomlc99/toml) (source-dependencies tomlc99/toml.c)
(csc-options "-X" "r7rs" "-R" "r7rs" "-K" "prefix" "-sJ" (source "tomlc99/toml.c"))
"-Itomlc99")))) (extension toml
(objects tomlc99/toml)
(csc-options "-X" "r7rs" "-R" "r7rs" "-K" "prefix" "-sJ"
"-Itomlc99"))))

View file

@ -1,3 +1,3 @@
(repo git "https://gitea.lyrion.ch/zilti/toml.git") (repo git "https://gitea.lyrion.ch/zilti/toml.git")
(uri targz "https://gitea.lyrion.ch/zilti/toml/archive/{egg-release}.tar.gz") (uri targz "https://gitea.lyrion.ch/zilti/toml/archive/{egg-release}.tar.gz")
(release "0.5") (release "0.6")

236
toml.wiki
View file

@ -1,118 +1,118 @@
[[tags: egg]] [[tags: egg]]
[[toc:]] [[toc:]]
== TOML == TOML
A Chicken wrapper for the TOML configuration language A Chicken wrapper for the TOML configuration language
=== Requirements === Requirements
[[/eggref/5/r7rs|r7rs]] [[/eggref/5/r7rs|r7rs]]
[[/eggref/5/rfc3339|rfc3339]] [[/eggref/5/rfc3339|rfc3339]]
[[/eggref/5/coops|coops]] [[/eggref/5/coops|coops]]
=== Usage === Usage
<enscript language=scheme> <enscript language=scheme>
(import toml) (import toml)
</enscript> </enscript>
=== Loading TOML configuration === Loading TOML configuration
<syntax>(table-from-file FILENAME) --> <TomlTable></syntax> <syntax>(table-from-file FILENAME) --> <TomlTable></syntax>
Loads {{FILENAME}} contents as a TOML configuration. Loads {{FILENAME}} contents as a TOML configuration.
<syntax>(table-from-string STRING) --> <TomlTable></syntax> <syntax>(table-from-string STRING) --> <TomlTable></syntax>
Loads the contents of {{STRING}} as TOML configuration. Loads the contents of {{STRING}} as TOML configuration.
=== Tables === Tables
<syntax>(toml-self-key TOMLTABLE) --> string</syntax> <syntax>(toml-self-key TOMLTABLE) --> string</syntax>
Returns the key, if any, to which {{TOMLTABLE}} is assigned. Returns the key, if any, to which {{TOMLTABLE}} is assigned.
<syntax>(toml-key-exists? TOMLTABLE KEY) --> bool</syntax> <syntax>(toml-key-exists? TOMLTABLE KEY) --> bool</syntax>
Checks if {{KEY}} exists in {{TOMLTABLE}}. Checks if {{KEY}} exists in {{TOMLTABLE}}.
<syntax>(toml-count-key-vals TOMLTABLE) --> int</syntax> <syntax>(toml-count-key-vals TOMLTABLE) --> int</syntax>
<syntax>(toml-count-arrays TOMLTABLE) --> int</syntax> <syntax>(toml-count-arrays TOMLTABLE) --> int</syntax>
<syntax>(toml-count-tables TOMLTABLE) --> int</syntax> <syntax>(toml-count-tables TOMLTABLE) --> int</syntax>
Returns the number of key-value entries, arrays, or tables respectively in {{TOMLTABLE}}. Returns the number of key-value entries, arrays, or tables respectively in {{TOMLTABLE}}.
<syntax>(toml-key-at TOMLTABLE INDEX) --> string</syntax> <syntax>(toml-key-at TOMLTABLE INDEX) --> string</syntax>
Returns the table key at position {{INDEX}} in {{TOMLTABLE}}. Returns the table key at position {{INDEX}} in {{TOMLTABLE}}.
<syntax>(toml-string TOMLTABLE KEY) --> string</syntax> <syntax>(toml-string TOMLTABLE KEY) --> string</syntax>
<syntax>(toml-bool TOMLTABLE KEY) --> bool</syntax> <syntax>(toml-bool TOMLTABLE KEY) --> bool</syntax>
<syntax>(toml-int TOMLTABLE KEY) --> int</syntax> <syntax>(toml-int TOMLTABLE KEY) --> int</syntax>
<syntax>(toml-double TOMLTABLE KEY) --> double</syntax> <syntax>(toml-double TOMLTABLE KEY) --> double</syntax>
<syntax>(toml-timestamp TOMLTABLE KEY) --> rfc3339</syntax> <syntax>(toml-timestamp TOMLTABLE KEY) --> rfc3339</syntax>
<syntax>(toml-array TOMLTABLE KEY) --> <TomlArray></syntax> <syntax>(toml-array TOMLTABLE KEY) --> <TomlArray></syntax>
<syntax>(toml-table TOMLTABLE KEY) --> <TomlTable></syntax> <syntax>(toml-table TOMLTABLE KEY) --> <TomlTable></syntax>
Returns the element of the given type in {{TOMLTABLE}} at {{KEY}}. Returns the element of the given type in {{TOMLTABLE}} at {{KEY}}.
=== Arrays === Arrays
<syntax>(toml-self-key TOMLARRAY) --> string</syntax> <syntax>(toml-self-key TOMLARRAY) --> string</syntax>
Returns the key, if any, to which {{TOMLARRAY}} is assigned. Returns the key, if any, to which {{TOMLARRAY}} is assigned.
<syntax>(toml-count-entries TOMLARRAY) --> int</syntax> <syntax>(toml-count-entries TOMLARRAY) --> int</syntax>
Returns the number of entries in {{TOMLARRAY}}. Returns the number of entries in {{TOMLARRAY}}.
<syntax>(toml-string TOMLARRAY KEY) --> string</syntax> <syntax>(toml-string TOMLARRAY KEY) --> string</syntax>
<syntax>(toml-bool TOMLARRAY KEY) --> bool</syntax> <syntax>(toml-bool TOMLARRAY KEY) --> bool</syntax>
<syntax>(toml-int TOMLARRAY KEY) --> int</syntax> <syntax>(toml-int TOMLARRAY KEY) --> int</syntax>
<syntax>(toml-double TOMLARRAY KEY) --> double</syntax> <syntax>(toml-double TOMLARRAY KEY) --> double</syntax>
<syntax>(toml-timestamp TOMLARRAY KEY) --> rfc3339</syntax> <syntax>(toml-timestamp TOMLARRAY KEY) --> rfc3339</syntax>
<syntax>(toml-array TOMLARRAY KEY) --> <TomlArray></syntax> <syntax>(toml-array TOMLARRAY KEY) --> <TomlArray></syntax>
<syntax>(toml-table TOMLARRAY KEY) --> <TomlTable></syntax> <syntax>(toml-table TOMLARRAY KEY) --> <TomlTable></syntax>
Returns the element of the given type in {{TOMLARRAY}} at {{KEY}}. Returns the element of the given type in {{TOMLARRAY}} at {{KEY}}.
== About this egg == About this egg
=== Authors === Authors
Daniel Ziltener Daniel Ziltener
CK Tan CK Tan
=== Repository === Repository
The repository of the Chicken wrapper can be found at [[https://gitea.lyrion.ch/zilti/toml|https://gitea.lyrion.ch/zilti/toml]]. The repository of the Chicken wrapper can be found at [[https://gitea.lyrion.ch/zilti/toml|https://gitea.lyrion.ch/zilti/toml]].
The repository of the C implementation being wrapped can be found at [[https://github.com/cktan/tomlc99|https://github.com/cktan/tomlc99]]. The repository of the C implementation being wrapped can be found at [[https://github.com/cktan/tomlc99|https://github.com/cktan/tomlc99]].
=== Version History === Version History
; 0.5 : first version of the wrapper ; 0.6 : first version of the wrapper
=== License === License
MIT License MIT License
Copyright (c) Daniel Ziltener Copyright (c) Daniel Ziltener
https://gitea.lyrion.ch/zilti/toml https://gitea.lyrion.ch/zilti/toml
Copyright (c) CK Tan Copyright (c) CK Tan
https://github.com/cktan/tomlc99 https://github.com/cktan/tomlc99
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 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 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.