Lines Matching defs:hd

301 	HD_TAR *hd;
306 hd = (HD_TAR *)blk;
316 if (hd->name[0] == '\0')
320 if (asc_ul(hd->chksum,sizeof(hd->chksum),OCT) != tar_chksm(blk,BLKMULT))
372 HD_TAR *hd;
387 hd = (HD_TAR *)buf;
393 arcn->nlen = l_strncpy(arcn->name, hd->name,
394 MIN(sizeof(hd->name), sizeof(arcn->name)) - 1);
396 arcn->sb.st_mode = (mode_t)(asc_ul(hd->mode,sizeof(hd->mode),OCT) &
398 arcn->sb.st_uid = (uid_t)asc_ul(hd->uid, sizeof(hd->uid), OCT);
399 arcn->sb.st_gid = (gid_t)asc_ul(hd->gid, sizeof(hd->gid), OCT);
401 arcn->sb.st_size = (off_t)asc_ul(hd->size, sizeof(hd->size), OCT);
402 arcn->sb.st_mtime = (time_t)asc_ul(hd->mtime, sizeof(hd->mtime), OCT);
404 arcn->sb.st_size = (off_t)asc_uqd(hd->size, sizeof(hd->size), OCT);
405 arcn->sb.st_mtime = (time_t)asc_uqd(hd->mtime, sizeof(hd->mtime), OCT);
416 switch(hd->linkflag) {
423 arcn->ln_nlen = l_strncpy(arcn->ln_name, hd->linkname,
424 MIN(sizeof(hd->linkname), sizeof(arcn->ln_name)) - 1);
435 arcn->ln_nlen = l_strncpy(arcn->ln_name, hd->linkname,
436 MIN(sizeof(hd->linkname), sizeof(arcn->ln_name)) - 1);
509 HD_TAR *hd;
540 if (arcn->ln_nlen >= (int)sizeof(hd->linkname)) {
557 if (len >= (int)sizeof(hd->name)) {
570 hd = &hdblk;
571 l_strncpy(hd->name, arcn->name, sizeof(hd->name) - 1);
572 hd->name[sizeof(hd->name) - 1] = '\0';
581 hd->linkflag = AREGTYPE;
582 memset(hd->linkname, 0, sizeof(hd->linkname));
583 hd->name[len-1] = '/';
584 if (ul_oct((u_long)0L, hd->size, sizeof(hd->size), 1))
590 hd->linkflag = SYMTYPE;
591 l_strncpy(hd->linkname,arcn->ln_name, sizeof(hd->linkname) - 1);
592 hd->linkname[sizeof(hd->linkname) - 1] = '\0';
593 if (ul_oct((u_long)0L, hd->size, sizeof(hd->size), 1))
599 hd->linkflag = LNKTYPE;
600 l_strncpy(hd->linkname,arcn->ln_name, sizeof(hd->linkname) - 1);
601 hd->linkname[sizeof(hd->linkname) - 1] = '\0';
602 if (ul_oct((u_long)0L, hd->size, sizeof(hd->size), 1))
608 hd->linkflag = AREGTYPE;
609 memset(hd->linkname, 0, sizeof(hd->linkname));
611 if (ul_oct((u_long)arcn->sb.st_size, hd->size,
612 sizeof(hd->size), 1)) {
614 if (uqd_oct((u_quad_t)arcn->sb.st_size, hd->size,
615 sizeof(hd->size), 1)) {
626 if (ul_oct((u_long)arcn->sb.st_mode, hd->mode, sizeof(hd->mode), 0) ||
627 ul_oct((u_long)arcn->sb.st_uid, hd->uid, sizeof(hd->uid), 0) ||
628 ul_oct((u_long)arcn->sb.st_gid, hd->gid, sizeof(hd->gid), 0) ||
629 ul_oct((u_long)arcn->sb.st_mtime, hd->mtime, sizeof(hd->mtime), 1))
637 if (ul_oct(tar_chksm((char *)&hdblk, sizeof(HD_TAR)), hd->chksum,
638 sizeof(hd->chksum), 3))
701 HD_USTAR *hd;
705 hd = (HD_USTAR *)blk;
713 if (hd->name[0] == '\0')
715 if (strncmp(hd->magic, TMAGIC, TMAGLEN - 1) != 0)
717 if (asc_ul(hd->chksum,sizeof(hd->chksum),OCT) != tar_chksm(blk,BLKMULT))
733 HD_USTAR *hd;
748 hd = (HD_USTAR *)buf;
755 if (*(hd->prefix) != '\0') {
756 cnt = l_strncpy(dest, hd->prefix,
757 MIN(sizeof(hd->prefix), sizeof(arcn->name) - 2));
767 arcn->nlen = cnt + l_strncpy(dest, hd->name,
768 MIN(sizeof(hd->name), sizeof(arcn->name) - cnt - 1));
775 arcn->sb.st_mode = (mode_t)(asc_ul(hd->mode, sizeof(hd->mode), OCT) &
778 arcn->sb.st_size = (off_t)asc_ul(hd->size, sizeof(hd->size), OCT);
779 arcn->sb.st_mtime = (time_t)asc_ul(hd->mtime, sizeof(hd->mtime), OCT);
781 arcn->sb.st_size = (off_t)asc_uqd(hd->size, sizeof(hd->size), OCT);
782 arcn->sb.st_mtime = (time_t)asc_uqd(hd->mtime, sizeof(hd->mtime), OCT);
792 hd->gname[sizeof(hd->gname) - 1] = '\0';
793 if (gid_name(hd->gname, &(arcn->sb.st_gid)) < 0)
794 arcn->sb.st_gid = (gid_t)asc_ul(hd->gid, sizeof(hd->gid), OCT);
795 hd->uname[sizeof(hd->uname) - 1] = '\0';
796 if (uid_name(hd->uname, &(arcn->sb.st_uid)) < 0)
797 arcn->sb.st_uid = (uid_t)asc_ul(hd->uid, sizeof(hd->uid), OCT);
811 switch(hd->typeflag) {
834 if (hd->typeflag == BLKTYPE) {
841 devmajor = (dev_t)asc_ul(hd->devmajor,sizeof(hd->devmajor),OCT);
842 devminor = (dev_t)asc_ul(hd->devminor,sizeof(hd->devminor),OCT);
847 if (hd->typeflag == SYMTYPE) {
861 arcn->ln_nlen = l_strncpy(arcn->ln_name, hd->linkname,
862 MIN(sizeof(hd->linkname), sizeof(arcn->ln_name) - 1));
897 HD_USTAR *hd;
914 (arcn->ln_nlen > (int)sizeof(hd->linkname))) {
927 hd = &hdblk;
939 l_strncpy(hd->prefix, arcn->name, sizeof(hd->prefix));
942 memset(hd->prefix, 0, sizeof(hd->prefix));
948 l_strncpy(hd->name, pt, sizeof(hd->name));
955 hd->typeflag = DIRTYPE;
956 memset(hd->linkname, 0, sizeof(hd->linkname));
957 memset(hd->devmajor, 0, sizeof(hd->devmajor));
958 memset(hd->devminor, 0, sizeof(hd->devminor));
959 if (ul_oct((u_long)0L, hd->size, sizeof(hd->size), 3))
965 hd->typeflag = CHRTYPE;
967 hd->typeflag = BLKTYPE;
968 memset(hd->linkname, 0, sizeof(hd->linkname));
969 if (ul_oct((u_long)MAJOR(arcn->sb.st_rdev), hd->devmajor,
970 sizeof(hd->devmajor), 3) ||
971 ul_oct((u_long)MINOR(arcn->sb.st_rdev), hd->devminor,
972 sizeof(hd->devminor), 3) ||
973 ul_oct((u_long)0L, hd->size, sizeof(hd->size), 3))
977 hd->typeflag = FIFOTYPE;
978 memset(hd->linkname, 0, sizeof(hd->linkname));
979 memset(hd->devmajor, 0, sizeof(hd->devmajor));
980 memset(hd->devminor, 0, sizeof(hd->devminor));
981 if (ul_oct((u_long)0L, hd->size, sizeof(hd->size), 3))
988 hd->typeflag = SYMTYPE;
990 hd->typeflag = LNKTYPE;
992 l_strncpy(hd->linkname,arcn->ln_name, sizeof(hd->linkname));
993 memset(hd->devmajor, 0, sizeof(hd->devmajor));
994 memset(hd->devminor, 0, sizeof(hd->devminor));
995 if (ul_oct((u_long)0L, hd->size, sizeof(hd->size), 3))
1005 hd->typeflag = CONTTYPE;
1007 hd->typeflag = REGTYPE;
1008 memset(hd->linkname, 0, sizeof(hd->linkname));
1009 memset(hd->devmajor, 0, sizeof(hd->devmajor));
1010 memset(hd->devminor, 0, sizeof(hd->devminor));
1013 if (ul_oct((u_long)arcn->sb.st_size, hd->size,
1014 sizeof(hd->size), 3)) {
1016 if (uqd_oct((u_quad_t)arcn->sb.st_size, hd->size,
1017 sizeof(hd->size), 3)) {
1025 l_strncpy(hd->magic, TMAGIC, TMAGLEN);
1026 l_strncpy(hd->version, TVERSION, TVERSLEN);
1032 if (ul_oct((u_long)arcn->sb.st_mode, hd->mode, sizeof(hd->mode), 3) ||
1033 ul_oct((u_long)arcn->sb.st_uid, hd->uid, sizeof(hd->uid), 3) ||
1034 ul_oct((u_long)arcn->sb.st_gid, hd->gid, sizeof(hd->gid), 3) ||
1035 ul_oct((u_long)arcn->sb.st_mtime,hd->mtime,sizeof(hd->mtime),3))
1037 l_strncpy(hd->uname,name_uid(arcn->sb.st_uid, 0),sizeof(hd->uname));
1038 l_strncpy(hd->gname,name_gid(arcn->sb.st_gid, 0),sizeof(hd->gname));
1045 if (ul_oct(tar_chksm((char *)&hdblk, sizeof(HD_USTAR)), hd->chksum,
1046 sizeof(hd->chksum), 3))