From d2be4787c6e78df1a0fec1f6fdc75a616ecc1e1e Mon Sep 17 00:00:00 2001 From: Ori Bernstein Date: Sat, 6 Jun 2020 19:05:00 -0700 Subject: acme: import event log from plan9port (thanks fshahriar) Based off the following 3 commits: 4a3fb87264f8bc03fc62f00ef335056f30d18023 45f8ba54143323f08a21343633764caa59aa3ea3 fdf6ef333705c844bcf3ccf2f93b2773f1a6aa41 Reading /mnt/acme/log reports a log of window create, put, focus, and delete events, as they happen. It blocks until the next event is available. Example log output: 8 new /Users/rsc/foo.go 8 put /Users/rsc/foo.go 8 del /Users/rsc/foo.go This lets acme-aware programs react to file writes, for example compiling code, running a test, or updating an import block. --- sys/src/cmd/acme/dat.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sys/src/cmd/acme/dat.h') diff --git a/sys/src/cmd/acme/dat.h b/sys/src/cmd/acme/dat.h index 100488c64..4739acc49 100644 --- a/sys/src/cmd/acme/dat.h +++ b/sys/src/cmd/acme/dat.h @@ -8,6 +8,7 @@ enum Qeditout, Qindex, Qlabel, + Qlog, Qnew, QWaddr, @@ -396,6 +397,7 @@ struct Fid Mntdir *mntdir; int nrpart; uchar rpart[UTFmax]; + vlong logoff; // for putlog }; @@ -408,7 +410,6 @@ struct Xfid Fid *f; uchar *buf; int flushed; - }; void xfidctl(void *); @@ -423,6 +424,10 @@ void xfideventwrite(Xfid*, Window*); void xfidindexread(Xfid*); void xfidutfread(Xfid*, Text*, uint, int); int xfidruneread(Xfid*, Text*, uint, uint); +void xfidlogopen(Xfid*); +void xfidlogread(Xfid*); +void xfidlogflush(Xfid*); +void xfidlog(Window*, char*); struct Reffont { -- cgit v1.2.3