php-src/ext/sysvshm/php_sysvshm.h

81 lines
2.2 KiB
C
Raw Normal View History

/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
2007-01-01 09:29:37 +00:00
| Copyright (c) 1997-2007 The PHP Group |
+----------------------------------------------------------------------+
2006-01-01 13:10:10 +00:00
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
2006-01-01 13:10:10 +00:00
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
2002-02-28 08:29:35 +00:00
| Author: Christian Cartus <cartus@atrior.de> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
#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 <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#define PHP_SHM_RSRC_NAME "sysvshm"
typedef struct {
int le_shm;
long init_mem;
} sysvshm_module;
typedef struct {
long key;
long length;
long next;
char mem;
} sysvshm_chunk;
typedef struct {
char magic[8];
long start;
long end;
long free;
long total;
} sysvshm_chunk_head;
typedef struct {
key_t key; /* key set by user */
long id; /* returned by shmget */
sysvshm_chunk_head *ptr; /* memory address of shared memory */
} sysvshm_shm;
PHP_MINIT_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);
2003-03-07 00:52:04 +00:00
1999-12-18 04:01:20 +00:00
extern sysvshm_module php_sysvshm;
#else
#define sysvshm_module_ptr NULL
#endif
#define phpext_sysvshm_ptr sysvshm_module_ptr
#endif /* PHP_SYSVSHM_H */