/****************************************************************************
- * Copyright (c) 2009-2016,2017 Free Software Foundation, Inc. *
+ * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2009-2016,2017 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.47 2017/04/09 00:27:42 tom Exp $
+ * $Id: demo_terminfo.c,v 1.51 2020/05/09 13:56:40 tom Exp $
*
* A simple demo of the terminfo interface.
*/
static bool n_opt = FALSE;
static bool q_opt = FALSE;
static bool s_opt = FALSE;
+#ifdef NCURSES_VERSION
static bool x_opt = FALSE;
static bool y_opt = FALSE;
+#endif
static char *d_opt;
static char *e_opt;
db_item++;
}
}
- printf("** %s\n", result);
+ if (result != 0)
+ printf("** %s\n", result);
return result;
}
}
#ifdef NCURSES_VERSION
if (x_opt && (my_blob == 0)) {
- int mod;
if (y_opt) {
#if NCURSES_XNAMES
TERMTYPE *term = (TERMTYPE *) cur_term;
"kLFT", "kNXT", "kPRV", "kRIT", "kUP",
};
for (n = 0; n < SIZEOF(xterm_keys); ++n) {
+ int mod;
for (mod = 0; mod < 8; ++mod) {
if (mod == 0) {
/* these happen to be standard - avoid duplicates */
size_t count;
size_t length = 1;
char **result = 0;
- char *blob = 0;
char *unused = 0;
for (pass = 0; pass < 2; ++pass) {
}
}
if (pass == 0) {
- blob = malloc(length);
+ char *blob = malloc(length);
result = typeCalloc(char *, count + 1);
unused = blob;
if (blob == 0 || result == 0)
case 's':
s_opt = TRUE;
break;
-#ifdef NCURSES_VERSION
case 'x':
+#ifdef NCURSES_VERSION
x_opt = TRUE;
+#endif
break;
+#ifdef NCURSES_VERSION
case 'y':
y_opt = TRUE;
x_opt = TRUE;