Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/hexdump remove agitation that od(1) was deprecated -...



details:   https://anonhg.NetBSD.org/src/rev/426eacc80310
branches:  trunk
changeset: 751948:426eacc80310
user:      drochner <drochner%NetBSD.org@localhost>
date:      Tue Feb 09 14:06:37 2010 +0000

description:
remove agitation that od(1) was deprecated -- it is still POSIX

diffstat:

 usr.bin/hexdump/conv.c     |  12 ++++++------
 usr.bin/hexdump/hexdump.c  |   6 +++---
 usr.bin/hexdump/hexdump.h  |   6 +++---
 usr.bin/hexdump/od.1       |  22 +---------------------
 usr.bin/hexdump/odsyntax.c |  21 ++++++---------------
 5 files changed, 19 insertions(+), 48 deletions(-)

diffs (208 lines):

diff -r 11f2ce61b148 -r 426eacc80310 usr.bin/hexdump/conv.c
--- a/usr.bin/hexdump/conv.c    Tue Feb 09 13:59:01 2010 +0000
+++ b/usr.bin/hexdump/conv.c    Tue Feb 09 14:06:37 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: conv.c,v 1.12 2006/01/04 01:30:21 perry Exp $  */
+/*     $NetBSD: conv.c,v 1.13 2010/02/09 14:06:37 drochner Exp $       */
 
 /*
  * Copyright (c) 1989, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)conv.c     8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: conv.c,v 1.12 2006/01/04 01:30:21 perry Exp $");
+__RCSID("$NetBSD: conv.c,v 1.13 2010/02/09 14:06:37 drochner Exp $");
 #endif
 #endif /* not lint */
 
@@ -61,7 +61,7 @@
                goto strpr;
        /* case '\a': */
        case '\007':
-               if (deprecated)         /* od didn't know about \a */
+               if (odmode)             /* od doesn't know about \a */
                        break;
                str = "\\a";
                goto strpr;
@@ -81,7 +81,7 @@
                str = "\\t";
                goto strpr;
        case '\v':
-               if (deprecated)
+               if (odmode)
                        break;
                str = "\\v";
                goto strpr;
