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

📄 mlowner.c

📁 这是一个同样来自贝尔实验室的和UNIX有着渊源的操作系统, 其简洁的设计和实现易于我们学习和理解
💻 C
字号:
#include "common.h"#include "dat.h"Biobuf in;String *from;String *sender;voidusage(void){	fprint(2, "usage: %s address-list-file listname\n", argv0);	exits("usage");}voidmain(int argc, char **argv){	String *msg;	char *alfile;	char *listname;	ARGBEGIN{	}ARGEND;	rfork(RFENVG|RFREND);	if(argc < 2)		usage();	alfile = argv[0];	listname = argv[1];	if(Binit(&in, 0, OREAD) < 0)		sysfatal("opening input: %r");	msg = s_new();	/* discard the 'From ' line */	if(s_read_line(&in, msg) == nil)		sysfatal("reading input: %r");	/* read up to the first 128k of the message.  more is redculous */	if(s_read(&in, s_restart(msg), 128*1024) <= 0)		sysfatal("reading input: %r");	/* parse the header */	yyinit(s_to_c(msg), s_len(msg));	yyparse();	/* get the sender */	getaddrs();	if(from == nil)		from = sender;	if(from == nil)		sysfatal("message must contain From: or Sender:");	if(strstr(s_to_c(msg), "remove")||strstr(s_to_c(msg), "unsubscribe"))		writeaddr(alfile, s_to_c(from), 1, listname);	else if(strstr(s_to_c(msg), "subscribe"))		writeaddr(alfile, s_to_c(from), 0, listname);	exits(0);}

⌨️ 快捷键说明

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