我正在开发 apache 模块。我想从我自己的配置文件中读取一些数据。如何在 Apache 中读取配置文件。我正在使用C语言开发模块。
问问题
351 次
2 回答
0
您应该避免使用它,因为 Apache 为您提供了复杂的配置机制。如果您坚持这样做,请注册一个 post_config 挂钩并执行 C 编程 101 I/O 以读取文件并解析它。
于 2016-08-07T20:46:28.740 回答
0
您需要包含ap_config.h
在您的 c 代码中。
ap_config_file *fl;
apr_pool_t *pl;
location = "location of your file";
apr_pool_create(&pl,NULL);
if(ap_pcfg_openfile(&fl,pl,location)==APR_SUCCESS){
/* do your stuff here */
}
于 2016-12-04T14:10:27.513 回答