#include "lib/intmath/addsub.h"
#include "lib/intmath/muldiv.h"
#include "lib/intmath/cmp.h"
+#include "lib/log/ratelim.h"
#include "common/util_bug.h"
#ifndef O_BINARY
orconfig.h
lib/cc/*.h
lib/compress/*.h
+lib/log/*.h
# XXX I'd like to remove this.
common/*.h
#include "lib/malloc/util_malloc.h"
#include "lib/defs/digest_sizes.h"
#include "lib/ctime/di_ops.h"
+#include "lib/string/compat_ctype.h"
#include "lib/string/util_string.h"
#include "lib/string/printf.h"
+#include "common/util_bug.h"
+
#include <stdlib.h>
#include <string.h>
#define TOR_SMARTLIST_H
#include <stddef.h>
+#include <stdarg.h>
+
#include "lib/cc/compat_compiler.h"
-#include "common/util_bug.h"
+#include "lib/cc/torint.h"
#include "lib/testsupport/testsupport.h"
/** A resizeable list of pointers, with associated helpful functionality.
*/
static inline int smartlist_len(const smartlist_t *sl);
static inline int smartlist_len(const smartlist_t *sl) {
- tor_assert(sl);
+ raw_assert(sl);
return (sl)->num_used;
}
/** Return the <b>idx</b>th element of sl.
*/
static inline void *smartlist_get(const smartlist_t *sl, int idx);
static inline void *smartlist_get(const smartlist_t *sl, int idx) {
- tor_assert(sl);
- tor_assert(idx>=0);
- tor_assert(sl->num_used > idx);
+ raw_assert(sl);
+ raw_assert(idx>=0);
+ raw_assert(sl->num_used > idx);
return sl->list[idx];
}
static inline void smartlist_set(smartlist_t *sl, int idx, void *val) {
- tor_assert(sl);
- tor_assert(idx>=0);
- tor_assert(sl->num_used > idx);
+ raw_assert(sl);
+ raw_assert(idx>=0);
+ raw_assert(sl->num_used > idx);
sl->list[idx] = val;
}
#else /* !(defined(DEBUG_SMARTLIST)) */
lib/intmath/*.h
lib/string/*.h
lib/testsupport/testsupport.h
+lib/log/*.h
trunnel/pwbox.h
orconfig.h
lib/cc/*.h
lib/ctime/*.h
-
-# XXXX I'd like to remove this
-common/util.h
+lib/err/*.h
+lib/malloc/*.h
#include "orconfig.h"
#include "lib/ctime/di_ops.h"
-#include "common/util.h"
+#include "lib/err/torerr.h"
+#include "lib/malloc/util_malloc.h"
+
+#include <string.h>
/**
* Timing-safe version of memcmp. As memcmp, compare the <b>sz</b> bytes at
di_digest256_map_t *new_ent;
{
void *old_val = dimap_search(*map, key, NULL);
- tor_assert(! old_val);
- tor_assert(val);
+ raw_assert(! old_val);
+ raw_assert(val);
}
new_ent = tor_malloc_zero(sizeof(di_digest256_map_t));
new_ent->next = *map;
rand_val = INT64_MAX;
}
}
- tor_assert(total_so_far == total);
- tor_assert(n_chosen == 1);
- tor_assert(i_chosen >= 0);
- tor_assert(i_chosen < n_entries);
+ raw_assert(total_so_far == total);
+ raw_assert(n_chosen == 1);
+ raw_assert(i_chosen >= 0);
+ raw_assert(i_chosen < n_entries);
return i_chosen;
}
+orconfig.h
lib/cc/*.h
+lib/container/smartlist.h
+lib/err/*.h
+lib/intmath/*.h
+lib/log/*.h
lib/malloc/*.h
+lib/string/*.h
+lib/testsupport/*.h
+lib/wallclock/*.h
+
+micro-revision.i
\ No newline at end of file
#include "lib/log/ratelim.h"
#include "lib/malloc/util_malloc.h"
+#include "lib/string/printf.h"
/** If the rate-limiter <b>lim</b> is ready at <b>now</b>, return the number
* of calls to rate_limit_is_ready (including this one!) since the last time
#ifndef TOR_RATELIM_H
#define TOR_RATELIM_H
+#include <time.h>
+
/* Rate-limiter */
/** A ratelim_t remembers how often an event is occurring, and how often
#include "orconfig.h"
#include <stdarg.h>
-// #include <stdio.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_SYS_TIME_H
#define LOG_PRIVATE
#include "lib/log/torlog.h"
+#include "lib/log/ratelim.h"
+#include "lib/lock/compat_mutex.h"
#include "lib/container/smartlist.h"
#include "lib/err/torerr.h"
#include "lib/intmath/bits.h"
lib/err/*.h
lib/testsupport/testsupport.h
lib/tls/*.h
+lib/log/*.h
ciphers.inc
orconfig.h
+lib/log/*.h
lib/trace/*.h
-
-# XXXX
-common/torlog.h