Back to index

php5  5.3.10
php_sysvshm.h
Go to the documentation of this file.
00001 /* 
00002    +----------------------------------------------------------------------+
00003    | PHP Version 5                                                        |
00004    +----------------------------------------------------------------------+
00005    | Copyright (c) 1997-2012 The PHP Group                                |
00006    +----------------------------------------------------------------------+
00007    | This source file is subject to version 3.01 of the PHP license,      |
00008    | that is bundled with this package in the file LICENSE, and is        |
00009    | available through the world-wide-web at the following url:           |
00010    | http://www.php.net/license/3_01.txt                                  |
00011    | If you did not receive a copy of the PHP license and are unable to   |
00012    | obtain it through the world-wide-web, please send a note to          |
00013    | license@php.net so we can mail you a copy immediately.               |
00014    +----------------------------------------------------------------------+
00015    | Author: Christian Cartus <cartus@atrior.de>                          |
00016    +----------------------------------------------------------------------+
00017 */
00018 
00019 /* $Id: php_sysvshm.h 321634 2012-01-01 13:15:04Z felipe $ */
00020 
00021 #ifndef PHP_SYSVSHM_H
00022 #define PHP_SYSVSHM_H
00023 
00024 #if HAVE_SYSVSHM
00025 
00026 extern zend_module_entry sysvshm_module_entry;
00027 #define sysvshm_module_ptr &sysvshm_module_entry
00028 
00029 #include <sys/types.h>
00030 #include <sys/ipc.h>
00031 #include <sys/shm.h>
00032 
00033 #define PHP_SHM_RSRC_NAME "sysvshm"
00034 
00035 typedef struct {
00036        int le_shm;
00037        long init_mem;
00038 } sysvshm_module;
00039 
00040 typedef struct {
00041        long key;
00042        long length;
00043        long next;
00044        char mem;
00045 } sysvshm_chunk;
00046 
00047 typedef struct {
00048        char magic[8];
00049        long start;
00050        long end;
00051        long free;
00052        long total;
00053 } sysvshm_chunk_head;
00054 
00055 typedef struct {
00056        key_t key;               /* key set by user */
00057        long id;                 /* returned by shmget */
00058        sysvshm_chunk_head *ptr; /* memory address of shared memory */
00059 } sysvshm_shm;
00060 
00061 PHP_MINIT_FUNCTION(sysvshm);
00062 PHP_FUNCTION(shm_attach);
00063 PHP_FUNCTION(shm_detach);
00064 PHP_FUNCTION(shm_remove);
00065 PHP_FUNCTION(shm_put_var);
00066 PHP_FUNCTION(shm_get_var);
00067 PHP_FUNCTION(shm_has_var);
00068 PHP_FUNCTION(shm_remove_var);
00069 
00070 extern sysvshm_module php_sysvshm;
00071 
00072 #else
00073 
00074 #define sysvshm_module_ptr NULL
00075 
00076 #endif
00077 
00078 #define phpext_sysvshm_ptr sysvshm_module_ptr
00079 
00080 #endif /* PHP_SYSVSHM_H */