#include "lib/cc/torint.h"
#include "common/compat.h"
#include "common/container.h"
+#include "common/util_bug.h"
#ifdef ADDRESS_PRIVATE
#endif /* defined(ADDRESS_PRIVATE) */
#endif /* !defined(TOR_ADDRESS_H) */
-
* 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"
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.
#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.
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);
}
#endif /* !defined(TOR_CONTAINER_H) */
-
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.
*/
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);