xref: /openbsd-src/gnu/usr.bin/binutils/include/fopen-same.h (revision 2159047f7a97bd07d66507696a8b038f6aef0509)
1*2159047fSniklas /* Macros for the 'type' part of an fopen, freopen or fdopen.
2*2159047fSniklas 
3*2159047fSniklas 	<Read|Write>[Update]<Binary file|text file>
4*2159047fSniklas 
5*2159047fSniklas    This version is for "same" systems, where text and binary files are
6*2159047fSniklas    the same.  An example is Unix.  Many Unix systems could also add a
7*2159047fSniklas    "b" to the string, indicating binary files, but some reject this
8*2159047fSniklas    (and thereby don't conform to ANSI C, but what else is new?).
9*2159047fSniklas 
10*2159047fSniklas    This file is designed for inclusion by host-dependent .h files.  No
11*2159047fSniklas    user application should include it directly, since that would make
12*2159047fSniklas    the application unable to be configured for both "same" and "binary"
13*2159047fSniklas    variant systems.  */
14*2159047fSniklas 
15*2159047fSniklas #define FOPEN_RB	"r"
16*2159047fSniklas #define FOPEN_WB 	"w"
17*2159047fSniklas #define FOPEN_AB 	"a"
18*2159047fSniklas #define FOPEN_RUB 	"r+"
19*2159047fSniklas #define FOPEN_WUB 	"w+"
20*2159047fSniklas #define FOPEN_AUB 	"a+"
21*2159047fSniklas 
22*2159047fSniklas #define FOPEN_RT	"r"
23*2159047fSniklas #define FOPEN_WT 	"w"
24*2159047fSniklas #define FOPEN_AT 	"a"
25*2159047fSniklas #define FOPEN_RUT 	"r+"
26*2159047fSniklas #define FOPEN_WUT 	"w+"
27*2159047fSniklas #define FOPEN_AUT 	"a+"
28