xref: /openbsd/sbin/wsconsctl/wsconsctl.h (revision d22ea701)
1 /*	$OpenBSD: wsconsctl.h,v 1.16 2017/07/21 20:38:20 bru 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 #define FMT_CFG		201		/* wsmouse parameters */
52 	int format;
53 #define FLG_RDONLY	0x0001		/* variable cannot be modified */
54 #define FLG_WRONLY	0x0002		/* variable cannot be displayed */
55 #define FLG_NOAUTO	0x0004		/* skip variable on -a flag */
56 #define FLG_MODIFY	0x0008		/* variable may be modified with += */
57 #define	FLG_NORDBACK	0x0010		/* do not read back variable after write */
58 #define FLG_GET		0x0100		/* read this variable from driver */
59 #define FLG_SET		0x0200		/* write this variable to driver */
60 #define FLG_INIT	0x0400		/* init (read) before write */
61 #define FLG_DEAD	0x0800		/* the var isn't there, let it rest */
62 	int flags;
63 };
64 
65 struct field_pc {
66 	int max, min, cur;
67 };
68 
69 struct field *
70 	field_by_name(struct field *, char *);
71 struct field *
72 	field_by_value(struct field *, void *);
73 void	pr_field(const char *, struct field *, const char *);
74 void	rd_field(struct field *, char *, int);
75 int	name2ksym(char *);
76 char *	ksym2name(int);
77 void	ksymenc(int);
78 keysym_t ksym_upcase(keysym_t);
79 void	keyboard_get_values(int);
80 int	keyboard_put_values(int);
81 char *	keyboard_next_device(int);
82 void	mouse_init(int,int);
83 void	mouse_get_values(int);
84 int	mouse_put_values(int);
85 char *	mouse_next_device(int);
86 void	display_get_values(int);
87 int	display_put_values(int);
88 char *	display_next_device(int);
89 int	yyparse(void);
90 void	yyerror(char *);
91 int	yylex(void);
92 void	map_scan_setinput(char *);
93