From 9c932e49a7516570b6c1ff9863595d495e3a3212 Mon Sep 17 00:00:00 2001 From: wrmr Date: Tue, 5 Nov 2024 23:04:49 -0500 Subject: doc_add_link --- doc.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc.c') diff --git a/doc.c b/doc.c index 3d1b378..3f63ba8 100644 --- a/doc.c +++ b/doc.c @@ -54,6 +54,11 @@ void doc_add_textn(struct doc *d, const char *s, size_t n) { dl->len += n; } +unsigned short doc_add_link(struct doc *d, const char *url) { + buf_cat(&d->lnk, url, strlen(url) + 1); + return d->linkc++; +} + /* line navigation */ struct doc_line *doc_line_at(struct doc *d, size_t ofs) { -- cgit 1.4.1-2-gfad0