Lumiera  0.pre.03
»edityourfreedom«
filehandlecache.h
Go to the documentation of this file.
1 /*
2  FILEHANDLECACHE - filehandle management and caching
3 
4  Copyright (C) Lumiera.org
5  2008, Christian Thaeter <ct@pipapo.org>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 */
22 
23 
32 #ifndef BACKEND_FILEHANDLECACHE_H
33 #define BACKEND_FILEHANDLECACHE_H
34 
35 #include "lib/error.h"
36 #include "lib/mrucache.h"
37 #include "lib/mutex.h"
38 
39 typedef struct lumiera_filehandlecache_struct lumiera_filehandlecache;
40 typedef lumiera_filehandlecache* LumieraFilehandlecache;
41 
42 #include "backend/filehandle.h"
43 
44 
45 
48 {
49  lumiera_mrucache cache;
50  int available;
52  lumiera_mutex lock;
53 };
54 
61 void
62 lumiera_filehandlecache_new (int max_entries);
63 
69 void
71 
79 
88 
94 void
96 
97 
98 
99 #endif /*BACKEND_FILEHANDLECACHE_H*/
LumieraFilehandle lumiera_filehandlecache_checkout(LumieraFilehandle handle)
Remove a filehandle from cache aging Filehandles which are subject of cache aging must be checked out...
void lumiera_filehandlecache_delete(void)
Delete the filehandle cache.
lumiera_filehandlecache * LumieraFilehandlecache
lumiera_filehandle * LumieraFilehandle
Definition: filehandle.h:38
Lumiera error handling (C interface).
Filehandles manage the underlying POSIX filehandle for a file descriptor.
LumieraFilehandle lumiera_filehandlecache_handle_acquire(LumieraFiledescriptor desc)
Get a fresh filehandle.
void lumiera_filehandlecache_checkin(LumieraFilehandle handle)
Put a filehandle into the cache Filehandles which are checked in are subject of cache aging and might...
Mutual exclusion locking, header.
lumiera_filedescriptor * LumieraFiledescriptor
File handle cache manages file handles.
void lumiera_filehandlecache_new(int max_entries)
Initialises the filehandle cache.
Most recent used cache.