port_dirent.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
  2. // This source code is licensed under both the GPLv2 (found in the
  3. // COPYING file in the root directory) and Apache 2.0 License
  4. // (found in the LICENSE.Apache file in the root directory).
  5. //
  6. // Copyright (c) 2011 The LevelDB Authors. All rights reserved.
  7. // Use of this source code is governed by a BSD-style license that can be
  8. // found in the LICENSE file. See the AUTHORS file for names of contributors.
  9. //
  10. // See port_example.h for documentation for the following types/functions.
  11. #pragma once
  12. #ifdef ROCKSDB_PLATFORM_POSIX
  13. #include <dirent.h>
  14. #include <sys/types.h>
  15. #elif defined(OS_WIN)
  16. namespace ROCKSDB_NAMESPACE {
  17. namespace port {
  18. struct dirent {
  19. char d_name[_MAX_PATH]; /* filename */
  20. };
  21. struct DIR;
  22. DIR* opendir(const char* name);
  23. dirent* readdir(DIR* dirp);
  24. int closedir(DIR* dirp);
  25. } // namespace port
  26. using port::dirent;
  27. using port::DIR;
  28. using port::opendir;
  29. using port::readdir;
  30. using port::closedir;
  31. } // namespace ROCKSDB_NAMESPACE
  32. #endif // OS_WIN