From 358f080c76dbdfc65f32e08448a5e38b78d2bab0 Mon Sep 17 00:00:00 2001 From: txtsd Date: Tue, 12 Jul 2022 20:46:06 +0530 Subject: chore(markdown): MD012 Multiple consecutive blank lines Signed-off-by: txtsd --- libraries/tomlc99/README.md | 2 -- 1 file changed, 2 deletions(-) (limited to 'libraries/tomlc99') diff --git a/libraries/tomlc99/README.md b/libraries/tomlc99/README.md index 6715b5be..d2776448 100644 --- a/libraries/tomlc99/README.md +++ b/libraries/tomlc99/README.md @@ -10,7 +10,6 @@ If you are looking for a C++ library, you might try this wrapper: [https://githu [iarna/toml-spec-tests](https://github.com/iarna/toml-spec-tests). * Provides very simple and intuitive interface. - ## Usage Please see the `toml.h` file for details. What follows is a simple example that @@ -183,7 +182,6 @@ To test against the standard test set provided by BurntSushi/toml-test: % bash run.sh # this will run the test suite ``` - To test against the standard test set provided by iarna/toml: ```sh -- cgit From fba20e2cfb2bcf10b9987f74a3d454b59b079fa6 Mon Sep 17 00:00:00 2001 From: txtsd Date: Tue, 12 Jul 2022 21:04:57 +0530 Subject: chore(markdown): MD040 Fenced code blocks should have a language specified Signed-off-by: txtsd --- libraries/tomlc99/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libraries/tomlc99') diff --git a/libraries/tomlc99/README.md b/libraries/tomlc99/README.md index d2776448..103024f0 100644 --- a/libraries/tomlc99/README.md +++ b/libraries/tomlc99/README.md @@ -150,7 +150,7 @@ call was successful. If so, you may proceed to read the value corresponding to the type of the content. For example: -``` +```c toml_datum_t host = toml_string_in(tab, "host"); if (host.ok) { printf("host: %s\n", host.u.s); -- cgit From 19ecb1701e42eb277bfe5b185aec051a300f66dd Mon Sep 17 00:00:00 2001 From: txtsd Date: Wed, 13 Jul 2022 00:23:51 +0530 Subject: chore(markdown): MD031 Fenced code blocks should be surrounded by blank lines Signed-off-by: txtsd --- libraries/tomlc99/README.md | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libraries/tomlc99') diff --git a/libraries/tomlc99/README.md b/libraries/tomlc99/README.md index 103024f0..8a144e70 100644 --- a/libraries/tomlc99/README.md +++ b/libraries/tomlc99/README.md @@ -102,6 +102,7 @@ general, all access functions on tables are named `toml_*_in(...)`. In the normal case, you know the key and its content type, and retrievals can be done using one of these functions: + ```c toml_string_in(tab, key); toml_bool_in(tab, key); @@ -113,6 +114,7 @@ toml_array_in(tab, key); ``` You can also interrogate the keys in a table using an integer index: + ```c toml_table_t* tab = toml_parse_file(...); for (int i = 0; ; i++) { @@ -127,11 +129,13 @@ for (int i = 0; ; i++) { TOML arrays can be deref-ed using integer indices. In general, all access methods on arrays are named `toml_*_at()`. To obtain the size of an array: + ```c int size = toml_array_nelem(arr); ``` To obtain the content of an array, use a valid index and call one of these functions: + ```c toml_string_at(arr, idx); toml_bool_at(arr, idx); @@ -150,6 +154,7 @@ call was successful. If so, you may proceed to read the value corresponding to the type of the content. For example: + ```c toml_datum_t host = toml_string_in(tab, "host"); if (host.ok) { -- cgit From 96a91e988d7e87c3185efc930cc38de4c24e5d96 Mon Sep 17 00:00:00 2001 From: txtsd Date: Wed, 13 Jul 2022 00:25:03 +0530 Subject: chore(markdown): MD010 Hard tabs Signed-off-by: txtsd --- libraries/tomlc99/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libraries/tomlc99') diff --git a/libraries/tomlc99/README.md b/libraries/tomlc99/README.md index 8a144e70..7a0eecff 100644 --- a/libraries/tomlc99/README.md +++ b/libraries/tomlc99/README.md @@ -17,8 +17,8 @@ parses this config file: ```toml [server] - host = "www.example.com" - port = [ 8080, 8181, 8282 ] + host = "www.example.com" + port = [ 8080, 8181, 8282 ] ``` The steps for getting values from our file is usually : @@ -158,8 +158,8 @@ For example: ```c toml_datum_t host = toml_string_in(tab, "host"); if (host.ok) { - printf("host: %s\n", host.u.s); - free(host.u.s); /* FREE applies to string and timestamp types only */ + printf("host: %s\n", host.u.s); + free(host.u.s); /* FREE applies to string and timestamp types only */ } ``` -- cgit From 123d1864f430ef23b3c1fc5627c2f16284136fca Mon Sep 17 00:00:00 2001 From: txtsd Date: Wed, 13 Jul 2022 00:25:49 +0530 Subject: chore(markdown): MD037 Spaces inside emphasis markers Signed-off-by: txtsd --- libraries/tomlc99/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libraries/tomlc99') diff --git a/libraries/tomlc99/README.md b/libraries/tomlc99/README.md index 7a0eecff..1ac4d8c9 100644 --- a/libraries/tomlc99/README.md +++ b/libraries/tomlc99/README.md @@ -163,7 +163,7 @@ if (host.ok) { } ``` -** IMPORTANT: if the accessed value is a string or a timestamp, you must call `free(datum.u.s)` or `free(datum.u.ts)` respectively after usage. ** +**IMPORTANT: if the accessed value is a string or a timestamp, you must call `free(datum.u.s)` or `free(datum.u.ts)` respectively after usage.** ## Building and installing -- cgit From 78dc0cfdf3aab90af359c8639a77e0165a916f2b Mon Sep 17 00:00:00 2001 From: txtsd Date: Wed, 13 Jul 2022 00:46:24 +0530 Subject: chore(markdown): MD001 Heading levels should only increment by one level at a time Signed-off-by: txtsd --- libraries/tomlc99/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libraries/tomlc99') diff --git a/libraries/tomlc99/README.md b/libraries/tomlc99/README.md index 1ac4d8c9..e5fe9480 100644 --- a/libraries/tomlc99/README.md +++ b/libraries/tomlc99/README.md @@ -95,7 +95,7 @@ int main() } ``` -#### Accessing Table Content +### Accessing Table Content TOML tables are dictionaries where lookups are done using string keys. In general, all access functions on tables are named `toml_*_in(...)`. @@ -124,7 +124,7 @@ for (int i = 0; ; i++) { } ``` -#### Accessing Array Content +### Accessing Array Content TOML arrays can be deref-ed using integer indices. In general, all access methods on arrays are named `toml_*_at()`. @@ -146,7 +146,7 @@ toml_table_at(arr, idx); toml_array_at(arr, idx); ``` -#### toml_datum_t +### toml_datum_t Some `toml_*_at` and `toml_*_in` functions return a toml_datum_t structure. The `ok` flag in the structure indicates if the function -- cgit