Deleted Added
full compact
fsdb.c (89827) fsdb.c (92806)
1/* $NetBSD: fsdb.c,v 1.2 1995/10/08 23:18:10 thorpej Exp $ */
2
3/*
4 * Copyright (c) 1995 John T. Kohl
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 16 unchanged lines hidden (view full) ---

25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
27 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#ifndef lint
32static const char rcsid[] =
1/* $NetBSD: fsdb.c,v 1.2 1995/10/08 23:18:10 thorpej Exp $ */
2
3/*
4 * Copyright (c) 1995 John T. Kohl
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 16 unchanged lines hidden (view full) ---

25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
27 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#ifndef lint
32static const char rcsid[] =
33 "$FreeBSD: head/sbin/fsdb/fsdb.c 89827 2002-01-26 15:53:23Z joerg $";
33 "$FreeBSD: head/sbin/fsdb/fsdb.c 92806 2002-03-20 17:55:10Z obrien $";
34#endif /* not lint */
35
36#include <sys/param.h>
37#include <sys/time.h>
38#include <ctype.h>
39#include <err.h>
40#include <grp.h>
41#include <histedit.h>

--- 143 unchanged lines hidden (view full) ---

185 { NULL, 0, 0, 0 },
186};
187
188int
189helpfn(argc, argv)
190 int argc;
191 char *argv[];
192{
34#endif /* not lint */
35
36#include <sys/param.h>
37#include <sys/time.h>
38#include <ctype.h>
39#include <err.h>
40#include <grp.h>
41#include <histedit.h>

--- 143 unchanged lines hidden (view full) ---

185 { NULL, 0, 0, 0 },
186};
187
188int
189helpfn(argc, argv)
190 int argc;
191 char *argv[];
192{
193 register struct cmdtable *cmdtp;
193 struct cmdtable *cmdtp;
194
195 printf("Commands are:\n%-10s %5s %5s %s\n",
196 "command", "min argc", "max argc", "what");
197
198 for (cmdtp = cmds; cmdtp->cmd; cmdtp++)
199 printf("%-10s %5u %5u %s\n",
200 cmdtp->cmd, cmdtp->minargc, cmdtp->maxargc, cmdtp->helptxt);
201 return 0;

--- 188 unchanged lines hidden (view full) ---

390};
391
392int slot;
393
394int
395scannames(idesc)
396 struct inodesc *idesc;
397{
194
195 printf("Commands are:\n%-10s %5s %5s %s\n",
196 "command", "min argc", "max argc", "what");
197
198 for (cmdtp = cmds; cmdtp->cmd; cmdtp++)
199 printf("%-10s %5u %5u %s\n",
200 cmdtp->cmd, cmdtp->minargc, cmdtp->maxargc, cmdtp->helptxt);
201 return 0;

--- 188 unchanged lines hidden (view full) ---

390};
391
392int slot;
393
394int
395scannames(idesc)
396 struct inodesc *idesc;
397{
398 register struct direct *dirp = idesc->id_dirp;
398 struct direct *dirp = idesc->id_dirp;
399
400 printf("slot %d ino %d reclen %d: %s, `%.*s'\n",
401 slot++, dirp->d_ino, dirp->d_reclen, typename[dirp->d_type],
402 dirp->d_namlen, dirp->d_name);
403 return (KEEPON);
404}
405
406CMDFUNCSTART(ls)

--- 105 unchanged lines hidden (view full) ---

512}
513
514long slotcount, desired;
515
516int
517chinumfunc(idesc)
518 struct inodesc *idesc;
519{
399
400 printf("slot %d ino %d reclen %d: %s, `%.*s'\n",
401 slot++, dirp->d_ino, dirp->d_reclen, typename[dirp->d_type],
402 dirp->d_namlen, dirp->d_name);
403 return (KEEPON);
404}
405
406CMDFUNCSTART(ls)

--- 105 unchanged lines hidden (view full) ---

512}
513
514long slotcount, desired;
515
516int
517chinumfunc(idesc)
518 struct inodesc *idesc;
519{
520 register struct direct *dirp = idesc->id_dirp;
520 struct direct *dirp = idesc->id_dirp;
521
522 if (slotcount++ == desired) {
523 dirp->d_ino = idesc->id_parent;
524 return STOP|ALTERED|FOUND;
525 }
526 return KEEPON;
527}
528

--- 27 unchanged lines hidden (view full) ---

556 return 1;
557 }
558}
559
560int
561chnamefunc(idesc)
562 struct inodesc *idesc;
563{
521
522 if (slotcount++ == desired) {
523 dirp->d_ino = idesc->id_parent;
524 return STOP|ALTERED|FOUND;
525 }
526 return KEEPON;
527}
528

--- 27 unchanged lines hidden (view full) ---

556 return 1;
557 }
558}
559
560int
561chnamefunc(idesc)
562 struct inodesc *idesc;
563{
564 register struct direct *dirp = idesc->id_dirp;
564 struct direct *dirp = idesc->id_dirp;
565 struct direct testdir;
566
567 if (slotcount++ == desired) {
568 /* will name fit? */
569 testdir.d_namlen = strlen(idesc->id_name);
570 if (DIRSIZ(NEWDIRFMT, &testdir) <= dirp->d_reclen) {
571 dirp->d_namlen = testdir.d_namlen;
572 strcpy(dirp->d_name, idesc->id_name);

--- 334 unchanged lines hidden ---
565 struct direct testdir;
566
567 if (slotcount++ == desired) {
568 /* will name fit? */
569 testdir.d_namlen = strlen(idesc->id_name);
570 if (DIRSIZ(NEWDIRFMT, &testdir) <= dirp->d_reclen) {
571 dirp->d_namlen = testdir.d_namlen;
572 strcpy(dirp->d_name, idesc->id_name);

--- 334 unchanged lines hidden ---