@@ -45,12 +45,29 @@ HOW TO USE IT
45
45
46
46
--proto=filename.
47
47
48
+ SOURCE AND HEADER FILE NAME
49
+
50
+ ./ext_skel generates 'module_name.c' and 'php_module_name.h' as main source
51
+ and header files. Keep these names.
52
+
53
+ Module functions (User functions) must be named
54
+
55
+ module_name_function()
56
+
57
+ When you need to expose module functions to other modules, expose functions
58
+ strictly needed by others. Exposed internal function must be named
59
+
60
+ php_module_name_function()
61
+
62
+ See also CODING_STANDARDS.
63
+
64
+
48
65
FORMAT OF FUNCTION DEFINITIONS FILE
49
66
50
67
All the definitions must be on one line. In it's simplest form, it's just
51
68
the function name, e.g.
52
69
53
- my_function
70
+ module_name_function
54
71
55
72
but then you'll be left with an almost empty function body without any
56
73
argument handling.
@@ -72,8 +89,9 @@ FORMAT OF FUNCTION DEFINITIONS FILE
72
89
73
90
An example:
74
91
75
- my_function (int arg1, int arg2 [, int arg3 [, int arg4]]) this is my 1st
92
+ module_name_function (int arg1, int arg2 [, int arg3 [, int arg4]])
76
93
94
+ Arguments arg1 and arg2 are required.
77
95
Arguments arg3 and arg4 are optional.
78
96
79
97
If possible, the function definition should also contain it's return type
@@ -133,15 +151,15 @@ EXAMPLE
133
151
134
152
The following _one_ line
135
153
136
- bool my_drawtext (resource image, string text, resource font, int x, int y [, int color])
154
+ bool module_name_drawtext (resource image, string text, resource font, int x, int y [, int color])
137
155
138
156
will create this function definition for you (note that there are a few
139
157
question marks to be replaced by you, and you must of course add your own
140
158
value definitions too):
141
159
142
- /* {{{ proto bool my_drawtext (resource image, string text, resource font, int x, int y [, int color])
160
+ /* {{{ proto bool module_name_drawtext (resource image, string text, resource font, int x, int y [, int color])
143
161
*/
144
- PHP_FUNCTION(my_drawtext )
162
+ PHP_FUNCTION(module_name_drawtext )
145
163
{
146
164
char *text = NULL;
147
165
int argc = ZEND_NUM_ARGS();
@@ -164,7 +182,7 @@ PHP_FUNCTION(my_drawtext)
164
182
ZEND_FETCH_RESOURCE(???, ???, font, font_id, "???", ???_rsrc_id);
165
183
}
166
184
167
- php_error(E_WARNING, "my_drawtext : not yet implemented");
185
+ php_error(E_WARNING, "module_name_drawtext : not yet implemented");
168
186
}
169
187
/* }}} */
170
188
0 commit comments