php_sysvsem.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 7 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2018 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 3.01 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available through the world-wide-web at the following url: |
  10. | http://www.php.net/license/3_01.txt |
  11. | If you did not receive a copy of the PHP license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@php.net so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. | Author: Tom May <tom@go2net.com> |
  16. +----------------------------------------------------------------------+
  17. */
  18. #ifndef PHP_SYSVSEM_H
  19. #define PHP_SYSVSEM_H
  20. #if HAVE_SYSVSEM
  21. extern zend_module_entry sysvsem_module_entry;
  22. #define sysvsem_module_ptr &sysvsem_module_entry
  23. #include "php_version.h"
  24. #define PHP_SYSVSEM_VERSION PHP_VERSION
  25. PHP_MINIT_FUNCTION(sysvsem);
  26. PHP_MINFO_FUNCTION(sysvsem);
  27. PHP_FUNCTION(sem_get);
  28. PHP_FUNCTION(sem_acquire);
  29. PHP_FUNCTION(sem_release);
  30. PHP_FUNCTION(sem_remove);
  31. typedef struct {
  32. int le_sem;
  33. } sysvsem_module;
  34. typedef struct {
  35. int id; /* For error reporting. */
  36. int key; /* For error reporting. */
  37. int semid; /* Returned by semget(). */
  38. int count; /* Acquire count for auto-release. */
  39. int auto_release; /* flag that says to auto-release. */
  40. } sysvsem_sem;
  41. extern sysvsem_module php_sysvsem_module;
  42. #else
  43. #define sysvsem_module_ptr NULL
  44. #endif
  45. #define phpext_sysvsem_ptr sysvsem_module_ptr
  46. #endif /* PHP_SYSVSEM_H */