commit | 9576ad4b8f94698aeba5218caf9e9e1f28a6f44d | [log] [tgz] |
---|---|---|
author | Chris Dickens <christopher.a.dickens@gmail.com> | Mon Aug 10 19:01:42 2020 -0700 |
committer | Chris Dickens <christopher.a.dickens@gmail.com> | Mon Aug 10 19:01:42 2020 -0700 |
tree | 77443a6323fd8518c6c98e8cff764e18d395b95d | |
parent | 96898a25ccfde6e87737991000a41695ed6b3812 [diff] |
core: Introduce list iteration helpers The syntax for traversing over lists is somewhat cluttered. It could be made much better with the use of the 'typeof' keyword, but unfortunately this is not universally supported by all compilers. We can, however, improve the situation by introducing some macros for the common cases. To that end, this commit introduces a number of 'for_each' macros that iterate over a specific linked list. Current syntax: list_for_each_entry(itransfer, &ctx->flying_transfers, list, struct usbi_transfer) New syntax: for_each_transfer(ctx, itransfer) Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
libusb is a library for USB device access from Linux, macOS, Windows, OpenBSD/NetBSD, Haiku and Solaris userspace. It is written in C (Haiku backend in C++) and licensed under the GNU Lesser General Public License version 2.1 or, at your option, any later version (see COPYING).
libusb is abstracted internally in such a way that it can hopefully be ported to other operating systems. Please see the PORTING file for more information.
libusb homepage: http://libusb.info/
Developers will wish to consult the API documentation: http://api.libusb.info
Use the mailing list for questions, comments, etc: http://mailing-list.libusb.info
(Please use the mailing list rather than mailing developers directly)