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