1 /* $NetBSD: wsconsctl.h,v 1.14 2021/12/25 13:54:13 mlelstv Exp $ */ 2 3 /*- 4 * Copyright (c) 1998, 2004, 2012 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_INT 4 /* signed integer */ 59 #define FMT_KBDTYPE 101 /* keyboard type */ 60 #define FMT_MSTYPE 102 /* mouse type */ 61 #define FMT_DPYTYPE 103 /* display type */ 62 #define FMT_KBDENC 104 /* keyboard encoding */ 63 #define FMT_KBMAP 105 /* keyboard map */ 64 #define FMT_COLOR 201 /* display color */ 65 #define FMT_ATTRS 202 /* display attributes */ 66 #define FMT_EDID 203 /* edid data */ 67 int format; 68 #define FLG_RDONLY 0x0001 /* variable cannot be modified */ 69 #define FLG_WRONLY 0x0002 /* variable cannot be displayed */ 70 #define FLG_NOAUTO 0x0004 /* skip variable on -a flag */ 71 #define FLG_MODIFY 0x0008 /* variable may be modified with += */ 72 #define FLG_DISABLED 0x0010 /* variable is not available */ 73 #define FLG_GET 0x0100 /* read this variable from driver */ 74 #define FLG_SET 0x0200 /* write this variable to driver */ 75 #define FLG_MODIFIED 0x0400 /* value was merged with += */ 76 int flags; 77 }; 78 79 void field_setup(struct field *, int); 80 struct field *field_by_name(char *); 81 struct field *field_by_value(void *); 82 void field_disable_by_value(void *); 83 void pr_field(struct field *, const char *); 84 void rd_field(struct field *, char *, int); 85 int name2ksym(char *); 86 const char *ksym2name(int); 87 keysym_t ksym_upcase(keysym_t); 88 void keyboard_get_values(int); 89 void keyboard_put_values(int); 90 void mouse_get_values(int); 91 void mouse_put_values(int); 92 void display_get_values(int); 93 void display_put_values(int); 94 #ifndef YYEMPTY 95 int yyparse(void); 96 #endif 97 int yylex(void); 98 void map_scan_setinput(char *); 99