summaryrefslogtreecommitdiff
path: root/src/iobuf.c
Commit message (Collapse)AuthorAgeFilesLines
* janitor: fix compiler warningsHenrik Rydberg2010-06-221-0/+1
| | | | Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* mtdev_get: return number of retrieved events if error occursChase Douglas2010-06-221-4/+2
| | | | | | | | Otherwise, we pull events, but return -1. We should send the events we were able to retrieve for now. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Restructure mtdev apiHenrik Rydberg2010-06-191-14/+23
| | | | | | | | | | | | | Split the api into plumbing and porcelain layers and move the plumbing part to its own optional header file. The main usecase is to fetch events from the device, route them through the converter and extract the processed events. To simplify the API, replace the intermediate mtdev_pull() function by the higher-level mtdev_get(). This function does all the required steps, and has the same semantics as read(). Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Correct semantic error in mtdev_idleHenrik Rydberg2010-06-181-6/+2
| | | | | | | | | The current semantics, that a non-empty conversion pipe means the device is not idle, is not very useful. This patch changes the semantics to simply checking if the fetch buffer is empty, and if there are no events to fetch from the device. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Allow max_events to be zero in mtdev_pull()Henrik Rydberg2010-06-181-0/+2
| | | | | | | When reading from non-blocking devices, it makes sense to read all events available. This patch lets a zero max_events achieve that. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Rectify argument order in mtdev_fetchHenrik Rydberg2010-06-181-2/+2
| | | | | | | The argument order in mtdev_fetch() differs from all other usages involved the file descriptor. Fixed with this patch. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Add idle functionHenrik Rydberg2010-06-171-0/+12
| | | | | | | This patch adds the mtdev_idle() function, which checks the kernel device for activity. Useful when implementing timing logic. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Initial load of mtdev projectHenrik Rydberg2010-06-171-0/+69
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>