12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- /*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
- #include "a.h"
- /*
- * 20. Miscellaneous
- */
- /* .mc - margin character */
- /* .ig - ignore; treated like a macro in t7.c */
- /* .pm - print macros and strings */
- void
- r_pm(int argc, Rune **argv)
- {
- int i;
-
- if(argc == 1){
- printds(0);
- return;
- }
- if(runestrcmp(argv[1], L("t")) == 0){
- printds(1);
- return;
- }
- for(i=1; i<argc; i++)
- fprint(2, "%S: %S\n", argv[i], getds(argv[i]));
- }
- void
- r_tm(Rune *name)
- {
- Rune *line;
-
- USED(name);
-
- line = readline(CopyMode);
- fprint(2, "%S\n", line);
- free(line);
- }
- void
- r_ab(Rune *name)
- {
- USED(name);
-
- r_tm(L("ab"));
- exits(".ab");
- }
- void
- r_lf(int argc, Rune **argv)
- {
- if(argc == 1)
- return;
- if(argc == 2)
- setlinenumber(nil, eval(argv[1]));
- if(argc == 3)
- setlinenumber(argv[2], eval(argv[1]));
- }
- void
- r_fl(int argc, Rune **argv)
- {
- USED(argc);
- USED(argv);
- Bflush(&bout);
- }
- void
- t20init(void)
- {
- addreq(L("mc"), r_warn, -1);
- addraw(L("tm"), r_tm);
- addraw(L("ab"), r_ab);
- addreq(L("lf"), r_lf, -1);
- addreq(L("pm"), r_pm, -1);
- addreq(L("fl"), r_fl, 0);
- }
|