/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1998-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
/*
* sfio { lzw gzip pzip bzip } discipline wrapper
*/
#include "pzlib.h"
#include <sfdcbzip.h>
/*
* push the sfio discipline named by meth:
*
* bzip
* gzip [--[no]crc]
* lzw
* pzip [--[no]crc] [--] [ partition ]
* qzip [--] [ record-size ]
*
* return:
* >0 discipline pushed
* 0 discipline not needed
* <0 error
*/
int
{
const char* part;
const char* mesg;
int r;
int zip;
int len;
unsigned long flags;
if (meth)
{
else
zip = 0;
{
case (4<<8)|'b':
break;
case (4<<8)|'g':
break;
case (3<<8)|'l':
break;
case (4<<8)|'p':
break;
#if 0
case (4<<8)|'q':
break;
#endif
}
}
else
{
/*
* defer to sfdcpzip() for SF_READ recognition
*/
part = 0;
}
if (!zip)
{
r = -1;
}
else
{
flags = 0;
if (part)
for (;;)
{
while (part[0] == ' ')
part++;
{
if (!part[0])
part = 0;
break;
}
part += 2;
if (part[0] == ' ')
{
while (part[0] == ' ')
part++;
if (!part[0])
part = 0;
break;
}
if (!part[0])
{
part = 0;
break;
}
{
part += 2;
r = 0;
}
else
r = 1;
{
case 3:
switch (zip)
{
case METH_gzip:
if (!r)
flags |= SFGZ_NOCRC;
break;
case METH_pzip:
if (r)
break;
}
break;
}
}
if (!path)
{
path = "input";
else
path = "output";
}
switch (zip)
{
case METH_bzip:
break;
case METH_gzip:
break;
case METH_lzw:
break;
case METH_pzip:
{
r = -1;
}
else
{
}
break;
}
if (r > 0)
}
if (r < 0 && errorf)
return r;
}