aboutsummaryrefslogtreecommitdiff
path: root/src/lib/subsys/subsys.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-02-14 09:39:36 -0500
committerNick Mathewson <nickm@torproject.org>2020-03-26 11:20:20 -0400
commit53d74c0954b989d478c868b12647e1088a079457 (patch)
tree05cf64f517c8b21d3cbaf67986cd3ffcfadf4c35 /src/lib/subsys/subsys.h
parente7290dc8c00dcb765ac67bebb6e30a086903b859 (diff)
downloadtor-53d74c0954b989d478c868b12647e1088a079457.tar.gz
tor-53d74c0954b989d478c868b12647e1088a079457.zip
Add a "location" field for subsystems to declare which file they are in.
Diffstat (limited to 'src/lib/subsys/subsys.h')
-rw-r--r--src/lib/subsys/subsys.h13
1 files changed, 13 insertions, 0 deletions
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
@@ -42,6 +42,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.
**/