| * 18. Insertions from the standard input |
| r_rd(int argc, Rune **argv) |
| * print prompt, then read until double newline, |
| * then run the text just read as though it were |
| * a macro body, using the remaining arguments. |
| fprint(2, "%S", argv[1]); |
| fprint(2, "%c", 7/*BEL*/); |
| Binit(&bstdin, 0, OREAD); |
| while((s = Brdstr(&bstdin, '\n', 0)) != nil){ |
| p = runefmtstrflush(&fmt); |
| warn("out of memory in %Crd", dot); |
| runmacro('.', argc, argv); |
| /* terminate exactly as if input had ended */ |
| r_ex(int argc, Rune **argv) |
| addreq(L("rd"), r_rd, -1); |
| addreq(L("ex"), r_ex, 0); |