fsdb.h revision 92881
1214152Sed/*	$NetBSD: fsdb.h,v 1.2 1995/10/08 23:18:11 thorpej Exp $	*/
2214152Sed
3214152Sed/*
4214152Sed *  Copyright (c) 1995 John T. Kohl
5214152Sed *  All rights reserved.
6229135Sed *
7214152Sed *  Redistribution and use in source and binary forms, with or without
8229135Sed *  modification, are permitted provided that the following conditions
9229135Sed *  are met:
10229135Sed *  1. Redistributions of source code must retain the above copyright
11229135Sed *     notice, this list of conditions and the following disclaimer.
12214152Sed *  2. Redistributions in binary form must reproduce the above copyright
13229135Sed *     notice, this list of conditions and the following disclaimer in the
14229135Sed *     documentation and/or other materials provided with the distribution.
15229135Sed *  3. The name of the author may not be used to endorse or promote products
16229135Sed *     derived from this software without specific prior written permission.
17229135Sed *
18229135Sed * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR
19214152Sed * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20214152Sed * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21214152Sed * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
22214152Sed * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23214152Sed * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24214152Sed * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25214152Sed * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26214152Sed * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
27214152Sed * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28214152Sed * POSSIBILITY OF SUCH DAMAGE.
29214152Sed *
30214152Sed * $FreeBSD: head/sbin/fsdb/fsdb.h 92881 2002-03-21 13:10:52Z imp $
31214152Sed */
32214152Sed
33214152Sedextern int bread(int fd, char *buf, daddr_t blk, long size);
34214152Sedextern void bwrite(int fd, char *buf, daddr_t blk, long size);
35229135Sedextern void rwerror(char *mesg, daddr_t blk);
36214152Sedextern int reply(char *question);
37214152Sed
38214152Sedextern long dev_bsize;
39214152Sedextern long secsize;
40214152Sedextern int fsmodified;
41214152Sedextern int fsfd;
42214152Sed
43214152Sedstruct cmdtable {
44229135Sed	const char *cmd;
45214152Sed	const char *helptxt;
46214152Sed	unsigned int minargc;
47214152Sed	unsigned int maxargc;
48214152Sed	unsigned int flags;
49214152Sed#define	FL_RO	0x0000		/* for symmetry */
50214152Sed#define	FL_WR	0x0001		/* wants to write */
51214152Sed	int (*handler)(int argc, char *argv[]);
52214152Sed};
53229135Sedextern struct dinode *curinode;
54214152Sedextern ino_t curinum;
55214152Sed
56214152Sedint argcount(struct cmdtable *cmdp, int argc, char *argv[]);
57214152Sedchar **crack(char *line, int *argc);
58214152Sedchar **recrack(char *line, int *argc, int argc_max);
59214152Sedvoid printstat(const char *cp, ino_t inum, struct dinode *dp);
60214152Sedint printactive(int doblocks);
61214152Sedint checkactive(void);
62214152Sedint checkactivedir(void);
63214152Sed