Apache2
ap_socache.h
Go to the documentation of this file.
1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2  * contributor license agreements. See the NOTICE file distributed with
3  * this work for additional information regarding copyright ownership.
4  * The ASF licenses this file to You under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
26 #ifndef AP_SOCACHE_H
27 #define AP_SOCACHE_H
28 
29 #include "httpd.h"
30 #include "ap_provider.h"
31 #include "apr_pools.h"
32 #include "apr_time.h"
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
43 /* XXX: Even if store/retrieve/remove is atomic, isn't it useful to note
44  * independently that status and iterate may or may not be?
45  */
46 #define AP_SOCACHE_FLAG_NOTMPSAFE (0x0001)
47 
50 
60 };
61 
78  server_rec *s,
79  void *userctx,
80  const unsigned char *id,
81  unsigned int idlen,
82  const unsigned char *data,
83  unsigned int datalen,
84  apr_pool_t *pool);
85 
89 typedef struct ap_socache_provider_t {
91  const char *name;
92 
94  unsigned int flags;
95 
110  const char *(*create)(ap_socache_instance_t **instance, const char *arg,
111  apr_pool_t *tmp, apr_pool_t *p);
112 
129  apr_status_t (*init)(ap_socache_instance_t *instance, const char *cname,
130  const struct ap_socache_hints *hints,
132 
139 
153  const unsigned char *id, unsigned int idlen,
154  apr_time_t expiry,
155  unsigned char *data, unsigned int datalen,
156  apr_pool_t *pool);
157 
173  const unsigned char *id, unsigned int idlen,
174  unsigned char *data, unsigned int *datalen,
175  apr_pool_t *pool);
176 
187  const unsigned char *id, unsigned int idlen,
188  apr_pool_t *pool);
189 
199  void (*status)(ap_socache_instance_t *instance, request_rec *r, int flags);
200 
213  void *userctx, ap_socache_iterator_t *iterator,
214  apr_pool_t *pool);
215 
217 
219 #define AP_SOCACHE_PROVIDER_GROUP "socache"
221 #define AP_SOCACHE_PROVIDER_VERSION "0"
222 
224 #define AP_SOCACHE_DEFAULT_PROVIDER "default"
225 
226 #ifdef __cplusplus
227 }
228 #endif
229 
230 #endif /* AP_SOCACHE_H */
Apache Provider API.
APR memory allocation.
APR Time Library.
apr_status_t() ap_socache_iterator_t(ap_socache_instance_t *instance, server_rec *s, void *userctx, const unsigned char *id, unsigned int idlen, const unsigned char *data, unsigned int datalen, apr_pool_t *pool)
Definition: ap_socache.h:77
struct ap_socache_instance_t ap_socache_instance_t
Definition: ap_socache.h:49
struct ap_socache_provider_t ap_socache_provider_t
request_rec * r
Definition: mod_dav.h:518
const char * s
Definition: mod_dav.h:1327
apr_bucket_brigade request_rec apr_pool_t * pool
Definition: mod_dav.h:557
int apr_status_t
Definition: apr_errno.h:44
size_t apr_size_t
Definition: apr.h:394
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
apr_int64_t apr_interval_time_t
Definition: apr_time.h:55
apr_int64_t apr_time_t
Definition: apr_time.h:45
HTTP Daemon routines.
Definition: ap_socache.h:53
apr_size_t avg_id_len
Definition: ap_socache.h:55
apr_size_t avg_obj_size
Definition: ap_socache.h:57
apr_interval_time_t expiry_interval
Definition: ap_socache.h:59
Definition: ap_socache.h:89
apr_status_t(* store)(ap_socache_instance_t *instance, server_rec *s, const unsigned char *id, unsigned int idlen, apr_time_t expiry, unsigned char *data, unsigned int datalen, apr_pool_t *pool)
Definition: ap_socache.h:152
unsigned int flags
Definition: ap_socache.h:94
void(* status)(ap_socache_instance_t *instance, request_rec *r, int flags)
Definition: ap_socache.h:199
const char * name
Definition: ap_socache.h:91
apr_status_t(* remove)(ap_socache_instance_t *instance, server_rec *s, const unsigned char *id, unsigned int idlen, apr_pool_t *pool)
Definition: ap_socache.h:186
apr_status_t(* iterate)(ap_socache_instance_t *instance, server_rec *s, void *userctx, ap_socache_iterator_t *iterator, apr_pool_t *pool)
Definition: ap_socache.h:212
void(* destroy)(ap_socache_instance_t *instance, server_rec *s)
Definition: ap_socache.h:138
apr_status_t(* init)(ap_socache_instance_t *instance, const char *cname, const struct ap_socache_hints *hints, server_rec *s, apr_pool_t *pool)
Definition: ap_socache.h:129
apr_status_t(* retrieve)(ap_socache_instance_t *instance, server_rec *s, const unsigned char *id, unsigned int idlen, unsigned char *data, unsigned int *datalen, apr_pool_t *pool)
Definition: ap_socache.h:172
A structure that represents the current request.
Definition: httpd.h:856
A structure to store information for each virtual server.
Definition: httpd.h:1382
apr_pool_t * p