Merge from vendor branch TNV:
[pkgsrcv2.git] / inputmethod / skkfep / patches / patch-be
1 $NetBSD$
2
3 --- readwrite.c.orig    Tue Jul  7 00:31:15 1998
4 +++ readwrite.c Sun Sep 27 10:24:06 1998
5 @@ -4,6 +4,14 @@
6  #include "kanjicode.h"
7  #include "ctrlcode.h"
8  
9 +#ifndef STDIN_FILENO
10 +#define STDIN_FILENO   0
11 +#endif
12 +
13 +#ifndef STDOUT_FILENO
14 +#define STDOUT_FILENO  1
15 +#endif
16 +
17  #ifdef DEBUG
18  extern FILE *wrlog;
19  #endif
20 @@ -29,12 +37,10 @@
21         SIC_B,SOC_B,"JIS",3,3,
22  };
23  
24 -extern int     tty;
25 -
26  char read1()
27  {      char    c;
28  
29 -       if (read(tty,&c,1) != 0)
30 +       if (read(STDIN_FILENO,&c,1) != 0)
31                 return c;
32         return EOF;
33  }
34 @@ -320,13 +326,13 @@
35  char    *s;
36  {       int    l = strlen(s);
37         
38 -       writeTTYorg(tty,s,l,INTERNALCODE,OutCode,&TInter_Stat,&To_TTY_Stat);
39 +       writeTTYorg(STDOUT_FILENO,s,l,INTERNALCODE,OutCode,&TInter_Stat,&To_TTY_Stat);
40  }
41  
42  write1(c)
43  char c;
44  {
45 -       writeTTYorg(tty,&c,1,INTERNALCODE,OutCode,&TInter_Stat,&To_TTY_Stat);
46 +       writeTTYorg(STDOUT_FILENO,&c,1,INTERNALCODE,OutCode,&TInter_Stat,&To_TTY_Stat);
47  }
48  
49  writeShTty(s,l)
50 @@ -334,14 +340,14 @@
51  int    l;
52  {
53  
54 -       writeTTYorg(tty,s,l,WriteCode,OutCode,&From_SH_Stat,&To_TTY_Stat);
55 +       writeTTYorg(STDOUT_FILENO,s,l,WriteCode,OutCode,&From_SH_Stat,&To_TTY_Stat);
56  }
57  
58  writeTty(s,l)
59  char   *s;
60  int    l;
61  {
62 -       writeTTYorg(tty,s,l,INTERNALCODE,OutCode,&TInter_Stat,&To_TTY_Stat);
63 +       writeTTYorg(STDOUT_FILENO,s,l,INTERNALCODE,OutCode,&TInter_Stat,&To_TTY_Stat);
64  }
65  
66