1 /* $OpenBSD: wsconsctl.h,v 1.9 2009/07/15 20:32:28 martynas 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 int format; 49 #define FLG_RDONLY 0x0001 /* variable cannot be modified */ 50 #define FLG_WRONLY 0x0002 /* variable cannot be displayed */ 51 #define FLG_NOAUTO 0x0004 /* skip variable on -a flag */ 52 #define FLG_MODIFY 0x0008 /* variable may be modified with += */ 53 #define FLG_GET 0x0100 /* read this variable from driver */ 54 #define FLG_SET 0x0200 /* write this variable to driver */ 55 #define FLG_INIT 0x0400 /* init (read) before write */ 56 #define FLG_DEAD 0x0800 /* the var isn't there, let it rest */ 57 int flags; 58 }; 59 60 struct field_pc { 61 int max, min, cur; 62 }; 63 64 struct field *field_by_name(struct field *, char *); 65 struct field *field_by_value(struct field *, void *); 66 void pr_field(const char *, struct field *, const char *); 67 void rd_field(struct field *, char *, int); 68 int name2ksym(char *); 69 char *ksym2name(int); 70 keysym_t ksym_upcase(keysym_t); 71 void keyboard_get_values(const char *,int); 72 int keyboard_put_values(const char *,int); 73 void mouse_get_values(const char *,int); 74 int mouse_put_values(const char *,int); 75 void display_get_values(const char *,int); 76 int display_put_values(const char *,int); 77 int yyparse(void); 78 void yyerror(char *); 79 int yylex(void); 80 void map_scan_setinput(char *); 81