ref: 521670692b07cbadbf6a88964839d76531ba9afd
dir: /libacme.man/
.TH ACME 2 .SH NAME acme \- functions for interacting with acme's filesystem interface .SH SYNOPSIS .B #include <u.h> .br .B #include <libc.h> .br .B #include <thread.h> .br .B #include <acme.h> .PP .B int awinfsopen(AWin *w, char *file, int mode); .PP .B AWin * awincreate(void); .br .B void awinclose(AWin *w); .br .B void awincloseall(void); .PP .B void awinctl(AWin *w, char *fmt, ...); .br .B void awinclear(AWin *w); .br .B int awincat(AWin *w, char *file); .br .B void awinprint(AWin *w, char *fmt, ...); .br .B void awinerror(AWin *w, char *fmt, ...); .br .B void awinaddtag(AWin *w, char *tag); .br .B void awinsettag(AWin *w, char *tag); .PP .B Channel * aeventlisten(AWin *w); .br .B void aeventstop(AWin *w); .br .B void aeventsend(AWin *w, AEvent *ev); .SH DESCRIPTION .PP These routines provide an interface to .IR acme (1)\'s filesystem interface described in .IR acme (3). .SS Window management .PP .I Awinfsopen opens .B file in the window\'s directory with the mode specified. .PP .I Awincreate creates a new window in acme and returns a .B AWin struct representing the created window. .PP .I Awinclose closes the window the described by the .B win argument and frees its memory. .PP .I Awincloseall closes all windows that have been opened using .I awincreate. .SS Window control .I awinctl writes a message to the window's control file. The .B fmt argument is a .IR print (2) style format string used to format the control message. .PP .I Awinclear clears the body of the window specified. .PP .I Awincat reads .B file and copies in into the window body. .PP .I Awinprint, .I awinerror, and .I awinfatal function similarly to .I awinctl; writing to different window control files with .IR print (2) style format strings. .I Awinprint writes to the window body wheras .I awinerror and .I awinfatal write to the window errors file. .I Awinfatal will also close the window. .SS Event interface .PP .I Awinlisten returns a channel of .B AEvent structures (also storing it in w->eventc) and launches a process to fill it with events as they occur. .PP .I Awinstop closes the channel allocated by .I awinlisten and stops processing of events. .PP .I Awinsend writes an event to the events file. Causing acme to react as if the user caused the event. .SH FILES .PP .B /sys/include/acme.h .SH SEE ALSO .PP .IR acme (1), .IR acme (4), .IR print (2), .IR thread (2)