+ for (s = buf; *s; s++) {
+ endTime = clock() + CLOCKS_PER_SEC*0.05;
+ while (clock() < endTime) continue;
+ if (curses) {
+ waddch(curwnd, *s);
+ wrefresh(curwnd);
+ }
+ else {
+ putchar(*s);
+ fflush(stdout);
+ }
+ }
+}
+
+void cgetline(char *line, int max)
+{
+ if (curses) {
+ wgetnstr(curwnd, line, max);
+ strcat(line, "\n");
+ wrefresh(curwnd);
+ } else {
+ fgets(line, max, stdin);
+ }
+ line[strlen(line)-1] = '\0';
+}
+
+void setwnd(WINDOW *wnd)
+/* change windows -- OK for this to be a no-op in tty mode */
+{
+ if (curses) {
+ curwnd=wnd;
+ curs_set(wnd == FULLSCREEN_WINDOW || wnd == LOWER_WINDOW);
+ }
+}
+
+void clreol (void)
+/* clear to end of line -- can be a no-op in tty mode */
+{
+ if (curses) {
+ wclrtoeol(curwnd);
+ wrefresh(curwnd);
+ }
+}
+
+void clrscr (void)
+/* clear screen -- can be a no-op in tty mode */
+{
+ if (curses) {
+ wclear(curwnd);
+ wmove(curwnd,0,0);
+ wrefresh(curwnd);
+ }