Subversion Repositories planix.SVN

Rev

Rev 115 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 115 Rev 116
Line 2... Line 2...
2
 * Copyright (c) 1980 Regents of the University of California.
2
 * Copyright (c) 1980 Regents of the University of California.
3
 * All rights reserved.  The Berkeley software License Agreement
3
 * All rights reserved.  The Berkeley software License Agreement
4
 * specifies the terms and conditions for redistribution.
4
 * specifies the terms and conditions for redistribution.
5
 */
5
 */
6
 
6
 
7
#if	!defined(lint) && defined(DOSCCS)
7
#include <stdio.h>
8
static char *sccsid = "@(#)ex_set.c	7.4 (Berkeley) 6/7/85";
-
 
9
#endif
8
 
10
 
9
 
11
#include "ex.h"
10
#include "ex.h"
12
#include "ex_temp.h"
11
#include "ex_temp.h"
13
#include "ex_tty.h"
12
#include "ex_tty.h"
14
 
13
 
15
/*
14
/*
16
 * Set command.
15
 * Set command.
17
 */
16
 */
18
char	optname[ONMSZ];
17
char	optname[ONMSZ];
-
 
18
 
-
 
19
static void prall(void);
-
 
20
static void propt(struct option * op);
-
 
21
static void propts(void);
-
 
22
 
19
 
23
 
20
set()
24
set()
21
{
25
{
22
	register char *cp;
26
	register char *cp;
23
	register struct option *op;
27
	register struct option *op;
Line 29... Line 33...
29
	if (skipend()) {
33
	if (skipend()) {
30
		if (peekchar() != EOF)
34
		if (peekchar() != EOF)
31
			ignchar();
35
			ignchar();
32
		propts();
36
		propts();
33
		return;
37
		return;
34
	}
38
	}
35
	do {
39
	do {
36
		cp = optname;
40
		cp = optname;
37
		do {
41
		do {
38
			if (cp < &optname[ONMSZ - 2])
42
			if (cp < &optname[ONMSZ - 2])
39
				*cp++ = getchar();
43
				*cp++ = getchar();
40
		} while (isalnum(peekchar()));
44
		} while (isalnum(peekchar()));
41
		*cp = 0;
45
		*cp = 0;
42
		cp = optname;
46
		cp = optname;
43
		if (eq("all", cp)) {
47
		if (eq("all", cp)) {
-
 
48
 
44
			if (inopen)
49
			if (inopen)
45
				pofix();
50
				pofix();
46
			prall();
51
			prall();
47
			goto next;
52
			goto next;
48
		}
53
		}
Line 155... Line 160...
155
	eol();
160
	eol();
156
}
161
}
157
 
162
 
158
setend()
163
setend()
159
{
164
{
160
 
-
 
161
	return (iswhite(peekchar()) || endcmd(peekchar()));
165
	return (iswhite(peekchar()) || endcmd(peekchar()));
162
}
166
}
163
 
167
 
-
 
168
static void 
164
prall()
169
prall(void)
165
{
170
{
166
	register int incr = (NOPTS + 2) / 3;
171
	register int incr = (NOPTS + 2) / 3;
167
	register int rows = incr;
172
	register int rows = incr;
168
	register struct option *op = options;
173
	register struct option *op = options;
169
 
174
 
Line 177... Line 182...
177
		}
182
		}
178
		putNFL();
183
		putNFL();
179
	}
184
	}
180
}
185
}
181
 
186
 
-
 
187
static void
182
propts()
188
propts(void)
183
{
189
{
184
	register struct option *op;
190
	register struct option *op;
185
 
191
 
186
	for (op = options; op < &options[NOPTS]; op++) {
192
	for (op = options; op < &options[NOPTS]; op++) {
187
#ifdef V6
193
#ifdef V6
188
		if (op == &options[TERM])
194
		if (op == &options[TERM])
189
#else
195
#else
190
		if (op == &options[TTYTYPE])
196
		if (op == &options[TTYTYPE])
191
#endif
197
#endif
192
			continue;
198
		continue;
-
 
199
		
193
		switch (op->otype) {
200
		switch (op->otype) {
194
 
201
 
195
		case ONOFF:
202
		case ONOFF:
196
		case NUMERIC:
203
		case NUMERIC:
197
			if (op->ovalue == op->odefault)
204
			if (op->ovalue == op->odefault)
Line 208... Line 215...
208
	}
215
	}
209
	noonl();
216
	noonl();
210
	flush();
217
	flush();
211
}
218
}
212
 
219
 
213
propt(op)
220
static void
214
	register struct option *op;
221
propt(struct option * op)
215
{
222
{
216
	register char *name;
223
	register char *name;
217
	
224
 
218
	name = op->oname;
225
	name = op->oname;
219
 
226
 
220
	switch (op->otype) {
227
	switch (op->otype) {
221
 
228
 
222
	case ONOFF:
229
	case ONOFF: