2 * Copyright (c) 2003-2006, Maxime Henrion <mux@FreeBSD.org>
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 #include <sys/types.h>
32 #include <sys/socket.h>
43 #define CO_BACKUP 0x00000001
44 #define CO_DELETE 0x00000002
45 #define CO_KEEP 0x00000004
46 #define CO_OLD 0x00000008
47 #define CO_UNLINKBUSY 0x00000010
48 #define CO_NOUPDATE 0x00000020
49 #define CO_COMPRESS 0x00000040
50 #define CO_USERELSUFFIX 0x00000080
51 #define CO_EXACTRCS 0x00000100
52 #define CO_CHECKRCS 0x00000200
53 #define CO_SKIP 0x00000400
54 #define CO_CHECKOUTMODE 0x00000800
55 #define CO_NORSYNC 0x00001000
56 #define CO_KEEPBADFILES 0x00002000
57 #define CO_EXECUTE 0x00004000
58 #define CO_SETOWNER 0x00008000
59 #define CO_SETMODE 0x00010000
60 #define CO_SETFLAGS 0x00020000
61 #define CO_NORCS 0x00040000
62 #define CO_STRICTCHECKRCS 0x00080000
63 #define CO_TRUSTSTATUSFILE 0x00100000
64 #define CO_DODELETESONLY 0x00200000
65 #define CO_DETAILALLRCSFILES 0x00400000
67 #define CO_MASK 0x007fffff
69 /* Options that the server is allowed to set. */
70 #define CO_SERVMAYSET (CO_SKIP | CO_NORSYNC | CO_NORCS)
71 /* Options that the server is allowed to clear. */
72 #define CO_SERVMAYCLEAR CO_CHECKRCS
85 struct pattlist *co_accepts;
86 struct pattlist *co_refusals;
87 struct globtree *co_dirfilter;
88 struct globtree *co_filefilter;
89 struct globtree *co_norsync;
90 const char *co_colldir;
92 time_t co_scantime; /* Set by the detailer thread. */
95 struct keyword *co_keyword;
96 STAILQ_ENTRY(coll) co_next;
100 STAILQ_HEAD(, coll) colls;
101 struct fixups *fixups;
103 struct sockaddr *laddr;
109 struct stream *server;
110 fattr_support_t fasupport;
113 struct config *config_init(const char *, struct coll *, int);
114 int config_checkcolls(struct config *);
115 void config_free(struct config *);
117 struct coll *coll_new(struct coll *);
118 void coll_override(struct coll *, struct coll *, int);
119 char *coll_statuspath(struct coll *);
120 char *coll_statussuffix(struct coll *);
121 void coll_add(char *);
122 void coll_free(struct coll *);
123 void coll_setdef(void);
124 void coll_setopt(int, char *);
126 #endif /* !_CONFIG_H_ */