The namespace the dotted `path` names under `from`, every segment created * on the way; CS_NONE for a bad name, when memory ran out, and past the * scanner's nesting limit: a scope read back from the store is held to the * limit its writer keeps (every enclosing namespace is a lookup step). */
| 856 | * scanner's nesting limit: a scope read back from the store is held to the |
| 857 | * limit its writer keeps (every enclosing namespace is a lookup step). */ |
| 858 | static int ns_make_path(cs_index_t *ix, int from, const char *path) { |
| 859 | int ns = from; |
| 860 | for (const char *p = path; ns >= 0 && *p;) { |
| 861 | if (ix->nss[ns].depth >= CS_MAX_NEST) { |
| 862 | return CS_NONE; |
| 863 | } |
| 864 | const char *dot = strchr(p, '.'); |
| 865 | size_t n = dot ? (size_t)(dot - p) : strlen(p); |
| 866 | ns = ns_make(ix, ns, p, n); |
| 867 | p = dot ? dot + SKIP_ONE : p + n; |
| 868 | } |
| 869 | return ns; |
| 870 | } |
| 871 | |
| 872 | /* ── Scope blob parsing ──────────────────────────────────────────── */ |
| 873 |
no test coverage detected