-#ifndef HAVE_TERMCAP_H
-extern int tgetent (char *bp, char *name);
-extern int tgetnum (char *id);
-extern int tgetflag (char *id);
-extern char *tgetstr (char *id, char **area);
-extern char *tgoto (char *cm, int destcol, int destline);
-extern int tputs (char *cp, int affcnt, int (*outc) (int));
+#if ! defined(HAVE_TERMCAP_H) && ! defined (HAVE_NCURSES_TERMCAP_H)
+ extern int tgetent (char *bp, char *name);
+ extern int tgetnum (char *id);
+ extern int tgetflag (char *id);
+ extern char *tgetstr (char *id, char **area);
+ extern char *tgoto (char *cm, int destcol, int destline);
+ extern int tputs (char *cp, int affcnt, int (*outc) (int));