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

📄 p

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻
字号:
#ifdef X400set_which_mts(msg_fp)FILE	*msg_fp;{    register int  state;    register char tmpbuf[BUFSIZ];    char          name[NAMESZ];    extern char   need_x400_me;    for (state = FLD;state == FLD || state == FLDPLUS;) {	state = m_getfld (state, name, tmpbuf, BUFSIZ, msg_fp);	switch (state) {	    case FLD: 	    case FLDPLUS: 		if (uleq(name, "X-mts"))		    if (uleq(tmpbuf, "x400"))			need_x400_me = 1;		while (state == FLDPLUS)		    state = m_getfld (state, name, tmpbuf, BUFSIZ, msg_fp);		break;	    case LENERR: 	    case FMTERR: 	    case BODY: 	    case FILEEOF:		break;	    default: 		adios (NULLCP, "m_getfld() returned %d", state);	}    }    rewind(msg_fp);}char *get_x400_orname(){int	pid, len;int	pipefds[2];char	ptr[BUFSIZ];/* Open a pie channel for retrieving the output of x400_whois. */    if (pipe(pipefds) != 0) {	fprintf(stderr,"Can't get pipes for x400_whois!\n");	return ((char *)NULL);    }    pid = fork();    if (pid == -1)	return((char *)NULL);    if (pid > 0) {	/* Parent process. */	if (wait(NULL) != pid)	    fprintf(stderr,"Wait returned without pid\n");    }    else {		/* Child process. */	close(1);	dup(pipefds[1]);	close(2);	dup(pipefds[1]);	execl("/usr/bin/x400_whois", "x400_whois", (char *)NULL);	execlp("x400_whois", "x400_whois", (char *)NULL);	fprintf(stderr,"Can't find 'x400_whois'...\n");	exit(1);    }    len = read(pipefds[0], ptr, BUFSIZ-1);    if (len < 0)	fprintf(stderr,"Failed to read anything from x400_whois...\n");    else {	ptr[len] = '\0';/* If the output of x400_whois does not begin with a '/' then it is not an * ORaddress... Ignore any of the error output. */	if (*ptr != '/')	    *ptr = '\0';	else	    if (ptr[len-1] == '\n')		ptr[len - 1] = '\0';    }    close(pipefds[0]);    close(pipefds[1]);    return(ptr);}#endif X400

⌨️ 快捷键说明

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