diff options
Diffstat (limited to 'vendor/libghostty-vt/include/ghostty/vt/grid_ref.h')
| -rw-r--r-- | vendor/libghostty-vt/include/ghostty/vt/grid_ref.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/vendor/libghostty-vt/include/ghostty/vt/grid_ref.h b/vendor/libghostty-vt/include/ghostty/vt/grid_ref.h index d3489ea7..1f9f52b9 100644 --- a/vendor/libghostty-vt/include/ghostty/vt/grid_ref.h +++ b/vendor/libghostty-vt/include/ghostty/vt/grid_ref.h @@ -110,6 +110,32 @@ GHOSTTY_API GhosttyResult ghostty_grid_ref_graphemes(const GhosttyGridRef *ref, size_t *out_len); /** + * Get the hyperlink URI for the cell at the grid reference's position. + * + * Writes the URI bytes into the provided buffer. If the cell has no + * hyperlink, out_len is set to 0 and GHOSTTY_SUCCESS is returned. + * + * If the buffer is too small (or NULL), the function returns + * GHOSTTY_OUT_OF_SPACE and writes the required number of bytes to + * out_len. The caller can then retry with a sufficiently sized buffer. + * + * @param ref Pointer to the grid reference + * @param buf Output buffer for the URI bytes (may be NULL) + * @param buf_len Size of the output buffer in bytes + * @param[out] out_len On success, the number of bytes written. On + * GHOSTTY_OUT_OF_SPACE, the required buffer size in bytes. + * @return GHOSTTY_SUCCESS on success, GHOSTTY_INVALID_VALUE if the ref's + * node is NULL, GHOSTTY_OUT_OF_SPACE if the buffer is too small + * + * @ingroup grid_ref + */ +GHOSTTY_API GhosttyResult ghostty_grid_ref_hyperlink_uri( + const GhosttyGridRef *ref, + uint8_t *buf, + size_t buf_len, + size_t *out_len); + +/** * Get the style of the cell at the grid reference's position. * * @param ref Pointer to the grid reference |
