/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1987-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* pax vmsbackup format
*/
#include "format.h"
#define BLKHDR_hdrsiz 0
#define FILHDR_size 0
#define FILATT_recfmt 0
#define RECHDR_size 0
typedef struct Saveset_s
{
} Saveset_t;
/*
* get next saveset record
* if header!=0 then all records skipped until REC_file found
* otherwise REC_vbn cause non-zero return
* 0 returned for no record match
*/
static int
getsaveset(Pax_t* pax, register Archive_t* ap, register File_t* f, register Saveset_t* ss, int header)
{
register char* p;
register char* s;
char* t;
int i;
long n;
for (;;)
{
{
{
if (header)
gettrailer(ap, f);
return 0;
}
}
if (i == REC_file)
{
if (header)
{
p += 2;
n = 0;
{
if (isupper(*s))
*t++ = tolower(*s);
else if (n)
{
if (*s == ';')
break;
*t++ = *s;
}
else if (*s == ']')
{
n = 1;
*t++ = '/';
}
else if (*s == '.')
*t++ = '/';
else
*t++ = *s;
}
*t = 0;
for (i = 0; i < 5; i++)
{
s = p + FILHDR_size;
}
f->st->st_size = (long)(swapget(1, p + FILHDR_data + FILATT_blocks, 2) - 1) * BLOCKSIZE + (long)swapget(1, p + FILHDR_data + FILATT_frag, 2);
for (; i < 15; i++)
{
s = p + FILHDR_size;
}
/*
* pure guesswork based on 100 nsec epoch
* 17-NOV-1858 00:00:00 GMT
*/
n = 1;
else
return 1;
}
return 0;
}
return 1;
}
}
static int
{
{
}
return 0;
}
static int
{
register off_t c;
int i;
int j;
int k;
if (wfd < 0)
wfp = 0;
{
return -1;
}
j = 0;
k = 0;
c = 0;
{
/*
* this part transcribed from vmsbackup
*/
i = 0;
{
case 1: /* fixed length */
i++;
j--;
break;
case 2: /* variable length */
case 3: /* with fixed control */
if (j <= 0)
{
i += 2;
{
}
}
else
{
{
}
i++;
j--;
}
if (j <= 0)
{
if (i & 1) i++;
}
break;
case 4: /* seq stream */
case 5: /* seq LF stream */
if (j <= 0) j = 512;
else j--;
i++;
break;
case 6: /* seq CR stream */
i++;
break;
default:
error(state.keepgoing ? 1 : 3, "%s: invalid %s format data record format=%d", f->name, ap->format->name, ss->recfmt);
goto next;
}
next:
c += i;
}
if (wfp)
{
}
return 1;
}
static int
{
return 1;
}
static int
{
register char* s;
{
return 0;
}
{
s++;
}
else
s = f->name;
{
return 0;
}
return 1;
}
{
"vmsbackup",
0,
"VMS backup savset; for tape devices only",
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
};