commit 5d10869872e8e20d22b0ecf875fb93ed16c587ca
parent b889a432a70f2d4fc365afed5e5d6bcfb2428987
Author: Pavel Renev <an2qzavok@gmail.com>
Date: Thu, 26 Aug 2021 20:47:56 +0000
clicked links are now reported to ctl file
Diffstat:
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/fs.c b/fs.c
@@ -41,6 +41,7 @@ initfs(char *srvname)
newobj = nil;
consbuf = nil;
consc = chancreate(sizeof(Array *), 1024);
+ ctlc = chancreate(sizeof(Array *), 1024);
srv.tree = alloctree("richterm", "richterm", DMDIR|0555, nil);
fsroot = srv.tree->root;
new = createfile(fsroot, "new", "richterm", 0444,
diff --git a/richterm.c b/richterm.c
@@ -799,9 +799,15 @@ rgen(int n)
}
void
-rfollow(Object *)
+rfollow(Object *obj)
{
- /* TODO: send link to be read from /ctl file */
+ Array *a;
+ a = arraycreate(sizeof(char), 1024, nil);
+ arraygrow(a, 5, "link ");
+ arraygrow(a, obj->dlink->count, arrayget(obj->dlink, 0, nil));
+ arraygrow(a, 1, "\n");
+
+ nbsend(ctlc, &a);
}
void
diff --git a/richterm.h b/richterm.h
@@ -1,6 +1,7 @@
extern Channel *redrawc;
extern Channel *insertc;
extern Channel *consc;
+extern Channel *ctlc;
extern File *fsroot;
void drawscrollbar(void);