summaryrefslogtreecommitdiff
path: root/src/or/config.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-11-14 16:49:41 -0500
committerNick Mathewson <nickm@torproject.org>2017-12-05 19:49:28 -0500
commit3907faf2fdc28a0c9f85279a58f2059c9a44f9b4 (patch)
treeb195babb833cacd649e1837a30e3c23702b52be1 /src/or/config.h
parent7b34ab3e384b5c72e938d11e5e05c72b9d529bb8 (diff)
downloadtor-3907faf2fdc28a0c9f85279a58f2059c9a44f9b4.tar.gz
tor-3907faf2fdc28a0c9f85279a58f2059c9a44f9b4.zip
New accessors for keydir/cachedir access
This patch is a result of auditing all of our uses of get_datadir_fname() and its kin, and dividing them into cache vs keys vs other data. The new get_keydir_fname() and get_cachedir_fname() functions don't actually do anything new yet.
Diffstat (limited to 'src/or/config.h')
-rw-r--r--src/or/config.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/or/config.h b/src/or/config.h
index de9858a25b..4e9bb0f6fe 100644
--- a/src/or/config.h
+++ b/src/or/config.h
@@ -72,6 +72,11 @@ MOCK_DECL(char *,
* get_datadir_fname2_suffix. */
#define get_datadir_fname2(sub1,sub2) \
get_datadir_fname2_suffix((sub1), (sub2), NULL)
+/** Return a newly allocated string containing datadir/sub1suffix. See
+ * get_datadir_fname2_suffix. */
+#define get_datadir_fname_suffix(sub1, suffix) \
+ get_datadir_fname2_suffix((sub1), NULL, (suffix))
+
/** Return a newly allocated string containing datadir/sub1 relative to
* opts. See get_datadir_fname2_suffix. */
#define options_get_datadir_fname(opts,sub1) \
@@ -80,10 +85,18 @@ MOCK_DECL(char *,
* opts. See get_datadir_fname2_suffix. */
#define options_get_datadir_fname2(opts,sub1,sub2) \
options_get_datadir_fname2_suffix((opts),(sub1), (sub2), NULL)
-/** Return a newly allocated string containing datadir/sub1suffix. See
- * get_datadir_fname2_suffix. */
-#define get_datadir_fname_suffix(sub1, suffix) \
- get_datadir_fname2_suffix((sub1), NULL, (suffix))
+
+/** DOCDOC */
+#define get_keydir_fname(sub1) \
+ get_datadir_fname2("keys", (sub1))
+#define options_get_keydir_fname(options, sub1) \
+ options_get_datadir_fname2((options), "keys", (sub1))
+#define get_keydir_fname_suffix(sub1, suffix) \
+ get_datadir_fname2_suffix("keys", (sub1), (suffix))
+
+#define get_cachedir_fname(sub1) get_datadir_fname((sub1))
+#define get_cachedir_fname_suffix(sub1, suffix) \
+ get_datadir_fname_suffix((sub1), (suffix))
int using_default_dir_authorities(const or_options_t *options);