/****************************************************************************
- * Copyright (c) 1999,2000 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 *
/*
* Author: Thomas E. Dickey <dickey@clark.net> 1999
*
- * $Id: dots.c,v 1.4 2000/02/13 01:05:13 tom Exp $
+ * $Id: dots.c,v 1.8 2002/04/06 21:33:42 tom Exp $
*
* A simple demo of the terminfo interface.
*/
-#include <test.priv.h>
-
-#include <term.h> /* for tparm() */
-
#include <time.h>
-#include <signal.h>
+
+#include <test.priv.h>
#define valid(s) ((s != 0) && s != (char *)-1)
{
interrupted = TRUE;
cleanup();
- exit(EXIT_FAILURE);
+ ExitProgram(EXIT_FAILURE);
}
static float
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;
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 = (int)(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);