386BSD 0.1 development
[unix-history] / usr / othersrc / public / cvs-1.3 / src / rcs.h
CommitLineData
fe37a9c9
WJ
1/* @(#)rcs.h 1.14 92/03/31 */
2
3/*
4 * Copyright (c) 1992, Brian Berliner and Jeff Polk
5 * Copyright (c) 1989-1992, Brian Berliner
6 *
7 * You may distribute under the terms of the GNU General Public License as
8 * specified in the README file that comes with the CVS 1.3 kit.
9 *
10 * RCS source control definitions needed by rcs.c and friends
11 */
12
13#define RCS "rcs"
14#define RCS_CI "ci"
15#define RCS_CO "co"
16#define RCS_RLOG "rlog"
17#define RCS_DIFF "rcsdiff"
18#define RCS_MERGE "merge"
19#define RCS_RCSMERGE "rcsmerge"
20#define RCS_MERGE_PAT "^>>>>>>> " /* runs "grep" with this pattern */
21#define RCSEXT ",v"
22#define RCSHEAD "head"
23#define RCSBRANCH "branch"
24#define RCSSYMBOLS "symbols"
25#define RCSDATE "date"
26#define RCSDESC "desc"
27#define DATEFORM "%02d.%02d.%02d.%02d.%02d.%02d"
28#define SDATEFORM "%d.%d.%d.%d.%d.%d"
29
30/*
31 * Opaque structure definitions used by RCS specific lookup routines
32 */
33#define VALID 0x1 /* flags field contains valid data */
34#define INATTIC 0x2 /* RCS file is located in the Attic */
35struct rcsnode
36{
37 int refcount;
38 int flags;
39 char *path;
40 char *head;
41 char *branch;
42 List *symbols;
43 List *versions;
44 List *dates;
45};
46typedef struct rcsnode RCSNode;
47
48struct rcsversnode
49{
50 char *version;
51 char *date;
52 char *next;
53 List *branches;
54};
55typedef struct rcsversnode RCSVers;
56
57/*
58 * CVS reserves all even-numbered branches for its own use. "magic" branches
59 * (see rcs.c) are contained as virtual revision numbers (within symbolic
60 * tags only) off the RCS_MAGIC_BRANCH, which is 0. CVS also reserves the
61 * ".1" branch for vendor revisions. So, if you do your own branching, you
62 * should limit your use to odd branch numbers starting at 3.
63 */
64#define RCS_MAGIC_BRANCH 0
65
66/*
67 * exported interfaces
68 */
69#if __STDC__
70List *RCS_parsefiles (List * files, char *xrepos);
71RCSNode *RCS_parse (char *file, char *repos);
72RCSNode *RCS_parsercsfile (char *rcsfile);
73char *RCS_check_kflag (char *arg);
74char *RCS_getdate (RCSNode * rcs, char *date, int force_tag_match);
75char *RCS_gettag (RCSNode * rcs, char *tag, int force_tag_match);
76char *RCS_getversion (RCSNode * rcs, char *tag, char *date,
77 int force_tag_match);
78char *RCS_magicrev (RCSNode *rcs, char *rev);
79int RCS_isbranch (char *file, char *rev, List *srcfiles);
80char *RCS_whatbranch (char *file, char *tag, List *srcfiles);
81char *RCS_head (RCSNode * rcs);
82int RCS_datecmp (char *date1, char *date2);
83time_t RCS_getrevtime (RCSNode * rcs, char *rev, char *date, int fudge);
84void RCS_check_tag (char *tag);
85void freercsnode (RCSNode ** rnodep);
86#else
87List *RCS_parsefiles ();
88RCSNode *RCS_parse ();
89char *RCS_head ();
90char *RCS_getversion ();
91char *RCS_magicrev ();
92int RCS_isbranch ();
93char *RCS_whatbranch ();
94char *RCS_gettag ();
95char *RCS_getdate ();
96char *RCS_check_kflag ();
97void RCS_check_tag ();
98time_t RCS_getrevtime ();
99RCSNode *RCS_parsercsfile ();
100int RCS_datecmp ();
101void freercsnode ();
102#endif /* __STDC__ */