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

📄 options.c

📁 操作系统源代码
💻 C
字号:
/* Copyright (c) 1985 Ceriel J.H. Jacobs */# ifndef lintstatic char rcsid[] = "$Header: options.c,v 7.0 86/12/05 09:37:45 ceriel Exp $";# endif# define _OPTIONS_# include "in_all.h"# include "options.h"# include "output.h"# include "display.h"# include <ctype.h>STATIC int parsopt();char *getenv();/* * Read the options. Return the argv pointer following them if there were * no errors, otherwise return 0. */char **readoptions(argv) char ** argv; {	register char ** av = argv+1;	register char *p;	if (p = getenv("YAP")) {		(VOID) parsopt(p);	}	while (*av && **av == '-') {		if (parsopt(*av)) {			/*			 * Error in option			 */			putline(*av);			putline(": illegal option\n");			return (char **) 0;		}		av++;	}	if (*av && **av == '+') {		/*		 * Command in command line		 */		startcomm = *av + 1;		av++;	}	return av;}STATIC intparsopt(s) register char *s; {	register i;	if (*s == '-') s++;	if (isdigit(*s)) {		/*		 * pagesize option		 */		i = 0;		do {			i = i * 10 + *s++ - '0';		} while (isdigit(*s));		if (i < MINPAGESIZE) i = MINPAGESIZE;		pagesize = i;	}	while (*s) {		switch(*s++) {		  case 'c' :			cflag++;			break;		  case 'n' :			nflag++;			break;		  case 'u' :			uflag++;			break;		  case 'q' :			qflag++;			break;		  default :			return 1;		}	}	return 0;}

⌨️ 快捷键说明

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