summaryrefslogtreecommitdiff
path: root/ext/skeleton/create_stubs
diff options
context:
space:
mode:
authorAndrei Zmievski <andrei@php.net>2001-08-12 02:45:41 +0000
committerAndrei Zmievski <andrei@php.net>2001-08-12 02:45:41 +0000
commit75da34e8aa4ac9720e5c3e21b2ef3f760fdb2f2c (patch)
tree3b8a2ca4c33a832778e5c83c96177d37da12c9dd /ext/skeleton/create_stubs
parentecc2fae5421db06521fd40abb67e2f17d6ea8b0e (diff)
downloadphp-git-75da34e8aa4ac9720e5c3e21b2ef3f760fdb2f2c.tar.gz
Fix it up a bit.
Diffstat (limited to 'ext/skeleton/create_stubs')
-rwxr-xr-xext/skeleton/create_stubs27
1 files changed, 14 insertions, 13 deletions
diff --git a/ext/skeleton/create_stubs b/ext/skeleton/create_stubs
index ad9bc81ab0..4ce740859f 100755
--- a/ext/skeleton/create_stubs
+++ b/ext/skeleton/create_stubs
@@ -114,21 +114,18 @@ BEGIN {
argnames[num_funcs,args_max] = arg_name
args_max++
- spec_str = spec_str spec_map[arg_type]
if (optional) {
- optionals[num_funcs,i] = optional
- if (arg_type != "resource") {
- useswitch[num_funcs] = 1
+ if (!spec_opt) {
+ spec_str = spec_str "|"
+ spec_opt = 1
}
+ optionals[num_funcs,i] = optional
} else {
- args_min++
+ args_min++
}
+ spec_str = spec_str spec_map[arg_type]
if (x = gobble("\\[")) {
- if (!spec_opt) {
- spec_str = spec_str "|"
- spec_opt = 1
- }
optional++
}
@@ -180,13 +177,17 @@ END {
" <funcprototype>\n" \
" <funcdef>" types[i] " <function>" funcs[i] "</function></funcdef>\n"
- fetchargs = "\tif (zend_parse_parameters(ZEND_NUM_ARGS(), " specs[i] ", "
+ fetchargs = "\tif (zend_parse_parameters("
+ if (spec_opt) {
+ ints = ints "\tint argc = ZEND_NUM_ARGS();\n"
+ fetchargs = fetchargs "argc"
+ } else
+ fetchargs = fetchargs "ZEND_NUM_ARGS()"
+ fetchargs = fetchargs ", " specs[i]
for (j = 0; j < maxargs[i]; j++) {
- if (j) {
- fetchargs = fetchargs ", "
- }
+ fetchargs = fetchargs ", "
fetchargs = fetchargs "&" argnames[i,j]
if (argtypes[i,j] == "string") {