php_filestat.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. | Author: Jim Winstead <jimw@php.net> |
  14. +----------------------------------------------------------------------+
  15. */
  16. #ifndef PHP_FILESTAT_H
  17. #define PHP_FILESTAT_H
  18. PHP_RINIT_FUNCTION(filestat);
  19. PHP_RSHUTDOWN_FUNCTION(filestat);
  20. #ifdef PHP_WIN32
  21. #define S_IRUSR S_IREAD
  22. #define S_IWUSR S_IWRITE
  23. #define S_IXUSR S_IEXEC
  24. #define S_IRGRP S_IREAD
  25. #define S_IWGRP S_IWRITE
  26. #define S_IXGRP S_IEXEC
  27. #define S_IROTH S_IREAD
  28. #define S_IWOTH S_IWRITE
  29. #define S_IXOTH S_IEXEC
  30. #undef getgid
  31. #define getgroups(a, b) 0
  32. #define getgid() 1
  33. #define getuid() 1
  34. #endif
  35. /* Compatibility. */
  36. typedef size_t php_stat_len;
  37. PHPAPI void php_clear_stat_cache(bool clear_realpath_cache, const char *filename, size_t filename_len);
  38. PHPAPI void php_stat(zend_string *filename, int type, zval *return_value);
  39. /* Switches for various filestat functions: */
  40. #define FS_PERMS 0
  41. #define FS_INODE 1
  42. #define FS_SIZE 2
  43. #define FS_OWNER 3
  44. #define FS_GROUP 4
  45. #define FS_ATIME 5
  46. #define FS_MTIME 6
  47. #define FS_CTIME 7
  48. #define FS_TYPE 8
  49. #define FS_IS_W 9
  50. #define FS_IS_R 10
  51. #define FS_IS_X 11
  52. #define FS_IS_FILE 12
  53. #define FS_IS_DIR 13
  54. #define FS_IS_LINK 14
  55. #define FS_EXISTS 15
  56. #define FS_LSTAT 16
  57. #define FS_STAT 17
  58. #define FS_LPERMS 18
  59. #endif /* PHP_FILESTAT_H */