]>
Commit | Line | Data |
---|---|---|
252b5132 | 1 | /* vms.h -- Header file for VMS (Alpha and Vax) support. |
aa820537 | 2 | Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, |
9fcd9da6 | 3 | 2008, 2009, 2010 Free Software Foundation, Inc. |
0c376465 TG |
4 | |
5 | Main header file. | |
252b5132 RH |
6 | |
7 | Written by Klaus K"ampf ([email protected]) | |
8 | ||
7920ce38 | 9 | This file is part of BFD, the Binary File Descriptor library. |
252b5132 | 10 | |
7920ce38 NC |
11 | This program is free software; you can redistribute it and/or modify |
12 | it under the terms of the GNU General Public License as published by | |
cd123cb7 | 13 | the Free Software Foundation; either version 3 of the License, or |
7920ce38 | 14 | (at your option) any later version. |
252b5132 | 15 | |
7920ce38 NC |
16 | This program is distributed in the hope that it will be useful, |
17 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 | GNU General Public License for more details. | |
252b5132 | 20 | |
7920ce38 NC |
21 | You should have received a copy of the GNU General Public License |
22 | along with this program; if not, write to the Free Software | |
cd123cb7 NC |
23 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, |
24 | MA 02110-1301, USA. */ | |
252b5132 | 25 | |
cd123cb7 | 26 | #undef vms |
252b5132 RH |
27 | #ifndef VMS_H |
28 | #define VMS_H | |
29 | ||
95e34ef7 | 30 | #include <time.h> |
0c376465 | 31 | |
95e34ef7 | 32 | /* Size of a VMS block on disk. */ |
4b544b64 | 33 | |
95e34ef7 | 34 | #define VMS_BLOCK_SIZE 512 |
0c376465 | 35 | |
771deb08 | 36 | /* Miscellaneous definitions. */ |
7920ce38 | 37 | |
0c376465 TG |
38 | #define MAX_OUTREC_SIZE 4096 |
39 | #define MIN_OUTREC_LUFT 64 | |
40 | ||
771deb08 | 41 | /* File format. */ |
95e34ef7 | 42 | |
771deb08 TG |
43 | enum file_format_enum |
44 | { | |
45 | /* Not yet known. */ | |
46 | FF_UNKNOWN, | |
47 | ||
48 | /* Unix format. Each record is preceeded by the record length, | |
49 | on 2 bytes. */ | |
50 | FF_FOREIGN, | |
51 | ||
52 | /* Native (=VMS) format. The file only contains the content of the | |
53 | records. This may also appear on Unix, depending on which tool | |
54 | was used to transfer files. */ | |
55 | FF_NATIVE | |
56 | }; | |
0c376465 | 57 | |
95e34ef7 | 58 | /* VMS records input buffer. */ |
0c376465 | 59 | |
95e34ef7 | 60 | struct vms_rec_rd |
0c376465 | 61 | { |
95e34ef7 TG |
62 | /* Buffer and its size. */ |
63 | unsigned char *buf; | |
64 | unsigned int buf_size; | |
0c376465 | 65 | |
95e34ef7 TG |
66 | /* Current record and its size. */ |
67 | unsigned char *rec; | |
68 | unsigned int rec_size; | |
0c376465 | 69 | |
95e34ef7 | 70 | /* Input file format. */ |
0c376465 | 71 | enum file_format_enum file_format; |
0c376465 TG |
72 | }; |
73 | ||
95e34ef7 | 74 | /* VMS records output buffer. */ |
0c376465 | 75 | |
95e34ef7 TG |
76 | struct vms_rec_wr |
77 | { | |
78 | /* Output buffer. */ | |
79 | unsigned char *buf; | |
0c376465 | 80 | |
95e34ef7 TG |
81 | /* Current length of the record. */ |
82 | unsigned short int size; | |
0c376465 | 83 | |
95e34ef7 TG |
84 | /* Sub-record start offset. */ |
85 | unsigned short int subrec_offset; | |
0c376465 | 86 | |
95e34ef7 TG |
87 | /* Some records must have a size that is a multiple of the alignment. |
88 | Mustn't be 0. */ | |
89 | unsigned short int align; | |
0c376465 TG |
90 | }; |
91 | ||
0c376465 TG |
92 | struct evax_private_udata_struct |
93 | { | |
94 | asymbol *bsym; | |
95 | asymbol *enbsym; | |
96 | char *origname; | |
97 | int lkindex; | |
98 | }; | |
99 | ||
95e34ef7 TG |
100 | /* vms-misc.c. */ |
101 | ||
102 | #define VMS_DEBUG 1 | |
771deb08 TG |
103 | |
104 | #if VMS_DEBUG | |
0fd3a477 JW |
105 | extern void _bfd_vms_debug (int, char *, ...) ATTRIBUTE_PRINTF_2; |
106 | extern void _bfd_hexdump (int, unsigned char *, int, int); | |
e4d2e665 TG |
107 | |
108 | #define vms_debug _bfd_vms_debug | |
109 | #define vms_debug2(X) _bfd_vms_debug X | |
110 | #else | |
111 | #define vms_debug2(X) | |
771deb08 TG |
112 | #endif |
113 | ||
9fcd9da6 | 114 | extern char * vms_get_module_name (const char *, bfd_boolean); |
95e34ef7 TG |
115 | extern unsigned char *get_vms_time_string (void); |
116 | extern time_t vms_time_to_time_t (unsigned int hi, unsigned int lo); | |
9fcd9da6 | 117 | extern time_t vms_rawtime_to_time_t (unsigned char *); |
953b49ed TG |
118 | extern void vms_time_t_to_vms_time (time_t ut, unsigned int *hi, unsigned int *lo); |
119 | extern void vms_get_time (unsigned int *hi, unsigned int *lo); | |
120 | extern void vms_raw_get_time (unsigned char *buf); | |
9fcd9da6 NC |
121 | |
122 | extern char * _bfd_vms_save_sized_string (unsigned char *, int); | |
123 | extern char * _bfd_vms_save_counted_string (unsigned char *); | |
124 | extern void _bfd_vms_output_begin (struct vms_rec_wr *, int); | |
125 | extern void _bfd_vms_output_alignment (struct vms_rec_wr *, int); | |
126 | extern void _bfd_vms_output_begin_subrec (struct vms_rec_wr *, int); | |
127 | extern void _bfd_vms_output_end_subrec (struct vms_rec_wr *); | |
128 | extern void _bfd_vms_output_end (bfd *, struct vms_rec_wr *); | |
129 | extern int _bfd_vms_output_check (struct vms_rec_wr *, int); | |
130 | extern void _bfd_vms_output_byte (struct vms_rec_wr *, unsigned); | |
131 | extern void _bfd_vms_output_short (struct vms_rec_wr *, unsigned); | |
132 | extern void _bfd_vms_output_long (struct vms_rec_wr *, unsigned long); | |
133 | extern void _bfd_vms_output_quad (struct vms_rec_wr *, bfd_vma); | |
81bb31c0 TG |
134 | extern void _bfd_vms_output_counted (struct vms_rec_wr *, const char *); |
135 | extern void _bfd_vms_output_dump (struct vms_rec_wr *, const unsigned char *, int); | |
9fcd9da6 NC |
136 | extern void _bfd_vms_output_fill (struct vms_rec_wr *, int, int); |
137 | extern int _bfd_vms_convert_to_var_unix_filename (const char *); | |
95e34ef7 TG |
138 | |
139 | /* vms-alpha.c */ | |
140 | ||
141 | extern void bfd_vms_set_section_flags (bfd *, asection *, flagword, flagword); | |
142 | ||
252b5132 | 143 | #endif /* VMS_H */ |