0

我阅读了这个网站并对 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 函数获取函数指针。但是永远不要看谁一个可执行文件可能会在库中定义变量,任何人都可以帮助我解决这个问题吗?

4

1 回答 1

0

dlsym()可以返回变量的地址——在 POSIX 文档中甚至有一个例子。我不知道什么是 Windows 的等价物。

于 2011-03-14T16:26:34.410 回答