Skip to content

Commit

Permalink
Add -O option to write old tapes with six file header words.
Browse files Browse the repository at this point in the history
SALV 9 from 1973 does not accept seven words.
  • Loading branch information
larsbrinkhoff committed Jul 28, 2019
1 parent c87e3bf commit 4f41b42
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions itstar.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
extern unsigned long bpi; /* tape density in bits per inch */
extern unsigned long count; /* count of tape frames written */
extern int simh; /* NZ to support SIMH tape images */
int old_header; /* NZ to limit file header to six words */

static void usage(), itsname(), extitsname(), changedir();
static void addfiles(), addfile(), listfiles(), listfile(),
Expand Down Expand Up @@ -310,9 +311,12 @@ static void addfile(int argc,char **argv,char *f)
/* output buffer must have been initialized with resetbuf() */
void save(char *f)
{
long len = 7;
if(verify) printf("%s => %s;%s %s ",f,ufd,fn1,fn2);

outword(-7L,0L); /* 1: AOBJN ptr giving length */
if (old_header)
len = 6;
outword(len,0L); /* 1: AOBJN ptr giving length */
outsix(ufd); /* 2: UFD */
outsix(fn1); /* 3: filename 1 */
outsix(fn2); /* 4: filename 2 */
Expand All @@ -327,12 +331,15 @@ void save(char *f)
/* left of it are unused in UFD entries so hopefully it's safe to */
/* grab them */
/* tm_year and UFD year field are both YEAR-1900 */
outword((((unsigned long)cdate.tm_year)<<9L)|
(((unsigned long)cdate.tm_mon+1L)<<5L)|
(unsigned long)cdate.tm_mday,
((((unsigned long)cdate.tm_hour*60L)+
(unsigned long)cdate.tm_min)*60L+
(unsigned long)cdate.tm_sec)*2L); /* 7: date of last ref */
if (len >= 7) {
outword((((unsigned long)cdate.tm_year)<<9L)|
(((unsigned long)cdate.tm_mon+1L)<<5L)|
(unsigned long)cdate.tm_mday,
((((unsigned long)cdate.tm_hour*60L)+
(unsigned long)cdate.tm_min)*60L+
(unsigned long)cdate.tm_sec)*2L);
/* 7: date of last ref */
}
/* tapeflush(); */ /* finish off label record */

if(islink) { /* it's a link, not a file */
Expand Down Expand Up @@ -596,6 +603,7 @@ switches:\n\
-f HOST:DEV use \"rmt\" remote tape server\n\
-v verify (display) names of all files accessed\n\
-E use E-11 tape image format\n\
-O write old format tape (6 file header words)\n\
\n");

/* need some way to differentiate rmt protocol from my own weird one,
Expand Down

0 comments on commit 4f41b42

Please sign in to comment.