httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@apache.org
Subject cvs commit: httpd-2.0/modules/experimental cache_util.c mod_cache.h mod_disk_cache.c
Date Mon, 04 Feb 2002 04:43:34 GMT
ianh        02/02/03 20:43:34

  Modified:    modules/experimental cache_util.c mod_cache.h
                        mod_disk_cache.c
  Log:
  make it compile on win32
  
  Revision  Changes    Path
  1.9       +11 -11    httpd-2.0/modules/experimental/cache_util.c
  
  Index: cache_util.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/cache_util.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- cache_util.c	3 Feb 2002 19:04:15 -0000	1.8
  +++ cache_util.c	4 Feb 2002 04:43:34 -0000	1.9
  @@ -65,7 +65,7 @@
   /* -------------------------------------------------------------- */
   
   /* return true if the request is conditional */
  -int ap_cache_request_is_conditional(request_rec *r)
  +CACHE_DECLARE(int) ap_cache_request_is_conditional(request_rec *r)
   {
       if (apr_table_get(r->headers_in, "If-Match") ||
           apr_table_get(r->headers_in, "If-None-Match") ||
  @@ -79,7 +79,7 @@
   
   
   /* remove other filters from filter stack */
  -void ap_cache_reset_output_filters(request_rec *r)
  +CACHE_DECLARE(void) ap_cache_reset_output_filters(request_rec *r)
   {
       ap_filter_t *f = r->output_filters;
   
  @@ -97,9 +97,9 @@
       }
   }
   
  -const char *ap_cache_get_cachetype(request_rec *r, 
  -                                   cache_server_conf *conf, 
  -                                   const char *url)
  +CACHE_DECLARE(const char *)ap_cache_get_cachetype(request_rec *r, 
  +                                                  cache_server_conf *conf, 
  +                                                  const char *url)
   {
       const char *type = NULL;
       int i;
  @@ -139,7 +139,7 @@
    * The return returns 1 if the token val is found in the list, or 0
    * otherwise.
    */
  -int ap_cache_liststr(const char *list, const char *key, char **val)
  +CACHE_DECLARE(int) ap_cache_liststr(const char *list, const char *key, char **val)
   {
       int len, i;
       char *p;
  @@ -183,7 +183,7 @@
   }
   
   /* return each comma separated token, one at a time */
  -const char *ap_cache_tokstr(apr_pool_t *p, const char *list, const char **str)
  +CACHE_DECLARE(const char *)ap_cache_tokstr(apr_pool_t *p, const char *list, const char
**str)
   {
       apr_size_t i;
       const char *s;
  @@ -218,7 +218,7 @@
   /*
    * Converts apr_time_t hex digits to a time integer
    */
  -apr_time_t ap_cache_hex2msec(const char *x)
  +CACHE_DECLARE(apr_time_t) ap_cache_hex2msec(const char *x)
   {
       int i, ch;
       apr_time_t j;
  @@ -238,7 +238,7 @@
   /*
    * Converts a time integer to apr_time_t hex digits
    */
  -void ap_cache_msec2hex(apr_time_t j, char *y)
  +CACHE_DECLARE(void) ap_cache_msec2hex(apr_time_t j, char *y)
   {
       int i, ch;
   
  @@ -295,9 +295,9 @@
       val[i + 22 - k] = '\0';
   }
   
  -char *generate_name(apr_pool_t *p, int dirlevels, int dirlength, const char *name)
  +CACHE_DECLARE(char *)generate_name(apr_pool_t *p, int dirlevels, int dirlength, const char
*name)
   {
       char hashfile[66];
       cache_hash(name, hashfile, dirlevels, dirlength);
       return apr_pstrdup(p, hashfile);
  -}
  +}
  \ No newline at end of file
  
  
  
  1.17      +31 -9     httpd-2.0/modules/experimental/mod_cache.h
  
  Index: mod_cache.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_cache.h,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- mod_cache.h	3 Feb 2002 19:04:15 -0000	1.16
  +++ mod_cache.h	4 Feb 2002 04:43:34 -0000	1.17
  @@ -124,6 +124,27 @@
   #define DEFAULT_CACHE_EXPIRE    MSEC_ONE_HR
   #define DEFAULT_CACHE_LMFACTOR (0.1)
   
  +/* Create a set of PROXY_DECLARE(type), PROXY_DECLARE_NONSTD(type) and 
  + * PROXY_DECLARE_DATA with appropriate export and import tags for the platform
  + */
  +#if !defined(WIN32)
  +#define CACHE_DECLARE(type)            type
  +#define CACHE_DECLARE_NONSTD(type)     type
  +#define CACHE_DECLARE_DATA
  +#elif defined(CACHE_DECLARE_STATIC)
  +#define CACHE_DECLARE(type)            type __stdcall
  +#define CACHE_DECLARE_NONSTD(type)     type
  +#define CACHE_DECLARE_DATA
  +#elif defined(CACHE_DECLARE_EXPORT)
  +#define CACHE_DECLARE(type)            __declspec(dllexport) type __stdcall
  +#define CACHE_DECLARE_NONSTD(type)     __declspec(dllexport) type
  +#define CACHE_DECLARE_DATA             __declspec(dllexport)
  +#else
  +#define CACHE_DECLARE(type)            __declspec(dllimport) type __stdcall
  +#define CACHE_DECLARE_NONSTD(type)     __declspec(dllimport) type
  +#define CACHE_DECLARE_DATA             __declspec(dllimport)
  +#endif
  +
   struct cache_enable {
       const char *url;
       const char *type;
  @@ -211,15 +232,16 @@
   /**
    *
    */
  -apr_time_t ap_cache_hex2msec(const char *x);
  -void ap_cache_msec2hex(apr_time_t j, char *y);
  -char *generate_name(apr_pool_t *p, int dirlevels, int dirlength, 
  -                    const char *name);
  -int ap_cache_request_is_conditional(request_rec *r);
  -void ap_cache_reset_output_filters(request_rec *r);
  -const char *ap_cache_get_cachetype(request_rec *r, cache_server_conf *conf, const char
*url);
  -int ap_cache_liststr(const char *list, const char *key, char **val);
  -const char *ap_cache_tokstr(apr_pool_t *p, const char *list, const char **str);
  +CACHE_DECLARE(apr_time_t) ap_cache_hex2msec(const char *x);
  +CACHE_DECLARE(void) ap_cache_msec2hex(apr_time_t j, char *y);
  +CACHE_DECLARE(char *) generate_name(apr_pool_t *p, int dirlevels, 
  +                                    int dirlength, 
  +                                    const char *name);
  +CACHE_DECLARE(int) ap_cache_request_is_conditional(request_rec *r);
  +CACHE_DECLARE(void) ap_cache_reset_output_filters(request_rec *r);
  +CACHE_DECLARE(const char *)ap_cache_get_cachetype(request_rec *r, cache_server_conf *conf,
const char *url);
  +CACHE_DECLARE(int) ap_cache_liststr(const char *list, const char *key, char **val);
  +CACHE_DECLARE(const char *)ap_cache_tokstr(apr_pool_t *p, const char *list, const char
**str);
   
   /**
    * cache_storage.c
  
  
  
  1.15      +5 -0      httpd-2.0/modules/experimental/mod_disk_cache.c
  
  Index: mod_disk_cache.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_disk_cache.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- mod_disk_cache.c	3 Feb 2002 19:04:15 -0000	1.14
  +++ mod_disk_cache.c	4 Feb 2002 04:43:34 -0000	1.15
  @@ -151,7 +151,12 @@
           else {
               /* XXX log */
           }
  +#ifdef WIN32
  +        /* XXX: win32 doesn't have a link */
  +        if  (apr_file_copy(dobj->tempfile, info->datafile, APR_FILE_SOURCE_PERMS,
r->pool) != APR_SUCCESS) {
  +#else
           if (link(dobj->tempfile, info->datafile) == -1) {
  +#endif
               /* XXX log */
           }
           else {
  
  
  

Mime
View raw message