From 837a9067c0ef2e0b3affbf7035788cd0e80ce7ba Mon Sep 17 00:00:00 2001 From: wrmr Date: Tue, 5 Nov 2024 23:56:09 -0500 Subject: add rudimentary gophermap parsing --- doc.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'doc.c') diff --git a/doc.c b/doc.c index 3f63ba8..89ff756 100644 --- a/doc.c +++ b/doc.c @@ -59,6 +59,11 @@ unsigned short doc_add_link(struct doc *d, const char *url) { return d->linkc++; } +void doc_set_link(struct doc *d, unsigned short lnk) { + struct doc_line *l = doc_line_at(d, d->latest); + l->link = lnk; +} + /* line navigation */ struct doc_line *doc_line_at(struct doc *d, size_t ofs) { -- cgit 1.4.1-2-gfad0