<!-- BEGIN EXAMPLE CODE -->
<highlight language="c">
-module AP_MODULE_DECLARE_DATA example_module =
+AP_DECLARE_MODULE(example) =
{
STANDARD20_MODULE_STUFF,
create_dir_conf, /* Per-directory configuration handler */
<p>
This bit of code lets the server know that we have now registered a new module
in the system, and that its name is <code>example_module</code>. The name
-of the module is used primarily for two things:<br/>
+of the module is used primarily for three things:<br/>
</p>
<ul>
<li>Letting the server know how to load the module using the LoadModule</li>
<li>Setting up a namespace for the module to use in configurations</li>
+<li>Allowing the user to distinguish an origin of log messages</li>
</ul>
<p>
For now, we're only concerned with the first purpose of the module name,
<!-- BEGIN EXAMPLE CODE -->
<highlight language="c">
-module AP_MODULE_DECLARE_DATA example_module =
+AP_DECLARE_MODULE(example) =
{
STANDARD20_MODULE_STUFF,
NULL,
/* Define our module as an entity and assign a function for registering hooks */
-module AP_MODULE_DECLARE_DATA example_module =
+AP_DECLARE_MODULE(example) =
{
STANDARD20_MODULE_STUFF,
NULL, /* Per-directory configuration handler */
<!-- BEGIN EXAMPLE CODE -->
<highlight language="c">
-module AP_MODULE_DECLARE_DATA example_module =
+AP_DECLARE_MODULE(example) =
{
STANDARD20_MODULE_STUFF,
NULL, /* Per-directory configuration handler */
Our module name tag:
==============================================================================
*/
-module AP_MODULE_DECLARE_DATA example_module =
+AP_DECLARE_MODULE(example) =
{
STANDARD20_MODULE_STUFF,
NULL, /* Per-directory configuration handler */
<!-- BEGIN EXAMPLE CODE -->
<highlight language="c">
-module AP_MODULE_DECLARE_DATA example_module =
+AP_DECLARE_MODULE(example) =
{
STANDARD20_MODULE_STUFF,
create_dir_conf, /* Per-directory configuration handler */
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
-module AP_MODULE_DECLARE_DATA example_module =
+AP_DECLARE_MODULE(example) =
{
STANDARD20_MODULE_STUFF,
create_dir_conf, /* Per-directory configuration handler */
<p>To create a module DLL, a small change is necessary to the
module's source file: The module record must be exported from
the DLL (which will be created later; see below). To do this,
- add the <code>AP_MODULE_DECLARE_DATA</code> (defined in the
+ add the <code>AP_DECLARE_MODULE</code> (defined in the
Apache httpd header files) to your module's module record definition.
For example, if your module has:</p>
<p>Replace the above with:</p>
<example>
- module AP_MODULE_DECLARE_DATA foo_module;
+ AP_DECLARE_MODULE(foo);
</example>
<p>Note that this will only be activated on Windows, so the
modification à son fichier source : l'enregistrement du module doit
être exporté depuis la DLL (qui sera elle-même créée plus tard ;
voir plus loin). Pour ce faire, ajoutez la macro
- <code>AP_MODULE_DECLARE_DATA</code> (définie dans les fichiers
+ <code>AP_DECLARE_MODULE</code> (définie dans les fichiers
d'en-têtes d'Apache httpd) à la définition de l'enregistrement de votre
module. Par exemple, si votre module est déclaré comme suit :</p>
<p>Remplacez cette ligne par :</p>
<example>
- module AP_MODULE_DECLARE_DATA foo_module;
+ AP_DECLARE_MODULE(foo);
</example>
<p>Notez que cette macro ne sera prise en compte que sous Windows,
モジュールの作成に小さな変更を行なう必要があります。
つまり、モジュールのレコード (これは後で作成されます。
以下を参照してください) が DLL からエクスポートされなければなりません。
- これを行なうには、<code>AP_MODULE_DECLARE_DATA</code> (Apache httpd
+ これを行なうには、<code>AP_DECLARE_MODULE</code> (Apache httpd
のヘッダファイルで定義されています) をモジュールのモジュールレコード
定義の部分に追加してください。たとえば、モジュールに</p>
<example>
<p>があるとすると、それを次のもので置き換えてください。</p>
<example>
- module AP_MODULE_DECLARE_DATA foo_module;
+ AP_DECLARE_MODULE(foo);
</example>
<p>Unix 上でもこのモジュールを
<p>¸ðµâ DLLÀ» ¸¸µé±âÀ§Çؼ´Â ¸ðµâÀÇ ¼Ò½ºÆÄÀÏÀ» Á¶±Ý ¼öÁ¤Çؾß
ÇÑ´Ù. DLLÀº module record¸¦ exportÇØ¾ß ÇÑ´Ù. (¾Æ·¡ Âü°í)
À̸¦ À§ÇØ ¸ðµâÀÇ module record Á¤ÀÇ¿¡ (¾ÆÆÄÄ¡ Çì´õÆÄÀÏ¿¡
- Á¤ÀǵÈ) <code>AP_MODULE_DECLARE_DATA</code>¸¦ Ãß°¡ÇÑ´Ù.
+ Á¤ÀǵÈ) <code>AP_DECLARE_MODULE</code>¸¦ Ãß°¡ÇÑ´Ù.
¿¹¸¦ µé¾î, ´ÙÀ½°ú °°Àº ¸ðµâÀÌ ÀÖ´Ù¸é:</p>
<example>
<p>´ÙÀ½°ú °°ÀÌ ¼öÁ¤ÇÑ´Ù:</p>
<example>
- module AP_MODULE_DECLARE_DATA foo_module;
+ AP_DECLARE_MODULE(foo);
</example>
<p>ÀÌ ºÎºÐÀº À©µµ¿ìÁî¿¡¼¸¸ »ç¿ëÇϱ⶧¹®¿¡ º¯°æÇÏ¿©µµ À¯´Ð½º¿¡¼
değişiklik yapmak gerekir: Modül kaydının daha sonra oluşturulacak olan
DLL’den ihraç edilebilmesi gerekir (aşağıya bakınız). Bunu yapmak için
modülün modül kaydı tanımına (Apache httpd başlık dosyalarında
- tanımlanmış olan) <code>AP_MODULE_DECLARE_DATA</code> eklenmelidir.
+ tanımlanmış olan) <code>AP_DECLARE_MODULE</code> eklenmelidir.
Örneğin, modülünüz</p>
<example>
<p>diye bir satır içeriyorsa bunu,</p>
<example>
- module AP_MODULE_DECLARE_DATA foo_module;
+ AP_DECLARE_MODULE(foo);
</example>
<p>olarak değiştirmelisiniz. Bunun yalnız Windows üzerinde etkili olduğunu