1 /* $Id$
2  *  Provides declarations for compiler- and platform-independent
3  *  file and record locking.
4  *
5  * HUSKYLIB: common defines, types and functions for HUSKY
6  *
7  * This is part of The HUSKY Fidonet Software project:
8  * see http://husky.sourceforge.net for details
9  *
10  *
11  * HUSKYLIB is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2 of the License, or (at your option) any later version.
15  *
16  * HUSKYLIB is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  * General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with this library; see file COPYING. If not, write to the
23  * Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24  *
25  * See also http://www.gnu.org, license may be found here.
26  */
27 
28 #ifndef HUSKY_LOCKING_H__
29 # define HUSKY_LOCKING_H__
30 
31 #include "compiler.h"
32 #include "huskyext.h"  /* compiler see directory of this .h file */
33 
34 /* file locking implementation
35  */
36 HUSKYEXT int lock(int handle, long ofs, long length);
37 
38 /* file unlocking implementation
39  */
40 HUSKYEXT int unlock(int handle, long ofs, long length);
41 
42 /* waitlock2() wait some (OS or runtime library default) time for a lock
43  */
44 HUSKYEXT int waitlock(int handle, long ofs, long length);
45 
46 /* waitlock2() wait <t> seconds for a lock
47  * THERE SHOULD BE A BETTER WAY TO MAKE A TIMED LOCK
48  */
49 HUSKYEXT int waitlock2(int handle, long ofs, long length, long t);
50 
51 #ifndef HAS_sopen
52 /* #define HAS_sopen 4  */ /* sopen() : 4 parameters */
53 HUSKYEXT int sopen(const char *name, int oflag, int ishared, int mode);
54 #endif
55 
56 #endif
57