/* -------------------------------------------------------------- */
/* 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") ||
/* 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;
}
}
-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;
* 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;
}
/* 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;
/*
* 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;
/*
* 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;
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
#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;
/**
*
*/
-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
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 {