-+-+-+-+-+-+-+-+ START OF PART 3 -+-+-+-+-+-+-+-+ X`09char`20name`5B80`5D; X`09\1906\61031; X`09/*`20read`20the`20tape`20label`20-`204`20\BE06s`20of`2080`20bytes`20*/ X`09while`20((\A404read(fd,\3706,`20LABEL_SIZE))`20!=`200)`20`7B\B804f`20(i`20 V\1003\200B\1905`09fprintf(stderr,`20"Snark:`20bad`20\8B06\8706`5Cn"); X`09`09`09exit(1\0C05`7D X\5A06strncmp(\8407"VOL1",4)`20==\8108`09sscanf(label+4,`20"%14s",`20name) V\5905if(vflag`20`7C`7C`20tflag)`20\9C07"Volume:`20%s`5Cn",n\3308\8018HDR1 V\8032\220D31\23044d",`20`26setnr\7109/*`20get`20the`20block`20size`20*/\8C1A2" V,`20\8D0Enfound`20=`200\7A125,`20"%5d\7904blocksize); X#ifdef`09DEBUG\3404printf("\2409\4E03%d`5Cn",`20\370Dendif X\BB05\0303if((vflag`20`7C`7C`20tflag)`20`26`26`20!\9106)`20\2903\5908Saveset V`20name:`20%s`20`20`20number:`20%\6805name,setnr); X`09/*`20get`20the`20block`20buffer`20*/ X`09\1106=`20(char`20*)`20malloc(b\A90B`09if`20(\2907\2A0B0)`20`7B\9503fp\9606s Vtderr,`20"memory`20allocation`20for`20\4006failed`5Cn"\5704`09exit(1); X`09`7D X`09return(\EF07; X`7D X Xrdtail() X`7B X`09int`20i; X`09\7E05name`5B80`5D\DD06read\DE05tape`20label`20-`204`20records`20of`2080`20b Vytes`20\F404while`20((i\F803read(fd,\3706,`20LABEL_SIZE))`20!=`20\E507if`20(i V`20!=`20\200B\1905\FF12Snark:`20bad`20\8B06\8706\F408\F50B\F604\5A05strncmp( V\8407"EOF1",4)`20==\8108`09sscanf(label+4,`20"%14s",`20name)\5905if(vflag`20 V`7C`7C`20tflag) X\1603`09p\A006"End`20of`20saveset:`20%s`5Cn`5Cn`5Cn",n\4308\9003`7D X`7D X Xusage(progname) Xchar`09*p\1007; X\9103\F70F X`09`20`20"Usage:`20`20%s`20-`7Btx`7D`5Bcdevw`5D`5B-s`20setnumber\0E03f`20tapef Vile`5D`5Cn",\6709; X`7D Xmain(argc,`20argv) Xint`09argc; X\8506argv`5B`5D\8305 X`09char`20*\980A`09int`09c,`20i,`20eoffl\1207selset; X`09extern`20int`20optind;\1409\4B06optarg; X X`09\5508`20=\8905`5B0`5D; X`09if(argc`20<`202)`7B X`09`09usage(p\C10A`09`09exit(1\0B04`7D X`09gargv\4207; X`09gargc`20\0F05c; X`09tapefil\6304def_\0F08; X`09cflag=dflag=eflag=sflag=tflag=vflag=wflag=xflag=0; X`09while((c=getopt(argc,argv,"cdef:s:tvwx"))`20!=`20EOF)\AD03switch(c\CD05case V`20'c': X`09`09\8206++\D204`09break\0A04\2206d'\2205dflag\2216e'\2205eflag\2216f'\2205 V\F308`20=`20optarg\2C14s'\2C05sf\4E0Asscanf(optarg,"%d",`26selset)\4214t' V\6E06\901Av'\2205vf\2219w'\2205wf\2219x'\2205xf\2219?'\2205usage(progname V\B206exit(1\BE0F`7D; X`09if(!tflag`20`26`26`20!xflag)`20`7B X\4615\450A`7D X`09goptind`20=`20optind; X X#ifdef`09NEWD X`09/*`20open`20debug`20file`20*/ X`09lf\3203fopen("log",`20"w")\8905`20(\1D04=`20NULL\8406perror\2906\8211#endif V X X\6A09the`20tape\6D0Afd\9F05en(tapefile,`20O_RDONLY\7408fd`20<`200)\700C\2D08 V\7311\6C05rewind`20\6E09\6904op.mt_op\6F03MTREW;\1308count`20=`201; X`09i\0803ioctl(fd,`20MTIOCTOP,`20`26op)\8D07i`20\8C2Beoffl`20=`20rdhead(); X`09\9F05ad\9D05backup\A406blocks`20until`20end`20of\BD08`20 X`09while`20(!eoffl\7E06if(sflag`20`26`26`20setnr`20!=`20selset\2106\F30EFSF; V\150A\F50C\4B03\F71E\6C04\F90D\FB16\FD0C`09`09`7D X\59070;\0A03\0E04else\1508read\6D05block\0707size\3D05if(i`20==`200\6F07rdtail V()\5905eoffl=rdhead(\1305\5D08`20i\A705!=\4F0B\4106fprintf(stderr,`20"bad V\2506\8A05`20i\9303%d`5Cn",`20i\6607\CB0A\5F08\4A05eoffl\D608`09process_block( Vb\CC14\3E03\0303if(vflag`20`7C`7C`20tflag)`20\9307"End`20of`20tape`5Cn"); X X`09/*`20close`20the`20tape`20*/ X`09close(fd); X X#ifdef`09NEWD X\2F0Adebug`20file\3105fclose(lf); X#endif\3106\3205exit`20cleanly`20\2E04exit(0); X`7D $ call unpack [.VMS-BACKUP]VMSBACKUP.C;1 - 1279834317 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" $ v=f$verify(v) $ exit