summaryrefslogtreecommitdiff
path: root/README.EXT_SKEL
diff options
context:
space:
mode:
authorYasuo Ohgaki <yohgaki@php.net>2014-01-26 18:31:27 +0900
committerStanislav Malyshev <stas@php.net>2014-01-26 17:20:12 -0800
commitf496aac1f6fc2b3ef30d5ed9539dbfdf9b4a1892 (patch)
treeddfd36b5a85c358fc05b1d906a9b8f3d97d970ba /README.EXT_SKEL
parent76c098395df506692b1aba48ed0042cc1a27b491 (diff)
downloadphp-git-f496aac1f6fc2b3ef30d5ed9539dbfdf9b4a1892.tar.gz
Update source docs
Diffstat (limited to 'README.EXT_SKEL')
-rw-r--r--README.EXT_SKEL30
1 files changed, 24 insertions, 6 deletions
diff --git a/README.EXT_SKEL b/README.EXT_SKEL
index d44fcc5c6a..20b684ddfa 100644
--- a/README.EXT_SKEL
+++ b/README.EXT_SKEL
@@ -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");
}
/* }}} */