Module Name:    src
Committed By:   roy
Date:           Wed Feb 10 14:48:26 UTC 2010

Modified Files:
        src/sys/arch/atari/stand/edahdi: Makefile edahdi.c

Log Message:
Convert to terminfo so we compile.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/atari/stand/edahdi/Makefile
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/atari/stand/edahdi/edahdi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/atari/stand/edahdi/Makefile
diff -u src/sys/arch/atari/stand/edahdi/Makefile:1.6 src/sys/arch/atari/stand/edahdi/Makefile:1.7
--- src/sys/arch/atari/stand/edahdi/Makefile:1.6	Wed Feb  3 15:34:44 2010
+++ src/sys/arch/atari/stand/edahdi/Makefile	Wed Feb 10 14:48:26 2010
@@ -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

Index: src/sys/arch/atari/stand/edahdi/edahdi.c
diff -u src/sys/arch/atari/stand/edahdi/edahdi.c:1.9 src/sys/arch/atari/stand/edahdi/edahdi.c:1.10
--- src/sys/arch/atari/stand/edahdi/edahdi.c:1.9	Wed Mar 18 10:22:25 2009
+++ src/sys/arch/atari/stand/edahdi/edahdi.c	Wed Feb 10 14:48:26 2010
@@ -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);
-		}
-	}
-}

Reply via email to