Re: [9fans] Help with interrupting fgetc()

2015-06-28 Thread Nils M Holm
On 2015-06-27T18:29:12-0700, erik quanstrom wrote: two additional points. I the style for note matching is strstr matching because the exact string can't be counted on. [...] Good to know! also the bio(2) library and peint(2) areusually used instead of stdio. Yes, I know about bio(2). I'm

Re: [9fans] Help with interrupting fgetc()

2015-06-27 Thread Charles Forsyth
On 27 June 2015 at 21:30, Nils M Holm n...@t3x.org wrote: if (!strcmp(s, interrupt)) { A minor stylistic point: Plan 9 code almost invariably uses if(strcmp(...) == 0), and for pointers if(p == nil) instead of if(!p). if(!!...) is never used.

Re: [9fans] Help with interrupting fgetc()

2015-06-27 Thread Nils M Holm
On 2015-06-27T22:12:09+0100, Charles Forsyth wrote: On 27 June 2015 at 21:30, Nils M Holm n...@t3x.org wrote: if (!strcmp(s, interrupt)) { A minor stylistic point: Plan 9 code almost invariably uses if(strcmp(...) == 0), and for pointers if(p == nil) instead of if(!p).

Re: [9fans] Help with interrupting fgetc()

2015-06-27 Thread Charles Forsyth
On 27 June 2015 at 21:30, Nils M Holm n...@t3x.org wrote: It should keep echoing after printing oopsie, but it just exits instead. What am I missing? if interrupted, fgetc returns EOF because the underlying read system call returns -1 (with error string interrupted). System calls are

Re: [9fans] Help with interrupting fgetc()

2015-06-27 Thread erik quanstrom
two additional points. I the style for note matching is strstr matching because the exact string can't be counted on. for example details may be added. also the bio(2) library and peint(2) areusually used instead of stdio. - erik On Jun 27, 2015 1:30 PM, Nils M Holm n...@t3x.org wrote:

[9fans] Help with interrupting fgetc()

2015-06-27 Thread Nils M Holm
I'm trying to get the DEL key to cause an error in an interpreter I'm writing. On Unix, I just catch SIGINT and set an error flag that causes the interpreter to return to the REPL. On Plan9, fgetc() seems to return EOF after catching an interrupted note. To make a long story short, I expected