splitDocName: `before.Name` with a capitalized Name. False when the text * after the last dot is no Name (then nothing is split off). */
| 449 | /* splitDocName: `before.Name` with a capitalized Name. False when the text |
| 450 | * after the last dot is no Name (then nothing is split off). */ |
| 451 | static bool go_split_name(const char *s, size_t n, size_t *before_len, const char **name, |
| 452 | size_t *name_len) { |
| 453 | size_t dot = n; |
| 454 | for (size_t i = n; i > 0; i--) { |
| 455 | if (s[i - SKIP_ONE] == '.') { |
| 456 | dot = i - SKIP_ONE; |
| 457 | break; |
| 458 | } |
| 459 | } |
| 460 | size_t ns = dot < n ? dot + SKIP_ONE : 0; |
| 461 | if (!go_is_name(s + ns, n - ns)) { |
| 462 | return false; |
| 463 | } |
| 464 | *name = s + ns; |
| 465 | *name_len = n - ns; |
| 466 | *before_len = dot < n ? dot : 0; |
| 467 | return true; |
| 468 | } |
| 469 | |
| 470 | bool cbm_doclink_go_parse_ref(const char *raw, size_t len, CBMDocLinkGoRef *out) { |
| 471 | memset(out, 0, sizeof(*out)); |
no test coverage detected