1 /** $MirOS: src/usr.sbin/config/cmd.h,v 1.3 2007/02/19 03:24:55 tg Exp $ */ 2 /* $OpenBSD: cmd.h,v 1.7 2003/06/03 00:52:35 weingart Exp $ */ 3 4 /* 5 * Copyright (c) 1997 Tobias Weingartner 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 2. Redistributions in binary form must reproduce the above copyright 14 * notice, this list of conditions and the following disclaimer in the 15 * documentation and/or other materials provided with the distribution. 16 * 17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29 #ifndef _CMD_H 30 #define _CMD_H 31 32 /* Constants (returned by cmd funs) */ 33 #define CMD_EXIT 0x0000 34 #define CMD_SAVE 0x0001 35 #define CMD_CONT 0x0002 36 37 /* Data types */ 38 struct _cmd_table_t; 39 typedef struct _cmd_t { 40 struct _cmd_table_t *table; 41 char cmd[10]; 42 char args[100]; 43 } cmd_t; 44 45 typedef struct _cmd_table_t { 46 const char *cmd; 47 int (*fcn)(cmd_t *); 48 const char *opt; 49 const char *help; 50 } cmd_table_t; 51 52 53 #ifndef CMD_NOEXTERN 54 extern cmd_table_t cmd_table[]; 55 #endif 56 57 /* Prototypes */ 58 int Xhelp(cmd_t *); 59 int Xadd(cmd_t *); 60 int Xbase(cmd_t *); 61 int Xchange(cmd_t *); 62 int Xdisable(cmd_t *); 63 int Xenable(cmd_t *); 64 int Xfind(cmd_t *); 65 int Xlines(cmd_t *); 66 int Xlist(cmd_t *); 67 int Xshow(cmd_t *); 68 int Xexit(cmd_t *); 69 int Xquit(cmd_t *); 70 int Xtimezone(cmd_t *); 71 int Xnmbclusters(cmd_t *); 72 int Xbufcachepct(cmd_t *); 73 int Xnkmempg(cmd_t *); 74 int Xshmseg(cmd_t *); 75 int Xshmmaxpgs(cmd_t *); 76 int Xrootdev(cmd_t *); 77 78 #endif /* _CMD_H */ 79