Skip to content

Commit

Permalink
Release v0.3.0 (#23)
Browse files Browse the repository at this point in the history
* Update ChangeLog

* meson: set version to 0.3.0, comment out sanitizer

* Doxyfile: No to inline sources, yes to source_browser

* Add more info to README

* tests: Add skip_attributes
  • Loading branch information
andy5995 committed Feb 29, 2024
1 parent cfa4ac0 commit bb21c3e
Show file tree
Hide file tree
Showing 31 changed files with 879 additions and 240 deletions.
8 changes: 4 additions & 4 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Canfigger ChangeLog

2024-02-26
2024-02-29

- remove canfigger_attr
* release v0.3.0

2024-02-25
Changes since 2024-02-21

* canfigger_free() replaced with canfigger_free_current_key_node_advance()
* canfigger_free_attr() removed
* use 'canfigger_free_current_attr_str_advance()' instead of
'list->attr_node = list->attr_node->next'
* canfigger_attr points to the current attribute, or NULL if there is none
* In meson.build, rename dep_canfigger->canfigger_dep
* lines starting with '[' are ignored

2024-02-21

Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![actions-c-badge]][actions-c-url]
[![cirrus-badge]][cirrus-url]

# canfigger v0.3.0999
# canfigger v0.3.0

Canfigger is a lightweight C language library designed to parse configuration
files. It provides functionality to read them and represent their contents as
Expand Down Expand Up @@ -61,6 +61,18 @@ An example program will be built when you run `ninja`. It will read
different config file, give `example` the name of a config file as an
argument.

## Using canfigger in your project

If canfigger is not available for your operating system or distribution, you
can copy the required sources (and the LICENSE file) into your project and add
them to your build system. The line `include <config.h>` from the top of the
.c file will need to be removed, as it is normally generated during the Meson
setup and only contains version information.

