dir.h 1006 B

123456789101112131415161718192021222324252627
  1. /* Copyright (c) 2003-2004, Roger Dingledine
  2. * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
  3. * Copyright (c) 2007-2018, The Tor Project, Inc. */
  4. /* See LICENSE for licensing information */
  5. #ifndef TOR_DIR_H
  6. #define TOR_DIR_H
  7. #include "lib/cc/compat_compiler.h"
  8. #include "lib/testsupport/testsupport.h"
  9. /** Possible behaviors for check_private_dir() on encountering a nonexistent
  10. * directory; see that function's documentation for details. */
  11. typedef unsigned int cpd_check_t;
  12. #define CPD_NONE 0
  13. #define CPD_CREATE (1u << 0)
  14. #define CPD_CHECK (1u << 1)
  15. #define CPD_GROUP_OK (1u << 2)
  16. #define CPD_GROUP_READ (1u << 3)
  17. #define CPD_CHECK_MODE_ONLY (1u << 4)
  18. #define CPD_RELAX_DIRMODE_CHECK (1u << 5)
  19. MOCK_DECL(int, check_private_dir, (const char *dirname, cpd_check_t check,
  20. const char *effective_user));
  21. MOCK_DECL(struct smartlist_t *, tor_listdir, (const char *dirname));
  22. #endif