php_scandir.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. +----------------------------------------------------------------------+
  3. | Copyright (c) The PHP Group |
  4. +----------------------------------------------------------------------+
  5. | This source file is subject to version 3.01 of the PHP license, |
  6. | that is bundled with this package in the file LICENSE, and is |
  7. | available through the world-wide-web at the following url: |
  8. | https://www.php.net/license/3_01.txt |
  9. | If you did not receive a copy of the PHP license and are unable to |
  10. | obtain it through the world-wide-web, please send a note to |
  11. | license@php.net so we can mail you a copy immediately. |
  12. +----------------------------------------------------------------------+
  13. | Authors: Shane Caraveo <shane@caraveo.com> |
  14. | Ilia Alshanetsky <ilia@prohost.org> |
  15. +----------------------------------------------------------------------+
  16. */
  17. #ifndef PHP_SCANDIR_H
  18. #define PHP_SCANDIR_H
  19. #include <sys/types.h>
  20. #ifdef PHP_WIN32
  21. #include "config.w32.h"
  22. #include "win32/readdir.h"
  23. #else
  24. #include <php_config.h>
  25. #endif
  26. #ifdef HAVE_DIRENT_H
  27. #include <dirent.h>
  28. #endif
  29. #ifdef HAVE_SCANDIR
  30. #define php_scandir scandir
  31. #else
  32. PHPAPI int php_scandir(const char *dirname, struct dirent **namelist[], int (*selector) (const struct dirent *entry), int (*compare) (const struct dirent **a, const struct dirent **b));
  33. #endif
  34. #ifdef HAVE_ALPHASORT
  35. #define php_alphasort alphasort
  36. #else
  37. PHPAPI int php_alphasort(const struct dirent **a, const struct dirent **b);
  38. #endif
  39. #endif /* PHP_SCANDIR_H */