xref: /openbsd/usr.bin/vi/ex/ex_set.c (revision 404b540a)
1 /*	$OpenBSD: ex_set.c,v 1.4 2002/02/16 21:27:57 millert Exp $	*/
2 
3 /*-
4  * Copyright (c) 1992, 1993, 1994
5  *	The Regents of the University of California.  All rights reserved.
6  * Copyright (c) 1992, 1993, 1994, 1995, 1996
7  *	Keith Bostic.  All rights reserved.
8  *
9  * See the LICENSE file for redistribution information.
10  */
11 
12 #include "config.h"
13 
14 #ifndef lint
15 static const char sccsid[] = "@(#)ex_set.c	10.7 (Berkeley) 3/6/96";
16 #endif /* not lint */
17 
18 #include <sys/types.h>
19 #include <sys/queue.h>
20 
21 #include <bitstring.h>
22 #include <limits.h>
23 #include <stdio.h>
24 
25 #include "../common/common.h"
26 
27 /*
28  * ex_set -- :set
29  *	Ex set option.
30  *
31  * PUBLIC: int ex_set(SCR *, EXCMD *);
32  */
33 int
34 ex_set(sp, cmdp)
35 	SCR *sp;
36 	EXCMD *cmdp;
37 {
38 	switch(cmdp->argc) {
39 	case 0:
40 		opts_dump(sp, CHANGED_DISPLAY);
41 		break;
42 	default:
43 		if (opts_set(sp, cmdp->argv, cmdp->cmd->usage))
44 			return (1);
45 		break;
46 	}
47 	return (0);
48 }
49