/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2011 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#include "sfdchdr.h"
/* Discipline to make an unseekable read stream seekable
**
** sfraise(f,SFSK_DISCARD,0) discards previous seek data
** but seeks from current offset on still allowed
**
** Written by Kiem-Phong Vo, kpv@research.att.com, 03/18/1998.
*/
typedef struct _skable_s
} Seek_t;
#if __STD_C
#else
Sfio_t* f; /* stream involved */
size_t n; /* number of bytes to read */
#endif
{
return (ssize_t)(-1);
}
#if __STD_C
#else
Sfio_t* f; /* stream involved */
size_t n; /* number of bytes to read */
#endif
{
ssize_t r, w, p;
return w;
n -= r;
}
/* do a raw read */
w = 0;
}
else
{
if(p > 0)
}
return r+w;
}
#if __STD_C
#else
Sfio_t* f;
int type;
#endif
{
ssize_t r, w;
switch (type)
{
case SEEK_SET:
break;
case SEEK_CUR:
break;
case SEEK_END:
break;
default:
return -1;
}
if(addr < 0)
return (Sfoff_t)(-1);
return (Sfoff_t)(-1);
/* read enough to reach the seek point */
w = sizeof(buf);
w = r-1;
if(w != r)
break;
}
}
return (Sfoff_t)(-1);
}
}
/* on close, remove the discipline */
#if __STD_C
#else
Sfio_t* f;
int type;
#endif
{
switch (type)
{
case SF_FINAL:
case SF_DPOP:
break;
case SFSK_DISCARD:
break;
}
return 0;
}
#if __STD_C
#else
int sfdcseekable(f)
Sfio_t* f;
#endif
{
/* see if already seekable */
return 0;
return -1;
return -1;
}
return 0;
}