Re: <inc> in ncsa server

Tony Sanders (
Fri, 08 Oct 1993 10:20:06 -0500

> I don't see how. As I said, the filter does not have to be a separate
> program to the server.
Right, you could special case certain conversions and just change a
pointer to the "send" function instead of using an external conversion.

For example:
send_fp = default_send;
if ("converting from macro-html to html") # use internal conversion
send_fp = send_macro_html;
if ("converting from xyz to html") # uses external conversion
open(stdout, "|xyz2html"); # this is perl, but you get the idea
(*send_fp)(stdin, stdout);
Of course, it'll need to be more robust (e.g., you wouldn't use two internal
conversions unless you wrote a streams object to move the data around).
However, if you just setup pipe()'s and fork() you can easily use muliple
internal conversions (that just read stdin and write stdout) and the system
will handle the streams for you. This is efficient enough for most systems,
esp on systems with copy-on-write. This is how Plexus handles it.

| |____ --------------------------------------------------------------
__| | Tony Sanders Development and US Customer Support
\ | sanders@BSDI.COM Berkeley Software Design, Inc.
\/\ * _/ Voice + 1 512 251 1937 1801 Wells Branch Parkway, #2111
\_ / Support + 1 800 ITS BSD8 Austin, TX 78728
\| Orders + 1 800 800 4BSD