summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-02-21 18:45:11 +0000
committerNick Mathewson <nickm@torproject.org>2008-02-21 18:45:11 +0000
commit5c03f82a650e3986c37466197d79d85906cce671 (patch)
treee3dd766777ef56175d09c3c76e51c8535746ba46 /src/common
parent6b50f5ae5d1d76f151b7f4ca6cb44cbe6dc05fc3 (diff)
downloadtor-5c03f82a650e3986c37466197d79d85906cce671.tar.gz
tor-5c03f82a650e3986c37466197d79d85906cce671.zip
r18345@catbus: nickm | 2008-02-21 13:45:04 -0500
Do the last part of arma's fix for bug 437: Track the origin of every addrmap, and use this info so we can remove all the trackhostexits-originated mappings for a given exit. svn:r13660
Diffstat (limited to 'src/common')
-rw-r--r--src/common/container.h7
-rw-r--r--src/common/torint.h10
2 files changed, 17 insertions, 0 deletions
diff --git a/src/common/container.h b/src/common/container.h
index 72fbfcd318..db53dcb71b 100644
--- a/src/common/container.h
+++ b/src/common/container.h
@@ -286,6 +286,13 @@ DECLARE_MAP_FNS(digestmap_t, const char *, digestmap_);
/** Used to end a DIGESTMAP_FOREACH() block. */
#define DIGESTMAP_FOREACH_END MAP_FOREACH_END
+#define STRMAP_FOREACH(map, keyvar, valtype, valvar) \
+ MAP_FOREACH(strmap_, map, const char *, keyvar, valtype, valvar)
+#define STRMAP_FOREACH_MODIFY(map, keyvar, valtype, valvar) \
+ MAP_FOREACH_MODIFY(strmap_, map, const char *, keyvar, valtype, valvar)
+#define STRMAP_FOREACH_END MAP_FOREACH_END
+
+
void* strmap_set_lc(strmap_t *map, const char *key, void *val);
void* strmap_get_lc(const strmap_t *map, const char *key);
void* strmap_remove_lc(strmap_t *map, const char *key);
diff --git a/src/common/torint.h b/src/common/torint.h
index 2d9c3b031f..e6f3180e96 100644
--- a/src/common/torint.h
+++ b/src/common/torint.h
@@ -267,6 +267,16 @@ typedef uint32_t uintptr_t;
#endif
#endif
+#ifndef SHORT_MAX
+#if (SIZEOF_SHORT == 2)
+#define SHORT_MAX 0x7fff
+#elif (SIZEOF_SHORT == 4)
+#define SHORT_MAX 0x7fffffff
+#else
+#error "Can't define SHORT_MAX"
+#endif
+#endif
+
#ifndef TIME_MAX
#ifdef TIME_T_IS_SIGNED