mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-14 07:03:44 +01:00
clean up smartlist_string_isin so callers don't have to manage bufs
themselves svn:r3338
This commit is contained in:
parent
70b3208f0a
commit
51f47d746e
@ -132,6 +132,12 @@ int smartlist_string_isin(const smartlist_t *sl, const char *element) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int smartlist_string_num_isin(const smartlist_t *sl, int num) {
|
||||||
|
char buf[16];
|
||||||
|
tor_snprintf(buf,sizeof(buf),"%d", num);
|
||||||
|
return smartlist_string_isin(sl, buf);
|
||||||
|
}
|
||||||
|
|
||||||
/** Return true iff some element E of sl2 has smartlist_isin(sl1,E).
|
/** Return true iff some element E of sl2 has smartlist_isin(sl1,E).
|
||||||
*/
|
*/
|
||||||
int smartlist_overlap(const smartlist_t *sl1, const smartlist_t *sl2) {
|
int smartlist_overlap(const smartlist_t *sl1, const smartlist_t *sl2) {
|
||||||
|
@ -31,6 +31,7 @@ void smartlist_add_all(smartlist_t *sl, const smartlist_t *s2);
|
|||||||
void smartlist_remove(smartlist_t *sl, void *element);
|
void smartlist_remove(smartlist_t *sl, void *element);
|
||||||
int smartlist_isin(const smartlist_t *sl, void *element);
|
int smartlist_isin(const smartlist_t *sl, void *element);
|
||||||
int smartlist_string_isin(const smartlist_t *sl, const char *element);
|
int smartlist_string_isin(const smartlist_t *sl, const char *element);
|
||||||
|
int smartlist_string_num_isin(const smartlist_t *sl, int num);
|
||||||
int smartlist_overlap(const smartlist_t *sl1, const smartlist_t *sl2);
|
int smartlist_overlap(const smartlist_t *sl1, const smartlist_t *sl2);
|
||||||
void smartlist_intersect(smartlist_t *sl1, const smartlist_t *sl2);
|
void smartlist_intersect(smartlist_t *sl1, const smartlist_t *sl2);
|
||||||
void smartlist_subtract(smartlist_t *sl1, const smartlist_t *sl2);
|
void smartlist_subtract(smartlist_t *sl1, const smartlist_t *sl2);
|
||||||
|
Loading…
Reference in New Issue
Block a user