aboutsummaryrefslogtreecommitdiffstats
path: root/src/lockfile.h
blob: 6941a1e3ed76f53d9874bd1bc1d5f3e8dbdc8622 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
 * lockfile.h:
 *
 * Copyright (c) 2008 James McKenzie <james@fishsoup.dhs.org>,
 * All rights reserved.
 *
 */

/*
 * $Id$
 */

/*
 * $Log$
 * Revision 1.7  2008/02/23 11:48:37  james
 * *** empty log message ***
 *
 * Revision 1.6  2008/02/15 23:52:12  james
 * *** empty log message ***
 *
 * Revision 1.5  2008/02/15 20:52:36  james
 * *** empty log message ***
 *
 * Revision 1.4  2008/02/15 19:51:30  james
 * *** empty log message ***
 *
 * Revision 1.3  2008/02/15 18:16:36  james
 * *** empty log message ***
 *
 * Revision 1.2  2008/02/15 16:48:56  james
 * *** empty log message ***
 *
 * Revision 1.1  2008/02/15 15:09:17  james
 * *** empty log message ***
 *
 */

#ifndef __LOCKFILE_H__
#define __LOCKFILE_H__

#define SERIAL_LOCK_PASSIVE 0
#define SERIAL_LOCK_ACTIVE  1

#define FILE_LIST_MAX_LEN 1024

typedef struct Filelist_ent
{
  char name[FILE_LIST_MAX_LEN];
  struct Filelist_ent *next;
} Filelist_ent;

typedef struct
{
  Filelist_ent *head;
} Filelist;


typedef struct
{
  int mode;
  int i;
  struct timeval last_stale_purge;
  Filelist *locks_to_check;
  Filelist *locks_held;
} Serial_lock;



#endif /* __LOCKFILE_H__ */