PHP. Руководство по PHP. 2005
Implementation of All Exported Functions
Глава 51. Source Discussion
Implementation of All Exported Functions
Implementing the exported functions is the final step. The example function in first_module looks like this:
The function declaration is done using ZEND_FUNCTION, which corresponds to ZEND_FE in the function entry table (discussed earlier).ZEND_FUNCTION(first_module)
{long parameter; if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", ¶meter) == FAILURE){return;} RETURN_LONG(parameter);
}
After the declaration, code for checking and retrieving the function's arguments, argument conversion, and return value generation follows (more on this later).
Creation of get_module()