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