svn: /phpdoc/en/trunk/internals2/variables/ index.xml

From: Date: Thu, 11 Apr 2013 01:15:54 +0000
Subject: svn: /phpdoc/en/trunk/internals2/variables/ index.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-11194@lists.php.net to get a copy of this message
krakjoe Thu, 11 Apr 2013 01:15:54 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=330069 Log: improve readability of table Changed paths: U phpdoc/en/trunk/internals2/variables/index.xml Modified: phpdoc/en/trunk/internals2/variables/index.xml =================================================================== --- phpdoc/en/trunk/internals2/variables/index.xml 2013-04-11 00:33:27 UTC (rev 330068) +++ phpdoc/en/trunk/internals2/variables/index.xml 2013-04-11 01:15:54 UTC (rev 330069) @@ -12,7 +12,7 @@ </para> <screen> <![CDATA[ - typedef struct _zval_struct { +typedef struct _zval_struct { zvalue_value value; /* variable value */ zend_uint refcount__gc; /* reference counter */ zend_uchar type; /* value type */ @@ -608,9 +608,9 @@ </section> <section xml:id="internals2.variables.tables"> - <title>Working with HashTable Directly</title> + <title>Working with HashTable</title> - <para>The HashTable structure serves many purposes in PHP and can be found everywhere, a good understanding of it's functionality is a preqrequisite of being a good developer.</para> + <para>The HashTable structure serves many purposes in PHP and can be found everywhere, a good understanding of it's functionality is a preqrequisite of being a good <code>Hacker</code>.</para> <para>The HashTable implemented by the engine is a standard HashTable, that is to say, a key = > value based store, where the keys are always strings, whose hashes are calculated with a built in hashing algorythim <code>zend_inline_hash_func(const char* key, uint length)</code>, which results in good distribution, and reasonable usage.</para> @@ -620,41 +620,53 @@ <table xml:id="internals2.variables.advrrays.api"> <title>HashTable API</title> - <tgroup cols="2"> - <thead> + <tgroup cols="1"> + <tbody> <row> - <entry>Prototype</entry> - <entry>Description</entry> + <entry><code>int zend_hash_init(HashTable* ht, uint size, hash_func_t hash, dtor_func_t destructor, zend_bool persistent)</code></entry> </row> - </thead> - <tbody> + <row> - <entry><code>int zend_hash_init(HashTable* ht, uint size, hash_func_t hash, dtor_func_t destructor, zend_bool persistent)</code></entry> <entry>Initializes the hash table to hold at least <code>size</code> elements, <code>hash</code> exists for historical reasons and is always ignored, <code>zend_inline_hash_func</code> is always used as the hashing function. <code>destructor</code> may be <code>NULL</code>.</entry> </row> <row> <entry><code>int zend_hash_add(HashTable* ht, const char* key, uint klen, void* data, uint dlen, void** dest)</code></entry> + </row> + + <row> <entry>adds <code>data</code> to the table using the specified <code>key</code>, where the key is <code>length</code> bytes long (and will be copied from <code>key</code> to the table). If the key is set FAILURE will be returned.</entry> </row> <row> <entry><code>int zend_hash_update(HashTable* ht, const char* key, uint klen, void* data, uint dlen, void** dest)</code></entry> + </row> + + <row> <entry>adds <code>data</code> to the table using the specified <code>key</code>, where the key is <code>length</code> bytes long (and will be copied from <code>key</code> to the table). If the key has been set previously the old data has <code>dtor_func_t</code> called on it and the existing data is replaced with <code>data</code></entry> </row> <row> <entry><code>int zend_hash_find(HashTable* ht, const char* key, uint klen, void** data)</code></entry> + </row> + + <row> <entry>searches the table for <code>key</code>, setting <code>*data</code> and returning SUCCESS when it is found.</entry> </row> <row> <entry><code>zend_bool zend_hash_exists(HashTable* ht, const char* key, uint klen)</code></entry> + </row> + + <row> <entry>returns positively if <code>key</code> is found in the <code>ht</code></entry> </row> <row> - <entry><code>int zend_hash_del(HashTable* ht, const char* key, uint klen)</code></entry> + <entry><code>int zend_hash_del(HashTable* ht, const char* key, uint klen)</code></entry> + </row> + + <row> <entry>removes the entry identified by <code>key</code> from the table if found</entry> </row> @@ -669,6 +681,8 @@ </caution> </section> + <!-- traversal here --> + <!-- copying/merging/cleaning here --> <section xml:id="internals2.variables.objects">

« previous php.doc.cvs (#11194) next »