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;

  // 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

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.


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