谁可以获得库中定义的变量
我读了这个网站并且对C有疑问。
/*
* Declare and populate the module's data structure. The
* name of this structure ('tut1_module') is important - it
* must match the name of the module. This structure is the
* only "glue" between the httpd core and the module.
*/
module AP_MODULE_DECLARE_DATA tut1_module =
{
// Only one callback function is provided. Real
// modules will need to declare callback functions for
// server/directory configuration, configuration merging
// and other tasks.
STANDARD20_MODULE_STUFF,
NULL,
NULL,
NULL,
NULL,
NULL,
mod_tut1_register_hooks, /* callback for registering hooks */
};
在上面的部分中我没有知道 apache 得到这个变量是什么。 我知道谁在 C 中使用 LoadLibrary/dlopen、GetProcAddress/dlsyn 函数获取函数指针。但永远不要看谁一个可执行文件可能会在库中定义变量,任何人都可以帮助我解决这个疑问吗?
I read this site and have a doubt with C.
/*
* Declare and populate the module's data structure. The
* name of this structure ('tut1_module') is important - it
* must match the name of the module. This structure is the
* only "glue" between the httpd core and the module.
*/
module AP_MODULE_DECLARE_DATA tut1_module =
{
// Only one callback function is provided. Real
// modules will need to declare callback functions for
// server/directory configuration, configuration merging
// and other tasks.
STANDARD20_MODULE_STUFF,
NULL,
NULL,
NULL,
NULL,
NULL,
mod_tut1_register_hooks, /* callback for registering hooks */
};
In the section above I not know what apache get this variable.
I know who get function pointer in C, using LoadLibrary/dlopen, GetProcAddress/dlsyn function. But never watch who one executable may get variable defined in library, anyone can help me in this doubt ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
dlsym() 可以返回变量的地址——POSIX 文档中甚至有一个示例。我不知道 Windows 的等效项是什么。
dlsym()
can return address of variables -- there is even an example in POSIX doc. I don't what is the equivalent for Windows.