httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@locus.apache.org
Subject cvs commit: apache-2.0/src/include ap.h ap_base64.h ap_hooks.h ap_sha1.h
Date Sat, 27 May 2000 04:23:26 GMT
wrowe       00/05/26 21:23:26

  Modified:    src/ap   ap.dsp ap_base64.c ap_sha1.c ap_hooks.c
               src/include ap.h ap_base64.h ap_hooks.h ap_sha1.h
  Log:
  
    ap.h is the basis for the ap.lib collection.  Since it is a distinct
    package, this patch provides appropriate Win32 linkage resolution for
    its functions and data.
  
    The most significant change is in the ap_hooks.h declaration macros.
    These now require a first parameter of the linkage to be used.  There
    is no shared data, so only the hook-in and hook-run functions are
    affected.  Use the appropriate function export without the parens,
    for the core server this will be API_EXPORT (no variable args, and the
    functions are exported from the core server.)
  
    The patch to correct the resulting issues in the server core follows
    seperately.
    
  
  Revision  Changes    Path
  1.9       +12 -7     apache-2.0/src/ap/ap.dsp
  
  Index: ap.dsp
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/ap/ap.dsp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ap.dsp	2000/05/24 23:44:33	1.8
  +++ ap.dsp	2000/05/27 04:23:23	1.9
  @@ -26,7 +26,6 @@
   # PROP Scc_ProjName ""
   # PROP Scc_LocalPath ""
   CPP=cl.exe
  -RSC=rc.exe
   
   !IF  "$(CFG)" == "ap - Win32 Release"
   
  @@ -40,11 +39,12 @@
   # PROP Output_Dir "Release"
   # PROP Intermediate_Dir "Release"
   # PROP Target_Dir ""
  -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
  -# ADD CPP /nologo /MD /W3 /GX /O2 /I "../include" /I "../lib/apr/include" /I "../os/win32/"
/D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
  -# SUBTRACT CPP /YX
  +RSC=rc.exe
   # ADD BASE RSC /l 0x409
   # ADD RSC /l 0x409
  +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
  +# ADD CPP /nologo /MD /W3 /GX /O2 /I "../include" /I "../lib/apr/include" /I "../os/win32/"
/D "NDEBUG" /D "AP_EXPORT_SYMBOLS" /D "WIN32" /D "_WINDOWS" /FD /c
  +# SUBTRACT CPP /YX
   BSC32=bscmake.exe
   # ADD BASE BSC32 /nologo
   # ADD BSC32 /nologo
  @@ -64,11 +64,12 @@
   # PROP Output_Dir "Debug"
   # PROP Intermediate_Dir "Debug"
   # PROP Target_Dir ""
  -# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
  -# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "../include" /I "../lib/apr/include" /I "../os/win32/"
/D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
  -# SUBTRACT CPP /YX
  +RSC=rc.exe
   # ADD BASE RSC /l 0x409
   # ADD RSC /l 0x409
  +# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
  +# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "../include" /I "../lib/apr/include" /I "../os/win32/"
