112048Speter/*	$NetBSD: fsdb.h,v 1.2 1995/10/08 23:18:11 thorpej Exp $	*/
212048Speter
312048Speter/*
412048Speter *  Copyright (c) 1995 John T. Kohl
512048Speter *  All rights reserved.
612048Speter *
712048Speter *  Redistribution and use in source and binary forms, with or without
812048Speter *  modification, are permitted provided that the following conditions
912048Speter *  are met:
1012048Speter *  1. Redistributions of source code must retain the above copyright
1112048Speter *     notice, this list of conditions and the following disclaimer.
1212048Speter *  2. Redistributions in binary form must reproduce the above copyright
1312048Speter *     notice, this list of conditions and the following disclaimer in the
1412048Speter *     documentation and/or other materials provided with the distribution.
1512048Speter *  3. The name of the author may not be used to endorse or promote products
1612048Speter *     derived from this software without specific prior written permission.
1712048Speter *
1812048Speter * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR
1912048Speter * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
2012048Speter * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
2112048Speter * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
2212048Speter * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
2312048Speter * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
2412048Speter * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2512048Speter * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
2612048Speter * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
2712048Speter * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2812048Speter * POSSIBILITY OF SUCH DAMAGE.
2923839Speter *
3050476Speter * $FreeBSD$
3112048Speter */
3212048Speter
33163846Spjdextern int blread(int fd, char *buf, ufs2_daddr_t blk, long size);
34100935Sphkextern void rwerror(const char *mesg, ufs2_daddr_t blk);
35100935Sphkextern int reply(const char *question);
3612048Speter
3712048Speterextern long dev_bsize;
3812048Speterextern long secsize;
3912048Speterextern int fsmodified;
4012048Speterextern int fsfd;
4112048Speter
4212048Speterstruct cmdtable {
4312048Speter	const char *cmd;
4412048Speter	const char *helptxt;
4512048Speter	unsigned int minargc;
4612048Speter	unsigned int maxargc;
4724956Sjoerg	unsigned int flags;
4824956Sjoerg#define	FL_RO	0x0000		/* for symmetry */
4924956Sjoerg#define	FL_WR	0x0001		/* wants to write */
50157950Smaxim#define	FL_ST	0x0002		/* resplit final string if argc > maxargc */
5192881Simp	int (*handler)(int argc, char *argv[]);
5212048Speter};
5398542Smckusickextern union dinode *curinode;
5412048Speterextern ino_t curinum;
5512048Speter
5692881Simpint argcount(struct cmdtable *cmdp, int argc, char *argv[]);
5792881Simpchar **crack(char *line, int *argc);
5892881Simpchar **recrack(char *line, int *argc, int argc_max);
5998542Smckusickvoid printstat(const char *cp, ino_t inum, union dinode *dp);
6092881Simpint printactive(int doblocks);
6192881Simpint checkactive(void);
6292881Simpint checkactivedir(void);
63