docs/Writerside/topics/properties.h.md

changeset 1553
7c46531efd52
parent 1424
563033aa998c
child 1555
8972247f54e8
equal deleted inserted replaced
1552:a114fc4a285a 1553:7c46531efd52
24 > There is also a field reserved for `continuation` which will be used as a line continuation character 24 > There is also a field reserved for `continuation` which will be used as a line continuation character
25 > in a future version of UCX. 25 > in a future version of UCX.
26 > In UCX 3.1 this is not implemented. 26 > In UCX 3.1 this is not implemented.
27 27
28 ## Basic Parsing 28 ## Basic Parsing
29
30 The following listing shows the properties-parser API.
31
32 > To simplify documentation, we introduce the pseudo-type `AnyStr` with the meaning that
33 > any UCX string and any C string are supported.
34 > The implementation is actually hidden behind a macro which uses `cx_strcast()` to guarantee compatibility.
35 {style="note"}
29 36
30 ```C 37 ```C
31 #include <cx/properties.h> 38 #include <cx/properties.h>
32 39
33 typedef struct cx_properties_config_s { 40 typedef struct cx_properties_config_s {
48 void cxPropertiesReset(CxProperties *prop); 55 void cxPropertiesReset(CxProperties *prop);
49 56
50 int cxPropertiesFilln(CxProperties *prop, 57 int cxPropertiesFilln(CxProperties *prop,
51 const char *buf, size_t len); 58 const char *buf, size_t len);
52 59
53 // where S is one of cxstring, cxmutstr, char*, const char* 60 int cxPropertiesFill(CxProperties *prop, AnyStr string);
54 int cxPropertiesFill(CxProperties *prop, S string);
55 61
56 CxPropertiesStatus cxPropertiesNext(CxProperties *prop, 62 CxPropertiesStatus cxPropertiesNext(CxProperties *prop,
57 cxstring *key, cxstring *value); 63 cxstring *key, cxstring *value);
58 64
59 void cxPropertiesUseStack(CxProperties *prop, 65 void cxPropertiesUseStack(CxProperties *prop,

mercurial