/****************************************************************************
- * Copyright (c) 2005-2008,2009 Free Software Foundation, Inc. *
+ * Copyright (c) 2005-2010,2011 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
/*
* Author: Thomas E. Dickey
*
- * $Id: demo_termcap.c,v 1.11 2009/08/02 00:02:53 tom Exp $
+ * $Id: demo_termcap.c,v 1.14 2011/01/15 21:41:27 tom Exp $
*
* A simple demo of the termcap interface.
*/
} else if ((num = tgetnum(cap)) >= 0) {
printf(FNAME(num), cap);
printf(" %d\n", num);
- } else if ((num = tgetflag(cap)) > 0) {
+ } else if (tgetflag(cap) > 0) {
printf(FNAME(flg), cap);
printf("%s\n", "true");
}
cap[2] = 0;
for (c1 = 0; c1 < 256; ++c1) {
- cap[0] = c1;
+ cap[0] = (char) c1;
if (isCapName(c1)) {
for (c2 = 0; c2 < 256; ++c2) {
- cap[1] = c2;
+ cap[1] = (char) c2;
if (isCapName(c2)) {
dumpit(cap);
}
NCURSES_CONST char *cap;
printf("Terminal type \"%s\"\n", name);
+#if HAVE_SETUPTERM
setupterm(name, 1, (int *) 0);
+#else
+ setterm(name);
+#endif
if (b_opt) {
for (n = 0;; ++n) {