Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/mtree - add lineno field to NODE



details:   https://anonhg.NetBSD.org/src/rev/2df60eccfeef
branches:  trunk
changeset: 516569:2df60eccfeef
user:      lukem <lukem%NetBSD.org@localhost>
date:      Thu Oct 25 03:00:14 2001 +0000

description:
- add lineno field to NODE
- move inotype() prototype into mtree.h from extern.h

diffstat:

 usr.sbin/mtree/extern.h |   3 +--
 usr.sbin/mtree/mtree.h  |  12 +++++++++---
 usr.sbin/mtree/spec.c   |   5 +++--
 3 files changed, 13 insertions(+), 7 deletions(-)

diffs (76 lines):

diff -r 281194fa6625 -r 2df60eccfeef usr.sbin/mtree/extern.h
--- a/usr.sbin/mtree/extern.h   Thu Oct 25 02:37:49 2001 +0000
+++ b/usr.sbin/mtree/extern.h   Thu Oct 25 03:00:14 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: extern.h,v 1.15 2001/10/22 07:07:46 lukem Exp $        */
+/*     $NetBSD: extern.h,v 1.16 2001/10/25 03:00:14 lukem Exp $        */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -42,7 +42,6 @@
 int     crc(int, u_int32_t *, u_int32_t *);
 void    cwalk(void);
 void    dump_nodes(const char *, NODE *);
-const char *inotype(u_int);
 int     matchtags(NODE *);
 void    mtree_err(const char *, ...)
        __attribute__((__format__(__printf__, 1, 2)));
diff -r 281194fa6625 -r 2df60eccfeef usr.sbin/mtree/mtree.h
--- a/usr.sbin/mtree/mtree.h    Thu Oct 25 02:37:49 2001 +0000
+++ b/usr.sbin/mtree/mtree.h    Thu Oct 25 03:00:14 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mtree.h,v 1.16 2001/10/22 07:07:46 lukem Exp $ */
+/*     $NetBSD: mtree.h,v 1.17 2001/10/25 03:00:14 lukem Exp $ */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -59,6 +59,7 @@
        nlink_t st_nlink;                       /* link count */
        char    *md5sum;                        /* md5 checksum */
        char    *tags;                          /* tags, comma delimited */
+       size_t  lineno;                         /* line # entry came from */
 
 #define        F_CKSUM 0x00000001                      /* check sum */
 #define        F_DONE  0x00000002                      /* directory done */
@@ -101,8 +102,13 @@
 } slist_t;
 
 
-NODE   *spec(FILE *);
-u_int   nodetoino(u_int);
+/*
+ * prototypes for functions published to other programs which want to use
+ * the specfile parser but don't want to pull in all of "extern.h"
+ */
+const char     *inotype(u_int);
+u_int           nodetoino(u_int);
+NODE           *spec(FILE *);
 
 
 #define        RP(p)   \
diff -r 281194fa6625 -r 2df60eccfeef usr.sbin/mtree/spec.c
--- a/usr.sbin/mtree/spec.c     Thu Oct 25 02:37:49 2001 +0000
+++ b/usr.sbin/mtree/spec.c     Thu Oct 25 03:00:14 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: spec.c,v 1.34 2001/10/22 07:07:46 lukem Exp $  */
+/*     $NetBSD: spec.c,v 1.35 2001/10/25 03:00:14 lukem Exp $  */
 
 /*-
  * Copyright (c) 1989, 1993
@@ -74,7 +74,7 @@
 #if 0
 static char sccsid[] = "@(#)spec.c     8.2 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: spec.c,v 1.34 2001/10/22 07:07:46 lukem Exp $");
+__RCSID("$NetBSD: spec.c,v 1.35 2001/10/25 03:00:14 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -206,6 +206,7 @@
                if ((centry = calloc(1, sizeof(NODE) + strlen(p))) == NULL)
                        mtree_err("%s", strerror(errno));
                *centry = ginfo;
+               centry->lineno = lineno;
                strcpy(centry->name, p);
 #define        MAGIC   "?*["
                if (strpbrk(p, MAGIC))



Home | Main Index | Thread Index | Old Index