xref: /netbsd-src/external/gpl3/binutils.old/dist/include/fopen-bin.h (revision e992f068c547fd6e84b3f104dc2340adcc955732)
175fd0b74Schristos /* Macros for the 'type' part of an fopen, freopen or fdopen.
275fd0b74Schristos 
375fd0b74Schristos 	<Read|Write>[Update]<Binary file|text file>
475fd0b74Schristos 
575fd0b74Schristos    This version is for "binary" systems, where text and binary files are
675fd0b74Schristos    different.  An example is Mess-Dose.  Many Unix systems could also
775fd0b74Schristos    cope with a "b" in the string, indicating binary files, but some reject this
875fd0b74Schristos    (and thereby don't conform to ANSI C, but what else is new?).
975fd0b74Schristos 
10*e992f068Schristos    Copyright (C) 1996-2022 Free Software Foundation, Inc.
1175fd0b74Schristos 
1275fd0b74Schristos    This program is free software; you can redistribute it and/or modify
1375fd0b74Schristos    it under the terms of the GNU General Public License as published by
1475fd0b74Schristos    the Free Software Foundation; either version 2, or (at your option)
1575fd0b74Schristos    any later version.
1675fd0b74Schristos 
1775fd0b74Schristos    This program is distributed in the hope that it will be useful,
1875fd0b74Schristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
1975fd0b74Schristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2075fd0b74Schristos    GNU General Public License for more details.
2175fd0b74Schristos 
2275fd0b74Schristos    You should have received a copy of the GNU General Public License
2375fd0b74Schristos    along with this program; if not, write to the Free Software
2475fd0b74Schristos    Foundation, Inc., 51 Franklin Street - Fifth Floor,
2575fd0b74Schristos    Boston, MA 02110-1301, USA.  */
2675fd0b74Schristos 
2775fd0b74Schristos /* This file is designed for inclusion by host-dependent .h files.  No
2875fd0b74Schristos    user application should include it directly, since that would make
2975fd0b74Schristos    the application unable to be configured for both "same" and "binary"
3075fd0b74Schristos    variant systems.  */
3175fd0b74Schristos 
3275fd0b74Schristos #define FOPEN_RB	"rb"
3375fd0b74Schristos #define FOPEN_WB 	"wb"
3475fd0b74Schristos #define FOPEN_AB 	"ab"
3575fd0b74Schristos #define FOPEN_RUB 	"r+b"
3675fd0b74Schristos #define FOPEN_WUB 	"w+b"
3775fd0b74Schristos #define FOPEN_AUB 	"a+b"
3875fd0b74Schristos 
3975fd0b74Schristos #define FOPEN_RT	"r"
4075fd0b74Schristos #define FOPEN_WT 	"w"
4175fd0b74Schristos #define FOPEN_AT 	"a"
4275fd0b74Schristos #define FOPEN_RUT 	"r+"
4375fd0b74Schristos #define FOPEN_WUT 	"w+"
4475fd0b74Schristos #define FOPEN_AUT 	"a+"
45