diff -r 0ffb71f15426 -r 9af21a50b516 docs/src/modules.md --- a/docs/src/modules.md Wed May 16 19:01:21 2018 +0200 +++ b/docs/src/modules.md Wed May 16 19:27:45 2018 +0200 @@ -589,6 +589,25 @@ cases. If you know what you are doing, it can save you some performance, because you do not need the `strlen()` call. +### Handling immutable strings + +*(Since: UCX 2.0)* + +For immutable strings (i.e. `const char*` strings), UCX provides the `scstr_t` +type, which works exactly as the `sstr_t` type but with a pointer +to `const char`. All UCX string functions come in two flavors: one that enforces +the `scstr_t` type, and another that usually accepts both types and performs +a conversion automatically, if necessary. + +There are some exceptions to this rule, as the return type may depend on the +argument type. +E.g. the `sstrchr()` function returns a substring starting at +the first occurrence of the specified character. +Since this substring points to the memory of the argument string, it does not +accept `scstr_t` as input argument, because the return type would break the +constness. + + ### Finding the position of a substring The `sstrstr()` function gives you a new `sstr_t` object starting with the