int readline_getc_function(FILE *)
{
if (senf::console::detail::ReadlineClientReader::active())
- return senf::console::detail::ReadlineClientReader::instance().getc()
+ return senf::console::detail::ReadlineClientReader::instance().getc();
else
return -1;
}
prefix_ senf::console::detail::ReadlineClientReader::ReadlineClientReader(Client & client)
: ClientReader(client), ch_ (-1), skipChars_ (0),
- schedBinding_ ( client.handle(),
- senf::membind(&ReadlineClientReader::charEvent, this),
- Scheduler::EV_READ,
- false ),
+ readevent_ ( "ReadlineClientReader", senf::membind(&ReadlineClientReader::charEvent, this),
+ client.handle(), scheduler::FdEvent::EV_READ, false ),
terminate_ (false)
{
if (instance_ != 0)
0xFF, 0xFB, 0x03, // IAC WILL SGA
0x00 };
handle().write(options, options+sizeof(options));
+ handle().write(std::string("(readline support enabled)\r\n"));
strncpy(promptBuffer_, promptString().c_str(), 1024);
promptBuffer_[1023] = 0;
_rl_bell_preference = 0; // Set this *after* the config file has been read
- schedBinding_.enable();
+ readevent_.enable();
}
prefix_ senf::console::detail::ReadlineClientReader::~ReadlineClientReader()
boost::replace_all(data, "\xff", "\xff\xff");
}
-prefix_ void senf::console::detail::ReadlineClientReader::charEvent(Scheduler::EventId event)
+prefix_ void senf::console::detail::ReadlineClientReader::charEvent(int event)
{
char ch;
- if (event != Scheduler::EV_READ || handle().read(&ch, &ch+1) <= &ch) {
+ if (event != scheduler::FdEvent::EV_READ || handle().read(&ch, &ch+1) <= &ch) {
stopClient();
return;
}