OSDN Git Service

1a75a6881431d4915174d6e97a6b981ee8843a4c
[modchxj/mod_chxj.git] / include / chxj_memcache.h
1 /*
2  * Copyright (C) 2005-2009 Atsushi Konno All rights reserved.
3  * Copyright (C) 2005 QSDN,Inc. All rights reserved.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 #ifdef USE_MEMCACHE_COOKIE
18 #ifndef __CHXJ_MEMCACHE_H__
19 #define __CHXJ_MEMCACHE_H__
20
21 #include "mod_chxj.h"
22 #include "apr.h"
23
24 #define DEFAULT_MEMCACHE_HOST "localhost"
25
26 typedef struct {
27   char *host;
28   apr_port_t port;
29 } memcache_t;
30
31
32 extern int chxj_memcache_init(request_rec *r, mod_chxj_config *m);
33 extern int chxj_memcache_and_memcache_server_create(request_rec *r, mod_chxj_config *m);
34 extern int chxj_memcache_set_cookie(request_rec *r, mod_chxj_config *m, const char *cookie_id, const char *store_string);
35 extern char *chxj_memcache_get_cookie(request_rec *r, mod_chxj_config *m, const char *cookie_id);
36 extern int chxj_memcache_delete_cookie(request_rec *r, mod_chxj_config *m, const char *cookie_id);
37 extern int chxj_memcache_reset_cookie(request_rec *r, mod_chxj_config *m, const char *cookie_id);
38
39
40 /* operation for cookie */
41 extern int chxj_save_cookie_memcache(request_rec *r, mod_chxj_config *m, const char *cookie_id, const char *store_string);
42 extern int chxj_update_cookie_memcache(request_rec *, mod_chxj_config *m, const char *cookie_id, const char *store_string);
43 extern char *chxj_load_cookie_memcache(request_rec *r, mod_chxj_config *m, const char *cookie_id);
44 extern int chxj_delete_cookie_memcache(request_rec *r, mod_chxj_config *m, const char *cookie_id);
45 extern int chxj_save_cookie_expire_memcache(request_rec *r, mod_chxj_config *m, const char *cookie_id);
46 extern int chxj_delete_cookie_expire_memcache(request_rec *r, mod_chxj_config *m, const char *cookie_id);
47 extern int chxj_cookie_expire_gc_memcache(request_rec *r, mod_chxj_config *m);
48
49 extern int chxj_cookie_lock_memcache(request_rec *r, mod_chxj_config *m);
50 extern int chxj_cookie_unlock_memcache(request_rec *r, mod_chxj_config *m);
51 #endif
52 #endif