wvstreamlistex2.cc

来自「wvstreams软件包包含了libwvutils, libwvstreams 」· CC 代码 · 共 26 行

CC
26
字号
#include <wvstreamlist.h>#include <wvpipe.h>int main(){    const char *argv1[] = { "sh", "-c", 				"while :; do echo foo; sleep 3; done" };    const char *argv2[] = { "sh", "-c", 				"while :; do echo snorkle; sleep 1; done" };    WvPipe stream1(argv1[0], argv1, false, true, false);    WvPipe stream2(argv2[0], argv2, false, true, false);    stream1.autoforward(*wvcon);    stream2.autoforward(*wvcon);        WvStreamList l;    l.append(&stream1, false);    l.append(&stream2, false);        while (stream1.isok() || stream2.isok())    {	if (l.select(-1))	    l.callback();    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?