From: Nick Mathewson Date: Fri, 14 Feb 2020 14:39:36 +0000 (-0500) Subject: Add a "location" field for subsystems to declare which file they are in. X-Git-Tag: tor-0.4.5.0-alpha-dev~74^2~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=53d74c0954b989d478c868b12647e1088a079457;p=thirdparty%2Ftor.git Add a "location" field for subsystems to declare which file they are in. --- diff --git a/src/lib/subsys/subsys.h b/src/lib/subsys/subsys.h index c05b69af39..b29015746e 100644 --- a/src/lib/subsys/subsys.h +++ b/src/lib/subsys/subsys.h @@ -41,6 +41,11 @@ typedef struct subsys_fns_t { **/ const char *name; + /** + * The file in which the subsystem object is declared. Used for debugging. + **/ + const char *location; + /** * Whether this subsystem is supported -- that is, whether it is compiled * into Tor. For most subsystems, this should be true. @@ -187,6 +192,14 @@ typedef struct subsys_fns_t { int (*flush_state)(void *); } subsys_fns_t; +#ifndef COCCI +/** + * Macro to declare a subsystem's location. + **/ +#define SUBSYS_DECLARE_LOCATION() \ + .location = __FILE__ +#endif + /** * Lowest allowed subsystem level. **/