xref: /openbsd/usr.sbin/config/cmd.h (revision 404b540a)
1 /*	$OpenBSD: cmd.h,v 1.7 2003/06/03 00:52:35 weingart 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 */
37 struct _cmd_table_t;
38 typedef struct _cmd_t {
39 	struct _cmd_table_t *table;
40 	char cmd[10];
41 	char args[100];
42 } cmd_t;
43 
44 typedef 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
53 extern cmd_table_t cmd_table[];
54 #endif
55 
56 /* Prototypes */
57 int Xhelp(cmd_t *);
58 int Xadd(cmd_t *);
59 int Xbase(cmd_t *);
60 int Xchange(cmd_t *);
61 int Xdisable(cmd_t *);
62 int Xenable(cmd_t *);
63 int Xfind(cmd_t *);
64 int Xlines(cmd_t *);
65 int Xlist(cmd_t *);
66 int Xshow(cmd_t *);
67 int Xexit(cmd_t *);
68 int Xquit(cmd_t *);
69 int Xtimezone(cmd_t *);
70 int Xnmbclusters(cmd_t *);
71 int Xbufcachepct(cmd_t *);
72 int Xnkmempg(cmd_t *);
73 int Xshmseg(cmd_t *);
74 int Xshmmaxpgs(cmd_t *);
75 
76 #endif /* _CMD_H */
77 
78 
79