1 1.12 christos /* $NetBSD: mdb.h,v 1.12 2019/06/23 22:46:41 christos Exp $ */ 2 1.1 phil 3 1.1 phil /* 4 1.1 phil * Copyright 1997 Piermont Information Systems Inc. 5 1.1 phil * All rights reserved. 6 1.1 phil * 7 1.1 phil * Written by Philip A. Nelson for Piermont Information Systems Inc. 8 1.1 phil * 9 1.1 phil * Redistribution and use in source and binary forms, with or without 10 1.1 phil * modification, are permitted provided that the following conditions 11 1.1 phil * are met: 12 1.1 phil * 1. Redistributions of source code must retain the above copyright 13 1.1 phil * notice, this list of conditions and the following disclaimer. 14 1.1 phil * 2. Redistributions in binary form must reproduce the above copyright 15 1.1 phil * notice, this list of conditions and the following disclaimer in the 16 1.1 phil * documentation and/or other materials provided with the distribution. 17 1.9 mbalmer * 3. The name of Piermont Information Systems Inc. may not be used to endorse 18 1.1 phil * or promote products derived from this software without specific prior 19 1.1 phil * written permission. 20 1.1 phil * 21 1.1 phil * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS'' 22 1.1 phil * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 1.1 phil * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 1.1 phil * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE 25 1.1 phil * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 1.1 phil * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 1.1 phil * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 1.1 phil * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 1.1 phil * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 1.1 phil * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 31 1.1 phil * THE POSSIBILITY OF SUCH DAMAGE. 32 1.1 phil * 33 1.1 phil */ 34 1.1 phil 35 1.1 phil /* mdb.h - definitions for the menu database. */ 36 1.1 phil 37 1.1 phil #ifndef MDB_H 38 1.1 phil #define MDB_H 39 1.1 phil 40 1.1 phil /* forward declaration */ 41 1.1 phil typedef struct menu_info menu_info; 42 1.1 phil 43 1.1 phil /* The declarations for the balanced binary trees. */ 44 1.1 phil 45 1.1 phil typedef struct id_rec { 46 1.1 phil /* The balanced binary tree fields. */ 47 1.1 phil char *id; /* The name. */ 48 1.1 phil short balance; /* For the balanced tree. */ 49 1.1 phil struct id_rec *left, *right; /* Tree pointers. */ 50 1.1 phil 51 1.1 phil /* Other information fields. */ 52 1.1 phil menu_info *info; 53 1.1 phil int menu_no; 54 1.1 phil } id_rec; 55 1.1 phil 56 1.1 phil 57 1.1 phil /* menu definitions records. */ 58 1.1 phil 59 1.1 phil typedef struct action { 60 1.1 phil char *code; 61 1.1 phil int endwin; 62 1.1 phil } action; 63 1.1 phil 64 1.1 phil typedef struct optn_info { 65 1.1 phil char *name; 66 1.8 dsl int name_is_code; 67 1.1 phil int menu; 68 1.1 phil int issub; 69 1.1 phil int doexit; 70 1.1 phil action optact; 71 1.1 phil struct optn_info *next; 72 1.1 phil } optn_info; 73 1.1 phil 74 1.1 phil struct menu_info { 75 1.1 phil char *title; 76 1.2 phil char *helpstr; 77 1.4 cgd char *exitstr; 78 1.1 phil int mopt; 79 1.1 phil int y, x; 80 1.1 phil int h, w; 81 1.1 phil int numopt; 82 1.8 dsl int name_is_code; 83 1.1 phil optn_info *optns; 84 1.10 martin action expact; 85 1.1 phil action postact; 86 1.1 phil action exitact; 87 1.1 phil }; 88 1.1 phil 89 1.1 phil /* defines for mopt */ 90 1.12 christos #define MC_NOEXITOPT 0x001 91 1.12 christos #define MC_NOBOX 0x002 92 1.12 christos #define MC_SCROLL 0x004 93 1.12 christos #define MC_NOSHORTCUT 0x008 94 1.12 christos #define MC_NOCLEAR 0x010 95 1.12 christos #define MC_DFLTEXIT 0x020 96 1.12 christos #define MC_ALWAYS_SCROLL 0x040 97 1.12 christos #define MC_SUBMENU 0x080 98 1.12 christos #define MC_CONTINUOUS 0x100 99 1.12 christos #define MC_VALID 0x200 100 1.1 phil #endif 101