Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/man Well, the removelist and renamelist functions we...



details:   https://anonhg.NetBSD.org/src/rev/618700becc8f
branches:  trunk
changeset: 486771:618700becc8f
user:      he <he%NetBSD.org@localhost>
date:      Sun May 28 16:23:55 2000 +0000

description:
Well, the removelist and renamelist functions were not unused;
they are still used by catman.  Add them back.

diffstat:

 usr.bin/man/config.c |  38 +++++++++++++++++++++++++++++++++++---
 usr.bin/man/config.h |   4 +++-
 2 files changed, 38 insertions(+), 4 deletions(-)

diffs (81 lines):

diff -r bd9800a09cab -r 618700becc8f usr.bin/man/config.c
--- a/usr.bin/man/config.c      Sun May 28 15:27:51 2000 +0000
+++ b/usr.bin/man/config.c      Sun May 28 16:23:55 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: config.c,v 1.11 2000/05/27 21:33:26 jdolecek Exp $     */
+/*     $NetBSD: config.c,v 1.12 2000/05/28 16:23:55 he Exp $   */
 
 /*
  * Copyright (c) 1989, 1993, 1995
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)config.c   8.8 (Berkeley) 1/31/95";
 #else
-__RCSID("$NetBSD: config.c,v 1.11 2000/05/27 21:33:26 jdolecek Exp $");
+__RCSID("$NetBSD: config.c,v 1.12 2000/05/28 16:23:55 he Exp $");
 #endif
 #endif /* not lint */
 
@@ -209,7 +209,7 @@
        ENTRY *ep;
 
        if ((ep = malloc(sizeof(*ep))) == NULL ||
-           (ep->s = strdup(newent)) == NULL) 
+           (ep->s = strdup(newent)) == NULL)
                err(1, "malloc");
        if (head)
                TAILQ_INSERT_HEAD(&tp->list, ep, q);
@@ -217,6 +217,38 @@
                TAILQ_INSERT_TAIL(&tp->list, ep, q);
 }
 
+void
+removelist(name)
+       const char *name;
+{
+       TAG *tp;
+       ENTRY *ep;
+
+       tp = getlist(name);
+       while ((ep = tp->list.tqh_first) != NULL) {
+               free(ep->s);
+               TAILQ_REMOVE(&tp->list, ep, q);
+       }
+       free(tp->s);
+       TAILQ_REMOVE(&head, tp, q);
+
+}
+
+TAG *
+renamelist(oldname, newname)
+       const char *oldname;
+       const char *newname;
+{
+       TAG *tp;
+
+       if(!(tp = getlist(oldname)))
+               return (NULL);
+       free(tp->s);
+       if(!(tp->s = strdup(newname)))
+               err(1, "malloc");
+       return (tp);
+}
+
 #ifdef MANDEBUG
 void
 debug(l)
diff -r bd9800a09cab -r 618700becc8f usr.bin/man/config.h
--- a/usr.bin/man/config.h      Sun May 28 15:27:51 2000 +0000
+++ b/usr.bin/man/config.h      Sun May 28 16:23:55 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: config.h,v 1.4 2000/05/27 21:33:26 jdolecek Exp $      */
+/*     $NetBSD: config.h,v 1.5 2000/05/28 16:23:55 he Exp $    */
 
 /*-
  * Copyright (c) 1993
@@ -60,3 +60,5 @@
 void    debug __P((const char *));
 #endif
 TAG    *getlist __P((const char *));
+void   removelist __P((const char *));
+TAG    *renamelist __P((const char *, const char *));



Home | Main Index | Thread Index | Old Index