X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fstrset%2Fstrset.h;h=250ce7189614a357b89cb2bc7620283a2254caaa;hb=4f2f6f1eba6cc2bcb0683c50269d1dbbe73ed167;hp=8d0d307e34c483d2b21351defe68d0ba0baab3c1;hpb=ab83de953730f5e5e571dbf69ffb3cc685a102dc;p=ccan diff --git a/ccan/strset/strset.h b/ccan/strset/strset.h index 8d0d307e..250ce718 100644 --- a/ccan/strset/strset.h +++ b/ccan/strset/strset.h @@ -52,7 +52,8 @@ static inline bool strset_empty(const struct strset *set) * @set: the set. * @member: the string to search for. * - * Returns the member, or NULL if it isn't in the set. + * Returns the member, or NULL if it isn't in the set (and sets errno + * = ENOENT). * * Example: * if (strset_test(&set, "hello")) @@ -65,8 +66,8 @@ char *strset_test(const struct strset *set, const char *member); * @set: the set. * @member: the string to place in the set. * - * This returns false if we run out of memory, or (more normally) if that - * string already appears in the set. + * This returns false if we run out of memory (errno = ENOMEM), or + * (more normally) if that string already appears in the set (EEXIST). * * Note that the pointer is placed in the set, the string is not copied. If * you want a copy in the set, use strdup(). @@ -82,7 +83,9 @@ bool strset_set(struct strset *set, const char *member); * @set: the set. * @member: the string to remove from the set. * - * This returns the string which was passed to strset_set(), or NULL. + * This returns the string which was passed to strset_set(), or NULL if + * the string was not in the map (in which case it sets errno = ENOENT). + * * This means that if you allocated a string (eg. using strdup()), you can * free it here. *