/* $NetBSD: fsdb.h,v 1.2 1995/10/08 23:18:11 thorpej Exp $ */12/*-3* SPDX-License-Identifier: BSD-3-Clause4*5* Copyright (c) 1995 John T. Kohl6* All rights reserved.7*8* Redistribution and use in source and binary forms, with or without9* modification, are permitted provided that the following conditions10* are met:11* 1. Redistributions of source code must retain the above copyright12* notice, this list of conditions and the following disclaimer.13* 2. Redistributions in binary form must reproduce the above copyright14* notice, this list of conditions and the following disclaimer in the15* documentation and/or other materials provided with the distribution.16* 3. The name of the author may not be used to endorse or promote products17* derived from this software without specific prior written permission.18*19* THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR20* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED21* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE22* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,23* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES24* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR25* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)26* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,27* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN28* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE29* POSSIBILITY OF SUCH DAMAGE.30*/3132extern int blread(int fd, char *buf, ufs2_daddr_t blk, long size);33extern void rwerror(const char *mesg, ufs2_daddr_t blk);34extern int reply(const char *question);3536extern long dev_bsize;37extern long secsize;38extern int fsmodified;39extern int fsfd;4041struct cmdtable {42const char *cmd;43const char *helptxt;44unsigned int minargc;45unsigned int maxargc;46unsigned int flags;47#define FL_RO 0x0000 /* for symmetry */48#define FL_WR 0x0001 /* wants to write */49#define FL_CWR 0x0002 /* wants to write critical data */50#define FL_ST 0x0003 /* resplit final string if argc > maxargc */51int (*handler)(int argc, char *argv[]);52};53extern struct inode curip;54extern union dinode *curinode;55extern ino_t curinum;5657int argcount(struct cmdtable *cmdp, int argc, char *argv[]);58char **crack(char *line, int *argc);59char **recrack(char *line, int *argc, int argc_max);60void printstat(const char *cp, ino_t inum, union dinode *dp);61int printactive(int doblocks);62int checkactive(void);63int checkactivedir(void);646566