glob
Glob Pattern Matching (fnmatch-style)
Functions
| Function | Description |
|---|---|
_glob_byte_at | Internal byte reader. |
_glob_match_class | Internal: match character class [abc] or [!abc]. Returns packed value: matche… |
_glob_do_match | Internal recursive match with bounded depth. pi=pattern index, si=string index. |
glob_match | Match a glob pattern against a string. Returns 1 if matches, 0 otherwise. |
glob_has_magic | Check if pattern contains wildcard characters (*, ?, [). |
glob_escape | Escape special glob characters in str. Wraps each *, ?, [, ] in [x]. Returns … |
Details
_glob_byte_at
fn _glob_byte_at(buf: &i8, idx: i64) -> i64Internal byte reader.
_glob_match_class
fn _glob_match_class(pat: &i8, ppos: i64, plen: i64, ch: i64) -> i64Internal: match character class [abc] or [!abc]. Returns packed value: matched + new_position * 2. Caller decodes: matched = result % 2, new_pos = result / 2.
_glob_do_match
fn _glob_do_match(pat: &i8, plen: i64, str: &i8, slen: i64, pi: i64, si: i64) -> i64Internal recursive match with bounded depth. pi=pattern index, si=string index.
glob_match
fn glob_match(pattern: &i8, plen: i64, str: &i8, slen: i64) -> i64Match a glob pattern against a string. Returns 1 if matches, 0 otherwise.
glob_has_magic
fn glob_has_magic(pattern: &i8, plen: i64) -> i64Check if pattern contains wildcard characters (*, ?, [).
glob_escape
fn glob_escape(str: &i8, slen: i64, out: &i8) -> i64Escape special glob characters in str. Wraps each *, ?, [, ] in [x]. Returns escaped length.