Commit Graph
13 Commits
Author SHA1 Message Date
Joachim Nilsson 9fc5227343 Update copyright years
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-04-22 14:30:56 +02:00
Joachim Nilsson e613248392 Minor style changes and whitespace fixes
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-04-22 14:30:07 +02:00
Joachim Nilsson ac5f01ea22 Remove Emacs version-control handling
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-04-22 14:29:19 +02:00
Markus Svilans a9a78e8bf0 Add support for EPOLLPRI events for i/o watchers 2016-03-16 09:21:07 -04:00
Joachim Nilsson b94023faed Reflow paragraphs to match original line breaks, no change in licensing terms!
While comparing the library layout with libite, I noticed how the
formatting of the license paragraphs in all source files had been
garbled.  This patch restores the orginal line breaks.

Note: Only whitespace changes, no change in licensing terms!

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-06-18 01:36:48 +02:00
Joachim Nilsson fe8f3f19da Massively improve error handling, check for EPOLLHUP & EPOLLERR etc.
- Make sure to listen for EPOLLRDHUP in watchers so users can be
  notified when a peer closes a connection.
- Handle EPOLLHUP and EPOLLERR gracefully.  Even handle spurious
  EPOLLHUP by means of an error counter.  If we receive too many errors
  we now restart the epoll fd and re-add all watchers.
- Return error from `epoll_ctl()` in `uev_watcher_stop()`
- Ignore any error from `uev_watcher_stop()` in `uev_watcher_set()`
- Move LIST_REMOVE() et al from io.c to core uev.c, should be
  done for timer and signal callbacks as well, of course.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-03-04 09:41:22 +01:00
Joachim Nilsson 2f8c45f438 Fix TODO: Add uev_*_start() functions.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-02-15 18:13:36 +01:00
Joachim Nilsson 618480140c Update copyright years and reflow LICENSE file.
Update copyright years of all sources.

Reflow/reformat paragraphs in MIT license to match Finit,
i.e., no content changes only whitespace/linebreak changes.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-01-07 02:11:09 +01:00
Joachim Nilsson 5065440f52 Minor change libuev --> libuEv and bump version for release.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-01-07 01:18:07 +01: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 c69ce87eb8 Rename uev_t --> uev_ctx_t and uev_watcher_t --> uev_t
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2013-08-06 02:00:24 +02:00
Joachim Nilsson b1de765841 Further cleanup, rename uev_io_t --> uev_watcher_t
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2013-07-23 02:25:51 +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