1 .TH OBJECT 3 "$Revision: 1.11 $"
4 wr_open, wr_close, wr_ohead, wr_sect, wr_outsect, wr_emit, wr_putc, wr_relo,
5 wr_name, wr_string, wr_arhdr, wr_ranlib, wr_int2, wr_long, wr_bytes,
6 rd_open, rd_fdopen, rd_close, rd_ohead, rd_sect, rd_outsect,
7 rd_emit, rd_relo, rd_rew_relo, rd_name, rd_string, rd_arhdr, rd_ranlib,
8 rd_int2, rd_unsigned2, rd_long, rd_bytes, rd_fd\ \-\ routines to read
9 and write ACK-object files and libraries
15 .B #include <ranlib.h>
17 .B #include <object.h>
19 .B int wr_open(filename)
25 .B void wr_ohead(head)
27 .B struct outhead *head;
29 .B void wr_sect(sect, cnt)
31 .B struct outsect *sect;
35 .B void wr_outsect(sectionnr)
39 .B void wr_emit(emit, cnt)
47 .B void wr_relo(relo, cnt)
49 .B struct outrelo *relo;
53 .B void wr_name(name, cnt)
55 .B struct outname *name;
59 .B void wr_string(stringaddr, cnt)
65 .B void wr_arhdr(fd, arhdr)
67 .B struct ar_hdr *arhdr;
69 .B void wr_ranlib(fd, ran, cnt)
71 .B struct ranlib *ran;
75 .B void wr_int2(fd, i)
77 .B void wr_long(fd, l)
81 .B void wr_bytes(fd, buf, l)
87 .B int rd_open(filename)
95 .B void rd_ohead(head)
97 .B struct outhead *head;
99 .B void rd_sect(sect, cnt)
101 .B struct outsect *sect;
105 .B void rd_outsect(sectionnr)
109 .B void rd_emit(emit, cnt)
115 .B void rd_relo(relo, cnt)
117 .B struct outrelo *relo;
121 .B void rd_rew_relo(head)
123 .B struct outhead *head;
125 .B void rd_name(name, cnt)
127 .B struct outname *name;
131 .B void rd_string(stringaddr, cnt)
137 .B int rd_arhdr(fd, arhdr)
139 .B struct ar_hdr *arhdr;
141 .B void rd_ranlib(fd, ran, cnt)
143 .B struct ranlib *ran;
149 .B unsigned int rd_unsigned2(fd)
153 .B void rd_bytes(fd, buf, l)
161 These routines come in handy when reading or writing ACK-object files
162 or libraries. No checking is performed.
167 for writing and initializes some of this modules local variables.
168 It must be called before writing parts of the object file.
169 It returns 1 if it succeeds, 0 if it fails.
172 closes the object file. Don't forget to call it, because it might
173 flush internal buffers.
179 This routine must be called before the routines to write the other
185 section headers, starting at
187 Before writing a section, its section header must be written.
190 indicates that the next section to be written is
192 This routine can be used to switch between sections.
199 of the current section.
204 to the current section.
209 outrelo structures, indicated by
211 in the relocation information part of the object file.
216 outname structures, indicated by
218 in the name-table part of the object file.
225 in the string table part of the object file.
227 The next few routines can be used independantly:
229 writes the archive member header
237 ranlib structures, indicated by
243 writes a 2-byte integer
247 low order byte first.
250 writes a 4-byte integer
254 low order word first, low order byte first.
266 routines are the opposite of the
268 routines. However, a few of them deserve special mentioning:
271 initialises for reading an "object file" from file descriptor
273 at its current position.
274 This is useful for reading an object that resides in an archive.
275 It returns 1 if it succeeds, 0 otherwise.
276 When using this entry point for reading,
278 does not have to be called.
281 rewinds the relocation part, so that it can be read again.
282 \fILed\fR(6) sometimes needs this.
285 reads two bytes from file descriptor
287 and interpretes them as an unsigned integer.
290 returns 1 if a header was read, and 0 on end-of-file.
292 When using any of the reading routines, a routine
296 It is called when a read fails, and is not supposed to return.
299 must be defined when using any of the writing routines.
307 ~em/modules/lib/libobject.a: the library in which these routines reside
309 ack.out(5), arch(1), aal(1)
316 return 0 if they fail, and 1 if they succeed.