Happy new year
[idzebra-moved-to-github.git] / include / idzebra / flock.h
1 /* This file is part of the Zebra server.
2    Copyright (C) 1994-2009 Index Data
3
4 Zebra is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
7 version.
8
9 Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12 for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
18 */
19
20 #include <yaz/yconfig.h>
21
22 #ifndef FLOCK_H
23 #define FLOCK_H
24
25 YAZ_BEGIN_CDECL
26
27 typedef struct zebra_lock_handle *ZebraLockHandle;
28
29 YAZ_EXPORT
30 ZebraLockHandle zebra_lock_create(const char *dir, const char *file);
31
32 YAZ_EXPORT
33 void zebra_lock_destroy (ZebraLockHandle h);
34
35 YAZ_EXPORT
36 int zebra_unlock (ZebraLockHandle h);
37 YAZ_EXPORT
38 char *zebra_mk_fname (const char *dir, const char *name);
39
40 YAZ_EXPORT
41 int zebra_lock_w (ZebraLockHandle h);
42 YAZ_EXPORT
43 int zebra_lock_r (ZebraLockHandle h);
44
45 YAZ_EXPORT 
46 void zebra_flock_init(void);
47
48 YAZ_END_CDECL
49
50 #endif
51 /*
52  * Local variables:
53  * c-basic-offset: 4
54  * indent-tabs-mode: nil
55  * End:
56  * vim: shiftwidth=4 tabstop=8 expandtab
57  */
58