X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Ftest_getstr.c;h=a0863937886be88ce551cdaa10b94e6c3a72806c;hp=2af10091d48abc22d1d2e9375775d5b15829397a;hb=f79b52fddd95c7a6f1ead29ef9c39eb8cdf60795;hpb=772f879d17117c5b766022f28099e341ebea825b diff --git a/test/test_getstr.c b/test/test_getstr.c index 2af10091..a0863937 100644 --- a/test/test_getstr.c +++ b/test/test_getstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2007 Free Software Foundation, Inc. * + * Copyright (c) 2007-2008,2009 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 * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_getstr.c,v 1.5 2007/07/21 22:22:55 tom Exp $ + * $Id: test_getstr.c,v 1.9 2009/08/29 19:02:25 tom Exp $ * * Author: Thomas E Dickey * @@ -44,6 +44,9 @@ #include +#if HAVE_CHGAT +/* Solaris SVr4 curses lacks wchgat, mvgetnstr, mvwgetnstr */ + #define BASE_Y 6 #define MAX_COLS 1024 @@ -87,9 +90,9 @@ MovePrompt(WINDOW *txtwin, int limit, int y, int x) } static int -ShowFlavor(WINDOW *strwin, WINDOW *txtwin, Flavors flavor, int limit) +ShowFlavor(WINDOW *strwin, WINDOW *txtwin, int flavor, int limit) { - char *name = "?"; + const char *name = "?"; bool limited = FALSE; bool wins = (txtwin != stdscr); int result; @@ -268,7 +271,7 @@ test_getstr(int level, char **argv, WINDOW *strwin) *buffer = '\0'; rc = ERR; echo(); - wattrset(txtwin, A_REVERSE); + (void) wattrset(txtwin, A_REVERSE); switch (flavor) { case eGetStr: if (txtwin != stdscr) { @@ -306,7 +309,7 @@ test_getstr(int level, char **argv, WINDOW *strwin) break; } noecho(); - wattrset(txtwin, A_NORMAL); + (void) wattrset(txtwin, A_NORMAL); wprintw(strwin, "%d:%s", rc, buffer); wnoutrefresh(strwin); break; @@ -349,3 +352,12 @@ main(int argc, char *argv[]) endwin(); ExitProgram(EXIT_SUCCESS); } + +#else +int +main(void) +{ + printf("This program requires the curses chgat function\n"); + ExitProgram(EXIT_FAILURE); +} +#endif