⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 error.c

📁 这是一个同样来自贝尔实验室的和UNIX有着渊源的操作系统, 其简洁的设计和实现易于我们学习和理解
💻 C
字号:
#include "sam.h"static char *emsg[]={	/* error_s */	"can't open",	"can't create",	"not in menu:",	"changes to",	"I/O error:",	"can't write while changing:",	/* error_c */	"unknown command",	"no operand for",	"bad delimiter",	/* error */	"can't fork",	"interrupt",	"address",	"search",	"pattern",	"newline expected",	"blank expected",	"pattern expected",	"can't nest X or Y",	"unmatched `}'",	"command takes no address",	"addresses overlap",	"substitution",	"& match too long",	"bad \\ in rhs",	"address range",	"changes not in sequence",	"addresses out of order",	"no file name",	"unmatched `('",	"unmatched `)'",	"malformed `[]'",	"malformed regexp",	"reg. exp. list overflow",	"plan 9 command",	"can't pipe",	"no current file",	"string too long",	"changed files",	"empty string",	"file search",	"non-unique match for \"\"",	"tag match too long",	"too many subexpressions",	"temporary file too large",	"file is append-only",	"no destination for plumb message",	"internal read error in buffer load",};static char *wmsg[]={	/* warn_s */	"duplicate file name",	"no such file",	"write might change good version of",	/* warn_S */	"files might be aliased",	/* warn */	"null characters elided",	"can't run pwd",	"last char not newline",	"exit status",};voiderror(Err s){	char buf[512];	sprint(buf, "?%s", emsg[s]);	hiccough(buf);}voiderror_s(Err s, char *a){	char buf[512];	sprint(buf, "?%s \"%s\"", emsg[s], a);	hiccough(buf);}voiderror_r(Err s, char *a){	char buf[512];	sprint(buf, "?%s \"%s\": %r", emsg[s], a);	hiccough(buf);}voiderror_c(Err s, int c){	char buf[512];	sprint(buf, "?%s `%C'", emsg[s], c);	hiccough(buf);}voidwarn(Warn s){	dprint("?warning: %s\n", wmsg[s]);}voidwarn_S(Warn s, String *a){	print_s(wmsg[s], a);}voidwarn_SS(Warn s, String *a, String *b){	print_ss(wmsg[s], a, b);}voidwarn_s(Warn s, char *a){	dprint("?warning: %s `%s'\n", wmsg[s], a);}voidtermwrite(char *s){	String *p;	if(downloaded){		p = tmpcstr(s);		if(cmd)			loginsert(cmd, cmdpt, p->s, p->n);		else			Strinsert(&cmdstr, p, cmdstr.n);		cmdptadv += p->n;		free(p);	}else		Write(2, s, strlen(s));}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -