2 disp_basic.c - Routines to do basic output with no fanciness.
3 Copyright 2000 Project Purple. Written by Jonathan McDowell
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software Foundation
17 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 http://www.gnu.org/copyleft/gpl.html
20 17/02/2000 - Started writing.
25 #include "disp_basic.h"
27 /* Which port did we display last? */
29 /* Count of chars so far this line */
30 static int wrap=WRAPINIT;
33 /* Initialise the display, ie do nothing */
39 /* Close the display, ie do nothing */
45 /* Output a status string about what's happening */
46 void disp_outputstatus(char *string)
48 printf("\n%s\n\t", string);
53 /* Output a string from the port. */
54 void disp_outputstr(int port, char *string,
55 long usec_threshold, long usec_waited)
57 if (usec_waited>usec_threshold) {
58 /* report how long we waited between the last port */
59 if (wrap!=WRAPINIT) printf("\n");
60 printf("\t<waited %0ld.%0ld seconds>\n",
67 /* If we didn't just send a CR, we need to now */
68 if (wrap!=WRAPINIT) printf("\n");
69 printf("\nPort%d:\t", port);
72 } else if (wrap==WRAPINIT) {
73 /* We should indent since we're continuing the same port
78 /* If we'd go over the line end, wrap */
79 if (strlen(string)+wrap > SCREEN_WIDTH) {
87 if (wrap % SCREEN_WIDTH == 0) {
88 /* we hit the edge of the screen */
93 /* flush all the time */