diff options
| author | tylov <[email protected]> | 2023-07-10 12:16:44 +0200 |
|---|---|---|
| committer | tylov <[email protected]> | 2023-07-10 12:16:44 +0200 |
| commit | 8debe47bc014c41b6cf8082dcef4b87e4ef29cfa (patch) | |
| tree | 9d2a770573930191d569c9a25e2e0e684b905a26 /docs | |
| parent | 7342a721e5dbef94bb1b1541f01154fe4a37aeb8 (diff) | |
| download | STC-modified-8debe47bc014c41b6cf8082dcef4b87e4ef29cfa.tar.gz STC-modified-8debe47bc014c41b6cf8082dcef4b87e4ef29cfa.zip | |
Renamed input enum flags for cregex functions.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ccommon_api.md | 8 | ||||
| -rw-r--r-- | docs/cregex_api.md | 18 |
2 files changed, 13 insertions, 13 deletions
diff --git a/docs/ccommon_api.md b/docs/ccommon_api.md index f21f2eaf..7569bb5b 100644 --- a/docs/ccommon_api.md +++ b/docs/ccommon_api.md @@ -369,8 +369,8 @@ int main() ### Coroutine API To resume the coroutine from where it was suspended with *cco_yield()*: call the coroutine again. -**Note**: *cco_yield()* / *cco_await()* may not be called inside a `switch` statement; use -`if-else-if` constructs instead. +**Note**: *cco_yield()* / *cco_await()* may not be called inside a `switch` statement from a +cco_routine scope; Use `if-else-if` constructs instead. | | Function / operator | Description | |:----------|:-------------------------------------|:----------------------------------------| @@ -384,11 +384,11 @@ To resume the coroutine from where it was suspended with *cco_yield()*: call the | | `cco_yield_v();` | Yield/suspend execution (return void) | | | `cco_yield_v(ret);` | Yield/suspend execution (return ret) | | | `cco_yield_final();` | Yield final time, enables cleanup-state | -| | `cco_yield_final(val);` | Yield a final value (e.g. CCO_ERROR) | +| | `cco_yield_final(ret);` | Yield a final value (e.g. CCO_ERROR) | | | `cco_await(condition);` | Suspend until condition is true (return CCO_AWAIT)| | | `cco_await_v(condition);` | Suspend until condition is true (return void) | | | `cco_await_v(condition, ret);` | Suspend until condition is true (return ret)| -| | `cco_await_on(cocall);` | Await on sub-coroutine to finish | +| | `cco_await_on(cocall);` | Await on sub-coroutine to finish (return its ret) | | | `cco_return;` | Return from coroutine (inside cco_routine) | | | `cco_closure(Closure, ...);` | Define a coroutine closure struct (optional) | | | Semaphores: | | diff --git a/docs/cregex_api.md b/docs/cregex_api.md index ff69c549..f87240f8 100644 --- a/docs/cregex_api.md +++ b/docs/cregex_api.md @@ -12,16 +12,16 @@ The API is simple and includes powerful string pattern matches and replace funct ```c enum { // compile-flags - CREG_C_DOTALL = 1<<0, // dot matches newline too: can be set/overridden by (?s) and (?-s) in RE - CREG_C_ICASE = 1<<1, // ignore case mode: can be set/overridden by (?i) and (?-i) in RE + CREG_DOTALL = 1<<0, // dot matches newline too: can be set/overridden by (?s) and (?-s) in RE + CREG_ICASE = 1<<1, // ignore case mode: can be set/overridden by (?i) and (?-i) in RE // match-flags - CREG_M_FULLMATCH = 1<<2, // like start-, end-of-line anchors were in pattern: "^ ... $" - CREG_M_NEXT = 1<<3, // use end of previous match[0] as start of input - CREG_M_STARTEND = 1<<4, // use match[0] as start+end of input + CREG_FULLMATCH = 1<<2, // like start-, end-of-line anchors were in pattern: "^ ... $" + CREG_NEXT = 1<<3, // use end of previous match[0] as start of input + CREG_STARTEND = 1<<4, // use match[0] as start+end of input // replace-flags - CREG_R_STRIP = 1<<5, // only keep the replaced matches, strip the rest + CREG_STRIP = 1<<5, // only keep the replaced matches, strip the rest }; cregex cregex_init(void); @@ -138,7 +138,7 @@ In order to use a callback function in the replace call, see `examples/regex_rep To iterate multiple matches in an input string, you may use ```c csview match[5] = {0}; -while (cregex_find(&re, input, match, CREG_M_NEXT) == CREG_OK) +while (cregex_find(&re, input, match, CREG_NEXT) == CREG_OK) for (int k = 1; i <= cregex_captures(&re); ++k) printf("submatch %d: %.*s\n", k, c_SV(match[k])); ``` @@ -181,8 +181,8 @@ For reference, **cregex** uses the following files: | \B | Not UTF8 word boundary | * | | \Q | Start literal input mode | * | | \E | End literal input mode | * | -| (?i) (?-i) | Ignore case on/off (override CREG_C_ICASE) | * | -| (?s) (?-s) | Dot matches newline on/off (override CREG_C_DOTALL) | * | +| (?i) (?-i) | Ignore case on/off (override CREG_ICASE) | * | +| (?s) (?-s) | Dot matches newline on/off (override CREG_DOTALL) | * | | \n \t \r | Match UTF8 newline, tab, carriage return | | | \d \s \w | Match UTF8 digit, whitespace, alphanumeric character | | | \D \S \W | Do not match the groups described above | | |
