return v;
}
-/*! Inserts str into map, returns 0 on success */
EXPORT int map_set(map_t *map, const char *str, void *val)
{
const uint8_t *const ubytes = (void *)str;
/** Returns value if map contains str. Note: NULL may mean two different things. */
void *map_get(map_t *map, const char *str);
-/** Inserts str into map, returns 0 on suceess */
+/** Inserts str into map. Returns 0 if new, 1 if replaced, or ENOMEM. */
int map_set(map_t *map, const char *str, void *val);
/** Deletes str from the map, returns 0 on suceess */
map_walk_prefixed((map), "", (callback), (baton))
/**
- * Calls callback for all strings in map with the given prefix
+ * Calls callback for all strings in map with the given prefix.
+ * Returns value immediately if a callback returns nonzero.
+ *
* @param map
* @param prefix required string prefix (empty => all strings)
* @param callback callback parameters are (key, value, baton)
#define set_contains(set, str) \
map_contains((set), (str))
-/*! Inserts str into set, returns 0 on suceess */
+/*! Inserts str into set. Returns 0 if new, 1 if already present, or ENOMEM. */
#define set_add(set, str) \
map_set((set), (str), (void *)1)