chiark / gitweb /
util: introduce container_of() macro
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Thu, 26 Apr 2012 16:36:01 +0000 (13:36 -0300)
committerKay Sievers <kay@vrfy.org>
Sun, 29 Apr 2012 17:14:05 +0000 (19:14 +0200)
commitc4326aa4af424ada8ab9e6fe77035db1cf222ffa
tree14f47bfbae8c0da4212ee22ad73f1bbeeee9e0bc
parentc8f8394a9309d4390daac70b736b34d0b6734f95
util: introduce container_of() macro

This macro comes from kernel and it's useful for unwrapping structs
inside another one. The generated code is actually the same to the one
where this logic is used in udev, but using this macro is much cleaner
and less error prone.
src/shared/util.h