/* test115.c Stewart, March 24, 1982 5:57 PM */ /* conditional jump around if statement too short */ main() { char c; for (;;) { if (chav()) { c = getchar() & 0177; switch (c) { case 'q': { putstring("\rQuit!\r"); return; }; case 'b': { f(0); p("Hello ch 0 ", 0); break; }; case 'B': { f(1); p("Hello ch 1 ", 1); break; }; case 's': { s(); break; }; case 't': { f(0); break; }; case 'T': { f(1); break; }; case '?': putstring("\rq: quit, ?: help\r"); putstring("b: ch 0 baud, B: ch 1 baud\r"); putstring("s: setspeed (0/1)(baudrate)\r"); putstring("t: typeon ch 0, T: typeon ch 1\r"); break; default: putstring("\r unknown command\r"); }; putstring("% "); }; }; }; s() { putstring("foo"); }; f(i) int i; { putstring("foo"); }; p(s, i) char *s; int i; { putstring("foo"); }; putstring(s) char *s; { putstring("foo"); }; int chav() { return(1); }; char getchar() { return('a'); };