l0t3k wrote:
Hartmut,
  will this also generate zend_parse_parameters calls based on prototype ?


Sure, see the two samples below. It even adds return statements for the return type specified in the proto where possible.

But unlike the current ext_skel it also supports code generation for
php.ini values, module globals, constants and resourcetypes ... :)

---------------------------------------------------------------------------

<function role='public' name='dummy_int'>
  <summary>dummy integer conversion</summary>
  <proto>int dummy_int(int bar)</proto>
</function>

/* {{{ func int dummy_int(int bar)
  dummy integer conversion */
PHP_FUNCTION(dummy_int)
{
  int argc = ZEND_NUM_ARGS();

long bar = 0;

if (zend_parse_parameters(argc TSRMLS_CC, "l", &bar) == FAILURE) return;

php_error(E_WARNING, "dummy_int: not yet implemented");

  RETURN_LONG(0);
}
/* }}} */


---------------------------------------------------------------------------


<function role='public' name='dummy_resource'>
  <summary>dummy resource test</summary>
  <proto>resource dummy_resource(resource bar)</proto>
</function>

/* {{{ proto resource dummy_resource(resource bar)
  dummy resource test */
PHP_FUNCTION(dummy_resource)
{
  zval * bar = NULL;
  int * bar_id = -1;
  int argc = ZEND_NUM_ARGS();


if (zend_parse_parameters(argc TSRMLS_CC, "r", &bar, &bar_id) == FAILURE) return;


  if (bar) {
    ZEND_FETCH_RESOURCE(???, ???, bar, bar_id, "???", ???_rsrc_id);
  }

  php_error(E_WARNING, "dummy_resource: not yet implemented");
}
/* }}} */


-- Six Offene Systeme GmbH http://www.six.de/ i.A. Hartmut Holzgraefe Email: [EMAIL PROTECTED] Tel.: +49-711-99091-77

Sie finden uns auf der CeBIT in Halle 6/H44 http://www.six.de/cebit2003/


-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to