xref: /PHP-7.4/ext/shmop/php_shmop.h (revision 92ac598a)
1 /*
2    +----------------------------------------------------------------------+
3    | PHP Version 7                                                        |
4    +----------------------------------------------------------------------+
5    | Copyright (c) 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 
22 #if HAVE_SHMOP
23 
24 extern zend_module_entry shmop_module_entry;
25 #define phpext_shmop_ptr &shmop_module_entry
26 
27 #include "php_version.h"
28 #define PHP_SHMOP_VERSION PHP_VERSION
29 
30 PHP_MINIT_FUNCTION(shmop);
31 PHP_MINFO_FUNCTION(shmop);
32 
33 PHP_FUNCTION(shmop_open);
34 PHP_FUNCTION(shmop_read);
35 PHP_FUNCTION(shmop_close);
36 PHP_FUNCTION(shmop_size);
37 PHP_FUNCTION(shmop_write);
38 PHP_FUNCTION(shmop_delete);
39 
40 #ifdef PHP_WIN32
41 # include "win32/ipc.h"
42 #endif
43 
44 struct php_shmop
45 {
46 	int shmid;
47 	key_t key;
48 	int shmflg;
49 	int shmatflg;
50 	char *addr;
51 	zend_long size;
52 };
53 
54 typedef struct {
55 	int le_shmop;
56 } php_shmop_globals;
57 
58 #ifdef ZTS
59 #define SHMOPG(v) TSRMG(shmop_globals_id, php_shmop_globals *, v)
60 #else
61 #define SHMOPG(v) (shmop_globals.v)
62 #endif
63 
64 #else
65 
66 #define phpext_shmop_ptr NULL
67 
68 #endif
69 
70 #endif	/* PHP_SHMOP_H */
71