Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/atari/stand/edahdi Convert to terminfo so we compile.



details:   https://anonhg.NetBSD.org/src/rev/619094c42973
branches:  trunk
changeset: 751983:619094c42973
user:      roy <roy%NetBSD.org@localhost>
date:      Wed Feb 10 14:48:26 2010 +0000

description:
Convert to terminfo so we compile.

diffstat:

 sys/arch/atari/stand/edahdi/Makefile |   6 +++---
 sys/arch/atari/stand/edahdi/edahdi.c |  34 +++++-----------------------------
 2 files changed, 8 insertions(+), 32 deletions(-)

diffs (96 lines):

diff -r 18314e019405 -r 619094c42973 sys/arch/atari/stand/edahdi/Makefile
--- a/sys/arch/atari/stand/edahdi/Makefile      Wed Feb 10 10:34:59 2010 +0000
+++ b/sys/arch/atari/stand/edahdi/Makefile      Wed Feb 10 14:48:26 2010 +0000
@@ -1,9 +1,9 @@
-#      $NetBSD: Makefile,v 1.6 2010/02/03 15:34:44 roy Exp $
+#      $NetBSD: Makefile,v 1.7 2010/02/10 14:48:26 roy Exp $
 
 PROG=  edahdi
 NOMAN= # defined
-DPADD= ${LIBTERMLIB}
-LDADD= -ltermlib
+DPADD= ${LIBTERMINFO}
+LDADD= -lterminfo
 BINDIR=        /sbin
 
 CFLAGS+=-Wall
diff -r 18314e019405 -r 619094c42973 sys/arch/atari/stand/edahdi/edahdi.c
--- a/sys/arch/atari/stand/edahdi/edahdi.c      Wed Feb 10 10:34:59 2010 +0000
+++ b/sys/arch/atari/stand/edahdi/edahdi.c      Wed Feb 10 14:48:26 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: edahdi.c,v 1.9 2009/03/18 10:22:25 cegger Exp $        */
+/*     $NetBSD: edahdi.c,v 1.10 2010/02/10 14:48:26 roy Exp $  */
 
 /*
  * Copyright (c) 1996 Leo Weppelman, Waldi Ravens.
@@ -47,7 +47,7 @@
 
 #include <fcntl.h>
 #include <stdlib.h>
-#include <curses.h>
+#include <term.h>
 #include <termios.h>
 #include <unistd.h>
 #include <stdio.h>
@@ -94,11 +94,6 @@
 #define        T_NUMBER        5
 #define        T_EOF           6
 
-/*
- * Terminal capability strings (Ok, 1 to start with ;-) )
- */
-char   *Clr_screen = "";
-
 void   ahdi_cksum(void *);
 u_int  ahdi_getparts(int, ptable_t *, u_int, u_int);
 int    bsd_label(int, u_int);
@@ -107,7 +102,6 @@
 void   *disk_read(int, u_int, u_int);
 void   disk_write(int, u_int, u_int, void  *);
 char   *get_id(void);
-void   get_termcap(void);
 int    lex(int *);
 int    show_parts(ptable_t *, int);
 void   update_disk(ptable_t *, int, int);
@@ -143,7 +137,7 @@
                return (2);
        }
 
-       get_termcap();
+       setupterm(NULL, STDOUT_FILENO, NULL);
 
        ptable.nparts = 0;
        ptable.parts  = NULL;
@@ -165,7 +159,8 @@
 
        for (;;) {
                error = NULL;
-               tputs(Clr_screen, 1, putchar);
+               if (clear_screen)
+                       tputs(clear_screen, 1, putchar);
                show_parts(ptable, scr_base);
 
                printf("\n\n");
@@ -532,22 +527,3 @@
        if (write(fd, buf, size) != size)
                err(1, "Write error");
 }
-
-void
-get_termcap(void)
-{
-       char    *term, tbuf[1024], buf[1024], *p;
-
-       if ((term = getenv("TERM")) == NULL)
-               warnx("No TERM environment variable!");
-       else {
-               if (tgetent(tbuf, term) != 1)
-                       errx(1, "Tgetent failure.");
-               p = buf;
-               if (tgetstr("cl", &p)) {
-                       if ((Clr_screen = malloc(strlen(buf) + 1)) == NULL)
-                               errx(1, "Malloc failure.");
-                       strcpy(Clr_screen, buf);
-               }
-       }
-}



Home | Main Index | Thread Index | Old Index