cvs: php-src(PHP_5_3) / README.EXT_SKEL

From: Date: Thu, 19 Jun 2008 17:59:36 +0000
Subject: cvs: php-src(PHP_5_3) / README.EXT_SKEL
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-50484@lists.php.net to get a copy of this message
stas Thu Jun 19 17:59:36 2008 UTC Modified files: (Branch: PHP_5_3) /php-src README.EXT_SKEL Log: update the docs # if we keep it in CVS, it should have correct docs http://cvs.php.net/viewvc.cgi/php-src/README.EXT_SKEL?r1=1.13&r2=1.13.8.1&diff_format=u Index: php-src/README.EXT_SKEL diff -u php-src/README.EXT_SKEL:1.13 php-src/README.EXT_SKEL:1.13.8.1 --- php-src/README.EXT_SKEL:1.13 Sun Jun 29 16:07:17 2003 +++ php-src/README.EXT_SKEL Thu Jun 19 17:59:35 2008 @@ -96,29 +96,7 @@ function entries and definitions at the end of the file, for copying and pasting into an already existing module. - --assign-params - --string-lens - - By default, function proto 'void foo(string bar)' creates the following: - ... - zval **bar; - ... (zend_get_parameters_ex() called in the middle...) - convert_to_string_ex(bar); - - Specifying both of these options changes the generated code to: - ... - zval **bar_arg; - int bar_len; - char *bar = NULL; - ... (zend_get_parameters_ex() called in the middle...) - convert_to_string_ex(bar_arg); - bar = Z_STRVAL_PP(bar_arg); - bar_len = Z_STRLEN_PP(bar_arg); - - You shouldn't have to ask what happens if you leave --string-lens out. If you - have to, it's questionable whether you should be reading this document. - - --with-xml[=file] + --xml[=file] Creates the basics for phpdoc .xml file. @@ -156,39 +134,32 @@ question marks to be replaced by you, and you must of course add your own value definitions too): -/* {{{ proto bool my_drawtext(resource image, string text, resource font, int x, int y[, int color]) +/* {{{ proto bool my_drawtext(resource image, string text, resource font, int x, int y [, int color]) */ PHP_FUNCTION(my_drawtext) { - zval **image, **text, **font, **x, **y, **color; - int argc; - int image_id = -1; - int font_id = -1; - - argc = ZEND_NUM_ARGS(); - if (argc < 5 || argc > 6 || zend_get_parameters_ex(argc, &image, &text, &font, &x, &y, &color) == FAILURE) { - WRONG_PARAM_COUNT; - } - - ZEND_FETCH_RESOURCE(???, ???, image, image_id, "???", ???_rsrc_id); - ZEND_FETCH_RESOURCE(???, ???, font, font_id, "???", ???_rsrc_id); - - switch (argc) { - case 6: - convert_to_long_ex(color); - /* Fall-through. */ - case 5: - convert_to_long_ex(y); - convert_to_long_ex(x); - /* font: fetching resources already handled. */ - convert_to_string_ex(text); - /* image: fetching resources already handled. */ - break; - default: - WRONG_PARAM_COUNT; - } + char *text = NULL; + int argc = ZEND_NUM_ARGS(); + int image_id = -1; + int text_len; + int font_id = -1; + long x; + long y; + long color; + zval *image = NULL; + zval *font = NULL; + + if (zend_parse_parameters(argc TSRMLS_CC, "rsrll|l", &image, &text, &text_len, &font, &x, &y, &color) == FAILURE) + return; + + if (image) { + ZEND_FETCH_RESOURCE(???, ???, image, image_id, "???", ???_rsrc_id); + } + if (font) { + ZEND_FETCH_RESOURCE(???, ???, font, font_id, "???", ???_rsrc_id); + } - php_error(E_WARNING, "my_drawtext: not yet implemented"); + php_error(E_WARNING, "my_drawtext: not yet implemented"); } /* }}} */

« previous php.cvs (#50484) next »