X-Git-Url: https://git.llucax.com/software/eventxx.git/blobdiff_plain/603c9c6d30d790ebe838ae858aeb1b365e06fef0..00f3b0a3783ac1d8fa7d89afeb5b9f4fd1cc8ead:/README?ds=sidebyside diff --git a/README b/README index 380ecfb..eb2a2ab 100644 --- a/README +++ b/README @@ -25,19 +25,17 @@ possible. Please, visit the @eventxx website for the latest version of this documentation. -You can always get the current -release from the -release -directory or grab the -most up -to date sources from the git repository. +You can always get the current +release from the release directory or +grab the most up to date sources from +the git repository. -You can also take a look the the eventxx -gitweb interface to see the latest changes online or subscribe to its -RSS -feed to follow the development. +You can also take a look the the eventxx gitweb +interface to see the latest changes online or subscribe to its +Atom feed to follow the development. + +For more information, bug reports or support, please visit the +eventxx project. @section Usage @@ -92,6 +90,7 @@ struct handler handler(eventxx::dispatcher& d): d(d), i(0) {} void operator() (int signum, eventxx::type event) { + std::cout << ++i << " interrupts, "; if (i < 5) std::cout << "keep going...\n"; else { @@ -101,19 +100,18 @@ struct handler } }; -void sighandler(int signum, short event, void* data) +void timer_handler(int, short, void*) { - int& i = *static_cast< int* >(data); - std::cout << ++i << " interrupts, "; + std::cout << "Press Ctrl-C 5 times to quit.\n"; } int main() { eventxx::dispatcher d; handler h(d); - eventxx::csignal sigev(SIGINT, sighandler, &h.i); + eventxx::ctimer t(timer_handler); eventxx::signal< handler > e(SIGINT, h); - d.add(sigev); + d.add(t, eventxx::time(1)); // 1 second d.add(e); d.dispatch(); return 0; @@ -126,10 +124,9 @@ examples related page. @section Status -I think the library is moderately stable now. The library has no support -for buffered events yet, but patches are welcome. It doesn't support the -HTTP stuff, and probably never will because that has nothing to do with -event handling. +I think the library is stable now. The library has no support for buffered +events yet, but patches are welcome. It doesn't support the HTTP stuff, and +probably never will because that has nothing to do with event handling. @libevent had a memory leak before version 1.3b (before 1.2 it didn't even had a way free that memory, from version 1.2 to 1.3a, if you tried to free @@ -152,13 +149,14 @@ it. @author Leandro Lucarella -@version 0.7 +@version 1.0 @par License -This program is under the BOLA license (see -http://auriga.wearlab.de/~alb/bola/ for more details or read the -LICENSE -file itself, it's very short and it basically says it's Public Domain). +This program is under the BOLA +License (see the license website or the +LICENSE +file itself for more details, it's very short and it basically says it's +Public Domain). */