From: Russ Cox <rsc@swtch.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] acme programming questions
Date: Wed, 17 Jun 2009 23:49:11 -0700 [thread overview]
Message-ID: <dd6fe68a0906172349t2ebdd977g8bd4e360cf6224b4@mail.gmail.com> (raw)
In-Reply-To: <Pine.BSI.4.64.0906171901460.14634@malasada.lava.net>
In plan9port there is a libacme and <acme.h>
which makes some of this easier. It is basically
a wrapping of the routines from acme Mail.
Using libacme, your event waiter can do
something like this to send the events back:
while(winreadevent(w, e) > 0) {
switch(e->c1){
default:
Unknown:
print("unknown message %c%c\n", e->c1, e->c2);
break;
case 'E': /* write to body; can't affect us */
case 'F': /* generated by our actions; ignore */
case 'K': /* type away; we don't care */
break;
case 'M':
switch(e->c2){
case 'x':
case 'X':
case 'l':
case 'L':
/* send it back */
winwriteevent(w, e);
break;
case 'I': /* modify away; we don't care */
case 'D':
case 'd':
case 'i':
break;
default:
goto Unknown;
}
}
}
Russ
next prev parent reply other threads:[~2009-06-18 6:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-18 5:09 Tim Newsham
2009-06-18 6:49 ` Russ Cox [this message]
2009-06-18 7:10 ` yy
2009-06-18 15:39 ` Tim Newsham
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dd6fe68a0906172349t2ebdd977g8bd4e360cf6224b4@mail.gmail.com \
--to=rsc@swtch.com \
--cc=9fans@9fans.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).