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