@@ -112,14 +112,14 @@
                                                /* od used nl, not lf */
        if (*p <= 0x1f) {
                *pr->cchar = 's';
-               if (deprecated && *p == 0x0a)
+               if (odmode && *p == 0x0a)
                        (void)printf(pr->fmt, "nl");
                else
                        (void)printf(pr->fmt, list[*p]);
        } else if (*p == 0x7f) {
                *pr->cchar = 's';
                (void)printf(pr->fmt, "del");
-       } else if (deprecated && *p == 0x20) {  /* od replaced space with sp */
+       } else if (odmode && *p == 0x20) {      /* od replaces space with sp */
                *pr->cchar = 's';
                (void)printf(pr->fmt, " sp");
        } else if (isprint(*p)) {
diff -r 11f2ce61b148 -r 426eacc80310 usr.bin/hexdump/hexdump.c
--- a/usr.bin/hexdump/hexdump.c Tue Feb 09 13:59:01 2010 +0000
+++ b/usr.bin/hexdump/hexdump.c Tue Feb 09 14:06:37 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hexdump.c,v 1.14 2008/07/21 14:19:23 lukem Exp $       */
+/*     $NetBSD: hexdump.c,v 1.15 2010/02/09 14:06:37 drochner Exp $    */
 
 /*
  * Copyright (c) 1989, 1993
@@ -40,7 +40,7 @@
 #if 0
 static char sccsid[] = "@(#)hexdump.c  8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: hexdump.c,v 1.14 2008/07/21 14:19:23 lukem Exp $");
+__RCSID("$NetBSD: hexdump.c,v 1.15 2010/02/09 14:06:37 drochner Exp $");
 #endif
 #endif /* not lint */
 
@@ -72,7 +72,7 @@
        if (!(p = strrchr(argv[0], 'o')) || strcmp(p, "od"))
                newsyntax(argc, &argv);
        else
-               oldsyntax(argc, &argv);
+               odsyntax(argc, &argv);
 
        /* figure out the data block size */
        for (blocksize = 0, tfs = fshead; tfs; tfs = tfs->nextfs) {
diff -r 11f2ce61b148 -r 426eacc80310 usr.bin/hexdump/hexdump.h
--- a/usr.bin/hexdump/hexdump.h Tue Feb 09 13:59:01 2010 +0000
+++ b/usr.bin/hexdump/hexdump.h Tue Feb 09 14:06:37 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hexdump.h,v 1.10 2006/08/26 18:17:42 christos Exp $    */
+/*     $NetBSD: hexdump.h,v 1.11 2010/02/09 14:06:37 drochner Exp $    */
 
 /*
  * Copyright (c) 1989, 1993
@@ -71,7 +71,7 @@
 enum _vflag { ALL, DUP, FIRST, WAIT }; /* -v values */
 
 extern int blocksize;                  /* data block size */
-extern int deprecated;                 /* od compatibility */
+extern int odmode;                     /* od compatibility */
 extern FU *endfu;                      /* format at end-of-data */
 extern int exitval;                    /* final exit value */
 extern FS *fshead;                     /* head of format strings list */
@@ -95,7 +95,7 @@
 u_char *get(void);
 void    newsyntax(int, char ***);
 int     next(char **);
-void    oldsyntax(int, char ***);
+void    odsyntax(int, char ***);
 void    rewrite(FS *);
 int     size(FS *);
 void    usage(void);
diff -r 11f2ce61b148 -r 426eacc80310 usr.bin/hexdump/od.1
--- a/usr.bin/hexdump/od.1      Tue Feb 09 13:59:01 2010 +0000
+++ b/usr.bin/hexdump/od.1      Tue Feb 09 14:06:37 2010 +0000
@@ -1,4 +1,4 @@
-.\"  $NetBSD: od.1,v 1.23 2008/09/03 16:32:57 drochner Exp $
+.\"  $NetBSD: od.1,v 1.24 2010/02/09 14:06:37 drochner Exp $
 .\"
 .\" Copyright (c) 2001 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -56,26 +56,6 @@
 .Oc
 .Ar file ...
 .Sh DESCRIPTION
-.Nm
-has been deprecated in favor of
-.Xr hexdump 1 .
-.Pp
-.Xr hexdump 1 ,
-if called as
-.Nm ,
-provides compatibility for the options described below.
-It does not provide compatibility for the
-.Fl s
-option (see
-.Xr strings 1 )
-or the
-.Fl P ,
-.Fl p ,
-or
-.Fl w
-options, nor is compatibility provided for the ``label'' component
-of the offset syntax.
-.Pp
 The options are as follows:
 .Bl -tag -width Fl
 .It Fl A Ar base
diff -r 11f2ce61b148 -r 426eacc80310 usr.bin/hexdump/odsyntax.c
--- a/usr.bin/hexdump/odsyntax.c        Tue Feb 09 13:59:01 2010 +0000
+++ b/usr.bin/hexdump/odsyntax.c        Tue Feb 09 14:06:37 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: odsyntax.c,v 1.25 2008/09/03 16:32:57 drochner Exp $   */
+/*     $NetBSD: odsyntax.c,v 1.26 2010/02/09 14:06:37 drochner Exp $   */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)odsyntax.c 8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: odsyntax.c,v 1.25 2008/09/03 16:32:57 drochner Exp $");
+__RCSID("$NetBSD: odsyntax.c,v 1.26 2010/02/09 14:06:37 drochner Exp $");
 #endif
 #endif /* not lint */
 
@@ -68,13 +68,13 @@
        char const *format2;
 };
 
-int deprecated;
+int odmode;
 
 static void odoffset(int, char ***);
 static void posixtypes(char const *);
 
 void
-oldsyntax(int argc, char ***argvp)
+odsyntax(int argc, char ***argvp)
 {
        static char empty[] = "", padding[] = PADDING;
        int ch;
@@ -84,10 +84,10 @@
        add("\"%07.7_Ao\n\"");
        add("\"%07.7_ao  \"");
 
-       deprecated = 1;
+       odmode = 1;
        argv = *argvp;
        while ((ch = getopt(argc, argv,
-           "A:aBbcDdeFfHhIij:LlN:OoPpst:wvXx")) != -1)
+           "A:aBbcDdeFfHhIij:LlN:Oot:vXx")) != -1)
                switch (ch) {
                case 'A':
                        switch (*optarg) {
@@ -174,17 +174,8 @@
                case 'v':
                        vflag = ALL;
                        break;
-               case 'P':
-               case 'p':
-               case 's':
-               case 'w':
                case '?':
                default:
-                       warnx("od(1) has been deprecated for hexdump(1).");
-                       if (ch != '?')
-                               warnx(
-"hexdump(1) compatibility doesn't support the -%c option%s\n",
-                                   ch, ch == 's' ? "; see strings(1)." : ".");
                        usage();
                }
 



Home | Main Index | Thread Index | Old Index