summaryrefslogtreecommitdiff
path: root/README.EXT_SKEL
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2008-06-19 17:59:35 +0000
committerStanislav Malyshev <stas@php.net>2008-06-19 17:59:35 +0000
commit6b87e16bf055286b3ee579a33d1cf461a54cb884 (patch)
treeabbe35a280668e12c8ef7c4e4ac59b8e4b890d1c /README.EXT_SKEL
parentfd10eb318e644a5aa1f6f616721faf54357c8965 (diff)
downloadphp-git-6b87e16bf055286b3ee579a33d1cf461a54cb884.tar.gz
update the docs
# if we keep it in CVS, it should have correct docs
Diffstat (limited to 'README.EXT_SKEL')
-rw-r--r--README.EXT_SKEL77
1 files changed, 24 insertions, 53 deletions
diff --git a/README.EXT_SKEL b/README.EXT_SKEL
index 599e6997c4..b0db843a42 100644
--- a/README.EXT_SKEL
+++ b/README.EXT_SKEL
@@ -96,29 +96,7 @@ OTHER OPTIONS
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 @@ EXAMPLE
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;
- }
-
- php_error(E_WARNING, "my_drawtext: not yet implemented");
+ 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");
}
/* }}} */