]> git.ozlabs.org Git - ccan/commit - ccan/tcon/test/run-container.c
tcon: Encode information on container members in "type" canaries
authorDavid Gibson <david@gibson.dropbear.id.au>
Tue, 20 Oct 2015 02:18:17 +0000 (13:18 +1100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Sun, 25 Oct 2015 12:32:44 +0000 (23:32 +1100)
commit0ddea4131eca28437638cdaf9394324fafab33da
tree9aedc0b200ed451745cdbac1e6c96db5eeac2f6c
parentfd48aee6393bda1e4eda9f9e52e6d9f818b77211
tcon: Encode information on container members in "type" canaries

Add "container canaries" to tcon.  This allows information about a specific
member of a container structure to be encoded with TCON or TCON_WRAP.  Once
that's done, tcon_container_of() and tcon_member_of() can be used to
translate between member and container pointers based on the canary
information, without having to repeat the type and member details.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
ccan/tcon/tcon.h
ccan/tcon/test/compile_fail-container1.c [new file with mode: 0644]
ccan/tcon/test/compile_fail-container1w.c [new file with mode: 0644]
ccan/tcon/test/compile_fail-container2.c [new file with mode: 0644]
ccan/tcon/test/compile_fail-container2w.c [new file with mode: 0644]
ccan/tcon/test/compile_fail-container3.c [new file with mode: 0644]
ccan/tcon/test/compile_fail-container3w.c [new file with mode: 0644]
ccan/tcon/test/compile_fail-container4.c [new file with mode: 0644]
ccan/tcon/test/compile_fail-container4w.c [new file with mode: 0644]
ccan/tcon/test/run-container.c [new file with mode: 0644]