Alternatively, if your project uses Meson, you can add a [wrap
file](https://mesonbuild.com/Wrap-dependency-system-manual.html#wrap-dependency-system-manual)
for canfigger in your 'subprojects' directory.

<!-- Add your project here if it has had at least one release -->
## Projects using canfigger

Expand Down
13 changes: 12 additions & 1 deletion ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
Release Notes for v0.3.0

will be added here before the upcoming release.
This version introduces breaking changes. Please see example.c in the source
root directory for usage.

Notable changes:

* Use dynamic memory allocation for keys, values, and attributes.
* canfigger_free() replaced with canfigger_free_current_key_node_advance()
* canfigger_free_attr() removed
* use 'canfigger_free_current_attr_str_advance()' instead of
'list->attr_node = list->attr_node->next'
* In meson.build, rename dep_canfigger->canfigger_dep
* lines starting with '[' are ignored
2 changes: 1 addition & 1 deletion docs/annotated.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">canfigger<span id="projectnumber">&#160;v0.3.0</span>
<div id="projectname">canfigger<span id="projectnumber">&#160;v0.3.x</span>
</div>
<div id="projectbrief">Lightweight config file parser library</div>
</td>
Expand Down
542 changes: 542 additions & 0 deletions docs/canfigger_8c_source.html

Large diffs are not rendered by default.

202 changes: 17 additions & 185 deletions docs/canfigger_8h.html

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/canfigger_8h_source.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">canfigger<span id="projectnumber">&#160;v0.3.0</span>
<div id="projectname">canfigger<span id="projectnumber">&#160;v0.3.x</span>
</div>
<div id="projectbrief">Lightweight config file parser library</div>
</td>
Expand Down Expand Up @@ -107,11 +107,11 @@
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span><span class="keywordtype">void</span> <a class="code hl_function" href="canfigger_8h.html#a095f7a89a1f2e3422870165280205a0b">canfigger_free_current_key_node_advance</a>(<span class="keyword">struct</span> <a class="code hl_struct" href="canfigger_8h.html#structCanfigger">Canfigger</a> **list);</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> </div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span><span class="keywordtype">void</span> <a class="code hl_function" href="canfigger_8h.html#ae6d70f9e366beaa126a989bb2b4457b8">canfigger_free_current_attr_str_advance</a>(<span class="keyword">struct</span> <a class="code hl_struct" href="canfigger_8h.html#structattributes">attributes</a> *<a class="code hl_struct" href="canfigger_8h.html#structattributes">attributes</a>, <span class="keywordtype">char</span> **attr);</div>
<div class="ttc" id="acanfigger_8h_html_a095f7a89a1f2e3422870165280205a0b"><div class="ttname"><a href="canfigger_8h.html#a095f7a89a1f2e3422870165280205a0b">canfigger_free_current_key_node_advance</a></div><div class="ttdeci">void canfigger_free_current_key_node_advance(struct Canfigger **list)</div><div class="ttdoc">Frees the current key node and advances to the next node in the list.</div><div class="ttdef"><b>Definition</b> canfigger.c:115</div></div>
<div class="ttc" id="acanfigger_8h_html_a37053197894e04e253629a9bdae52da0"><div class="ttname"><a href="canfigger_8h.html#a37053197894e04e253629a9bdae52da0">canfigger_parse_file</a></div><div class="ttdeci">struct Canfigger * canfigger_parse_file(const char *file, const int delimiter)</div><div class="ttdoc">Parses a configuration file and creates a linked list of key-value pairs.</div><div class="ttdef"><b>Definition</b> canfigger.c:330</div></div>
<div class="ttc" id="acanfigger_8h_html_ae6d70f9e366beaa126a989bb2b4457b8"><div class="ttname"><a href="canfigger_8h.html#ae6d70f9e366beaa126a989bb2b4457b8">canfigger_free_current_attr_str_advance</a></div><div class="ttdeci">void canfigger_free_current_attr_str_advance(struct attributes *attributes, char **attr)</div><div class="ttdoc">Frees the current attribute string and advances to the next attribute.</div><div class="ttdef"><b>Definition</b> canfigger.c:86</div></div>
<div class="ttc" id="acanfigger_8h_html_structCanfigger"><div class="ttname"><a href="canfigger_8h.html#structCanfigger">Canfigger</a></div><div class="ttdoc">Structure to represent a key-value pair with attributes in the configuration.</div><div class="ttdef"><b>Definition</b> canfigger.h:60</div></div>
<div class="ttc" id="acanfigger_8h_html_structattributes"><div class="ttname"><a href="canfigger_8h.html#structattributes">attributes</a></div><div class="ttdoc">Structure to hold attribute details of a configuration key.</div><div class="ttdef"><b>Definition</b> canfigger.h:44</div></div>
<div class="ttc" id="acanfigger_8h_html_a095f7a89a1f2e3422870165280205a0b"><div class="ttname"><a href="canfigger_8h.html#a095f7a89a1f2e3422870165280205a0b">canfigger_free_current_key_node_advance</a></div><div class="ttdeci">void canfigger_free_current_key_node_advance(struct Canfigger **list)</div><div class="ttdoc">Frees the current key node and advances to the next node in the list.</div><div class="ttdef"><b>Definition</b> <a href="canfigger_8c_source.html#l00114">canfigger.c:114</a></div></div>
<div class="ttc" id="acanfigger_8h_html_a37053197894e04e253629a9bdae52da0"><div class="ttname"><a href="canfigger_8h.html#a37053197894e04e253629a9bdae52da0">canfigger_parse_file</a></div><div class="ttdeci">struct Canfigger * canfigger_parse_file(const char *file, const int delimiter)</div><div class="ttdoc">Parses a configuration file and creates a linked list of key-value pairs.</div><div class="ttdef"><b>Definition</b> <a href="canfigger_8c_source.html#l00330">canfigger.c:330</a></div></div>
<div class="ttc" id="acanfigger_8h_html_ae6d70f9e366beaa126a989bb2b4457b8"><div class="ttname"><a href="canfigger_8h.html#ae6d70f9e366beaa126a989bb2b4457b8">canfigger_free_current_attr_str_advance</a></div><div class="ttdeci">void canfigger_free_current_attr_str_advance(struct attributes *attributes, char **attr)</div><div class="ttdoc">Frees the current attribute string and advances to the next attribute.</div><div class="ttdef"><b>Definition</b> <a href="canfigger_8c_source.html#l00075">canfigger.c:75</a></div></div>
<div class="ttc" id="acanfigger_8h_html_structCanfigger"><div class="ttname"><a href="canfigger_8h.html#structCanfigger">Canfigger</a></div><div class="ttdoc">Structure to represent a key-value pair with attributes in the configuration.</div><div class="ttdef"><b>Definition</b> <a href="#l00059">canfigger.h:60</a></div></div>
<div class="ttc" id="acanfigger_8h_html_structattributes"><div class="ttname"><a href="canfigger_8h.html#structattributes">attributes</a></div><div class="ttdoc">Structure to hold attribute details of a configuration key.</div><div class="ttdef"><b>Definition</b> <a href="#l00043">canfigger.h:44</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Expand Down
2 changes: 2 additions & 0 deletions docs/doxygen_crawl.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
</head>
<body>
<a href="example_8c-example.html"/>
<a href="canfigger_8c_source.html"/>
<a href="canfigger_8h_source.html"/>
<a href="example_8c_source.html"/>
<a href="canfigger_8h.html"/>
<a href="index.html"/>
<a href="doxygen_crawl.html"/>
Expand Down
7 changes: 7 additions & 0 deletions docs/dynsections.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,10 @@ let codefold = {
},
};
/* @license-end */
$(function() {
$('.code,.codeRef').each(function() {
$(this).data('powertip',$('#a'+$(this).attr('href').replace(/.*\//,'').replace(/[^a-z_A-Z0-9]/g,'_')).html());
$.fn.powerTip.smartPlacementLists.s = [ 's', 'n', 'ne', 'se' ];
$(this).powerTip({ placement: 's', smartPlacement: true, mouseOnToPopup: true });
});
});
28 changes: 21 additions & 7 deletions docs/example_8c-example.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">canfigger<span id="projectnumber">&#160;v0.3.0</span>
<div id="projectname">canfigger<span id="projectnumber">&#160;v0.3.x</span>
</div>
<div id="projectbrief">Lightweight config file parser library</div>
</td>
Expand Down Expand Up @@ -82,7 +82,7 @@
<div class="line"><span class="keywordtype">int</span></div>
<div class="line">main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> *argv[])</div>
<div class="line">{</div>
<div class="line"> <span class="keywordtype">char</span> *default_filename = <span class="stringliteral">&quot;../examplerc&quot;</span>;</div>
<div class="line"> <span class="keywordtype">char</span> *default_filename = SOURCE_DIR <span class="stringliteral">&quot;/examplerc&quot;</span>;</div>
<div class="line"> <span class="keywordtype">char</span> *filename_ptr = default_filename;</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">if</span> (argc == 2)</div>
Expand All @@ -108,6 +108,9 @@
<div class="line"> <span class="keywordflow">if</span> (!config)</div>
<div class="line"> <span class="keywordflow">return</span> -1;</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// i is only used for testing</span></div>
<div class="line"> <span class="keywordtype">int</span> i = 0;</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">while</span> (config != NULL)</div>
<div class="line"> {</div>
<div class="line"> <span class="comment">//</span></div>
Expand All @@ -118,7 +121,12 @@
<div class="line"> config-&gt;<a id="a3" name="a3"></a>value != NULL ? config-&gt;value : <span class="stringliteral">&quot;NULL&quot;</span>);</div>
<div class="line"> </div>
<div class="line"> <span class="comment">//</span></div>
<div class="line"> <span class="comment">// Process attributes if necessary</span></div>
<div class="line"> <span class="comment">// Process attributes if necessary. If you know there are no attributes</span></div>
<div class="line"> <span class="comment">// for the current node, you can skip this, and there is no reason in</span></div>
<div class="line"> <span class="comment">// this case to call canfigger_free_current_attr_str_advance().</span></div>
<div class="line"> <span class="comment">//</span></div>
<div class="line"> <span class="comment">// attr must be declared and initialized before using it as an</span></div>
<div class="line"> <span class="comment">// argument to canfigger_free_current_attr_str_advance().</span></div>
<div class="line"> <span class="keywordtype">char</span> *attr = NULL;</div>
<div class="line"> <span class="comment">//</span></div>
<div class="line"> <span class="comment">// Pass &#39;&amp;addr&#39; to this function and it will get assigned an</span></div>
Expand All @@ -137,15 +145,21 @@
<div class="line"> <span class="comment">// Move to the next node and automatically free the current node</span></div>
<div class="line"> <a id="a6" name="a6"></a><a class="code hl_function" href="canfigger_8h.html#a095f7a89a1f2e3422870165280205a0b">canfigger_free_current_key_node_advance</a>(&amp;config);</div>
<div class="line"> putchar(<span class="charliteral">&#39;\n&#39;</span>);</div>
<div class="line"> </div>
<div class="line"> i++;</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// This should be the number of keys in the example config</span></div>
<div class="line"> <span class="keywordflow">if</span> (i != 6)</div>
<div class="line"> <span class="keywordflow">return</span> -1;</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">return</span> 0;</div>
<div class="line">}</div>
<div class="ttc" id="acanfigger_8h_html"><div class="ttname"><a href="canfigger_8h.html">canfigger.h</a></div><div class="ttdoc">Header file for the Canfigger configuration parser.</div></div>
<div class="ttc" id="acanfigger_8h_html_a095f7a89a1f2e3422870165280205a0b"><div class="ttname"><a href="canfigger_8h.html#a095f7a89a1f2e3422870165280205a0b">canfigger_free_current_key_node_advance</a></div><div class="ttdeci">void canfigger_free_current_key_node_advance(struct Canfigger **list)</div><div class="ttdoc">Frees the current key node and advances to the next node in the list.</div><div class="ttdef"><b>Definition</b> canfigger.c:115</div></div>
<div class="ttc" id="acanfigger_8h_html_a37053197894e04e253629a9bdae52da0"><div class="ttname"><a href="canfigger_8h.html#a37053197894e04e253629a9bdae52da0">canfigger_parse_file</a></div><div class="ttdeci">struct Canfigger * canfigger_parse_file(const char *file, const int delimiter)</div><div class="ttdoc">Parses a configuration file and creates a linked list of key-value pairs.</div><div class="ttdef"><b>Definition</b> canfigger.c:330</div></div>
<div class="ttc" id="acanfigger_8h_html_ae6d70f9e366beaa126a989bb2b4457b8"><div class="ttname"><a href="canfigger_8h.html#ae6d70f9e366beaa126a989bb2b4457b8">canfigger_free_current_attr_str_advance</a></div><div class="ttdeci">void canfigger_free_current_attr_str_advance(struct attributes *attributes, char **attr)</div><div class="ttdoc">Frees the current attribute string and advances to the next attribute.</div><div class="ttdef"><b>Definition</b> canfigger.c:86</div></div>
<div class="ttc" id="acanfigger_8h_html_structCanfigger"><div class="ttname"><a href="canfigger_8h.html#structCanfigger">Canfigger</a></div><div class="ttdoc">Structure to represent a key-value pair with attributes in the configuration.</div><div class="ttdef"><b>Definition</b> canfigger.h:60</div></div>
<div class="ttc" id="acanfigger_8h_html_a095f7a89a1f2e3422870165280205a0b"><div class="ttname"><a href="canfigger_8h.html#a095f7a89a1f2e3422870165280205a0b">canfigger_free_current_key_node_advance</a></div><div class="ttdeci">void canfigger_free_current_key_node_advance(struct Canfigger **list)</div><div class="ttdoc">Frees the current key node and advances to the next node in the list.</div><div class="ttdef"><b>Definition</b> <a href="canfigger_8c_source.html#l00114">canfigger.c:114</a></div></div>
<div class="ttc" id="acanfigger_8h_html_a37053197894e04e253629a9bdae52da0"><div class="ttname"><a href="canfigger_8h.html#a37053197894e04e253629a9bdae52da0">canfigger_parse_file</a></div><div class="ttdeci">struct Canfigger * canfigger_parse_file(const char *file, const int delimiter)</div><div class="ttdoc">Parses a configuration file and creates a linked list of key-value pairs.</div><div class="ttdef"><b>Definition</b> <a href="canfigger_8c_source.html#l00330">canfigger.c:330</a></div></div>
<div class="ttc" id="acanfigger_8h_html_ae6d70f9e366beaa126a989bb2b4457b8"><div class="ttname"><a href="canfigger_8h.html#ae6d70f9e366beaa126a989bb2b4457b8">canfigger_free_current_attr_str_advance</a></div><div class="ttdeci">void canfigger_free_current_attr_str_advance(struct attributes *attributes, char **attr)</div><div class="ttdoc">Frees the current attribute string and advances to the next attribute.</div><div class="ttdef"><b>Definition</b> <a href="canfigger_8c_source.html#l00075">canfigger.c:75</a></div></div>
<div class="ttc" id="acanfigger_8h_html_structCanfigger"><div class="ttname"><a href="canfigger_8h.html#structCanfigger">Canfigger</a></div><div class="ttdoc">Structure to represent a key-value pair with attributes in the configuration.</div><div class="ttdef"><b>Definition</b> <a href="canfigger_8h_source.html#l00059">canfigger.h:60</a></div></div>
</div><!-- fragment --> </div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Expand Down
Loading

0 comments on commit bb21c3e

Please sign in to comment.