xref: /openbsd-src/sbin/wsconsctl/wsconsctl.h (revision f2da64fbbbf1b03f09f390ab01267c93dfd77c4c)
1 /*	$OpenBSD: wsconsctl.h,v 1.15 2015/05/08 19:12:51 miod Exp $	*/
2 /*	$NetBSD: wsconsctl.h 1.1 1998/12/28 14:01:17 hannken Exp $ */
3 
4 /*-
5  * Copyright (c) 1998 The NetBSD Foundation, Inc.
6  * All rights reserved.
7  *
8  * This code is derived from software contributed to The NetBSD Foundation
9  * by Juergen Hannken-Illjes.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions and the following disclaimer.
16  * 2. Redistributions in binary form must reproduce the above copyright
17  *    notice, this list of conditions and the following disclaimer in the
18  *    documentation and/or other materials provided with the distribution.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
21  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #include <dev/wscons/wsksymvar.h>
34 
35 struct field {
36 	char *name;
37 	void *valp;
38 #define FMT_UINT	1		/* unsigned integer */
39 #define FMT_INT		2		/* signed integer */
40 #define FMT_BOOL	3		/* boolean on/off */
41 #define FMT_PC		4		/* percentage fixed point 000.00 */
42 #define FMT_KBDTYPE	101		/* keyboard type */
43 #define FMT_MSTYPE	102		/* mouse type */
44 #define FMT_DPYTYPE	103		/* display type */
45 #define FMT_KBDENC	104		/* keyboard encoding */
46 #define FMT_KBMAP	105		/* keyboard map */
47 #define FMT_SCALE	106		/* wsmouse scale */
48 #define FMT_EMUL	107		/* wsdisplay emulations */
49 #define FMT_SCREEN	108		/* wsdisplay screen types */
50 #define FMT_STRING	109		/* free string */
51 	int format;
52 #define FLG_RDONLY	0x0001		/* variable cannot be modified */
53 #define FLG_WRONLY	0x0002		/* variable cannot be displayed */
54 #define FLG_NOAUTO	0x0004		/* skip variable on -a flag */
55 #define FLG_MODIFY	0x0008		/* variable may be modified with += */
56 #define	FLG_NORDBACK	0x0010		/* do not read back variable after write */
57 #define FLG_GET		0x0100		/* read this variable from driver */
58 #define FLG_SET		0x0200		/* write this variable to driver */
59 #define FLG_INIT	0x0400		/* init (read) before write */
60 #define FLG_DEAD	0x0800		/* the var isn't there, let it rest */
61 	int flags;
62 };
63 
64 struct field_pc {
65 	int max, min, cur;
66 };
67 
68 struct field *
69 	field_by_name(struct field *, char *);
70 struct field *
71 	field_by_value(struct field *, void *);
72 void	pr_field(const char *, struct field *, const char *);
73 void	rd_field(struct field *, char *, int);
74 int	name2ksym(char *);
75 char *	ksym2name(int);
76 void	ksymenc(int);
77 keysym_t ksym_upcase(keysym_t);
78 void	keyboard_get_values(int);
79 int	keyboard_put_values(int);
80 char *	keyboard_next_device(int);
81 void	mouse_get_values(int);
82 int	mouse_put_values(int);
83 char *	mouse_next_device(int);
84 void	display_get_values(int);
85 int	display_put_values(int);
86 char *	display_next_device(int);
87 int	yyparse(void);
88 void	yyerror(char *);
89 int	yylex(void);
90 void	map_scan_setinput(char *);
91