1 /* c-fopen.h: how to open files with fopen.
3 Copyright 1992 Karl Berry
4 Copyright 2007 TeX Users Group
5 Copyright 2014 Clerk Ma
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.
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.
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
25 /* How to open a text file: */
27 #define FOPEN_R_MODE "r"
31 #define FOPEN_W_MODE "w"
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"
39 #define FOPEN_RBIN_MODE "r"
40 #endif /* not (VM/CMS or DOS or VMS) */
41 #endif /* not FOPEN_RBIN_MODE */
43 /* How to open a binary file for writing: */
44 #ifndef FOPEN_WBIN_MODE
46 #define FOPEN_WBIN_MODE "wb"
47 #else /* end of DOS case */
49 #define FOPEN_WBIN_MODE "wb, lrecl=1024, recfm=f"
51 #define FOPEN_WBIN_MODE "w"
52 #endif /* not VM/CMS */
54 #endif /* not FOPEN_WBIN_MODE */
56 #endif /* not C_FOPEN_H */