daily update
[binutils/dougsmingw.git] / include / vms / lbr.h
blob768bc4c4ffcbe60c068fe840adc01def61d79d9e
1 /* Alpha VMS external format of Libraries.
3 Copyright 2010 Free Software Foundation, Inc.
4 Written by Tristan Gingold <gingold@adacore.com>, AdaCore.
6 This file is part of BFD, the Binary File Descriptor library.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
21 MA 02110-1301, USA. */
23 #ifndef _VMS_LBR_H
24 #define _VMS_LBR_H
26 /* Libray HeaDer. */
28 #define LHD_SANEID_DCX 319232342
29 #define LHD_SANEID3 233579905
30 #define LHD_SANEID4 233579911
32 /* Library type. */
33 #define LBR__C_TYP_UNK 0 /* Unknown / unspecified. */
34 #define LBR__C_TYP_OBJ 1 /* Vax object. */
35 #define LBR__C_TYP_MLB 2 /* Macro. */
36 #define LBR__C_TYP_HLP 3 /* Help. */
37 #define LBR__C_TYP_TXT 4 /* Text. */
38 #define LBR__C_TYP_SHSTB 5 /* Vax shareable image. */
39 #define LBR__C_TYP_NCS 6 /* NCS. */
40 #define LBR__C_TYP_EOBJ 7 /* Alpha object. */
41 #define LBR__C_TYP_ESHSTB 8 /* Alpha shareable image. */
42 #define LBR__C_TYP_IOBJ 9 /* IA-64 object. */
44 struct vms_lhd
46 /* Type of the library. See above. */
47 unsigned char type;
49 /* Number of indexes. Generally 1, 2 for object libraries. */
50 unsigned char nindex;
52 unsigned char fill_1[2];
54 /* Sanity Id. */
55 unsigned char sanity[4];
57 /* Version. */
58 unsigned char majorid[2];
59 unsigned char minorid[2];
61 /* Tool name. */
62 unsigned char lbrver[32];
64 /* Create time. */
65 unsigned char credat[8];
67 /* Update time. */
68 unsigned char updtim[8];
70 /* Size of the MHD. */
71 unsigned char mhdusz;
73 unsigned char idxblkf[2]; /* Unused. */
74 unsigned char fill_2;
75 unsigned char closerror[2];
77 unsigned char spareword[2];
79 /* First free block, and number of free blocks. */
80 unsigned char freevbn[4];
81 unsigned char freeblk[4];
83 unsigned char nextrfa[6];
84 unsigned char nextvbn[4];
86 /* Free pre-allocated index block. */
87 unsigned char freidxblk[4];
88 unsigned char freeidx[4];
90 /* Highest pre-allocated index block and in use. */
91 unsigned char hipreal[4];
92 unsigned char hiprusd[4];
94 /* Number of index blocks in use. */
95 unsigned char idxblks[4];
97 /* Number of index entries. */
98 unsigned char idxcnt[4];
100 /* Number of modules entries. */
101 unsigned char modcnt[4];
103 unsigned char fill_3[2];
105 /* Number of module headers. */
106 unsigned char modhdrs[4];
108 /* Overhead index pointers. */
109 unsigned char idxovh[4];
111 /* Update history records. */
112 unsigned char maxluhrec[2];
113 unsigned char numluhrec[2];
114 unsigned char begluhrfa[6];
115 unsigned char endluhrfa[6];
117 /* DCX map. */
118 unsigned char dcxmapvbn[4];
120 unsigned char fill_4[4 * 13];
123 /* Offset of the first IDD. */
124 #define LHD_IDXDESC 196
126 /* InDex Description. */
127 struct vms_idd
129 unsigned char flags[2];
131 /* Max length of the key. */
132 unsigned char keylen[2];
134 /* First index block. */
135 unsigned char vbn[4];
138 /* IDD flags. */
139 #define IDD__FLAGS_ASCII 1
140 #define IDD__FLAGS_LOCKED 2
141 #define IDD__FLAGS_VARLENIDX 4
142 #define IDD__FLAGS_NOCASECMP 8
143 #define IDD__FLAGS_NOCASENTR 16
144 #define IDD__FLAGS_UPCASNTRY 32
146 #define IDD_LENGTH 8
148 /* Index block. */
149 #define INDEXDEF__LENGTH 512
150 #define INDEXDEF__BLKSIZ 500
152 struct vms_indexdef
154 /* Number of bytes used. */
155 unsigned char used[2];
157 /* VBN of the parent. */
158 unsigned char parent[4];
160 unsigned char fill_1[6];
161 unsigned char keys[INDEXDEF__BLKSIZ];
164 /* Index keys. */
165 struct vms_idxdef
167 unsigned char vbn[4];
168 unsigned char offset[2];
170 unsigned char keylen;
171 unsigned char keyname[256];
174 struct vms_idxdef2
176 unsigned char vbn[4];
178 /* Offset from the start of the vbn, so minimum should be
179 DATA__DATA (ie 6). */
180 unsigned char offset[2];
182 unsigned char keylen[2];
183 unsigned char fill_1;
184 unsigned char keyname[256];
187 #define RFADEF__C_INDEX 0xffff
189 struct vms_datadef
191 /* Number of records in this block. */
192 unsigned char recs;
193 unsigned char fill_1;
195 /* Next vbn. */
196 unsigned char link[4];
198 /* Data. The first word is the record length, followed by record
199 data and a possible pad byte so that record length is always aligned. */
200 unsigned char data[506];
202 #define DATA__LENGTH 512
203 #define DATA__DATA 6
205 /* Module header. */
206 struct vms_mhd
208 /* Fixed part. */
209 unsigned char lbrflag;
210 unsigned char id;
211 unsigned char fill_1[2];
212 unsigned char refcnt[4];
213 unsigned char datim[8];
215 unsigned char objstat;
216 /* Ident or GSMATCH. */
217 unsigned char objidlng;
218 unsigned char objid[31];
221 #define MHD__C_MHDID 0xad /* Value for id. */
222 #define MHD__C_USRDAT 16
223 #define MHD__M_SELSRC 0x1
224 #define MHD__M_OBJTIR 0x2
225 #define MHD__M_WKSYM 0x4
227 struct vms_luh
229 unsigned char nxtluhblk[4];
230 unsigned char spare[2];
231 unsigned char data[506];
234 struct vms_luhdef
236 unsigned char rechdr[2];
237 unsigned char reclen[2];
239 #define LUH__RECHDRLEN 4
240 #define LUH__RECHDRMRK 0xabba
241 #define LUH__DATAFLDLEN 506
243 /* Entry in the history. */
245 struct vms_leh
247 unsigned char date[8];
248 unsigned char nbr_units[2];
249 unsigned char action[2]; /* 1: delete, 2: insert, 3: replaced. */
250 unsigned char idlen;
251 /* username
252 modules... */
255 #endif /* _VMS_LBR_H */