diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-02-16 20:00:43 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-02-16 20:00:43 +0000 |
commit | d4aaffc6e7af3577696f55a1ffbcb6a2f98fbddb (patch) | |
tree | a5a84c69319e287d9b2013e548a416f0203fc251 /src/or/config.c | |
parent | e5d3269b10754b9b46bc19234bbfabd3e631f733 (diff) | |
download | tor-d4aaffc6e7af3577696f55a1ffbcb6a2f98fbddb.tar.gz tor-d4aaffc6e7af3577696f55a1ffbcb6a2f98fbddb.zip |
r11824@catbus: nickm | 2007-02-16 13:16:47 -0500
Move all struct-offset-manipulation macros into util.h, and use them consistently. Because there are days when "SUBTYPE_P(handle, subtype, _base)" is just easier to read and write than "(basetp*)(((handle) - STRUCT_OFFSET(subtype, _base))".
svn:r9592
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/src/or/config.c b/src/or/config.c index 8b1b4909d0..279ddd5bb7 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -102,18 +102,6 @@ typedef struct config_var_t { const char *initvalue; /**< String (or null) describing initial value. */ } config_var_t; -/** Macro: yield a pointer to the field at position <b>off</b> within the - * structure <b>st</b>. Example: - * <pre> - * struct a { int foo; int bar; } x; - * off_t bar_offset = STRUCT_OFFSET(struct a, bar); - * int *bar_p = STRUCT_VAR_P(&x, bar_offset); - * *bar_p = 3; - * </pre> - */ -#define STRUCT_VAR_P(st, off) \ - ((void*) ( ((char*)st) + off ) ) - /** An entry for config_vars: "The option <b>name</b> has type * CONFIG_TYPE_<b>conftype</b>, and corresponds to * or_options_t.<b>member</b>" |