88 lines · 1.4 KB · C
RawDownload
/*  * 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 */ voidr_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]));} voidr_tm(Rune *name){	Rune *line;		USED(name);		line = readline(CopyMode);	fprint(2, "%S\n", line);	free(line);} voidr_ab(Rune *name){	USED(name);		r_tm(L("ab"));	exits(".ab");} voidr_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]));} voidr_fl(int argc, Rune **argv){	USED(argc);	USED(argv);	Bflush(&bout);} voidt20init(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);}