PHP擴展框架各個宏編譯成so動態連接庫文件以後對應的函數符號對照

###幾個比較重要的宏code

####一、PHP_RINIT_FUNCTION宏get

#define PHP_RINIT_FUNCTION		ZEND_MODULE_ACTIVATE_D
#define ZEND_MODULE_ACTIVATE_D(module)		int ZEND_MODULE_ACTIVATE_N(module)(INIT_FUNC_ARGS)
#define ZEND_MODULE_ACTIVATE_N(module)		zm_activate_##module

####二、PHP_MINIT_FUNCTION宏class

#define PHP_MINIT_FUNCTION		ZEND_MODULE_STARTUP_D
#define ZEND_MODULE_STARTUP_D(module)		int ZEND_MODULE_STARTUP_N(module)(INIT_FUNC_ARGS)
#define ZEND_MODULE_STARTUP_N(module)       zm_startup_##module

####三、ZEND_GET_MODULE宏module

#define ZEND_GET_MODULE(name) \
    BEGIN_EXTERN_C()\
	ZEND_DLEXPORT zend_module_entry *get_module(void) { return &name##_module_entry; }\
    END_EXTERN_C()

####四、PHP_MSHUTDOWN_FUNCTION宏co

#define PHP_MSHUTDOWN_FUNCTION	ZEND_MODULE_SHUTDOWN_D
#define ZEND_MODULE_SHUTDOWN_D(module)		int ZEND_MODULE_SHUTDOWN_N(module)(SHUTDOWN_FUNC_ARGS)
#define ZEND_MODULE_SHUTDOWN_N(module)		zm_shutdown_##module

####五、PHP_RSHUTDOWN_FUNCTION宏return

#define PHP_RSHUTDOWN_FUNCTION	ZEND_MODULE_DEACTIVATE_D
#define ZEND_MODULE_DEACTIVATE_D(module)	int ZEND_MODULE_DEACTIVATE_N(module)(SHUTDOWN_FUNC_ARGS)
#define ZEND_MODULE_DEACTIVATE_N(module)	zm_deactivate_##module

####六、PHP_MINFO_FUNCTION宏void

#define PHP_MINFO_FUNCTION		ZEND_MODULE_INFO_D
#define ZEND_MODULE_INFO_D(module)			void ZEND_MODULE_INFO_N(module)(ZEND_MODULE_INFO_FUNC_ARGS)
#define ZEND_MODULE_INFO_N(module)			zm_info_##module

####七、PHP_FUNCTION宏tar

#define PHP_FUNCTION			ZEND_FUNCTION
#define ZEND_FUNCTION(name)				ZEND_NAMED_FUNCTION(ZEND_FN(name))
#define ZEND_NAMED_FUNCTION(name)		void name(INTERNAL_FUNCTION_PARAMETERS)
#define ZEND_FN(name) zif_##name
相關文章
相關標籤/搜索