Code

0c252b0c177e35976118cbfef7e7f95ec0a8beab
[fusedav.git] / src / filecache.h
1 #ifndef foofilecachehfoo
2 #define foofilecachehfoo
4 /* $Id$ */
6 /***
7   Copyright (c) 2004-2006 Lennart Poettering
9   Permission is hereby granted, free of charge, to any person
10   obtaining a copy of this software and associated documentation files
11   (the "Software"), to deal in the Software without restriction,
12   including without limitation the rights to use, copy, modify, merge,
13   publish, distribute, sublicense, and/or sell copies of the Software,
14   and to permit persons to whom the Software is furnished to do so,
15   subject to the following conditions:
17   The above copyright notice and this permission notice shall be
18   included in all copies or substantial portions of the Software.
20   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
24   BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
25   ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
26   CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27   SOFTWARE.
28 ***/
30 #include <sys/types.h>
32 #include <ne_session.h>
34 void* file_cache_open(const char *path, int flags);
35 void* file_cache_get(const char *path);
36 void file_cache_unref(void *f);
38 int file_cache_close(void *f);
40 int file_cache_read(void *f, char *buf, size_t size, off_t offset);
41 int file_cache_write(void *f, const char *buf, size_t size, off_t offset);
42 int file_cache_truncate(void *f, off_t s);
43 int file_cache_sync(void *f);
44 int file_cache_close_all(void);
46 off_t file_cache_get_size(void *f);
48 #endif