I just used pipe-filter-ii to reimplement GNU Zile's shell-command (as in Emacs). It's a bit more complicated in structure than the original with all the callbacks, and it's pretty much the same length, but it gives me confidence a) because the code is from gnulib and b) because the original code used temporary files. The only inelegance is having to code up a struct type to pass around the privdata argument even for something as simple as passing data in and reading it out again.
Also, bar a couple of trivial brain-o's which I got wrong initially (first, I forgot to repeat the command in the argument list; secondly, I forgot to return NULL rather than merely "0" when there was no more data to write), it worked first time, which is more than can be said for the original code. -- http://rrt.sc3d.org