/****************************************************************************
- * Copyright (c) 2009 Free Software Foundation, Inc. *
+ * Copyright (c) 2009,2010 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_terminfo.c,v 1.5 2009/07/11 17:39:41 tom Exp $
+ * $Id: demo_terminfo.c,v 1.9 2010/11/28 00:15:27 tom Exp $
*
* A simple demo of the terminfo interface.
*/
#include <test.priv.h>
#ifdef NCURSES_VERSION
+#if !(defined(HAVE_TERM_ENTRY_H) && HAVE_TERM_ENTRY_H)
+#undef NCURSES_XNAMES
+#define NCURSES_XNAMES 0
+#endif
#if NCURSES_XNAMES
#include <term_entry.h>
#endif
#endif
+#if HAVE_TIGETSTR
+#if defined(HAVE_CURSES_DATA_BOOLNAMES) || defined(DECL_CURSES_DATA_BOOLNAMES)
+
static bool b_opt = FALSE;
static bool f_opt = FALSE;
static bool n_opt = FALSE;
|| (NUM_NUMBERS(term) != NUMCOUNT)
|| (NUM_STRINGS(term) != STRCOUNT))) {
for (n = BOOLCOUNT; n < NUM_BOOLEANS(term); ++n) {
- dumpit(ExtBoolname(term, n, boolnames));
+ dumpit(ExtBoolname(term, (int) n, boolnames));
}
for (n = NUMCOUNT; n < NUM_NUMBERS(term); ++n) {
- dumpit(ExtNumname(term, n, numnames));
+ dumpit(ExtNumname(term, (int) n, numnames));
}
for (n = STRCOUNT; n < NUM_STRINGS(term); ++n) {
- dumpit(ExtStrname(term, n, strnames));
+ dumpit(ExtStrname(term, (int) n, strnames));
}
}
#endif
ExitProgram(EXIT_SUCCESS);
}
+
+#else
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+ printf("This program requires the terminfo arrays\n");
+ ExitProgram(EXIT_FAILURE);
+}
+#endif
+#else /* !HAVE_TIGETSTR */
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+ printf("This program requires the terminfo functions such as tigetstr\n");
+ ExitProgram(EXIT_FAILURE);
+}
+#endif /* HAVE_TIGETSTR */