OSDN Git Service

update.
[putex/putex.git] / src / texsourc / c-fopen.h
1 /* c-fopen.h: how to open files with fopen.
2
3    Copyright 1992 Karl Berry
4    Copyright 2007 TeX Users Group
5    Copyright 2014 Clerk Ma
6
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful, but
13    WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15    General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20    02110-1301 USA.  */
21
22 #ifndef C_FOPEN_H
23 #define C_FOPEN_H
24
25 /* How to open a text file:  */
26 #ifndef FOPEN_R_MODE
27   #define FOPEN_R_MODE "r"
28 #endif
29
30 #ifndef FOPEN_W_MODE
31   #define FOPEN_W_MODE "w"
32 #endif
33
34 /* How to open a binary file for reading:  */
35 #ifndef FOPEN_RBIN_MODE
36   #if defined (VMS) || defined (DOS) || defined (VMCMS)
37     #define FOPEN_RBIN_MODE "rb"
38   #else
39     #define FOPEN_RBIN_MODE "r"
40   #endif /* not (VM/CMS or DOS or VMS) */
41 #endif /* not FOPEN_RBIN_MODE */
42
43 /* How to open a binary file for writing:  */
44 #ifndef FOPEN_WBIN_MODE
45   #ifdef MSDOS
46     #define FOPEN_WBIN_MODE "wb"
47   #else /* end of DOS case */
48     #ifdef VMCMS
49       #define FOPEN_WBIN_MODE "wb, lrecl=1024, recfm=f"
50     #else
51       #define FOPEN_WBIN_MODE "w"
52     #endif /* not VM/CMS */
53   #endif /* not DOS */
54 #endif /* not FOPEN_WBIN_MODE */
55
56 #endif /* not C_FOPEN_H */