Fix compilation with old g++ 3.3.5 and debian-sarge.
[wvstreams.git] / Docs / sgmlmanual / egfiles / wvstreamlistex.cc
blob81bae1016a14280a53c1076eff112dee89dd6ca5
1 /*
2 * A WvPipe example.
4 * Some text about this example...
5 */
7 #include <wvpipe.h>
9 int X = -1;
10 // int X = 0;
11 // int X = 1000;
13 int main()
15 const char *argv1[] = { "sh", "-c",
16 "while :; do echo foo; sleep 3; done", NULL };
17 const char *argv2[] = { "sh", "-c",
18 "while :; do echo snorkle; sleep 1; done", NULL };
20 WvPipe stream1(argv1[0], argv1, false, true, false);
21 WvPipe stream2(argv2[0], argv2, false, true, false);
22 stream1.autoforward(*wvcon);
23 stream2.autoforward(*wvcon);
25 while (stream1.isok() || stream2.isok())
27 if (stream1.select(X))
28 stream1.callback();
29 if (stream2.select(X))
30 stream2.callback();