/****************************************************************************
- * Copyright (c) 2007,2009 Free Software Foundation, Inc. *
+ * Copyright (c) 2007-2010,2011 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: savescreen.c,v 1.11 2009/10/10 19:38:21 tom Exp $
+ * $Id: savescreen.c,v 1.15 2011/01/15 18:15:11 tom Exp $
*
* Demonstrate save/restore functions from the curses library.
* Thomas Dickey - 2007/7/14
#include <test.priv.h>
+#if HAVE_SCR_DUMP
+
#include <sys/types.h>
#include <sys/stat.h>
if (has_colors()) {
start_color();
for (ch = 0; ch < COLOR_PAIRS; ++ch) {
- short pair = ch % COLOR_PAIRS;
- init_pair(pair, COLOR_WHITE, ch % COLORS);
+ short pair = (short) (ch % COLOR_PAIRS);
+ init_pair(pair, COLOR_WHITE, (short) (ch % COLORS));
}
}
getyx(stdscr, y, x);
while (!done) {
- switch (ch = get_command(which, last)) {
+ switch (get_command(which, last)) {
case 'n':
setup_next();
done = TRUE;
}
++which;
if (has_colors()) {
- short pair = which % COLOR_PAIRS;
- bkgd(COLOR_PAIR(pair));
+ short pair = (short) (which % COLOR_PAIRS);
+ bkgd((chtype) COLOR_PAIR(pair));
}
} else {
beep();
}
ExitProgram(EXIT_SUCCESS);
}
+#else
+int
+main(int argc, char *argv[])
+{
+ printf("This program requires the screen-dump functions\n");
+ ExitProgram(EXIT_FAILURE);
+}
+#endif