]> git.ozlabs.org Git - ccan/blobdiff - ccan/strmap/strmap.h
endian: add constant versions.
[ccan] / ccan / strmap / strmap.h
index d6104942f4cea6c7cb218bfd386ced9f96ec3b1a..8fabc359acc64e2d4a4603e7097cfe93b3b2be17 100644 (file)
@@ -156,7 +156,7 @@ void strmap_clear_(struct strmap *map);
  * @handle's prototype should be:
  *     bool @handle(const char *member, type value, typeof(arg) arg)
  *
- * If @handle returns true, the iteration will stop.
+ * If @handle returns false, the iteration will stop.
  * You should not alter the map within the @handle function!
  *
  * Example:
@@ -167,9 +167,9 @@ void strmap_clear_(struct strmap *map);
  *     {
  *             // Only dump out num nodes.
  *             if (*(num--) == 0)
- *                     return true;
+ *                     return false;
  *             printf("%s=>%i\n", member, *value);
- *             return false;
+ *             return true;
  *     }
  *
  *     static void dump_map(const struct strmap_intp *map)
@@ -189,8 +189,8 @@ void strmap_clear_(struct strmap *map);
                                                  __typeof__(arg)), (handle)), \
                        (arg))
 void strmap_iterate_(const struct strmap *map,
-                    bool (*handle)(const char *, void *, void *), void *data);
-
+                    bool (*handle)(const char *, void *, void *),
+                    const void *data);
 
 /**
  * strmap_prefix - return a submap matching a prefix