head	1.1;
access;
symbols
	RELEASE_8_3_0:1.1
	RELEASE_9_0_0:1.1
	RELEASE_7_4_0:1.1
	RELEASE_8_2_0:1.1
	RELEASE_6_EOL:1.1
	RELEASE_8_1_0:1.1
	RELEASE_7_3_0:1.1
	RELEASE_8_0_0:1.1
	RELEASE_7_2_0:1.1
	RELEASE_7_1_0:1.1
	RELEASE_6_4_0:1.1
	RELEASE_5_EOL:1.1
	RELEASE_7_0_0:1.1
	RELEASE_6_3_0:1.1
	PRE_XORG_7:1.1
	RELEASE_4_EOL:1.1
	RELEASE_6_2_0:1.1
	RELEASE_6_1_0:1.1
	RELEASE_5_5_0:1.1
	RELEASE_6_0_0:1.1
	RELEASE_5_4_0:1.1
	RELEASE_4_11_0:1.1
	RELEASE_5_3_0:1.1
	RELEASE_4_10_0:1.1
	RELEASE_5_2_1:1.1
	RELEASE_5_2_0:1.1
	RELEASE_4_9_0:1.1
	RELEASE_5_1_0:1.1
	RELEASE_4_8_0:1.1
	RELEASE_5_0_0:1.1
	RELEASE_4_7_0:1.1
	RELEASE_4_6_2:1.1
	RELEASE_4_6_1:1.1
	RELEASE_4_6_0:1.1
	RELEASE_5_0_DP1:1.1;
locks; strict;
comment	@# @;


1.1
date	2002.02.22.23.12.23;	author jmz;	state Exp;
branches;
next	;


desc
@@


1.1
log
@Add a few functions in p2clib. This fixes bugs occuring with some pascal code.

Submitted by:	joerg
@
text
@--- 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 <curses.h>
+#include <term.h>
+
+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);
+}
+
+
@