/D "_DEBUG" /D "AP_EXPORT_SYMBOLS" /D "WIN32" /D "_WINDOWS" /FD /c
  +# SUBTRACT CPP /YX
   BSC32=bscmake.exe
   # ADD BASE BSC32 /nologo
   # ADD BSC32 /nologo
  @@ -101,6 +102,10 @@
   # Begin Group "Header Files"
   
   # PROP Default_Filter ""
  +# Begin Source File
  +
  +SOURCE=..\include\ap.h
  +# End Source File
   # Begin Source File
   
   SOURCE=..\include\ap_base64.h
  
  
  
  1.10      +8 -8      apache-2.0/src/ap/ap_base64.c
  
  Index: ap_base64.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/ap/ap_base64.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ap_base64.c	2000/05/24 17:19:10	1.9
  +++ ap_base64.c	2000/05/27 04:23:23	1.10
  @@ -114,7 +114,7 @@
   static ap_xlate_t *xlate_to_ebcdic;
   static unsigned char os_toascii[256];
   
  -API_EXPORT(ap_status_t) ap_base64init_ebcdic(ap_xlate_t *to_ascii,
  +AP_EXPORT(ap_status_t) ap_base64init_ebcdic(ap_xlate_t *to_ascii,
                                                ap_xlate_t *to_ebcdic)
   {
       int i;
  @@ -150,7 +150,7 @@
   }
   #endif /*CHARSET_EBCDIC*/
   
  -API_EXPORT(int) ap_base64decode_len(const char *bufcoded)
  +AP_EXPORT(int) ap_base64decode_len(const char *bufcoded)
   {
       int nbytesdecoded;
       register const unsigned char *bufin;
  @@ -165,7 +165,7 @@
       return nbytesdecoded + 1;
   }
   
  -API_EXPORT(int) ap_base64decode(char *bufplain, const char *bufcoded)
  +AP_EXPORT(int) ap_base64decode(char *bufplain, const char *bufcoded)
   {
   #ifdef CHARSET_EBCDIC
       ap_size_t inbytes_left, outbytes_left;
  @@ -185,7 +185,7 @@
   /* This is the same as ap_base64decode() except on EBCDIC machines, where
    * the conversion of the output to ebcdic is left out.
    */
  -API_EXPORT(int) ap_base64decode_binary(unsigned char *bufplain,
  +AP_EXPORT(int) ap_base64decode_binary(unsigned char *bufplain,
   				   const char *bufcoded)
   {
       int nbytesdecoded;
  @@ -233,12 +233,12 @@
   static const char basis_64[] =
       "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
   
  -API_EXPORT(int) ap_base64encode_len(int len)
  +AP_EXPORT(int) ap_base64encode_len(int len)
   {
       return ((len + 2) / 3 * 4) + 1;
   }
   
  -API_EXPORT(int) ap_base64encode(char *encoded, const char *string, int len)
  +AP_EXPORT(int) ap_base64encode(char *encoded, const char *string, int len)
   {
   #ifndef CHARSET_EBCDIC
       return ap_base64encode_binary(encoded, (const unsigned char *) string, len);
  @@ -277,8 +277,8 @@
   /* This is the same as ap_base64encode() except on EBCDIC machines, where
    * the conversion of the input to ascii is left out.
    */
  -API_EXPORT(int) ap_base64encode_binary(char *encoded,
  -                                       const unsigned char *string, int len)
  +AP_EXPORT(int) ap_base64encode_binary(char *encoded,
  +                                      const unsigned char *string, int len)
   {
       int i;
       char *p;
  
  
  
  1.10      +10 -10    apache-2.0/src/ap/ap_sha1.c
  
  Index: ap_sha1.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/ap/ap_sha1.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ap_sha1.c	2000/05/24 17:19:10	1.9
  +++ ap_sha1.c	2000/05/27 04:23:23	1.10
  @@ -121,7 +121,7 @@
   #ifdef CHARSET_EBCDIC
   static ap_xlate_t *ebcdic2ascii_xlate;
   
  -API_EXPORT(ap_status_t) ap_SHA1InitEBCDIC(ap_xlate_t *x)
  +AP_EXPORT(ap_status_t) ap_SHA1InitEBCDIC(ap_xlate_t *x)
   {
       ap_status_t rv;
       int onoff;
  @@ -242,7 +242,7 @@
   
   /* initialize the SHA digest */
   
  -API_EXPORT(void) ap_SHA1Init(AP_SHA1_CTX *sha_info)
  +AP_EXPORT(void) ap_SHA1Init(AP_SHA1_CTX *sha_info)
   {
       sha_info->digest[0] = 0x67452301L;
       sha_info->digest[1] = 0xefcdab89L;
  @@ -256,9 +256,9 @@
   
   /* update the SHA digest */
   
  -API_EXPORT(void) ap_SHA1Update_binary(AP_SHA1_CTX *sha_info,
  -				      const unsigned char *buffer,
  -				      unsigned int count)
  +AP_EXPORT(void) ap_SHA1Update_binary(AP_SHA1_CTX *sha_info,
  +                                     const unsigned char *buffer,
  +                                     unsigned int count)
   {
       unsigned int i;
   
  @@ -295,8 +295,8 @@
       sha_info->local = count;
   }
   
  -API_EXPORT(void) ap_SHA1Update(AP_SHA1_CTX *sha_info, const char *buf,
  -			       unsigned int count)
  +AP_EXPORT(void) ap_SHA1Update(AP_SHA1_CTX *sha_info, const char *buf,
  +                              unsigned int count)
   {
   #ifdef CHARSET_EBCDIC
       int i;
  @@ -349,8 +349,8 @@
   
   /* finish computing the SHA digest */
   
  -API_EXPORT(void) ap_SHA1Final(unsigned char digest[SHA_DIGESTSIZE],
  -                              AP_SHA1_CTX *sha_info)
  +AP_EXPORT(void) ap_SHA1Final(unsigned char digest[SHA_DIGESTSIZE],
  +                             AP_SHA1_CTX *sha_info)
   {
       int count, i, j;
       ap_uint32_t lo_bit_count, hi_bit_count, k;
  @@ -384,7 +384,7 @@
   }
   
   
  -API_EXPORT(void) ap_sha1_base64(const char *clear, int len, char *out)
  +AP_EXPORT(void) ap_sha1_base64(const char *clear, int len, char *out)
   {
       int l;
       AP_SHA1_CTX context;
  
  
  
  1.14      +10 -5     apache-2.0/src/ap/ap_hooks.c
  
  Index: ap_hooks.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/ap/ap_hooks.c,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ap_hooks.c	2000/04/29 16:00:30	1.13
  +++ ap_hooks.c	2000/05/27 04:23:23	1.14
  @@ -6,6 +6,10 @@
   #define ap_palloc(pool,size)	malloc(size)
   #endif
   
  +AP_EXPORT_VAR ap_pool_t *g_pHookPool = NULL;
  +AP_EXPORT_VAR int g_bDebugHooks = FALSE;
  +AP_EXPORT_VAR const char *g_szCurrentHookName = NULL;
  +
   /* NB: This must echo the LINK_##name structure */
   typedef struct
   {
  @@ -144,7 +148,8 @@
       ap_array_header_t **paHooks;
   } HookSortEntry;
   
  -void ap_hook_sort_register(const char *szHookName,ap_array_header_t **paHooks)
  +AP_EXPORT(void) ap_hook_sort_register(const char *szHookName,
  +                                      ap_array_header_t **paHooks)
   {
       HookSortEntry *pEntry;
   
  @@ -155,7 +160,7 @@
       pEntry->paHooks=paHooks;
   }
   
  -void ap_sort_hooks()
  +AP_EXPORT(void) ap_sort_hooks()
   {
       int n;
   
  @@ -165,7 +170,7 @@
       }
   }
       
  -void ap_hook_deregister_all(void)
  +AP_EXPORT(void) ap_hook_deregister_all(void)
   {
       int n;    
   
  @@ -176,8 +181,8 @@
       s_aHooksToSort=NULL;
   }
   
  -void ap_show_hook(const char *szName,const char * const *aszPre,
  -		  const char * const *aszSucc)
  +AP_EXPORT(void) ap_show_hook(const char *szName,const char * const *aszPre,
  +		             const char * const *aszSucc)
   {
       int nFirst;
   
  
  
  
  1.12      +12 -31    apache-2.0/src/include/ap.h
  
  Index: ap.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/include/ap.h,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ap.h	2000/04/29 16:00:27	1.11
  +++ ap.h	2000/05/27 04:23:24	1.12
  @@ -60,37 +60,18 @@
   extern "C" {
   #endif
   
  -/* stuff marked API_EXPORT is part of the API, and intended for use
  - * by modules
  - */
  -#ifndef API_EXPORT
  -#define API_EXPORT(type)    type
  -#endif
  -
  -/* Stuff marked API_EXPORT_NONSTD is part of the API, and intended for
  - * use by modules.  The difference between API_EXPORT and
  - * API_EXPORT_NONSTD is that the latter is required for any functions
  - * which use varargs or are used via indirect function call.  This
  - * is to accomodate the two calling conventions in windows dlls.
  - */
  -#ifndef API_EXPORT_NONSTD
  -#define API_EXPORT_NONSTD(type)    type
  -#endif
  -
  -#ifndef MODULE_VAR_EXPORT
  -#define MODULE_VAR_EXPORT
  -#endif
  -#ifndef API_VAR_EXPORT
  -#define API_VAR_EXPORT
  -#endif
  -
  -/* modules should not used functions marked CORE_EXPORT
  - * or CORE_EXPORT_NONSTD */
  -#ifndef CORE_EXPORT
  -#define CORE_EXPORT	API_EXPORT
  -#endif
  -#ifndef CORE_EXPORT_NONSTD
  -#define CORE_EXPORT_NONSTD	API_EXPORT_NONSTD
  +#if !defined(WIN32) || defined(AP_STATIC)
  +#define AP_EXPORT(type)        type
  +#define AP_EXPORT_NONSTD(type) type
  +#define AP_EXPORT_VAR
  +#elif defined(AP_EXPORT_SYMBOLS)
  +#define AP_EXPORT(type)        __declspec(dllexport) type
  +#define AP_EXPORT_NONSTD(type) __declspec(dllexport) type
  +#define AP_EXPORT_VAR          __declspec(dllexport)
  +#else
  +#define AP_EXPORT(type)        __declspec(dllimport) type
  +#define AP_EXPORT_NONSTD(type) __declspec(dllimport) type
  +#define AP_EXPORT_VAR          __declspec(dllimport)
   #endif
   
   #ifdef __cplusplus
  
  
  
  1.3       +6 -6      apache-2.0/src/include/ap_base64.h
  
  Index: ap_base64.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/include/ap_base64.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ap_base64.h	2000/05/26 17:18:51	1.2
  +++ ap_base64.h	2000/05/27 04:23:25	1.3
  @@ -77,13 +77,13 @@
    * strings are neither. But propably should.
    *
    */
  -API_EXPORT(int) ap_base64encode_len(int len);
  -API_EXPORT(int) ap_base64encode(char * coded_dst, const char *plain_src,int len_plain_src);
  -API_EXPORT(int) ap_base64encode_binary(char * coded_dst, const unsigned char *plain_src,int
len_plain_src);
  +AP_EXPORT(int) ap_base64encode_len(int len);
  +AP_EXPORT(int) ap_base64encode(char * coded_dst, const char *plain_src,int len_plain_src);
  +AP_EXPORT(int) ap_base64encode_binary(char * coded_dst, const unsigned char *plain_src,int
len_plain_src);
   
  -API_EXPORT(int) ap_base64decode_len(const char * coded_src);
  -API_EXPORT(int) ap_base64decode(char * plain_dst, const char *coded_src);
  -API_EXPORT(int) ap_base64decode_binary(unsigned char * plain_dst, const char *coded_src);
  +AP_EXPORT(int) ap_base64decode_len(const char * coded_src);
  +AP_EXPORT(int) ap_base64decode(char * plain_dst, const char *coded_src);
  +AP_EXPORT(int) ap_base64decode_binary(unsigned char * plain_dst, const char *coded_src);
   
   #ifdef __cplusplus
   }
  
  
  
  1.16      +28 -25    apache-2.0/src/include/ap_hooks.h
  
  Index: ap_hooks.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/include/ap_hooks.h,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- ap_hooks.h	2000/05/18 00:45:05	1.15
  +++ ap_hooks.h	2000/05/27 04:23:25	1.16
  @@ -55,14 +55,16 @@
   #ifndef APACHE_AP_HOOKS_H
   #define APACHE_AP_HOOKS_H
   
  +#include "ap.h"
  +
   /* For ap_array_header_t */
   #include "apr_lib.h"
   
  -#define AP_DECLARE_HOOK(ret,name,args) \
  +#define AP_DECLARE_HOOK(impl,ret,name,args) \
   typedef ret HOOK_##name args; \
  -void ap_hook_##name(HOOK_##name *pf,const char * const *aszPre, \
  -		    const char * const *aszSucc,int nOrder); \
  -ret ap_run_##name args; \
  +impl(void) ap_hook_##name(HOOK_##name *pf,const char * const *aszPre, \
  +		         const char * const *aszSucc,int nOrder); \
  +impl(ret) ap_run_##name args; \
   typedef struct _LINK_##name \
       { \
       HOOK_##name *pFunc; \
  @@ -78,9 +80,9 @@
   #define AP_HOOK_LINK(name) \
       ap_array_header_t *link_##name;
   
  -#define AP_IMPLEMENT_HOOK_BASE(name) \
  -void ap_hook_##name(HOOK_##name *pf,const char * const *aszPre, \
  -		    const char * const *aszSucc,int nOrder) \
  +#define AP_IMPLEMENT_HOOK_BASE(impl,name) \
  +impl(void) ap_hook_##name(HOOK_##name *pf,const char * const *aszPre, \
  +		         const char * const *aszSucc,int nOrder) \
       { \
       LINK_##name *pHook; \
       if(!_hooks.link_##name) \
  @@ -103,9 +105,9 @@
      VOID runs all
   */
   
  -#define AP_IMPLEMENT_HOOK_VOID(name,args_decl,args_use) \
  -AP_IMPLEMENT_HOOK_BASE(name) \
  -void ap_run_##name args_decl \
  +#define AP_IMPLEMENT_HOOK_VOID(impl,name,args_decl,args_use) \
  +AP_IMPLEMENT_HOOK_BASE(impl,name) \
  +impl(void) ap_run_##name args_decl \
       { \
       LINK_##name *pHook; \
       int n; \
  @@ -121,9 +123,9 @@
   /* FIXME: note that this returns ok when nothing is run. I suspect it should
      really return decline, but that breaks Apache currently - Ben
   */
  -#define AP_IMPLEMENT_HOOK_RUN_ALL(ret,name,args_decl,args_use,ok,decline) \
  -AP_IMPLEMENT_HOOK_BASE(name) \
  -ret ap_run_##name args_decl \
  +#define AP_IMPLEMENT_HOOK_RUN_ALL(impl,ret,name,args_decl,args_use,ok,decline) \
  +AP_IMPLEMENT_HOOK_BASE(impl,name) \
  +impl(ret) ap_run_##name args_decl \
       { \
       LINK_##name *pHook; \
       int n; \
  @@ -143,9 +145,9 @@
       return ok; \
       }
   
  -#define AP_IMPLEMENT_HOOK_RUN_FIRST(ret,name,args_decl,args_use,decline) \
  -AP_IMPLEMENT_HOOK_BASE(name) \
  -ret ap_run_##name args_decl \
  +#define AP_IMPLEMENT_HOOK_RUN_FIRST(impl,ret,name,args_decl,args_use,decline) \
  +AP_IMPLEMENT_HOOK_BASE(impl,name) \
  +impl(ret) ap_run_##name args_decl \
       { \
       LINK_##name *pHook; \
       int n; \
  @@ -172,14 +174,15 @@
   #define AP_HOOK_LAST		20
   #define AP_HOOK_REALLY_LAST	30
   
  -extern ap_pool_t *g_pHookPool;
  -extern int g_bDebugHooks;
  -extern const char *g_szCurrentHookName;
  -
  -void ap_hook_sort_register(const char *szHookName, ap_array_header_t **aHooks);
  -void ap_sort_hooks(void);
  -void ap_show_hook(const char *szName,const char * const *aszPre,
  -		  const char * const *aszSucc);
  -void ap_hook_deregister_all(void);
  +extern AP_EXPORT_VAR ap_pool_t *g_pHookPool;
  +extern AP_EXPORT_VAR int g_bDebugHooks;
  +extern AP_EXPORT_VAR const char *g_szCurrentHookName;
  +
  +AP_EXPORT(void) ap_hook_sort_register(const char *szHookName, 
  +                                      ap_array_header_t **aHooks);
  +AP_EXPORT(void) ap_sort_hooks(void);
  +AP_EXPORT(void) ap_show_hook(const char *szName,const char * const *aszPre,
  +                             const char * const *aszSucc);
  +AP_EXPORT(void) ap_hook_deregister_all(void);
   
   #endif /* ndef(AP_HOOKS_H) */
  
  
  
  1.6       +9 -9      apache-2.0/src/include/ap_sha1.h
  
  Index: ap_sha1.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/include/ap_sha1.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ap_sha1.h	2000/05/26 17:18:51	1.5
  +++ ap_sha1.h	2000/05/27 04:23:25	1.6
  @@ -83,15 +83,15 @@
       int local;                      /* unprocessed amount in data */
   } AP_SHA1_CTX;
   
  -API_EXPORT(void) ap_sha1_base64(const char *clear, int len, char *out);
  -API_EXPORT(void) ap_SHA1Init(AP_SHA1_CTX *context);
  -API_EXPORT(void) ap_SHA1Update(AP_SHA1_CTX *context, const char *input,
  -			       unsigned int inputLen);
  -API_EXPORT(void) ap_SHA1Update_binary(AP_SHA1_CTX *context,
  -				      const unsigned char *input,
  -				      unsigned int inputLen);
  -API_EXPORT(void) ap_SHA1Final(unsigned char digest[SHA_DIGESTSIZE],
  -                              AP_SHA1_CTX *context);
  +AP_EXPORT(void) ap_sha1_base64(const char *clear, int len, char *out);
  +AP_EXPORT(void) ap_SHA1Init(AP_SHA1_CTX *context);
  +AP_EXPORT(void) ap_SHA1Update(AP_SHA1_CTX *context, const char *input,
  +                              unsigned int inputLen);
  +AP_EXPORT(void) ap_SHA1Update_binary(AP_SHA1_CTX *context,
  +                                     const unsigned char *input,
  +                                     unsigned int inputLen);
  +AP_EXPORT(void) ap_SHA1Final(unsigned char digest[SHA_DIGESTSIZE],
  +                             AP_SHA1_CTX *context);
   
   #ifdef __cplusplus
   }
  
  
  

Mime
View raw message