/***********************************************************************
* *
* 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 pzip discipline
*/
#include "pzlib.h"
#include <sfdcbzip.h>
typedef struct
{
} Sfpzip_t;
/*
* pzip exception handler
* free on close
*/
static int
{
int r;
switch (op)
{
case SF_ATEXIT:
return 0;
case SF_CLOSING:
case SF_DPOP:
case SF_FINAL:
{
}
else
r = 0;
if (op != SF_CLOSING)
return r;
case SF_DBUFFER:
return 1;
case SF_SYNC:
case SFPZ_HANDLE:
}
return 0;
}
/*
* sfio pzip discipline read
*/
static ssize_t
{
}
/*
* sfio pzip discipline write
*/
static ssize_t
{
}
/*
* create and push the sfio pzip discipline
*
* (flags&PZ_STAT) return
* >0 is a pzip file
* 0 not a pzip file
* <0 error
* otherwise flags have pzopen() semantics and return
* >0 discipline pushed (one or more of { pzip gzip lzw })
* 0 discipline not needed
* <0 error
*/
int
{
{
}
else
oz = 0;
{
return -1;
}
{
unsigned char* s;
int r;
int m1;
int m2;
if (!r)
if (!s)
return -1;
m1 = s[0];
m2 = s[1];
return r;
if (!r)
{
{
if (m1 == GZ_MAGIC_1)
{
if (m2 == GZ_MAGIC_2)
else if (m2 == LZ_MAGIC_2)
}
}
return r;
}
}
return -1;
{
return -1;
}
if (disc)
{
}
{
return -1;
}
if (path)
{
}
else
{
return -1;
}
if (oz)
return 1;
}