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

📄 translate.c

📁 这是一个同样来自贝尔实验室的和UNIX有着渊源的操作系统, 其简洁的设计和实现易于我们学习和理解
💻 C
字号:
#include "common.h"#include "send.h"/* pipe an address through a command to translate it */extern dest *translate(dest *dp){	process *pp;	String *line;	dest *rv;	char *cp;	int n;	pp = proc_start(s_to_c(dp->repl1), (stream *)0, outstream(), outstream(), 1, 0);	if (pp == 0) {		dp->status = d_resource;		return 0;	}	line = s_new();	for(;;) {		cp = Brdline(pp->std[1]->fp, '\n');		if(cp == 0)			break;		if(strncmp(cp, "_nosummary_", 11) == 0){			nosummary = 1;			continue;		}		n = Blinelen(pp->std[1]->fp);		cp[n-1] = ' ';		s_nappend(line, cp, n);	}	rv = s_to_dest(s_restart(line), dp);	s_restart(line);	while(s_read_line(pp->std[2]->fp, line))		;	if ((dp->pstat = proc_wait(pp)) != 0) {		dp->repl2 = line;		rv = 0;	} else		s_free(line);	proc_free(pp);	return rv;}

⌨️ 快捷键说明

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