|
|
@@ -45,12 +45,29 @@ HOW TO USE IT |
|
|
|
|
|
--proto=filename.
|
|
|
|
|
|
+SOURCE AND HEADER FILE NAME
|
|
|
+
|
|
|
+ ./ext_skel generates 'module_name.c' and 'php_module_name.h' as main source
|
|
|
+ and header files. Keep these names.
|
|
|
+
|
|
|
+ Module functions (User functions) must be named
|
|
|
+
|
|
|
+ module_name_function()
|
|
|
+
|
|
|
+ When you need to expose module functions to other modules, expose functions
|
|
|
+ strictly needed by others. Exposed internal function must be named
|
|
|
+
|
|
|
+ php_module_name_function()
|
|
|
+
|
|
|
+ See also CODING_STANDARDS.
|
|
|
+
|
|
|
+
|
|
|
FORMAT OF FUNCTION DEFINITIONS FILE
|
|
|
|
|
|
All the definitions must be on one line. In it's simplest form, it's just
|
|
|
the function name, e.g.
|
|
|
|
|
|
- my_function
|
|
|
+ module_name_function
|
|
|
|
|
|
but then you'll be left with an almost empty function body without any
|
|
|
argument handling.
|
|
|
@@ -72,8 +89,9 @@ FORMAT OF FUNCTION DEFINITIONS FILE |
|
|
|
|
|
An example:
|
|
|
|
|
|
- my_function(int arg1, int arg2 [, int arg3 [, int arg4]]) this is my 1st
|
|
|
+ module_name_function(int arg1, int arg2 [, int arg3 [, int arg4]])
|
|
|
|
|
|
+ Arguments arg1 and arg2 is required.
|
|
|
Arguments arg3 and arg4 are optional.
|
|
|
|
|
|
If possible, the function definition should also contain it's return type
|
|
|
@@ -133,15 +151,15 @@ EXAMPLE |
|
|
|
|
|
The following _one_ line
|
|
|
|
|
|
- bool my_drawtext(resource image, string text, resource font, int x, int y [, int color])
|
|
|
+ bool module_name_drawtext(resource image, string text, resource font, int x, int y [, int color])
|
|
|
|
|
|
will create this function definition for you (note that there are a few
|
|
|
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 module_name_drawtext(resource image, string text, resource font, int x, int y [, int color])
|
|
|
*/
|
|
|
-PHP_FUNCTION(my_drawtext)
|
|
|
+PHP_FUNCTION(module_name_drawtext)
|
|
|
{
|
|
|
char *text = NULL;
|
|
|
int argc = ZEND_NUM_ARGS();
|
|
|
@@ -164,7 +182,7 @@ PHP_FUNCTION(my_drawtext) |
|
|
ZEND_FETCH_RESOURCE(???, ???, font, font_id, "???", ???_rsrc_id);
|
|
|
}
|
|
|
|
|
|
- php_error(E_WARNING, "my_drawtext: not yet implemented");
|
|
|
+ php_error(E_WARNING, "module_name_drawtext: not yet implemented");
|
|
|
}
|
|
|
/* }}} */
|
|
|
|
0 comments on commit
f496aac