Merge from vendor branch BIND:
[dragonfly.git] / contrib / cvs-1.12 / src / watch.h
1 /* Interface to "cvs watch add", "cvs watchers", and related features
2
3    This program is free software; you can redistribute it and/or modify
4    it under the terms of the GNU General Public License as published by
5    the Free Software Foundation; either version 2, or (at your option)
6    any later version.
7
8    This program is distributed in the hope that it will be useful,
9    but WITHOUT ANY WARRANTY; without even the implied warranty of
10    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11    GNU General Public License for more details.  */
12
13 extern const char *const watch_usage[];
14
15 /* Flags to pass between the various functions making up the
16    add/remove code.  All in a single structure in case there is some
17    need to make the code reentrant some day.  */
18
19 struct addremove_args {
20     /* A flag for each watcher type.  */
21     int edit;
22     int unedit;
23     int commit;
24
25     /* Are we adding or removing (non-temporary) edit,unedit,and/or commit
26        watches?  */
27     int adding;
28
29     /* Should we add a temporary edit watch?  */
30     int add_tedit;
31     /* Should we add a temporary unedit watch?  */
32     int add_tunedit;
33     /* Should we add a temporary commit watch?  */
34     int add_tcommit;
35
36     /* Should we remove all temporary watches?  */
37     int remove_temp;
38
39     /* Should we set the default?  This is here for passing among various
40        routines in watch.c (a good place for it if there is ever any reason
41        to make the stuff reentrant), not for watch_modify_watchers. 
42        This is only set if there are no arguments specified, e.g. 'cvs watch add' */
43     int setting_default;
44
45     /* List of directories specified on the command line, to set the
46        default attributes. */
47     const char ** dirs;
48     int num_dirs;
49
50     /* Is this recursive? */
51     int local;
52
53 };
54
55 /* Modify the watchers for FILE.  *WHAT tells what to do to them.
56    If FILE is NULL, modify default args (WHAT->SETTING_DEFAULT is
57    not used).  */
58 void watch_modify_watchers (const char *file, struct addremove_args *what);
59
60 int watch_add (int argc, char **argv);
61 int watch_remove (int argc, char **argv);