/***********************************************************************
* *
* 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 invoke UNIX processes as data filters.
** These processes must be able to fit in pipelines.
**
** Written by Kiem-Phong Vo, kpv@research.att.com, 03/18/1998.
*/
typedef struct _filter_s
} Filter_t;
/* read data from the filter */
#if __STD_C
#else
Sfio_t* f; /* stream reading from */
size_t n; /* number of bytes requested */
#endif
{
ssize_t r, w;
for(;;)
{
/* get some raw data to stuff down the pipe */
}
else
{ /* eof, close write end of pipes */
}
}
{ /* see if pipe is ready for write */
if(r == 1) /* non-blocking write */
{ errno = 0;
return 0;
}
}
/* see if pipe is ready for read */
{ errno = 0;
return r;
return 0;
}
}
}
#if __STD_C
#else
Sfio_t* f; /* stream writing to */
size_t n; /* number of bytes requested */
#endif
{
return -1;
}
/* for the duration of this discipline, the stream is unseekable */
#if __STD_C
#else
Sfio_t* f;
int offset;
#endif
addr = 0;
offset = 0;
return (Sfoff_t)(-1);
}
/* on close, remove the discipline */
#if __STD_C
#else
Sfio_t* f;
int type;
#endif
{
}
return 0;
}
#if __STD_C
#else
int sfdcfilter(f, cmd)
Sfio_t* f; /* stream to filter data */
char* cmd; /* program to run as a filter */
#endif
{
/* open filter for read&write */
return -1;
/* unbuffered stream */
return -1;
}
return -1;
}
return 0;
}