diff options
| author | Üstün Ergenoğlu <ego@ustun.fi> | 2012-02-25 12:56:32 +0200 |
|---|---|---|
| committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-02-26 14:00:53 -0500 |
| commit | a676b8f2576ff85cbdbcf5b443214c0ebd5a5abd (patch) | |
| tree | 43709fa24d3c052fec449201208ba78bf76ea276 /src | |
| parent | protocol.xsl: Rename stylesheet to wayland-protocol.css (diff) | |
| download | wayland-a676b8f2576ff85cbdbcf5b443214c0ebd5a5abd.tar wayland-a676b8f2576ff85cbdbcf5b443214c0ebd5a5abd.tar.gz wayland-a676b8f2576ff85cbdbcf5b443214c0ebd5a5abd.tar.bz2 wayland-a676b8f2576ff85cbdbcf5b443214c0ebd5a5abd.tar.lz wayland-a676b8f2576ff85cbdbcf5b443214c0ebd5a5abd.tar.xz wayland-a676b8f2576ff85cbdbcf5b443214c0ebd5a5abd.tar.zst wayland-a676b8f2576ff85cbdbcf5b443214c0ebd5a5abd.zip | |
util: Comments before wl_list were a bit off, fixed the example usage.
Signed-off-by: Üstün Ergenoğlu <ego@ustun.fi>
Diffstat (limited to 'src')
| -rw-r--r-- | src/wayland-util.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/wayland-util.h b/src/wayland-util.h index 25c0901..7aa2166 100644 --- a/src/wayland-util.h +++ b/src/wayland-util.h @@ -80,10 +80,18 @@ struct wl_object { * * The following code will initialize a list: * - * wl_list_init(foo_list); - * wl_list_insert(foo_list, item1); Pushes item1 at the head - * wl_list_insert(foo_list, item2); Pushes item2 at the head - * wl_list_insert(item2, item3); Pushes item3 after item2 + * struct wl_list foo_list; + * + * struct item_t { + * int foo; + * struct wl_list link; + * }; + * struct item_t item1, item2, item3; + * + * wl_list_init(&foo_list); + * wl_list_insert(&foo_list, &item1.link); Pushes item1 at the head + * wl_list_insert(&foo_list, &item2.link); Pushes item2 at the head + * wl_list_insert(&item2.link, &item3.link);Pushes item3 after item2 * * The list now looks like [item2, item3, item1] * |
