/****************************************************************************
- * Copyright (c) 2005-2011,2012 Free Software Foundation, Inc. *
+ * Copyright (c) 2005-2012,2013 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.21 2012/06/30 22:02:56 tom Exp $
+ * $Id: demo_termcap.c,v 1.23 2013/01/19 19:30:52 tom Exp $
*
* A simple demo of the termcap interface.
*/
make_dbitem(char *p, char *q)
{
char *result = malloc(strlen(e_opt) + 2 + (size_t) (p - q));
- sprintf(result, "%s=%.*s", e_opt, p - q, q);
+ sprintf(result, "%s=%.*s", e_opt, (int) (p - q), q);
return result;
}
" -q quiet (prints only counts)",
" -r COUNT repeat for given count",
" -s print string-capabilities",
+#ifdef NCURSES_VERSION
+ " -y disable extended capabilities",
+#endif
};
unsigned n;
for (n = 0; n < SIZEOF(msg); ++n) {
int repeat;
int r_opt = 1;
- while ((n = getopt(argc, argv, "abd:e:nqr:s")) != -1) {
+ while ((n = getopt(argc, argv, "abd:e:nqr:sy")) != -1) {
switch (n) {
case 'a':
a_opt = TRUE;
case 's':
s_opt = TRUE;
break;
+#ifdef NCURSES_VERSION
+ case 'y':
+ use_extended_names(FALSE);
+ break;
+#endif
default:
usage();
break;