MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / rs_inline_dest

Function rs_inline_dest

internal/cbm/doclink_rs.c:1899–1925  ·  view source on GitHub ↗

The inline link `(dest "title")` at s[i] == '('. On success *end is past the * closing parenthesis. */

Source from the content-addressed store, hash-verified

1897/* The inline link `(dest "title")` at s[i] == '('. On success *end is past the
1898 * closing parenthesis. */
1899static bool rs_inline_dest(const rs_inline_t *in, uint32_t i, const char **dest, uint32_t *dest_len,
1900 uint32_t *end) {
1901 const char *s = in->s;
1902 uint32_t n = in->n;
1903 uint32_t k = i + SKIP_ONE;
1904 while (k < n && isspace((unsigned char)s[k])) {
1905 k++;
1906 }
1907 if (!rs_link_dest(s, n, &k, dest, dest_len)) {
1908 return false;
1909 }
1910 uint32_t after = k;
1911 while (after < n && isspace((unsigned char)s[after])) {
1912 after++;
1913 }
1914 if (after > k && !rs_link_title(s, n, &after)) {
1915 return false;
1916 }
1917 while (after < n && isspace((unsigned char)s[after])) {
1918 after++;
1919 }
1920 if (after >= n || s[after] != ')') {
1921 return false;
1922 }
1923 *end = after + SKIP_ONE;
1924 return true;
1925}
1926
1927/* The reference-style link the ']' at s[i] ends, when the text after it or
1928 * the bracket text itself is a label: full `[text][label]`, collapsed

Callers 1

rs_inline_closeFunction · 0.85

Calls 2

rs_link_destFunction · 0.85
rs_link_titleFunction · 0.85

Tested by

no test coverage detected