]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add a "location" field for subsystems to declare which file they are in.
authorNick Mathewson <nickm@torproject.org>
Fri, 14 Feb 2020 14:39:36 +0000 (09:39 -0500)
committerNick Mathewson <nickm@torproject.org>
Thu, 26 Mar 2020 15:20:20 +0000 (11:20 -0400)
src/lib/subsys/subsys.h

index c05b69af39b651fcd95317fc6f7ffb2fae00105b..b29015746edf51115645feff32e35ad30220c5cd 100644 (file)
@@ -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.
  **/