cvs: php4 /ext/ ext_skel /ext/skeleton/ create_stubs
| From: | Jouni Ahto | Date: | Sat, 10 Jun 2000 05:47:22 +0000 |
| Subject: | cvs: php4 /ext/ ext_skel /ext/skeleton/ create_stubs | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-133@lists.php.net to get a copy of this message | ||
jah Fri Jun 9 22:47:22 2000 EDT
Modified files:
/php4/ext ext_skel
/php4/ext/skeleton create_stubs
Log:
- Fix typos, add default case to switch and other small things.
Index: php4/ext/ext_skel
diff -u php4/ext/ext_skel:1.21 php4/ext/ext_skel:1.22
--- php4/ext/ext_skel:1.21 Fri Jun 9 20:53:11 2000
+++ php4/ext/ext_skel Fri Jun 9 22:47:22 2000
@@ -32,19 +32,18 @@
ECHO_C='\c'
fi
-ECHO_E="echo -e" # Any portability problems? If, how to test.
-
echo "Creating directory"
mkdir $extname || givup "Cannot create directory $extname"
-cd $extname
-chmod 755 .
-
if [ ! -z $functions ]; then
- cat $functions | awk -f ../skeleton/create_stubs
+ echo $functions
+ cat $functions | awk -v extname=$extname -f ./skeleton/create_stubs
fi
+cd $extname
+chmod 755 .
+
$ECHO_N "Creating basic files:$ECHO_C"
$ECHO_N " config.m4$ECHO_C"
@@ -129,6 +128,14 @@
rm function_entries
rm function_declarations
rm function_stubs
+ if [ -f function_warning ]; then
+ rm function_warning
+ warning="
+NOTE! Because some arguments to functions were resources, the code generated
+cannot yet be compiled without editing. Please consider this to be step 4.5
+in the instructions above.
+"
+ fi
fi
chmod 644 *
@@ -151,5 +158,5 @@
Repeat steps 3-6 until you are satisfied with ext/$extname/config.m4 and
step 6 confirms that your module is compiled in PHP. Then, start writing
code and repeat the last two steps as often as necessary.
-
+$warning
eof
Index: php4/ext/skeleton/create_stubs
diff -u php4/ext/skeleton/create_stubs:1.1 php4/ext/skeleton/create_stubs:1.2
--- php4/ext/skeleton/create_stubs:1.1 Fri Jun 9 20:53:11 2000
+++ php4/ext/skeleton/create_stubs Fri Jun 9 22:47:22 2000
@@ -66,7 +66,7 @@
useswitch = maxargs[i] - minargs[i]
funcvals = resources = handleargs = ""
- proto = "/* {{{ #proto " types[i] " " funcs[i] "("
+ proto = "/* {{{ proto " types[i] " " funcs[i] "("
if (maxargs[i]) {
zvals = "\tzval "
@@ -98,9 +98,9 @@
if (useswitch) {
if (j > minargs[i]-1) {
- handleargs = "\t\tcase " j+1 ";\n\t\t\t" convert(argtypes[i,j],
argnames[i,j]) "\t\t\t/* Fall-through. */\n" handleargs
+ handleargs = "\t\tcase " j+1 ":\n\t\t\t" convert(argtypes[i,j],
argnames[i,j]) "\t\t\t/* Fall-through. */\n" handleargs
} else if (j >= minargs[i]-1) {
- handleargs = "\t\tcase " j+1 ";\n\t\t\t" convert(argtypes[i,j],
argnames[i,j]) handleargs
+ handleargs = "\t\tcase " j+1 ":\n\t\t\t" convert(argtypes[i,j],
argnames[i,j]) handleargs
} else {
handleargs = "\t\t\t" convert(argtypes[i,j], argnames[i,j]) handleargs
}
@@ -112,21 +112,24 @@
proto = proto closeopts ")\n */\nPHP_FUNCTION(" funcs[i] ")\n{"
if (maxargs[i]) {
zvals = zvals ";"
- fetchargs = fetchargs ") == FAILURE) {\n\t\tWRONG_PARAM_COUNT();\n\t}\n"
+ fetchargs = fetchargs ") == FAILURE) {\n\t\tWRONG_PARAM_COUNT;\n\t}\n"
}
if (resources ) funcvals = funcvals "\t???LS_FETCH();\n"
- if (useswitch) handleargs = "\tswitch (argc) {\n" handleargs
"\t\t\tbreak;\n\t}"
+ if (useswitch) handleargs = "\tswitch (argc) {\n" handleargs
"\t\t\tbreak;\n\t\tdefault:\n\t\t\tWRONG_PARAM_COUNT;\n\t}"
- print proto > "function_stubs"
- if (zvals) print zvals > "function_stubs"
- if (funcvals) print funcvals > "function_stubs"
- if (fetchargs) print fetchargs > "function_stubs"
- if (resources) print resources > "function_stubs"
- if (handleargs) print handleargs > "function_stubs"
- print "\n\tphp_error(E_WARNING, \"" funcs[i] ": not yet
implemented\");" > "function_stubs"
- print "}\n/* }}} */\n" > "function_stubs"
- print "PHP_FUNCTION(" funcs[i] ");" > "function_declarations"
- print "\tPHP_FE(" funcs[i] ",\tNULL)" > "function_entries"
+ print proto > extname "/function_stubs"
+ if (zvals) print zvals > extname "/function_stubs"
+ if (funcvals) print funcvals > extname "/function_stubs"
+ if (fetchargs) print fetchargs > extname "/function_stubs"
+ if (resources) {
+ print resources > extname "/function_stubs"
+ print "" > extname "/function_warning"
+ }
+ if (handleargs) print handleargs > extname "/function_stubs"
+ print "\n\tphp_error(E_WARNING, \"" funcs[i] ": not yet
implemented\");" > extname "/function_stubs"
+ print "}\n/* }}} */\n" > extname "/function_stubs"
+ print "PHP_FUNCTION(" funcs[i] ");" > extname
"/function_declarations"
+ print "\tPHP_FE(" funcs[i] ",\tNULL)" > extname
"/function_entries"
}
}