dir.h 1.0 KB

123456789101112131415161718192021222324252627282930313233
  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. /**
  8. * \file dir.h
  9. *
  10. * \brief Header for dir.c
  11. **/
  12. #include "lib/cc/compat_compiler.h"
  13. #include "lib/testsupport/testsupport.h"
  14. /** Possible behaviors for check_private_dir() on encountering a nonexistent
  15. * directory; see that function's documentation for details. */
  16. typedef unsigned int cpd_check_t;
  17. #define CPD_NONE 0
  18. #define CPD_CREATE (1u << 0)
  19. #define CPD_CHECK (1u << 1)
  20. #define CPD_GROUP_OK (1u << 2)
  21. #define CPD_GROUP_READ (1u << 3)
  22. #define CPD_CHECK_MODE_ONLY (1u << 4)
  23. #define CPD_RELAX_DIRMODE_CHECK (1u << 5)
  24. MOCK_DECL(int, check_private_dir, (const char *dirname, cpd_check_t check,
  25. const char *effective_user));
  26. MOCK_DECL(struct smartlist_t *, tor_listdir, (const char *dirname));
  27. #endif