/****************************************************************************
- * Copyright (c) 2007 Free Software Foundation, Inc. *
+ * Copyright (c) 2007-2009,2012 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 *
* authorization. *
****************************************************************************/
/*
- * $Id: test_getstr.c,v 1.7 2007/08/11 16:56:25 tom Exp $
+ * $Id: test_getstr.c,v 1.10 2012/07/07 18:22:49 tom Exp $
*
* Author: Thomas E Dickey
*
#include <test.priv.h>
+#if HAVE_CHGAT
+/* Solaris SVr4 curses lacks wchgat, mvgetnstr, mvwgetnstr */
+
#define BASE_Y 6
#define MAX_COLS 1024
eMaxFlavor
} Flavors;
+/*
+ * Return-code is OK/ERR or a keyname.
+ */
+static const char *
+ok_keyname(int code)
+{
+ return ((code == OK) ? "OK" : ((code == ERR) ? "ERR" : keyname(code)));
+}
+
static bool
Quit(int ch)
{
*buffer = '\0';
rc = ERR;
echo();
- wattrset(txtwin, A_REVERSE);
+ (void) wattrset(txtwin, A_REVERSE);
switch (flavor) {
case eGetStr:
if (txtwin != stdscr) {
break;
}
noecho();
- wattrset(txtwin, A_NORMAL);
- wprintw(strwin, "%d:%s", rc, buffer);
+ (void) wattrset(txtwin, A_NORMAL);
+ wprintw(strwin, "%s:%s", ok_keyname(rc), buffer);
wnoutrefresh(strwin);
break;
default:
endwin();
ExitProgram(EXIT_SUCCESS);
}
+
+#else
+int
+main(void)
+{
+ printf("This program requires the curses chgat function\n");
+ ExitProgram(EXIT_FAILURE);
+}
+#endif