/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-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> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#include "sfdchdr.h"
/* Discipline to treat a contiguous segment of a stream as a stream
** in its own right. The hard part in all this is to allow multiple
** segments of the stream to be used as substreams at the same time.
**
** Written by David G. Korn and Kiem-Phong Vo (03/18/1998)
*/
typedef struct _subfile_s
{
} Subfile_t;
#if __STD_C
#else
Sfio_t* f;
size_t n;
int type;
#endif
{
/* read just what we need */
n = io;
if(n <= 0)
return n;
/* save current location in parent stream */
/* read data */
io = 0;
else
if(io > 0)
}
/* restore parent current position */
return io;
}
#if __STD_C
#else
Sfio_t* f;
size_t n;
#endif
{
}
#if __STD_C
#else
Sfio_t* f;
size_t n;
#endif
{
}
#if __STD_C
#else
Sfio_t* f;
int type;
#endif
{
switch(type)
{
case SEEK_SET:
here = 0;
break;
case SEEK_CUR:
break;
case SEEK_END:
else
return -1;
}
break;
default:
return -1;
}
return -1;
}
#if __STD_C
#else
Sfio_t* f;
int type;
#endif
{
return 0;
}
#if __STD_C
#else
Sfio_t* f; /* stream */
#endif
{
/* establish that we can seek to offset */
return 0;
if (!(sp = f) && !(sp = sfnew(NIL(Sfio_t*), NIL(Void_t*), (size_t)SF_UNBOUND, dup(sffileno(parent)), parent->flags)))
return 0;
{ if(sp != f)
return 0;
}
if(sp != f)
return 0;
}
return sp;
}