#ifndef PHP_SYSVSHM_H
#define PHP_SYSVSHM_H
#if HAVE_SYSVSHM
extern zend_module_entry sysvshm_module_entry;
#define sysvshm_module_ptr &sysvshm_module_entry
#include "php_version.h"
#define PHP_SYSVSHM_VERSION PHP_VERSION
#include <sys/types.h>
#ifdef PHP_WIN32
# include <TSRM/tsrm_win32.h>
# include "win32/ipc.h"
# ifndef THREAD_LS
# define THREAD_LS
# endif
#else
# include <sys/ipc.h>
# include <sys/shm.h>
#endif
#define PHP_SHM_RSRC_NAME "sysvshm"
typedef struct {
int le_shm;
zend_long init_mem;
} sysvshm_module;
typedef struct {
zend_long key;
zend_long length;
zend_long next;
char mem;
} sysvshm_chunk;
typedef struct {
char magic[8];
zend_long start;
zend_long end;
zend_long free;
zend_long total;
} sysvshm_chunk_head;
typedef struct {
key_t key;
zend_long id;
sysvshm_chunk_head *ptr;
} sysvshm_shm;
PHP_MINIT_FUNCTION(sysvshm);
PHP_MINFO_FUNCTION(sysvshm);
PHP_FUNCTION(shm_attach);
PHP_FUNCTION(shm_detach);
PHP_FUNCTION(shm_remove);
PHP_FUNCTION(shm_put_var);
PHP_FUNCTION(shm_get_var);
PHP_FUNCTION(shm_has_var);
PHP_FUNCTION(shm_remove_var);
extern sysvshm_module php_sysvshm;
#else
#define sysvshm_module_ptr NULL
#endif
#define phpext_sysvshm_ptr sysvshm_module_ptr
#endif