X-Git-Url: http://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=test%2Fdots.c;h=2e0190fc61bb26751b72074dba7260d980e4a93e;hb=46722468f47c2b77b3987729b4bcf2321cccfd01;hp=13ec66a570929ba8a5ed39686da21df9a2edb4ee;hpb=0eb88fc5281804773e2a0c7a488a4452463535ce;p=ncurses.git diff --git a/test/dots.c b/test/dots.c index 13ec66a5..2e0190fc 100644 --- a/test/dots.c +++ b/test/dots.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999 Free Software Foundation, Inc. * + * Copyright (c) 1999-2001,2002 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 * @@ -29,16 +29,13 @@ /* * Author: Thomas E. Dickey 1999 * - * $Id: dots.c,v 1.2 1999/10/23 13:24:32 tom Exp $ + * $Id: dots.c,v 1.8 2002/04/06 21:33:42 tom Exp $ * * A simple demo of the terminfo interface. */ -#include - -#include /* for tparm() */ - #include -#include + +#include #define valid(s) ((s != 0) && s != (char *)-1) @@ -81,7 +78,7 @@ onsig(int n GCC_UNUSED) { interrupted = TRUE; cleanup(); - exit(EXIT_FAILURE); + ExitProgram(EXIT_FAILURE); } static float @@ -93,8 +90,8 @@ ranf(void) int main( - int argc GCC_UNUSED, - char *argv[]GCC_UNUSED) + int argc GCC_UNUSED, + char *argv[]GCC_UNUSED) { int x, y, z, j, p; float r; @@ -123,19 +120,19 @@ main( y = (int) (r * ranf()) + 2; p = (ranf() > 0.9) ? '*' : ' '; - tputs(tparm(cursor_address, y, x), 1, outc); + tputs(tparm3(cursor_address, y, x), 1, outc); if (max_colors > 0) { - z = ranf() * max_colors; + z = (int) (ranf() * max_colors); if (ranf() > 0.01) { - tputs(tparm(set_a_foreground, z), 1, outc); + tputs(tparm2(set_a_foreground, z), 1, outc); } else { - tputs(tparm(set_a_background, z), 1, outc); + tputs(tparm2(set_a_background, z), 1, outc); } } else if (valid(exit_attribute_mode) - && valid(enter_reverse_mode)) { + && valid(enter_reverse_mode)) { if (ranf() <= 0.01) outs((ranf() > 0.6) ? enter_reverse_mode : - exit_attribute_mode); + exit_attribute_mode); } outc(p); fflush(stdout);