From 21d95d8abf2b0bae3a69e35cddea5627f0904127 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Thu, 19 Oct 2000 22:55:58 +0000 Subject: [PATCH] - Updated docs to reflect the new function names git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@34178 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/shmop.xml | 94 ++++++++++++++++++++++----------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/functions/shmop.xml b/functions/shmop.xml index b7883d5fbb..4ba5a373a4 100755 --- a/functions/shmop.xml +++ b/functions/shmop.xml @@ -17,33 +17,33 @@ <?php // Create 100 byte shared memory block with system id if 0xff3 -$shm_id = shm_open(0xff3, "c", 0644, 100); +$shm_id = shmop_open(0xff3, "c", 0644, 100); if(!$shm_id) { echo "Couldn't create shared memory segment\n"; } // Get shared memory block's size -$shm_size = shm_size($shm_id); +$shm_size = shmop_size($shm_id); echo "SHM Block Size: ".$shm_size. " has been created.\n"; // Lets write a test string into shared memory -$shm_bytes_written = shm_write($shm_id, "my shared memory block", 0); +$shm_bytes_written = shmop_write($shm_id, "my shared memory block", 0); if($shm_bytes_written != strlen("my shared memory block")) { echo "Couldn't write the entire length of data\n"; } // Now lets read the string back -$my_string = shm_read($shm_id, 0, $shm_size); +$my_string = shmop_read($shm_id, 0, $shm_size); if(!$my_string) { echo "Couldn't read from shared memory block\n"; } echo "The data inside shared memory was: ".$my_string."\n"; //Now lets delete the block and close the shared memory segment -if(!shm_delete($shm_id)) { +if(!shmop_delete($shm_id)) { echo "Couldn't mark shared memory block for deletion. } -shm_close($shm_id); +shmop_close($shm_id); ?> @@ -51,16 +51,16 @@ shm_close($shm_id); - + - shm_open + shmop_open Create or open shared memory block Description - int shm_open + int shmop_open int key string flags int mode @@ -68,10 +68,10 @@ shm_close($shm_id); - shm_open can create or open a shared memory block. + shmop_open can create or open a shared memory block. - shm_open takes 4 parameters: key, which is the + shmop_open takes 4 parameters: key, which is the system's id for the shared memory block, this parameter can be passed as a decimal or hex. The second parameter are the flags that you can use: @@ -95,7 +95,7 @@ shm_close($shm_id); in bytes. Note: the 3rd and 4th should be entered as 0 if you are opening an - existing memory segment. On success shm_open will + existing memory segment. On success shmop_open will return an id that you can use to access the shared memory segment you've created. @@ -105,7 +105,7 @@ shm_close($shm_id); Create a new shared memory block <?php -$shm_id = shm_open(0x0fff, "c", 0644, 100); +$shm_id = shmop_open(0x0fff, "c", 0644, 100); ?> @@ -116,27 +116,27 @@ $shm_id = shm_open(0x0fff, "c", 0644, 100); - + - shm_read + shmop_read Read data from shared memory block Description - string shm_read + string shmop_read int shmid int start int count - shm_read will read a string from shared memory block. + shmop_read will read a string from shared memory block. - shm_read takes 3 parameters: shmid, which is the shared - memory block identifier created by shm_open, offset from + shmop_read takes 3 parameters: shmid, which is the shared + memory block identifier created by shmop_open, offset from which to start reading and count on the number of bytes to read. @@ -144,7 +144,7 @@ $shm_id = shm_open(0x0fff, "c", 0644, 100); Reading shared memory block <?php -$shm_data = shm_read($shm_id, 0, 50); +$shm_data = shmop_read($shm_id, 0, 50); ?> @@ -156,27 +156,27 @@ $shm_data = shm_read($shm_id, 0, 50); - + - shm_write + shmop_write Write data into shared memory block Description - int shm_write + int shmop_write int shmid string data int offset - shm_write will write a string into shared memory block. + shmop_write will write a string into shared memory block. - shm_write takes 3 parameters: shmid, which is the - shared memory block identifier created by shm_open, + shmop_write takes 3 parameters: shmid, which is the + shared memory block identifier created by shmop_open, data, a string that you want to write into shared memory block and offset, which specifies where to start writing data inside the shared memory segment. @@ -185,7 +185,7 @@ $shm_data = shm_read($shm_id, 0, 50); Writing to shared memory block <?php -$shm_bytes_written = shm_write($shm_id, $my_string, 0); +$shm_bytes_written = shmop_write($shm_id, $my_string, 0); ?> @@ -200,24 +200,24 @@ $shm_bytes_written = shm_write($shm_id, $my_string, 0); - shm_size + shmop_size Get size of shared memory block Description - int shm_size + int shmop_size int shmid - shm_size is used to get the size, in bytes of the + shmop_size is used to get the size, in bytes of the shared memory block. - shm_size takes the shmid, which is the shared memory - block identifier created by shm_open, the function + shmop_size takes the shmid, which is the shared memory + block identifier created by shmop_open, the function will return and int, which represents the number of bytes the shared memory block occupies. @@ -226,7 +226,7 @@ $shm_bytes_written = shm_write($shm_id, $my_string, 0); Getting the size of the shared memory block <?php -$shm_size = shm_size($shm_id); +$shm_size = shmop_size($shm_id); ?> @@ -238,25 +238,25 @@ $shm_size = shm_size($shm_id); - + - shm_delete + shmop_delete Delete shared memory block Description - int shm_delete + int shmop_delete int shmid - shm_delete is used to delete a shared memory block. + shmop_delete is used to delete a shared memory block. - shm_delete takes the shmid, which is the shared memory - block identifier created by shm_open. On success 1 is + shmop_delete takes the shmid, which is the shared memory + block identifier created by shmop_open. On success 1 is returned, on failure 0 is returned. @@ -264,7 +264,7 @@ $shm_size = shm_size($shm_id); Deleting shared memory block <?php -shm_delete($shm_id); +shmop_delete($shm_id); ?> @@ -276,32 +276,32 @@ shm_delete($shm_id); - + - shm_close + shmop_close Close shared memory block Description - int shm_close + int shmop_close int shmid - shm_close is used to close a shared memory block. + shmop_close is used to close a shared memory block. - shm_close takes the shmid, which is the shared memory - block identifier created by shm_open. + shmop_close takes the shmid, which is the shared memory + block identifier created by shmop_open. Closing shared memory block <?php -shm_close($shm_id); +shmop_close($shm_id); ?>