4 #include <asm/byteorder.h>
8 int writeLead(int fd, struct rpmlead *lead)
12 memcpy(&l, lead, sizeof(*lead));
14 l.magic[0] = RPMLEAD_MAGIC0;
15 l.magic[1] = RPMLEAD_MAGIC1;
16 l.magic[2] = RPMLEAD_MAGIC2;
17 l.magic[3] = RPMLEAD_MAGIC3;
19 l.type = htons(l.type);
20 l.archnum = htons(l.archnum);
21 l.osnum = htons(l.osnum);
22 l.signature_type = htons(l.signature_type);
24 write(fd, &l, sizeof(l));
29 int readLead(int fd, struct rpmlead *lead)
31 read(fd, lead, sizeof(*lead));
33 lead->type = ntohs(lead->type);
34 lead->archnum = ntohs(lead->archnum);
35 lead->osnum = ntohs(lead->osnum);
36 lead->signature_type = ntohs(lead->signature_type);