p;zend_module_entry icbc_module_entry;
#define phpext_icbc_ptr &icbc_module_entry
#ifdef PHP_WIN32
#define PHP_ICBC_API __declspec(dllexport)
#else
#define PHP_ICBC_API
#endif
#ifdef ZTS
#include \"TSRM.h\"
#endif
PHP_MINIT_FUNCTION(icbc);
PHP_MSHUTDOWN_FUNCTION(icbc);
PHP_RINIT_FUNCTION(icbc);
PHP_RSHUTDOWN_FUNCTION(icbc);
PHP_MINFO_FUNCTION(icbc);
/*Modify youself here*/
PHP_FUNCTION(icbc_sign);
PHP_FUNCTION(icbc_vsign);
PHP_FUNCTION(icbc_getCertID);
/****End of Self control section***/
#ifdef ZTS
#define ICBC_G(v) TSRMG(icbc_globals_id, zend_icbc_globals *, v)
#else
#define ICBC_G(v) (icbc_globals.v)
#endif
#endif /* PHP_ICBC_H */
涉及到我们也就
PHP_FUNCTION(icbc_sign);
PHP_FUNCTION(icbc_vsign);
PHP_FUNCTION(icbc_getCertID);
其他的都是PHP各个状态的入口函数声明
4.编写这三个函数的实现:
#ifdef HAVE_CONFIG_H
#include \"config.h\"
#endif
#include \"php.h\"
#include \"php_ini.h\"
#include \"ext/standard/info.h\"
#include \"php_icbc.h\"
#include \"icbcapi.h\"
static int le_icbc;
zend_function_entry icbc_functions = {
PHP_FE(icbc_sign,NULL)
PHP_FE(icbc_vsign,NULL)
PHP_FE(icbc_getCertID,NULL)
{NULL, NULL, NULL} /* Must be the last line in icbc_functions */
};
zend_module_entry icbc_module_entry = {
#if ZEND_MODULE_API_NO >= 20010901
STANDARD_MODULE_HEADER,
#endif
\"icbc\",
icbc_functions,
PHP_MINIT(icbc),
PHP_MSHUTDOWN(icbc),
PHP_RINIT(icbc), /* Replace with NULL if there’s nothing to do at request start */
PHP_RSHUTDOWN(icbc), /* Replace with NULL if there’s nothing to do at request end */ [Page]
PHP_MINFO(icbc),
#if ZEND_MODULE_API_NO >= 20010901
\"0.1\", /* Replace with version number for your extension */
#endif
STANDARD_MODULE_PROPERTIES
};
#ifdef COMPILE_DL_ICBC
ZEND_GET_MODULE(icbc)
#endif
PHP_MINIT_FUNCTION(icbc)
{
return SUCCESS;
}
PHP_MSHUTDOWN_FUNCTION(icbc)
{
return SUCCESS;
}
PHP_RINIT_FUNCTION(icbc)
{
return SUCCESS;
}
PHP_RSHUTDOWN_FUNCTION(icbc)
{
return SUCCESS;
}
PHP_MINFO_FUNCTION(icbc)
{
php_info_print_table_start();
php_info_print_table_header(2