From ed43771126af243b485e9777836e48a12af80d0a Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Tue, 3 Apr 2001 00:27:16 +0000 Subject: [PATCH] Here they are, real working examples [well, perhaps working.] [Ben Laurie, Will Rowe] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88667 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 + STATUS | 9 +- .../experimental/mod_generic_hook_export.c | 4 +- .../experimental/mod_generic_hook_export.dsp | 95 +++++++++++++++++++ .../experimental/mod_generic_hook_export.h | 2 +- .../experimental/mod_generic_hook_import.c | 2 +- .../experimental/mod_generic_hook_import.dsp | 95 +++++++++++++++++++ 7 files changed, 198 insertions(+), 12 deletions(-) create mode 100644 modules/experimental/mod_generic_hook_export.dsp create mode 100644 modules/experimental/mod_generic_hook_import.dsp diff --git a/CHANGES b/CHANGES index a82c992817..224ce81bd7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with Apache 2.0.16-dev + *) Make generic hooks to work, with mod_generic_hook_import/export + experimental modules. [Ben Laurie, Will Rowe] + *) Fix segfaults for configuration file syntax errors such as "" followed by "" followed by "". [Jeff Trawick] diff --git a/STATUS b/STATUS index 979bc32274..513cd7f27b 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE 2.0 STATUS: -*-text-*- -Last modified at [$Date: 2001/04/02 22:07:35 $] +Last modified at [$Date: 2001/04/03 00:27:08 $] Release: @@ -24,13 +24,6 @@ RELEASE SHOWSTOPPERS: WARNING: ALWAYS check srclib/apr/STATUS and srclib/apr-util/STATUS - * Generic Hooks are absolutely wrong in linkage, they are declared as - exported from APU, but actually exported from modules. This needs - heavy fixup, which Bill will do on the plane tommorow. The actual - 'Apache' declaration is in Apache's files, with the 'explicit linkage' - flavor in apr-util. (Unless you folks will finally buckle and accept - the linkspec in hook declarations. I'm not holding my breath.) - * Root all file systems with for WIN32/OS2/NW permissions Status: patch brought forward from 1.3.14 WIN32 and OS2 need review [William Rowe, Brian Harvard] diff --git a/modules/experimental/mod_generic_hook_export.c b/modules/experimental/mod_generic_hook_export.c index fd7e28de1d..38ee86815d 100644 --- a/modules/experimental/mod_generic_hook_export.c +++ b/modules/experimental/mod_generic_hook_export.c @@ -57,8 +57,8 @@ #include "mod_generic_hook_export.h" #include "http_protocol.h" -AP_IMPLEMENT_GENERIC_HOOK_RUN_ALL(int,generic_hook_test,(const char *szStr), - (szStr),OK,DECLINED) +APR_IMPLEMENT_GENERIC_HOOK_RUN_ALL(ap,AP_MODULE,int,generic_hook_test,(const char *szStr), + (szStr),OK,DECLINED) static int ExportLogTransaction(request_rec *r) { diff --git a/modules/experimental/mod_generic_hook_export.dsp b/modules/experimental/mod_generic_hook_export.dsp new file mode 100644 index 0000000000..711a041565 --- /dev/null +++ b/modules/experimental/mod_generic_hook_export.dsp @@ -0,0 +1,95 @@ +# Microsoft Developer Studio Project File - Name="mod_generic_hook_export" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=mod_generic_hook_export - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "mod_generic_hook_export.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "mod_generic_hook_export.mak" CFG="mod_generic_hook_export - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_generic_hook_export - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_generic_hook_export - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "mod_generic_hook_export - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "..\..\include" /I "..\..\os\win32" /I "..\..\srclib\apr\include" /I "../../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Release\mod_generic_hook_export" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /out:"Release/mod_generic_hook_export.so" /machine:I386 +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /out:"Release/mod_generic_hook_export.so" /machine:I386 + +!ELSEIF "$(CFG)" == "mod_generic_hook_export - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\..\include" /I "..\..\os\win32" /I "..\..\srclib\apr\include" /I "../../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Debug\mod_generic_hook_export" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /out:"Debug/mod_generic_hook_export.so" /machine:I386 +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map/debug /out:"Debug/mod_generic_hook_export.so" /machine:I386 + +!ENDIF + +# Begin Target + +# Name "mod_generic_hook_export - Win32 Release" +# Name "mod_generic_hook_export - Win32 Debug" +# Begin Source File + +SOURCE=.\mod_generic_hook_export.c +# End Source File +# End Target +# End Project diff --git a/modules/experimental/mod_generic_hook_export.h b/modules/experimental/mod_generic_hook_export.h index 0f17fbbe2d..a55d2f227c 100644 --- a/modules/experimental/mod_generic_hook_export.h +++ b/modules/experimental/mod_generic_hook_export.h @@ -57,6 +57,6 @@ #include "apr_generic_hook.h" -AP_DECLARE_HOOK(int,generic_hook_test,(const char *)) +APR_DECLARE_EXTERNAL_HOOK(ap,AP_MODULE,int,generic_hook_test,(const char *)) #endif /* def MOD_GENERIC_HOOK_EXPORT_H */ diff --git a/modules/experimental/mod_generic_hook_import.c b/modules/experimental/mod_generic_hook_import.c index cf060512ea..f46fa44df5 100644 --- a/modules/experimental/mod_generic_hook_import.c +++ b/modules/experimental/mod_generic_hook_import.c @@ -67,7 +67,7 @@ static int ImportGenericHookTestHook(const char *szStr) static void ImportRegisterHooks(apr_pool_t *p) { - APR_HOOK_GENERIC(generic_hook_test,ImportGenericHookTestHook,NULL,NULL, + APR_HOOK_GENERIC(ap,generic_hook_test,ImportGenericHookTestHook,NULL,NULL, APR_HOOK_MIDDLE); } diff --git a/modules/experimental/mod_generic_hook_import.dsp b/modules/experimental/mod_generic_hook_import.dsp new file mode 100644 index 0000000000..78068294ab --- /dev/null +++ b/modules/experimental/mod_generic_hook_import.dsp @@ -0,0 +1,95 @@ +# Microsoft Developer Studio Project File - Name="mod_generic_hook_import" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=mod_generic_hook_import - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "mod_generic_hook_import.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "mod_generic_hook_import.mak" CFG="mod_generic_hook_import - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mod_generic_hook_import - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "mod_generic_hook_import - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "mod_generic_hook_import - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MD /W3 /O2 /I "..\..\include" /I "..\..\os\win32" /I "..\..\srclib\apr\include" /I "../../srclib/apr-util/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Release\mod_generic_hook_import" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /out:"Release/mod_generic_hook_import.so" /machine:I386 +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /out:"Release/mod_generic_hook_import.so" /machine:I386 + +!ELSEIF "$(CFG)" == "mod_generic_hook_import - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\..\include" /I "..\..\os\win32" /I "..\..\srclib\apr\include" /I "../../srclib/apr-util/include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /Fd"Debug\mod_generic_hook_import" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map /debug /out:"Debug/mod_generic_hook_import.so" /machine:I386 +# ADD LINK32 kernel32.lib /nologo /subsystem:windows /dll /incremental:no /map/debug /out:"Debug/mod_generic_hook_import.so" /machine:I386 + +!ENDIF + +# Begin Target + +# Name "mod_generic_hook_import - Win32 Release" +# Name "mod_generic_hook_import - Win32 Debug" +# Begin Source File + +SOURCE=.\mod_generic_hook_import.c +# End Source File +# End Target +# End Project -- 2.40.0