Source-Changes-HG archive

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

[src/trunk]: src/lib/libedit kill ifdef notdef



details:   https://anonhg.NetBSD.org/src/rev/37fa76e4fe85
branches:  trunk
changeset: 767752:37fa76e4fe85
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Jul 29 15:20:39 2011 +0000

description:
kill ifdef notdef

diffstat:

 lib/libedit/chared.c   |   61 +----------------------------
 lib/libedit/common.c   |    6 +-
 lib/libedit/sys.h      |   38 +-----------------
 lib/libedit/terminal.c |  102 +------------------------------------------------
 lib/libedit/tty.c      |    8 +--
 5 files changed, 10 insertions(+), 205 deletions(-)

diffs (truncated from 333 to 300 lines):

diff -r d8de70ed7d68 -r 37fa76e4fe85 lib/libedit/chared.c
--- a/lib/libedit/chared.c      Fri Jul 29 15:16:33 2011 +0000
+++ b/lib/libedit/chared.c      Fri Jul 29 15:20:39 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: chared.c,v 1.32 2011/07/29 15:16:33 christos Exp $     */
+/*     $NetBSD: chared.c,v 1.33 2011/07/29 15:20:39 christos Exp $     */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)chared.c   8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: chared.c,v 1.32 2011/07/29 15:16:33 christos Exp $");
+__RCSID("$NetBSD: chared.c,v 1.33 2011/07/29 15:20:39 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -326,41 +326,6 @@
 }
 
 
-#ifdef notdef
-/* c__number():
- *     Ignore character p points to, return number appearing after that.
- *     A '$' by itself means a big number; "$-" is for negative; '^' means 1.
- *     Return p pointing to last char used.
- */
-protected Char *
-c__number(
-    Char *p,   /* character position */
-    int *num,  /* Return value */
-    int dval)  /* dval is the number to subtract from like $-3 */
-{
-       int i;
-       int sign = 1;
-
-       if (*++p == '^') {
-               *num = 1;
-               return p;
-       }
-       if (*p == '$') {
-               if (*++p != '-') {
-                       *num = 0x7fffffff;      /* Handle $ */
-                       return --p;
-               }
-               sign = -1;                      /* Handle $- */
-               ++p;
-       }
-    /* XXX: this assumes ASCII compatible digits */
-       for (i = 0; Isdigit(*p); i = 10 * i + *p++ - '0')
-               continue;
-       *num = (sign < 0 ? dval - i : i);
-       return --p;
-}
-#endif
-
 /* cv_delfini():
  *     Finish vi delete action
  */
@@ -399,28 +364,6 @@
 }
 
 
-#ifdef notdef
-/* ce__endword():
- *     Go to the end of this word according to emacs
- */
-protected Char *
-ce__endword(Char *p, Char *high, int n)
-{
-       p++;
-
-       while (n--) {
-               while ((p < high) && Isspace(*p))
-                       p++;
-               while ((p < high) && !Isspace(*p))
-                       p++;
-       }
-
-       p--;
-       return p;
-}
-#endif
-
-
 /* cv__endword():
  *     Go to the end of this word according to vi
  */
