1 /*
2 * IceBreaker
3 * Copyright (c) 2002 Matthew Miller <mattdm@mattdm.org> and
4 *  Enrico Tassi <gareuselesinge@infinito.it>
5 *
6 * <http://www.mattdm.org/icebreaker/>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the Free
10 * Software Foundation; either version 2 of the License, or (at your option)
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc., 59
20 * Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23 
24 
25 #ifndef LOCK_H
26 #define LOCK_H
27 
28 // fix -- should this stuff go in win32_compatibility.h? it's a tradeoff
29 // between putting stuff closer to where it's used and isolating platform-
30 // specific stuff
31 
32 #ifdef WIN32
33   #include <windows.h>
34   #define FILE_DESC	 	HANDLE
35   #define INVALID_FILE_DESC	INVALID_HANDLE_VALUE
36 #else
37   #define FILE_DESC	 	int
38   #define INVALID_FILE_DESC	-1
39 #endif
40 
41 extern int lock(FILE_DESC fd);
42 extern int unlock(FILE_DESC fd);
43 
44 extern FILE_DESC openlockfile(char* fname);
45 extern void closelockfile(FILE_DESC f);
46 
47 #endif /* LOCK_H */
48