Commit Graph
14 Commits
Author SHA1 Message Date
Joachim Nilsson 0de9cb6321 Adapt bench.c (from libev) to libuev, no libev/libevent API wrappers available
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2013-08-06 02:04:41 +02:00
Joachim Nilsson 82a09196f0 Add support for make check using Sparse
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2013-08-06 02:00:24 +02:00
Joachim Nilsson d6e0146803 Major refactor: API change, code cleanup, remove calloc()/free()
- Rename all _create() functions --> _init()
- Rename all _delete() functions --> _stop()
- Watchers are automatically started, except
- Timer watchers are automatically started by uev_run()
- Allow I/O watchers to watch either EV_READ/EV_WRITE or both events
- Extend callbacks with a received events field
- Remove calloc()/free(), let user handle this
- Make event has-a context when initializing it => simplifies API
- Internal uev_watcher_*() API mostly handles epoll stop/start

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2013-08-06 02:00:24 +02:00
Joachim Nilsson baa02de05f Makefile: Add dist target. 2013-07-23 13:28:49 +02:00
Joachim Nilsson 1319f2ba5a Add support for signals using signalfd(2)
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2013-07-23 03:19:13 +02:00
Joachim Nilsson 9b5be13e62 Split libuev.c into smaller files to help linker
Split libuev.c into one file per watcher type, mostly to give a better
overview and ease of maintenance, but also to help the linker.

Unfortunately this steals a few bytes when linking a full blown app, but
for apps that, e.g., only need I/O watchers and no timers the resulting
binary will be smaller.  This applies to static binaries that are more
common in embedded systems.

$ size libuev.a libuev.so.1
   text	   data	    bss	    dec	    hex	filename
    999	      0	      0	    999	    3e7	main.o (ex libuev.a)
     90	      0	      0	     90	     5a	io.o (ex libuev.a)
    490	      0	      0	    490	    1ea	timer.o (ex libuev.a)
   4380	    696	      8	   5084	   13dc	libuev.so.1

Also, move uev.h back to top from include/libuev/uev.h since a separate
namespace is not needed after the removal of the OpenBSD queue.h copy.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2013-07-23 00:54:52 +02:00
Joachim Nilsson 499cbd2032 Refactor to use modern timerfd and epoll
This is a major refactor of the original design by Flemming Madsen.  It
converts the library timers from poll() to timerfd, which at the same
time also unifies the file and timer watchers into one design.  The idea
is to also add signalfd to the mix later on.

Also a couple of hundred kilobytes smaller, although size a secondary
goal.  The primary goal is to further simplify the internal design and
to continuously strive to employ modern APIs.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2013-07-22 20:25:08 +02:00
Joachim Nilsson 49c72c0914 Create unique include file namespace and fix install/uninstall make targets
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2013-07-21 13:08:40 +02:00
Joachim Nilsson 97398e0a7d Fix Makefile dependency handling and add install/uninstall targets
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2013-07-21 10:20:19 +02:00
Joachim Nilsson 0bba080660 Initial import of Flemming Madsen's LibUEvent
This fork is called libuev and will focus solely on embedded Linux
systems using C.  Patches for other UNIX-like operating systems are
welcome.

- Remove Lua support, will not be used.
- Rename from LibUEvent to libuev where applicable
- Add project's MIT license to top of all files, as is customary
- Add a LICENSE file, as is customary

This MIT licensed code was cloned from the Mercurial repository at
Google http://code.google.com/p/libuevent/ which had mislabled the
license as "New BSD License", which is wrong.  The actual license
of the project is https://en.wikipedia.org/wiki/MIT_License

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2013-07-18 23:37:07 +02:00
fm a2ab7c3685 Lua test coded, not yet running .. 2012-03-16 09:57:35 +01:00
fm c5878c6302 Lua basically running 2012-03-14 22:11:20 +01:00
fm 5c817c20ed Lua binding, done coding 2012-03-14 18:12:16 +01:00
fm 36a937505c Import from compactor 2012-03-14 10:30:20 +01:00