Sat, 01 Mar 2025 15:49:08 +0100
add one more sentence to the example for properties source and sink
docs/Writerside/topics/properties.h.md | file | annotate | diff | comparison | revisions |
--- a/docs/Writerside/topics/properties.h.md Sat Mar 01 15:02:57 2025 +0100 +++ b/docs/Writerside/topics/properties.h.md Sat Mar 01 15:49:08 2025 +0100 @@ -214,6 +214,7 @@ ``` You can create your own sources and sinks by initializing the respective structures. + For a source, only the `read_func` is mandatory, the other two functions are optional and used for initialization and cleanup, if required. The file source created by `cxPropertiesFileSource()`, for example, uses the `read_init_func` to allocate, and the `read_clean_func` to free the read buffer, respectively. @@ -221,6 +222,7 @@ Since the default map sink created by `cxPropertiesMapSink()` stores `char*` pointers into a map, the following example uses a different sink, which stores them as `cxmutstr` values, automatically freeing them when the map gets destroyed. +And instead of reading the data from a file with `fread()`, it uses `mmap()` to map the file into memory for reading. ```C #include <stdio.h>