proc_open.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. | Author: Wez Furlong <wez@thebrainroom.com> |
  14. +----------------------------------------------------------------------+
  15. */
  16. #ifdef PHP_WIN32
  17. typedef HANDLE php_file_descriptor_t;
  18. typedef DWORD php_process_id_t;
  19. # define PHP_INVALID_FD INVALID_HANDLE_VALUE
  20. #else
  21. typedef int php_file_descriptor_t;
  22. typedef pid_t php_process_id_t;
  23. # define PHP_INVALID_FD (-1)
  24. #endif
  25. /* Environment block under Win32 is a NUL terminated sequence of NUL terminated
  26. * name=value strings.
  27. * Under Unix, it is an argv style array. */
  28. typedef struct _php_process_env {
  29. char *envp;
  30. #ifndef PHP_WIN32
  31. char **envarray;
  32. #endif
  33. } php_process_env;
  34. typedef struct _php_process_handle {
  35. php_process_id_t child;
  36. #ifdef PHP_WIN32
  37. HANDLE childHandle;
  38. #endif
  39. int npipes;
  40. zend_resource **pipes;
  41. zend_string *command;
  42. php_process_env env;
  43. } php_process_handle;