33 Commits
Author SHA1 Message Date
Joachim Wiberg 0f59096154 Update copyright years
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2024-01-04 17:16:49 +01:00
Joachim Wiberg 1db9b6eb8e examples: update .gitignore
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-06-08 20:28:59 +02:00
Joachim Wiberg 042f1b59bf examples: update comments
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-17 08:10:52 +01:00
Joachim Wiberg 8f96965d35 examples: add fork + signals + timer example
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-17 08:09:00 +01:00
Joachim Wiberg 53cad7bee2 examples: add timer + signal example
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-16 20:02:24 +01:00
Joachim Wiberg 86e01be26e Update copyright years and maintainer surname
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-02-12 09:15:40 +01:00
Joachim Nilsson a334d230a1 Update copyright years
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-04-06 12:45:50 +02:00
Joachim Nilsson 2a709f739d Reverse christmas tree and simplify a bit
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-04-06 12:45:29 +02:00
Joachim Nilsson c4ac2eae5d Update example, use /dev/input/js0, the first joystick
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2018-05-31 23:37:39 +02:00
Joachim Nilsson 4d1875e49c Update, file used by redirect example
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-11-14 13:31:47 +01:00
Joachim Nilsson 2bea4192db Handle UEV_HUP properly in examples and unit tests
If an I/O watcher callback fails to read(), returning zero, we check
events for UEV_HUP to detect EOF or socket remote end shutdown().

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-11-14 12:56:39 +01:00
Joachim Nilsson d52254b4ec Make sure to restart the I/O watcher on UEV_ERROR
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-11-14 12:17:41 +01:00
Joachim Nilsson ddfc1460eb redirect: Update example to handle new failure mode
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-11-11 13:59:05 +01:00
Joachim Nilsson 71e6d78fdc redirect: Use err.h functions for error handling
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-11-11 13:58:35 +01:00
Joachim Nilsson 5929295c37 Update joystick example with new failure mode
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-11-11 13:57:43 +01:00
Joachim Nilsson 9642443a7c Clean up redirect example a bit
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-10-22 11:16:10 +02:00
Joachim Nilsson 98748277f3 Add Emacs hints for indentation
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-10-21 20:52:30 +02:00
Joachim Nilsson d46ff8e396 redirect: Make sure example application does not exit on len==0
We want to continue running the event loop until it is exited properly,
not if the callback for stdin detects a short read.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-10-21 19:54:00 +02:00
Joachim Nilsson 58ec8e1d6f Simple example of stdin redirect problem, issue #12
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-10-21 18:46:55 +02:00
Joachim Nilsson ce4f8d6ef5 Follow-up to ed5c9bb, fix examples Makefile after relocation
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-10-21 12:21:51 +02:00
Joachim Nilsson b6b4afc11b Update copyright years
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2017-09-19 09:09:29 +02:00
Joachim Nilsson de4d969ca0 Move complete test from examples/ --> tests/
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-11-22 01:12:47 +01:00
Joachim Nilsson 389c3b27ab Move cronrun test from examples/ --> tests/
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-11-22 01:09:38 +01:00
Joachim Nilsson 03a29440ef Move signal test from examples/ --> tests/
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-11-22 01:06:48 +01:00
Joachim Nilsson 59e1d376db cron: New API for absolute timers
This patch adds support for at/cron-like jobs that need an absolute
timer.  The API supports waking up with an UEV_HUP callback event if the
wall clock changed due to NTP or user input while waiting.

- uev_cron_init()
- uev_cron_set()
- uev_cron_start()
- uev_cron_stop()

A very simple cronrun example/test program is also included.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-10-30 15:08:34 +01: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
Joachim Nilsson 71697266ed Simplify and clean up joystick example
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-03-13 22:36:46 +01:00
Joachim Nilsson acf6bbcbaf Initial conversion to the GNU configure and build system
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2016-01-10 18:21:52 +01: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 1f9558059a API change -- Remove first ctx argument and add event mask to callback
There really does not exist a good reason for us sending a `uev_ctx_t *`
pointer as the first argument to event callbacks.  If the callback needs
to reference the context, it can find the ctx pointer in the `uev_t *w`.

This patch removes the first argument from all callbacks and also fixes
a slight bug in that the event loop never returned the actual event that
triggered the callback!

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-06-09 13:10:20 +02:00
Joachim Nilsson f29f3b7f38 Minor followup to bfcea55, add else statment.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-02-16 00:25:38 +01:00
Joachim Nilsson bfcea55b1e Add slightly odd signal testing + fork() example
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-02-15 18:13:26 +01:00
Joachim Nilsson 5ecc6d64b4 Move test.c and joystick.c to examples/
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2015-02-15 18:13:09 +01:00