[PATCH 1/4] Add null-terminated list interface.

walter harms wharms at bfs.de
Thu Aug 11 03:52:51 PDT 2011



Am 11.08.2011 05:20, schrieb Peter Hutterer:
> This is a set of macros to provide a struct list-alike interface for classic
> linked lists such as the XF86OptionRec or the DeviceIntRec. The typical
> format for these is to have a "struct foo *next" pointer in each struct foo
> and walk through those. These macros provide a few basic functions to add to,
> remove from and iterate through these lists.
> 
> While struct list is in some ways more flexible, switching legacy code to
> use struct list is not alway viable. These macros at least reduce the amount
> of open-coded lists.
> 

hello,

did you take a look at "man queue" ? glibc and BSD* provide a sys/queue.h
that has a set of macro to support linked lists.

re,
 wh


More information about the xorg-devel mailing list