From a84f8427e0b38d00ae4eabae6f0c6ac1f47fd28a Mon Sep 17 00:00:00 2001 From: Jean-Marc Zucconi Date: Fri, 22 Feb 2002 23:12:23 +0000 Subject: Add a few functions in p2clib. This fixes bugs occuring with some pascal code. Submitted by: joerg --- lang/p2c/files/patch-a | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 lang/p2c/files/patch-a (limited to 'lang/p2c/files/patch-a') diff --git a/lang/p2c/files/patch-a b/lang/p2c/files/patch-a new file mode 100644 index 000000000000..70a87485e835 --- /dev/null +++ b/lang/p2c/files/patch-a @@ -0,0 +1,45 @@ +--- src/loc.p2clib.c.orig Fri Feb 22 13:13:49 2002 ++++ src/loc.p2clib.c Fri Feb 22 13:12:44 2002 +@@ -4,3 +4,42 @@ + * the symbol LOCAL_INIT when you compile p2clib.c. + */ + ++/* Some Turbo "unit crt" functions. */ ++ ++#include ++#include ++ ++static int terminfo_initialized; ++static char *cl, *ce; ++ ++static void initcurs() ++{ ++ if (terminfo_initialized) ++ return; ++ setupterm(0, fileno(stdout), 0); ++ ce = tgetstr("ce", 0); ++ cl = tgetstr("cl", 0); ++ terminfo_initialized = 1; ++} ++ ++void clreol() ++{ ++ initcurs(); ++ if (ce) ++ tputs(ce, 1, putchar); ++} ++ ++void clrscr() ++{ ++ initcurs(); ++ if (cl) ++ tputs(cl, 1, putchar); ++} ++ ++void delay(ms) ++int ms; ++{ ++ usleep(1000 * ms); ++} ++ ++ -- cgit v1.2.3