xref: /netbsd-src/sbin/wsconsctl/wsconsctl.h (revision a5847cc334d9a7029f6352b847e9e8d71a0f9e0c)
1 /*	$NetBSD: wsconsctl.h,v 1.11 2011/08/27 19:01:34 joerg Exp $ */
2 
3 /*-
4  * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
5  * All rights reserved.
6  *
7  * This code is derived from software contributed to The NetBSD Foundation
8  * by Juergen Hannken-Illjes.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  */
31 
32 #include <dev/wscons/wsksymvar.h>
33 
34 /* fg / bg values. Made identical to ANSI terminal color codes. */
35 #define WSCOL_UNSUPPORTED	-1
36 #define WSCOL_BLACK		0
37 #define WSCOL_RED		1
38 #define WSCOL_GREEN		2
39 #define WSCOL_BROWN		3
40 #define WSCOL_BLUE		4
41 #define WSCOL_MAGENTA		5
42 #define WSCOL_CYAN		6
43 #define WSCOL_WHITE		7
44 /* flag values: */
45 #define WSATTR_NONE		0
46 #define WSATTR_REVERSE		1
47 #define WSATTR_HILIT		2
48 #define WSATTR_BLINK		4
49 #define WSATTR_UNDERLINE	8
50 #define WSATTR_WSCOLORS 	16
51 
52 struct field {
53 	const char *name;
54 	void *valp;
55 #define FMT_UINT	1		/* unsigned integer */
56 #define FMT_STRING	2		/* zero terminated string */
57 #define FMT_BITFIELD	3		/* bit field */
58 #define FMT_KBDTYPE	101		/* keyboard type */
59 #define FMT_MSTYPE	102		/* mouse type */
60 #define FMT_DPYTYPE	103		/* display type */
61 #define FMT_KBDENC	104		/* keyboard encoding */
62 #define FMT_KBMAP	105		/* keyboard map */
63 #define FMT_COLOR	201		/* display color */
64 #define FMT_ATTRS	202		/* display attributes */
65 	int format;
66 #define FLG_RDONLY	0x0001		/* variable cannot be modified */
67 #define FLG_WRONLY	0x0002		/* variable cannot be displayed */
68 #define FLG_NOAUTO	0x0004		/* skip variable on -a flag */
69 #define FLG_MODIFY	0x0008		/* variable may be modified with += */
70 #define FLG_DISABLED	0x0010		/* variable is not available */
71 #define FLG_GET		0x0100		/* read this variable from driver */
72 #define FLG_SET		0x0200		/* write this variable to driver */
73 	int flags;
74 };
75 
76 void field_setup(struct field *, int);
77 struct field *field_by_name(char *);
78 struct field *field_by_value(void *);
79 void field_disable_by_value(void *);
80 void pr_field(struct field *, const char *);
81 void rd_field(struct field *, char *, int);
82 int name2ksym(char *);
83 const char *ksym2name(int);
84 keysym_t ksym_upcase(keysym_t);
85 void keyboard_get_values(int);
86 void keyboard_put_values(int);
87 void mouse_get_values(int);
88 void mouse_put_values(int);
89 void display_get_values(int);
90 void display_put_values(int);
91 #ifndef YYEMPTY
92 int yyparse(void);
93 #endif
94 int yylex(void);
95 void map_scan_setinput(char *);
96