1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
3
* Author: Michael Zucchi <notzed@ximian.com>
5
* Copyright (C) 1999 Ximian (www.ximian.com/).
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of version 2 of the GNU Lesser General Public
9
* License as published by the Free Software Foundation.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU Lesser General Public License for more details.
16
* You should have received a copy of the GNU Lesser General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25
#include <camel/camel-exception.h>
27
/* for .lock locking, retry, delay and stale counts */
28
#define CAMEL_LOCK_DOT_RETRY (5) /* number of times to retry lock */
29
#define CAMEL_LOCK_DOT_DELAY (2) /* delay between locking retries */
30
#define CAMEL_LOCK_DOT_STALE (60) /* seconds before a lock becomes stale */
32
/* for locking folders, retry/interretry delay */
33
#define CAMEL_LOCK_RETRY (5) /* number of times to retry lock */
34
#define CAMEL_LOCK_DELAY (2) /* delay between locking retries */
43
/* specific locking strategies */
44
int camel_lock_dot(const char *path, CamelException *ex);
45
int camel_lock_fcntl(int fd, CamelLockType type, CamelException *ex);
46
int camel_lock_flock(int fd, CamelLockType type, CamelException *ex);
48
void camel_unlock_dot(const char *path);
49
void camel_unlock_fcntl(int fd);
50
void camel_unlock_flock(int fd);
52
/* lock a folder in a standard way */
53
int camel_lock_folder(const char *path, int fd, CamelLockType type, CamelException *ex);
54
void camel_unlock_folder(const char *path, int fd);
58
#endif /* !_CAMEL_LOCK_H */