Loading src/common/address.h +1 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #include "lib/cc/torint.h" #include "common/compat.h" #include "common/container.h" #include "common/util_bug.h" #ifdef ADDRESS_PRIVATE Loading Loading @@ -376,4 +377,3 @@ STATIC smartlist_t *get_interface_addresses_ioctl(int severity, #endif /* defined(ADDRESS_PRIVATE) */ #endif /* !defined(TOR_ADDRESS_H) */ src/common/container.c +11 −2 Original line number Diff line number Diff line Loading @@ -11,9 +11,7 @@ * a digest-to-void* map. **/ #include "common/compat.h" #include "common/util.h" #include "common/torlog.h" #include "common/container.h" #include "lib/crypt_ops/crypto_digest.h" Loading Loading @@ -113,6 +111,17 @@ smartlist_add_all(smartlist_t *s1, const smartlist_t *s2) s1->num_used = (int) new_size; } /** Append a copy of string to sl */ void smartlist_add_strdup(struct smartlist_t *sl, const char *string) { char *copy; copy = tor_strdup(string); smartlist_add(sl, copy); } /** Remove all elements E from sl such that E==element. Preserve * the order of any elements before E, but elements after E can be * rearranged. Loading src/common/container.h +10 −2 Original line number Diff line number Diff line Loading @@ -6,7 +6,15 @@ #ifndef TOR_CONTAINER_H #define TOR_CONTAINER_H #include "common/util.h" #include <stddef.h> #include <stdlib.h> #include <string.h> #include "lib/cc/compat_compiler.h" #include "lib/cc/torint.h" #include "lib/testsupport/testsupport.h" #include "lib/malloc/util_malloc.h" #include "common/util_bug.h" #include "siphash.h" /** A resizeable list of pointers, with associated helpful functionality. Loading Loading @@ -34,6 +42,7 @@ MOCK_DECL(void, smartlist_free_, (smartlist_t *sl)); void smartlist_clear(smartlist_t *sl); void smartlist_add(smartlist_t *sl, void *element); void smartlist_add_all(smartlist_t *sl, const smartlist_t *s2); void smartlist_add_strdup(struct smartlist_t *sl, const char *string); void smartlist_remove(smartlist_t *sl, const void *element); void smartlist_remove_keeporder(smartlist_t *sl, const void *element); void *smartlist_pop_last(smartlist_t *sl); Loading Loading @@ -739,4 +748,3 @@ third_quartile_uint32(uint32_t *array, int n_elements) } #endif /* !defined(TOR_CONTAINER_H) */ src/common/util.c +0 −11 Original line number Diff line number Diff line Loading @@ -3279,17 +3279,6 @@ smartlist_add_vasprintf(struct smartlist_t *sl, const char *pattern, smartlist_add(sl, str); } /** Append a copy of string to sl */ void smartlist_add_strdup(struct smartlist_t *sl, const char *string) { char *copy; copy = tor_strdup(string); smartlist_add(sl, copy); } /** Return a new list containing the filenames in the directory <b>dirname</b>. * Return NULL on error or if <b>dirname</b> is not a directory. */ Loading src/common/util.h +0 −1 Original line number Diff line number Diff line Loading @@ -167,7 +167,6 @@ void smartlist_add_asprintf(struct smartlist_t *sl, const char *pattern, ...) void smartlist_add_vasprintf(struct smartlist_t *sl, const char *pattern, va_list args) CHECK_PRINTF(2, 0); void smartlist_add_strdup(struct smartlist_t *sl, const char *string); /* Time helpers */ long tv_udiff(const struct timeval *start, const struct timeval *end); Loading Loading
src/common/address.h +1 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #include "lib/cc/torint.h" #include "common/compat.h" #include "common/container.h" #include "common/util_bug.h" #ifdef ADDRESS_PRIVATE Loading Loading @@ -376,4 +377,3 @@ STATIC smartlist_t *get_interface_addresses_ioctl(int severity, #endif /* defined(ADDRESS_PRIVATE) */ #endif /* !defined(TOR_ADDRESS_H) */
src/common/container.c +11 −2 Original line number Diff line number Diff line Loading @@ -11,9 +11,7 @@ * a digest-to-void* map. **/ #include "common/compat.h" #include "common/util.h" #include "common/torlog.h" #include "common/container.h" #include "lib/crypt_ops/crypto_digest.h" Loading Loading @@ -113,6 +111,17 @@ smartlist_add_all(smartlist_t *s1, const smartlist_t *s2) s1->num_used = (int) new_size; } /** Append a copy of string to sl */ void smartlist_add_strdup(struct smartlist_t *sl, const char *string) { char *copy; copy = tor_strdup(string); smartlist_add(sl, copy); } /** Remove all elements E from sl such that E==element. Preserve * the order of any elements before E, but elements after E can be * rearranged. Loading
src/common/container.h +10 −2 Original line number Diff line number Diff line Loading @@ -6,7 +6,15 @@ #ifndef TOR_CONTAINER_H #define TOR_CONTAINER_H #include "common/util.h" #include <stddef.h> #include <stdlib.h> #include <string.h> #include "lib/cc/compat_compiler.h" #include "lib/cc/torint.h" #include "lib/testsupport/testsupport.h" #include "lib/malloc/util_malloc.h" #include "common/util_bug.h" #include "siphash.h" /** A resizeable list of pointers, with associated helpful functionality. Loading Loading @@ -34,6 +42,7 @@ MOCK_DECL(void, smartlist_free_, (smartlist_t *sl)); void smartlist_clear(smartlist_t *sl); void smartlist_add(smartlist_t *sl, void *element); void smartlist_add_all(smartlist_t *sl, const smartlist_t *s2); void smartlist_add_strdup(struct smartlist_t *sl, const char *string); void smartlist_remove(smartlist_t *sl, const void *element); void smartlist_remove_keeporder(smartlist_t *sl, const void *element); void *smartlist_pop_last(smartlist_t *sl); Loading Loading @@ -739,4 +748,3 @@ third_quartile_uint32(uint32_t *array, int n_elements) } #endif /* !defined(TOR_CONTAINER_H) */
src/common/util.c +0 −11 Original line number Diff line number Diff line Loading @@ -3279,17 +3279,6 @@ smartlist_add_vasprintf(struct smartlist_t *sl, const char *pattern, smartlist_add(sl, str); } /** Append a copy of string to sl */ void smartlist_add_strdup(struct smartlist_t *sl, const char *string) { char *copy; copy = tor_strdup(string); smartlist_add(sl, copy); } /** Return a new list containing the filenames in the directory <b>dirname</b>. * Return NULL on error or if <b>dirname</b> is not a directory. */ Loading
src/common/util.h +0 −1 Original line number Diff line number Diff line Loading @@ -167,7 +167,6 @@ void smartlist_add_asprintf(struct smartlist_t *sl, const char *pattern, ...) void smartlist_add_vasprintf(struct smartlist_t *sl, const char *pattern, va_list args) CHECK_PRINTF(2, 0); void smartlist_add_strdup(struct smartlist_t *sl, const char *string); /* Time helpers */ long tv_udiff(const struct timeval *start, const struct timeval *end); Loading