1*ce7279d8Sjsg /* $OpenBSD: cmd.h,v 1.9 2024/05/21 05:00:48 jsg Exp $ */ 235319decSderaadt 335319decSderaadt /* 435319decSderaadt * Copyright (c) 1997 Tobias Weingartner 535319decSderaadt * All rights reserved. 635319decSderaadt * 735319decSderaadt * Redistribution and use in source and binary forms, with or without 835319decSderaadt * modification, are permitted provided that the following conditions 935319decSderaadt * are met: 1035319decSderaadt * 1. Redistributions of source code must retain the above copyright 1135319decSderaadt * notice, this list of conditions and the following disclaimer. 1235319decSderaadt * 2. Redistributions in binary form must reproduce the above copyright 1335319decSderaadt * notice, this list of conditions and the following disclaimer in the 1435319decSderaadt * documentation and/or other materials provided with the distribution. 1535319decSderaadt * 1635319decSderaadt * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 1735319decSderaadt * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 1835319decSderaadt * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1935319decSderaadt * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 2035319decSderaadt * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 2135319decSderaadt * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2235319decSderaadt * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2335319decSderaadt * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2435319decSderaadt * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 2535319decSderaadt * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2635319decSderaadt */ 2735319decSderaadt 2835319decSderaadt #ifndef _CMD_H 2935319decSderaadt #define _CMD_H 3035319decSderaadt 3135319decSderaadt /* Constants (returned by cmd funs) */ 3235319decSderaadt #define CMD_EXIT 0x0000 3335319decSderaadt #define CMD_SAVE 0x0001 3435319decSderaadt #define CMD_CONT 0x0002 3535319decSderaadt 3635319decSderaadt /* Data types */ 3735319decSderaadt struct _cmd_table_t; 3835319decSderaadt typedef struct _cmd_t { 3935319decSderaadt struct _cmd_table_t *table; 4035319decSderaadt char cmd[10]; 4135319decSderaadt char args[100]; 4235319decSderaadt } cmd_t; 4335319decSderaadt 4435319decSderaadt typedef struct _cmd_table_t { 4535319decSderaadt char *cmd; 4635319decSderaadt int (*fcn)(cmd_t *); 4735319decSderaadt char *opt; 4835319decSderaadt char *help; 4935319decSderaadt } cmd_table_t; 5035319decSderaadt 5135319decSderaadt 5235319decSderaadt #ifndef CMD_NOEXTERN 5335319decSderaadt extern cmd_table_t cmd_table[]; 5435319decSderaadt #endif 5535319decSderaadt 5635319decSderaadt /* Prototypes */ 57c72b5b24Smillert int Xhelp(cmd_t *); 58c72b5b24Smillert int Xadd(cmd_t *); 59c72b5b24Smillert int Xbase(cmd_t *); 60c72b5b24Smillert int Xchange(cmd_t *); 61c72b5b24Smillert int Xdisable(cmd_t *); 62c72b5b24Smillert int Xenable(cmd_t *); 63c72b5b24Smillert int Xfind(cmd_t *); 64c72b5b24Smillert int Xlines(cmd_t *); 65c72b5b24Smillert int Xlist(cmd_t *); 66c72b5b24Smillert int Xshow(cmd_t *); 67c72b5b24Smillert int Xexit(cmd_t *); 68c72b5b24Smillert int Xquit(cmd_t *); 695309eac8Smaja int Xnkmempg(cmd_t *); 7035319decSderaadt 71fd0d495eSheko #endif /* _CMD_H */ 7235319decSderaadt 7335319decSderaadt 74