In my mailparse extension I am building up an array to contain the headers
while parsing the message.  The array is held in a zval in the internal C
structure, one for each message part.

When the "user space" code requests info for a particular message part it
is returned as an assoc. array. One of the keys contains the headers;


$info => array(
   "content-type" => "text/plain",
   "headers" => array(
       "to" => "[EMAIL PROTECTED]",
       "from" => [EMAIL PROTECTED]"

So far, to do this I am using this code:

zval * headers;

*headers = *rfcbuf->headers;
if (zval_copy_ctor(headers) == SUCCESS)  {
   zend_hash_update(HASH_OF(return_value), "headers",
       strlen("headers") + 1, &headers, sizeof(headers)

where rfcbuf->headers is a "zval *" created using MAKE_STD_ZVAL and

It seems to work OK.

Is it correct?  The ZendAPI docs aren't 100% clear about using the copy
constructor, and I am experiencing intermittent segfaults in a specific
part of my "application" that uses this code.


PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to