php_shmop.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. | Authors: Slava Poliakov <hackie@prohost.org> |
  16. | Ilia Alshanetsky <ilia@prohost.org> |
  17. +----------------------------------------------------------------------+
  18. */
  19. #ifndef PHP_SHMOP_H
  20. #define PHP_SHMOP_H
  21. #if HAVE_SHMOP
  22. extern zend_module_entry shmop_module_entry;
  23. #define phpext_shmop_ptr &shmop_module_entry
  24. #include "php_version.h"
  25. #define PHP_SHMOP_VERSION PHP_VERSION
  26. PHP_MINIT_FUNCTION(shmop);
  27. PHP_MINFO_FUNCTION(shmop);
  28. PHP_FUNCTION(shmop_open);
  29. PHP_FUNCTION(shmop_read);
  30. PHP_FUNCTION(shmop_close);
  31. PHP_FUNCTION(shmop_size);
  32. PHP_FUNCTION(shmop_write);
  33. PHP_FUNCTION(shmop_delete);
  34. #ifdef PHP_WIN32
  35. # include "win32/ipc.h"
  36. #endif
  37. struct php_shmop
  38. {
  39. int shmid;
  40. key_t key;
  41. int shmflg;
  42. int shmatflg;
  43. char *addr;
  44. zend_long size;
  45. };
  46. typedef struct {
  47. int le_shmop;
  48. } php_shmop_globals;
  49. #ifdef ZTS
  50. #define SHMOPG(v) TSRMG(shmop_globals_id, php_shmop_globals *, v)
  51. #else
  52. #define SHMOPG(v) (shmop_globals.v)
  53. #endif
  54. #else
  55. #define phpext_shmop_ptr NULL
  56. #endif
  57. #endif /* PHP_SHMOP_H */
  58. /*
  59. * Local variables:
  60. * tab-width: 4
  61. * c-basic-offset: 4
  62. * End:
  63. */