]> git.ozlabs.org Git - ccan/blobdiff - ccan/container_of/container_of.h
modules: update documentation examples so they compile under ccanlint.
[ccan] / ccan / container_of / container_of.h
index 1f4b18e4426a1c3c0bfc5c47e2a4e807ae7e2a52..de3f4505162a5416f477d5624e0049da6d2abeec 100644 (file)
@@ -3,7 +3,7 @@
 #include <stddef.h>
 
 #include "config.h"
 #include <stddef.h>
 
 #include "config.h"
-#include "check_type/check_type.h"
+#include <ccan/check_type/check_type.h>
 
 /**
  * container_of - get pointer to enclosing structure
 
 /**
  * container_of - get pointer to enclosing structure
  * subtraction to return the pointer to the enclosing type.
  *
  * Example:
  * subtraction to return the pointer to the enclosing type.
  *
  * Example:
- *     struct info
- *     {
+ *     struct foo {
+ *             int fielda, fieldb;
+ *             // ...
+ *     };
+ *     struct info {
  *             int some_other_field;
  *             struct foo my_foo;
  *     };
  *
  *             int some_other_field;
  *             struct foo my_foo;
  *     };
  *
- *     struct info *foo_to_info(struct foo *foop)
+ *     static struct info *foo_to_info(struct foo *foo)
  *     {
  *             return container_of(foo, struct info, my_foo);
  *     }
  *     {
  *             return container_of(foo, struct info, my_foo);
  *     }
  * subtraction to return the pointer to the enclosing type.
  *
  * Example:
  * subtraction to return the pointer to the enclosing type.
  *
  * Example:
- *     struct info
- *     {
- *             int some_other_field;
- *             struct foo my_foo;
- *     };
- *
- *     struct info *foo_to_info(struct foo *foop)
+ *     static struct info *foo_to_i(struct foo *foo)
  *     {
  *             struct info *i = container_of_var(foo, i, my_foo);
  *             return i;
  *     {
  *             struct info *i = container_of_var(foo, i, my_foo);
  *             return i;