diff -r d8de70ed7d68 -r 37fa76e4fe85 lib/libedit/common.c
--- a/lib/libedit/common.c      Fri Jul 29 15:16:33 2011 +0000
+++ b/lib/libedit/common.c      Fri Jul 29 15:20:39 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: common.c,v 1.26 2011/07/29 15:16:33 christos Exp $     */
+/*     $NetBSD: common.c,v 1.27 2011/07/29 15:20:39 christos Exp $     */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)common.c   8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: common.c,v 1.26 2011/07/29 15:16:33 christos Exp $");
+__RCSID("$NetBSD: common.c,v 1.27 2011/07/29 15:20:39 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -139,7 +139,7 @@
 /*ARGSUSED*/
 ed_delete_next_char(EditLine *el, Int c)
 {
-#ifdef notdef                  /* XXX */
+#ifdef DEBUG_EDIT
 #define        EL      el->el_line
        (void) fprintf(el->el_errlfile,
            "\nD(b: %x(%s)  c: %x(%s) last: %x(%s) limit: %x(%s)\n",
diff -r d8de70ed7d68 -r 37fa76e4fe85 lib/libedit/sys.h
--- a/lib/libedit/sys.h Fri Jul 29 15:16:33 2011 +0000
+++ b/lib/libedit/sys.h Fri Jul 29 15:20:39 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys.h,v 1.15 2011/07/28 20:50:55 christos Exp $        */
+/*     $NetBSD: sys.h,v 1.16 2011/07/29 15:20:39 christos Exp $        */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -124,40 +124,4 @@
 extern char* tgetstr(char*, char**);
 #endif
 
-#ifdef notdef
-# undef REGEX
-# undef REGEXP
-# include <malloc.h>
-# ifdef __GNUC__
-/*
- * Broken hdrs.
- */
-extern int     tgetent(const char *bp, char *name);
-extern int     tgetflag(const char *id);
-extern int     tgetnum(const char *id);
-extern char    *tgetstr(const char *id, char **area);
-extern char    *tgoto(const char *cap, int col, int row);
-extern int     tputs(const char *str, int affcnt, int (*putc)(int));
-extern char    *getenv(const char *);
-extern int     fprintf(FILE *, const char *, ...);
-extern int     sigsetmask(int);
-extern int     sigblock(int);
-extern int     fputc(int, FILE *);
-extern int     fgetc(FILE *);
-extern int     fflush(FILE *);
-extern int     tolower(int);
-extern int     toupper(int);
-extern int     errno, sys_nerr;
-extern char    *sys_errlist[];
-extern void    perror(const char *);
-#  include <string.h>
-#  define strerror(e)  sys_errlist[e]
-# endif
-# ifdef SABER
-extern void *   memcpy(void *, const void *, size_t);
-extern void *   memset(void *, int, size_t);
-# endif
-extern char    *fgetline(FILE *, int *);
-#endif
-
 #endif /* _h_sys */
diff -r d8de70ed7d68 -r 37fa76e4fe85 lib/libedit/terminal.c
--- a/lib/libedit/terminal.c    Fri Jul 29 15:16:33 2011 +0000
+++ b/lib/libedit/terminal.c    Fri Jul 29 15:20:39 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: terminal.c,v 1.5 2011/07/29 15:16:33 christos Exp $    */
+/*     $NetBSD: terminal.c,v 1.6 2011/07/29 15:20:39 christos Exp $    */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)term.c     8.2 (Berkeley) 4/30/95";
 #else
-__RCSID("$NetBSD: terminal.c,v 1.5 2011/07/29 15:16:33 christos Exp $");
+__RCSID("$NetBSD: terminal.c,v 1.6 2011/07/29 15:20:39 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -89,78 +89,6 @@
 #define        Str(a)          el->el_terminal.t_str[a]
 #define        Val(a)          el->el_terminal.t_val[a]
 
-#ifdef notdef
-private const struct {
-       const char *b_name;
-       int b_rate;
-} baud_rate[] = {
-#ifdef B0
-       { "0", B0 },
-#endif
-#ifdef B50
-       { "50", B50 },
-#endif
-#ifdef B75
-       { "75", B75 },
-#endif
-#ifdef B110
-       { "110", B110 },
-#endif
-#ifdef B134
-       { "134", B134 },
-#endif
-#ifdef B150
-       { "150", B150 },
-#endif
-#ifdef B200
-       { "200", B200 },
-#endif
-#ifdef B300
-       { "300", B300 },
-#endif
-#ifdef B600
-       { "600", B600 },
-#endif
-#ifdef B900
-       { "900", B900 },
-#endif
-#ifdef B1200
-       { "1200", B1200 },
-#endif
-#ifdef B1800
-       { "1800", B1800 },
-#endif
-#ifdef B2400
-       { "2400", B2400 },
-#endif
-#ifdef B3600
-       { "3600", B3600 },
-#endif
-#ifdef B4800
-       { "4800", B4800 },
-#endif
-#ifdef B7200
-       { "7200", B7200 },
-#endif
-#ifdef B9600
-       { "9600", B9600 },
-#endif
-#ifdef EXTA
-       { "19200", EXTA },
-#endif
-#ifdef B19200
-       { "19200", B19200 },
-#endif
-#ifdef EXTB
-       { "38400", EXTB },
-#endif
-#ifdef B38400
-       { "38400", B38400 },
-#endif
-       { NULL, 0 }
-};
-#endif
-
 private const struct termcapstr {
        const char *name;
        const char *long_name;
@@ -912,20 +840,6 @@
 }
 
 
-#ifdef notdef
-/* terminal_clear_to_bottom():
- *     Clear to the bottom of the screen
- */
-protected void
-terminal_clear_to_bottom(EditLine *el)
-{
-       if (GoodStr(T_cd))
-               terminal_tputs(el, Str(T_cd), Val(T_li));
-       else if (GoodStr(T_ce))
-               terminal_tputs(el, Str(T_ce), Val(T_li));
-}
-#endif
-
 protected void
 terminal_get(EditLine *el, const char **term)
 {
@@ -1583,19 +1497,7 @@
                    "yes" : "no");
                return 0;
        } else if (Strcmp(*argv, STR("baud")) == 0) {
-#ifdef notdef
-               int i;
-
-               for (i = 0; baud_rate[i].b_name != NULL; i++)
-                       if (el->el_tty.t_speed == baud_rate[i].b_rate) {
-                               (void) fprintf(el->el_outfile, fmts,
-                                   baud_rate[i].b_name);
-                               return 0;
-                       }
-               (void) fprintf(el->el_outfile, fmtd, 0);
-#else
                (void) fprintf(el->el_outfile, fmtd, (int)el->el_tty.t_speed);



Home | Main Index | Thread Index | Old Index