Re: zend_parse_parameters

From: Date: Fri, 07 Sep 2001 18:38:23 +0000
Subject: Re: zend_parse_parameters
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-65378@lists.php.net to get a copy of this message
Hi, While adding some CA support functions to the openssl extension I have discovered the need to be able to have a large number of optional parameters (there are just so many things to tune for a certificate). Obviously this is a real pain to code in "user space". How about a new zend function that will parse values, much like zend_parse_parameters does, except that it operates on a hash and allows you to specify the keys of the hash: my_zval = array( "firstname" => "fred", "lastname" => "bloggs", "age" => 42 ); char * firstname = NULL; long firstname_len; char * lastname = NULL; long lastname_len; long age = 0; zend_parse_parameters_hash(HASH_OF(my_zval), // mandatory string value with key "firstname" "s%firstname", &firstname, &firstname_len, // optional string value with key "lastname" "|s%lastname", &lastname, &lastname_len, // mandatory long value with key "age" "l%age", &age NULL ); Any thoughts? I know Andrei mentioned a _hash function in his announcement of zend_parse_parameters, but I don't remember seeing anything about it doing what I have described above. --Wez.

« previous php.dev (#65378) next »