WvStreams
wvstreamex6.cc
1/*
2 * A WvStream example
3 *
4 * Some text about this example...
5 */
6
7#include <wvstream.h>
8
9void mycallback(WvStream &s, void *userdata)
10{
11 WvStream *outstream = (WvStream *)userdata;
12
13 char *str = s.getline();
14 if (str)
15 outstream->print("You said: %s\n", str);
16}
17
18int main()
19{
20 wvcon->setcallback(mycallback, wvcon);
21
22 while (wvcon->isok())
23 {
24 if (wvcon->select(-1))
25 wvcon->callback();
26 }
27}
Unified support for streams, that is, sequences of bytes that may or may not be ready for read/write ...
char * getline(time_t wait_msec=0, char separator='\n', int readahead=1024)
Read up to one line of data from the stream and return a pointer to the internal buffer containing th...