Home | History | Annotate | Download | only in bfd

Lines Matching refs:vec

806   struct vms_lib_iovec *vec = (struct vms_lib_iovec *) abfd->iostream;
807 return vec->where;
816 struct vms_lib_iovec *vec = (struct vms_lib_iovec *) abfd->iostream;
818 if (vec->blk_off == DATA__LENGTH)
823 if (bfd_seek (abfd->my_archive, vec->next_block, SEEK_SET) != 0)
827 vec->next_block = (bfd_getl32 (hdr + 2) - 1) * VMS_BLOCK_SIZE;
828 vec->blk_off = sizeof (hdr);
840 struct vms_lib_iovec *vec = (struct vms_lib_iovec *) abfd->iostream;
853 l = DATA__LENGTH - vec->blk_off;
873 vec->blk_off += l;
880 /* Decompress NBYTES from VEC. Store the bytes into BUF if not NULL. */
883 vms_lib_dcx (struct vms_lib_iovec *vec, unsigned char *buf, file_ptr nbytes)
896 sbm = vec->dcx_sbm;
897 offset = vec->dcx_offset;
898 j = vec->dcx_pos & 7;
900 for (i = vec->dcx_pos >> 3; i < vec->dcx_rlen; i++)
902 unsigned char b = vec->dcx_buf[i];
914 vec->dcx_pos = (i << 3) + j;
917 vec->dcx_offset = offset;
918 vec->dcx_sbm = sbm;
928 sbm = vec->dcxsbms + sbm->next[v];
939 vec->dcx_pos = (i << 3) + j + 1;
940 vec->dcx_offset = offset;
941 vec->dcx_sbm = sbm;
958 struct vms_lib_iovec *vec = (struct vms_lib_iovec *) abfd->iostream;
964 if (vec->where >= vec->file_len)
970 if (vec->rec_rem == 0)
977 vec->rec_len = bfd_getl16 (blen);
981 vec->rec_pos = 0;
982 vec->rec_rem = vec->rec_len;
987 vec->rec_pos = REC_POS_LEN0;
988 vec->rec_rem = (vec->rec_len + 1) & ~1; /* With align byte. */
990 if (vec->rec_len == 3)
993 if (vms_lib_bread_raw (abfd, vec->pattern, 4) != 4)
995 if (!memcmp (vec->pattern, eotdesc + 2, 3))
998 vec->where += res;
999 vec->file_len = vec->where;
1004 if (vec->dcxsbms != NULL)
1011 len = (vec->rec_len + 1) & ~1;
1012 if (len > vec->dcx_max)
1014 while (len > vec->dcx_max)
1015 vec->dcx_max *= 2;
1016 vec->dcx_buf = bfd_alloc (abfd, vec->dcx_max);
1017 if (vec->dcx_buf == NULL)
1022 vec->dcx_rlen = len;
1023 if (vec->rec_len == 3)
1026 memcpy (vec->dcx_buf, vec->pattern, 3);
1030 elen = vms_lib_bread_raw (abfd, vec->dcx_buf, len);
1036 vec->dcx_offset = 0;
1037 vec->dcx_sbm = vec->dcxsbms;
1038 vec->dcx_pos = 0;
1039 elen = vms_lib_dcx (vec, NULL, 0x10000);
1042 vec->rec_len = elen;
1043 vec->rec_rem = elen;
1046 vec->dcx_offset = 0;
1047 vec->dcx_sbm = vec->dcxsbms;
1048 vec->dcx_pos = 0;
1051 if (vec->rec_pos < 0)
1054 switch (vec->rec_pos)
1057 c = vec->rec_len & 0xff;
1058 vec->rec_pos = REC_POS_LEN1;
1061 c = (vec->rec_len >> 8) & 0xff;
1062 vec->rec_pos = 0;
1066 vec->rec_rem = 0;
1070 vec->rec_rem = 0;
1085 if (nbytes > vec->rec_rem)
1086 chunk = vec->rec_rem;
1090 if (vec->dcxsbms != NULL)
1094 if (!(buf == NULL && chunk == vec->rec_rem))
1095 chunk = vms_lib_dcx (vec, buf, chunk);
1099 if (vec->rec_len == 3)
1102 memcpy (buf, vec->pattern + vec->rec_pos, chunk);
1113 vec->rec_pos += chunk;
1114 vec->rec_rem -= chunk;
1116 if (vec->rec_rem == 0)
1121 if ((vec->rec_len & 1) == 1
1122 && vec->rec_len != 3
1123 && vec->dcxsbms == NULL)
1130 vec->rec_pos = REC_POS_NL;
1131 vec->rec_rem = 1;
1135 if ((vec->rec_len & 1) == 1 && vec->dcxsbms != NULL)
1137 vec->rec_pos = REC_POS_PAD;
1138 vec->rec_rem = 1;
1143 vec->where += res;
1152 struct vms_lib_iovec *vec = (struct vms_lib_iovec *) abfd->iostream;
1156 vec->where = 0;
1157 vec->rec_rem = 0;
1158 vec->dcx_pos = -1;
1159 vec->blk_off = vec->init_blk_off;
1160 vec->next_block = vec->init_next_block;
1162 if (bfd_seek (abfd->my_archive, vec->first_block, SEEK_SET) != 0)
1222 struct vms_lib_iovec *vec;
1229 vec = bfd_zalloc (el, sizeof (*vec));
1230 if (vec == NULL)
1233 el->iostream = vec;
1237 vec->file_len = -1;
1240 vec->next_block = filepos & ~(VMS_BLOCK_SIZE - 1);
1241 vec->blk_off = DATA__LENGTH;
1246 vec->blk_off = filepos & (VMS_BLOCK_SIZE - 1);
1247 vec->rec_rem = 0;
1274 vec->where = 0;
1275 vec->init_blk_off = vec->blk_off;
1276 vec->init_next_block = vec->next_block;
1277 vec->first_block = bfd_tell (el->my_archive);
1278 vec->dcxsbms = bfd_libdata (el->my_archive)->dcxsbm;
1280 if (vec->dcxsbms != NULL)
1283 vec->dcx_max = 10 * 1024;
1284 vec->dcx_buf = bfd_alloc (el, vec->dcx_max);
1285 vec->dcx_pos = -1;
1286 if (vec->dcx_buf == NULL)
1498 struct vms_lib_iovec *vec = (struct vms_lib_iovec *) abfd->iostream;
1500 if (vec->file_len == (ufile_ptr)-1)
1509 st->st_size = vec->file_len;