summaryrefslogtreecommitdiff
path: root/inputmethod/skkfep/patches/patch-be
blob: a7eacb8a21d5ddfd24febb0aecf52f3a4ca3df33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
$NetBSD: patch-be,v 1.1.1.1 2002/05/31 13:00:04 seb Exp $

--- readwrite.c.orig	Tue Jul  7 00:31:15 1998
+++ readwrite.c	Sun Sep 27 10:24:06 1998
@@ -4,6 +4,14 @@
 #include "kanjicode.h"
 #include "ctrlcode.h"
 
+#ifndef STDIN_FILENO
+#define STDIN_FILENO	0
+#endif
+
+#ifndef STDOUT_FILENO
+#define STDOUT_FILENO	1
+#endif
+
 #ifdef DEBUG
 extern FILE *wrlog;
 #endif
@@ -29,12 +37,10 @@
 	SIC_B,SOC_B,"JIS",3,3,
 };
 
-extern int	tty;
-
 char read1()
 {	char	c;
 
-	if (read(tty,&c,1) != 0)
+	if (read(STDIN_FILENO,&c,1) != 0)
 		return c;
 	return EOF;
 }
@@ -320,13 +326,13 @@
 char    *s;
 {       int    l = strlen(s);
 	
-	writeTTYorg(tty,s,l,INTERNALCODE,OutCode,&TInter_Stat,&To_TTY_Stat);
+	writeTTYorg(STDOUT_FILENO,s,l,INTERNALCODE,OutCode,&TInter_Stat,&To_TTY_Stat);
 }
 
 write1(c)
 char c;
 {
-	writeTTYorg(tty,&c,1,INTERNALCODE,OutCode,&TInter_Stat,&To_TTY_Stat);
+	writeTTYorg(STDOUT_FILENO,&c,1,INTERNALCODE,OutCode,&TInter_Stat,&To_TTY_Stat);
 }
 
 writeShTty(s,l)
@@ -334,14 +340,14 @@
 int	l;
 {
 
-	writeTTYorg(tty,s,l,WriteCode,OutCode,&From_SH_Stat,&To_TTY_Stat);
+	writeTTYorg(STDOUT_FILENO,s,l,WriteCode,OutCode,&From_SH_Stat,&To_TTY_Stat);
 }
 
 writeTty(s,l)
 char	*s;
 int	l;
 {
-	writeTTYorg(tty,s,l,INTERNALCODE,OutCode,&TInter_Stat,&To_TTY_Stat);
+	writeTTYorg(STDOUT_FILENO,s,l,INTERNALCODE,OutCode,&TInter_Stat,&To_TTY_Stat);
 }