1*86d7f5d3SJohn Marino /* $NetBSD: fsdb.h,v 1.2 1995/10/08 23:18:11 thorpej Exp $ */ 2*86d7f5d3SJohn Marino 3*86d7f5d3SJohn Marino /* 4*86d7f5d3SJohn Marino * Copyright (c) 1995 John T. Kohl 5*86d7f5d3SJohn Marino * All rights reserved. 6*86d7f5d3SJohn Marino * 7*86d7f5d3SJohn Marino * Redistribution and use in source and binary forms, with or without 8*86d7f5d3SJohn Marino * modification, are permitted provided that the following conditions 9*86d7f5d3SJohn Marino * are met: 10*86d7f5d3SJohn Marino * 1. Redistributions of source code must retain the above copyright 11*86d7f5d3SJohn Marino * notice, this list of conditions and the following disclaimer. 12*86d7f5d3SJohn Marino * 2. Redistributions in binary form must reproduce the above copyright 13*86d7f5d3SJohn Marino * notice, this list of conditions and the following disclaimer in the 14*86d7f5d3SJohn Marino * documentation and/or other materials provided with the distribution. 15*86d7f5d3SJohn Marino * 3. The name of the author may not be used to endorse or promote products 16*86d7f5d3SJohn Marino * derived from this software without specific prior written permission. 17*86d7f5d3SJohn Marino * 18*86d7f5d3SJohn Marino * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR 19*86d7f5d3SJohn Marino * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20*86d7f5d3SJohn Marino * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21*86d7f5d3SJohn Marino * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 22*86d7f5d3SJohn Marino * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23*86d7f5d3SJohn Marino * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24*86d7f5d3SJohn Marino * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25*86d7f5d3SJohn Marino * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26*86d7f5d3SJohn Marino * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 27*86d7f5d3SJohn Marino * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28*86d7f5d3SJohn Marino * POSSIBILITY OF SUCH DAMAGE. 29*86d7f5d3SJohn Marino * 30*86d7f5d3SJohn Marino * $FreeBSD: src/sbin/fsdb/fsdb.h,v 1.4.2.1 2002/03/20 13:39:02 joerg Exp $ 31*86d7f5d3SJohn Marino * $DragonFly: src/sbin/fsdb/fsdb.h,v 1.4 2006/04/03 01:58:49 dillon Exp $ 32*86d7f5d3SJohn Marino */ 33*86d7f5d3SJohn Marino 34*86d7f5d3SJohn Marino extern int bread(int fd, char *buf, daddr_t blk, long size); 35*86d7f5d3SJohn Marino extern void bwrite(int fd, char *buf, daddr_t blk, long size); 36*86d7f5d3SJohn Marino extern void rwerror(char *mesg, daddr_t blk); 37*86d7f5d3SJohn Marino extern int reply(char *question); 38*86d7f5d3SJohn Marino 39*86d7f5d3SJohn Marino extern long dev_bsize; 40*86d7f5d3SJohn Marino extern long secsize; 41*86d7f5d3SJohn Marino extern int fsmodified; 42*86d7f5d3SJohn Marino extern int fsfd; 43*86d7f5d3SJohn Marino 44*86d7f5d3SJohn Marino struct cmdtable { 45*86d7f5d3SJohn Marino const char *cmd; 46*86d7f5d3SJohn Marino const char *helptxt; 47*86d7f5d3SJohn Marino unsigned int minargc; 48*86d7f5d3SJohn Marino unsigned int maxargc; 49*86d7f5d3SJohn Marino unsigned int flags; 50*86d7f5d3SJohn Marino #define FL_RO 0x0000 /* for symmetry */ 51*86d7f5d3SJohn Marino #define FL_WR 0x0001 /* wants to write */ 52*86d7f5d3SJohn Marino int (*handler)(int argc, char *argv[]); 53*86d7f5d3SJohn Marino }; 54*86d7f5d3SJohn Marino extern struct ufs1_dinode *curinode; 55*86d7f5d3SJohn Marino extern ino_t curinum; 56*86d7f5d3SJohn Marino 57*86d7f5d3SJohn Marino int argcount(struct cmdtable *cmdp, int argc, char *argv[]); 58*86d7f5d3SJohn Marino char **crack(char *line, int *argc); 59*86d7f5d3SJohn Marino void printstat(const char *cp, ino_t inum, struct ufs1_dinode *dp); 60*86d7f5d3SJohn Marino int printactive(int doblocks); 61*86d7f5d3SJohn Marino int checkactive(void); 62*86d7f5d3SJohn Marino int checkactivedir(void); 63