| 1 | #include <fcntl.h> |
| 2 | #include <errno.h> |
| 3 | #include <stdio.h> |
| 4 | #include <sys/types.h> |
| 5 | #include <sys/stat.h> |
| 6 | #include <ctype.h> |
| 7 | #include <string.h> |
| 8 | #include <sys/file.h> |
| 9 | #include <stdlib.h> |
| 10 | |
| 11 | #ifndef O_ACCMODE |
| 12 | #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR) |
| 13 | #endif |
| 14 | #define SEEK_SET 0 |
| 15 | #define SEEK_CUR 1 |
| 16 | |
| 17 | #include <machine/param.h> |
| 18 | #include <machine/vmparam.h> |
| 19 | #define HOST_PAGE_SIZE (NBPG*CLSIZE) |
| 20 | #define HOST_MACHINE_ARCH bfd_arch_vax |
| 21 | |
| 22 | #define HOST_TEXT_START_ADDR USRTEXT |
| 23 | #define HOST_STACK_END_ADDR USRSTACK |
| 24 | |
| 25 | /* EXACT TYPES */ |
| 26 | typedef char int8e_type; |
| 27 | typedef unsigned char uint8e_type; |
| 28 | typedef short int16e_type; |
| 29 | typedef unsigned short uint16e_type; |
| 30 | typedef int int32e_type; |
| 31 | typedef unsigned int uint32e_type; |
| 32 | |
| 33 | /* CORRECT SIZE OR GREATER */ |
| 34 | typedef char int8_type; |
| 35 | typedef unsigned char uint8_type; |
| 36 | typedef short int16_type; |
| 37 | typedef unsigned short uint16_type; |
| 38 | typedef int int32_type; |
| 39 | typedef unsigned int uint32_type; |
| 40 | /* Macros for the 'type' part of an fopen, freopen or fdopen. |
| 41 | <Read|Write>[Update]<Binary file><text file> |
| 42 | */ |
| 43 | #define FOPEN_RB "r" |
| 44 | #define FOPEN_WB "w" |
| 45 | #define FOPEN_AB "a" |
| 46 | #define FOPEN_RUB "r+" |
| 47 | #define FOPEN_WUB "w+" |
| 48 | #define FOPEN_AUB "a+" |
| 49 | #define FOPEN_RT "r" |
| 50 | #define FOPEN_WT "w" |
| 51 | #define FOPEN_AT "a" |
| 52 | #define FOPEN_RUT "r+" |
| 53 | #define FOPEN_WUT "w+" |
| 54 | #define FOPEN_AUT "a+" |