# HG changeset patch # User Mike Becker # Date 1765405020 -3600 # Node ID b5d896ad5e758bb4290b4032725403c79cdd839e # Parent 355066cd91862780ea5f0e3d5dd47ee4da25acb5 adjusts documentation regarding line continuation support - relates to #457 diff -r 355066cd9186 -r b5d896ad5e75 CHANGELOG --- a/CHANGELOG Wed Dec 10 23:01:26 2025 +0100 +++ b/CHANGELOG Wed Dec 10 23:17:00 2025 +0100 @@ -3,6 +3,7 @@ * adds cx_system_page_size() to allocator.h * adds cxJsonFromString() + * adds line continuation support to CxProperties / CxPropertiesConfig * changes cxFreeDefault() from a macro to a function so that it can be used as a simple destructor * changes cxBufferReserve() to allow reducing the capacity * changes the members of CxJson and CxJsonValue diff -r 355066cd9186 -r b5d896ad5e75 docs/Writerside/topics/about.md --- a/docs/Writerside/topics/about.md Wed Dec 10 23:01:26 2025 +0100 +++ b/docs/Writerside/topics/about.md Wed Dec 10 23:17:00 2025 +0100 @@ -30,6 +30,7 @@ * adds cx_system_page_size() to allocator.h * adds cxJsonFromString() +* adds line continuation support to CxProperties / CxPropertiesConfig * changes cxFreeDefault() from a macro to a function so that it can be used as a simple destructor * changes cxBufferReserve() to allow reducing the capacity * changes the members of CxJson and CxJsonValue @@ -37,6 +38,7 @@ * changes CxTree structure so that it now inherits CX_COLLECTION_BASE * changes cxPropertiesLoad() to directly load properties from a file to a CxMap * fixes cxJsonWrite() incorrectly returning non-zero when strings needed to be escaped +* fixes cxJsonNext() incorrectly returning CX_JSON_INCOMPLETE_DATA when the input ends with trailing spaces * fixes critical memory leak when using cxMapFree() on a kv-list that is using destructors * fixes that overwriting items with cxMapPut() in a kv-list did not work * fixes that cxReallocate(), cxReallocateArray(), cx_reallocate(), and cx_reallocatearray() diff -r 355066cd9186 -r b5d896ad5e75 docs/Writerside/topics/properties.h.md --- a/docs/Writerside/topics/properties.h.md Wed Dec 10 23:01:26 2025 +0100 +++ b/docs/Writerside/topics/properties.h.md Wed Dec 10 23:17:00 2025 +0100 @@ -18,12 +18,13 @@ # next is a blank line and will be ignored keys_are_trimmed = and_so_are_values # also a comment + +key3 = value that \ + is continued on the next line ``` -> Delimiter and comment characters are configured with the `CxPropertiesConfig` structure. -> There is also a field reserved for `continuation` which will be used as a line continuation character -> in a future version of UCX. -> In UCX 3.1 this is not implemented. +> Delimiter, line continuation character, and up to three comment characters +> can be configured with the `CxPropertiesConfig` structure (see below). ## Basic Parsing @@ -42,7 +43,6 @@ char comment1; char comment2; char comment3; - // reserved for future use - not implemented in UCX 3.1 char continuation; } CxPropertiesConfig; @@ -77,9 +77,8 @@ The first step is to initialize a `CxProperties` structure with a call to `cxPropertiesInit()` using the desired config. The shorthand `cxPropertiesInitDefault()` creates a default configuration with the equals sign `'='` as delimiter and the hash-symbol `'#'` as comment symbol (the other two comment symbols remain unused in the default config). - -> In a future UCX version, the default `continuation` character will be a backslash `'\'`. -> In UCX 3.1 this feature is not implemented, yet. +The line continuation symbol is set to `'\'`. +Note that leading spaces of a continuing line are ignored. The actual parsing is an interleaving invocation of the `cxPropertiesFill()` (or `cxPropertiesFilln()`) and `cxPropertiesNext()` functions. The `cxPropertiesFill()` function is a convenience function, that accepts UCX strings and normal zero-terminated C strings and behaves otherwise like `cxPropertiesFilln()`.