php-src/ext/shmop
Andrei Zmievski 7b4983c8f8 Mega-patch to get better resource information for modules.
* Fixed a bug in zend_rsrc_list_get_rsrc_type()
  * Switched register_list_destructors() to use
    zend_register_list_destructors_ex() instead
  * Updated all relevant modules to provide the resource type name
    to register_list_destructors() call
  * Updated var_dump() to output resource type name instead of number

@- Made resource type names visible, e.g. var_dump() and
@  get_resource_type() display "file" for file resources. (Andrei)
2000-10-20 18:25:16 +00:00
..
config.m4 Clean up the alignment of configure --help output 2000-10-02 17:36:01 +00:00
Makefile.in @- Added the shmop extension. It allows more general ways of shared memory 2000-10-01 15:06:04 +00:00
php_shmop.h - Renamed the shm_ to shmop_ and created aliases for the old shm_ 2000-10-19 22:50:41 +00:00
README typo 2000-10-03 21:56:21 +00:00
setup.stub @- Added the shmop extension. It allows more general ways of shared memory 2000-10-01 15:06:04 +00:00
shmop.c Mega-patch to get better resource information for modules. 2000-10-20 18:25:16 +00:00

last update sept 3, 2000 (slavapl@mailandnews.com/iliaa@home.com)

Shared Memory Operations Extension to PHP4

	While developing a search deamon we needed the php based front end
	to communicate the deamon via SHM. Now, PHP already had a shared memory
	extention (sysvshm) written by Christian Cartus <cartus@atrior.de>,
	unfortunatly this extention was designed with PHP only in mind, and
	offers high level features which are extremly bothersome for basic SHM
	we had in mind.  After spending a day trying to reverse engeener figure
	out the format of sysvshm we decided that it would be much easier to
	add our own extention to php for simple SHM operations, we were right :)). 

the functions are:
	
int shm_open(int key, string flags, int mode, int size)
	
	key 		- the key of/for the shared memory block
	flags 		- 2 flags are avalible 
				a for access  (sets IPC_EXCL)
				c for create  (sets IPC_CREATE)
	mode		- acsess mode same as for a file (0644) for example
	size		- size of the block in bytes
	
	returns an indentifier
	

char shm_read(int shmid, int start, int count)

	shmid		- shmid from which to read
	start		- offset from which to start reading
	count		- how many bytes to read
	
	returns the data read

int shm_write(int shmid, string data, int offset)

	shmid		- shmid from which to read
	data		- string to put into shared memory
	offset		- offset in shm to write from
	
	returns bytes written
	
int shm_size(int shmid)

	shmid 		- shmid for which to return the size
	
	returns the size in bytes of the shm segment
	
	
int shm_delete(int shmid)

	marks the segment for deletion, the segment will be deleted when all processes mapping it will detach

	shmid		- shmid which to mark for deletion
	
	returns 1 if all ok, zero on failure
	
int shm_close(int shmid)

	shmid 		- shmid which to close
	
	returns zero