xref: /openbsd-src/sbin/fdisk/cmd.h (revision 898184e3e61f9129feb5978fad5a8c6865f00b92)
1 /*	$OpenBSD: cmd.h,v 1.9 2005/01/19 15:48:20 deraadt 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 /* Includes */
32 #include "disk.h"
33 #include "mbr.h"
34 
35 
36 /* Constants (returned by cmd funs) */
37 #define CMD_EXIT	0x0000
38 #define CMD_SAVE	0x0001
39 #define CMD_CONT	0x0002
40 #define CMD_CLEAN	0x0003
41 #define CMD_DIRTY	0x0004
42 
43 
44 /* Data types */
45 struct _cmd_table_t;
46 typedef struct _cmd_t {
47 	struct _cmd_table_t *table;
48 	char cmd[10];
49 	char args[100];
50 } cmd_t;
51 
52 typedef struct _cmd_table_t {
53 	char *cmd;
54 	int (*fcn)(cmd_t *, disk_t *, mbr_t *, mbr_t *, int);
55 	char *help;
56 } cmd_table_t;
57 
58 
59 /* Prototypes */
60 int Xreinit(cmd_t *, disk_t *, mbr_t *, mbr_t *, int);
61 int Xdisk(cmd_t *, disk_t *, mbr_t *, mbr_t *, int);
62 int Xmanual(cmd_t *, disk_t *, mbr_t *, mbr_t *, int);
63 int Xedit(cmd_t *, disk_t *, mbr_t *, mbr_t *, int);
64 int Xsetpid(cmd_t *, disk_t *, mbr_t *, mbr_t *, int);
65 int Xselect(cmd_t *, disk_t *, mbr_t *, mbr_t *, int);
66 int Xswap(cmd_t *, disk_t *, mbr_t *, mbr_t *, int);
67 int Xprint(cmd_t *, disk_t *, mbr_t *, mbr_t *, int);
68 int Xwrite(cmd_t *, disk_t *, mbr_t *, mbr_t *, int);
69 int Xexit(cmd_t *, disk_t *, mbr_t *, mbr_t *, int);
70 int Xquit(cmd_t *, disk_t *, mbr_t *, mbr_t *, int);
71 int Xabort(cmd_t *, disk_t *, mbr_t *, mbr_t *, int);
72 int Xhelp(cmd_t *, disk_t *, mbr_t *, mbr_t *, int);
73 int Xflag(cmd_t *, disk_t *, mbr_t *, mbr_t *, int);
74 int Xupdate(cmd_t *, disk_t *, mbr_t *, mbr_t *, int);
75 
76 #endif /* _CMD_H */
77 
78 
79