/[CvsGraph]/cvsgraph/rcs.h
ViewVC logotype

Annotate of /cvsgraph/rcs.h

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.14 - (show annotations)
Thu Dec 15 13:06:09 2005 UTC (12 years ago) by bertho
Branch: MAIN
Changes since 1.13: +1 -0 lines
File MIME type: text/plain
Implemented multiple regex match for triplets merge_{from,to,color} so
that merges can be detected with more disjoined tag definitions.
1 /*
2 * CvsGraph graphical representation generator of brances and revisions
3 * of a file in cvs/rcs.
4 *
5 * Copyright (C) 2001 B. Stultiens
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21 #ifndef __RCS_H
22 #define __RCS_H
23
24 struct __revision_t; /* Forward */
25
26 typedef struct __rev_t
27 {
28 char *branch;
29 char *rev;
30 int isbranch;
31 } rev_t;
32
33 typedef struct __revs_t
34 {
35 rev_t **revs;
36 int nrevs;
37 } revs_t;
38
39 typedef struct __tag_t
40 {
41 char *tag;
42 rev_t *rev;
43 struct __revision_t *logrev; /* backpointer to logical revision */
44 int yofs; /* Internal drawing offset to center of the tag */
45 int ignore; /* This tag is marked ignored for drawing */
46 } tag_t;
47
48 typedef struct __tags_t
49 {
50 tag_t **tags;
51 int ntags;
52 } tags_t;
53
54 typedef union __tag_revision_t
55 {
56 tag_t *tag;
57 struct __revision_t *rev;
58 } tag_revision_t;
59
60 typedef enum __tag_revision_e
61 {
62 TR_INVALID = 0,
63 TR_TAG,
64 TR_REVISION
65 } tag_revision_e;
66
67 typedef struct __merge_t
68 {
69 tag_revision_e type;
70 tag_revision_t to; /* This tag/revision is destination of a merge */
71 tag_revision_t from; /* This tag/revision is origin of a merge */
72 int clr; /* Color reference for multiple regex match statements */
73 } merge_t;
74
75 typedef struct __idrev_t
76 {
77 char *id;
78 rev_t *rev;
79 } idrev_t;
80
81 typedef struct __idrevs_t
82 {
83 idrev_t **idrevs;
84 int nidrevs;
85 } idrevs_t;
86
87 typedef struct __ids_t
88 {
89 char **ids;
90 int nids;
91 } ids_t;
92
93 typedef struct __dtext_t
94 {
95 rev_t *rev; /* Diff/log revision */
96 char *log; /* The log entry */
97 char *text; /* Diff text (only set if lexer send it) */
98 } dtext_t;
99
100 typedef struct __dtexts_t
101 {
102 dtext_t **dtexts;
103 int ndtexts;
104 } dtexts_t;
105
106 typedef enum __phrase_type_e /* Extra phrases in deltas */
107 {
108 PT_INVALID = 0,
109 PT_MERGEPOINT /* CVSNT: mergepoint1 <revision-string> */
110 } phrase_type_e;
111
112 typedef struct __phrase_t
113 {
114 phrase_type_e type;
115 rev_t *rev;
116 } phrase_t;
117
118 typedef struct __phrases_t
119 {
120 phrase_t **phrases;
121 int nphrases;
122 } phrases_t;
123
124 typedef struct __delta_t
125 {
126 rev_t *rev; /* Delta revision */
127 char *date;
128 char *author;
129 char *state;
130 revs_t *branches;
131 rev_t *next; /* Next delta in this branch */
132 phrases_t *phrases; /* Extra phrases in the delta */
133 phrase_t *mergepoint; /* CVSNT: mergepoint1 */
134 int flag; /* Set if assigned a branch to prevent infinite recursion */
135 } delta_t;
136
137 typedef struct __deltas_t
138 {
139 delta_t **deltas;
140 int ndeltas;
141 } deltas_t;
142
143 typedef struct __branch_t /* Logical branch structure */
144 {
145 struct __revision_t **revs;
146 int nrevs;
147 struct __revision_t *branchpoint; /* Backlink to revision that spawned the branch */
148 rev_t *branch; /* Branch id */
149 tag_t **tags; /* Symbolic tags */
150 int ntags;
151 int subtree_draw; /* Set if subtree drawing should draw this branch */
152 int folded; /* Set if this branch is folded in another box */
153 struct __branch_t *folded_to; /* Set to the branch where this one is folded into */
154 struct __branch_t **folds; /* List of other branches folded into this one */
155 int nfolds;
156 int fw; /* Max width of the branch number if folds present */
157 int w, h; /* BBox width/height */
158 int cx, y; /* BBox center-top position */
159 int tw, th; /* Total BBox width/height */
160 } branch_t;
161
162 typedef struct __revision_t /* Logical revision structure */
163 {
164 delta_t *delta;
165 dtext_t *dtext;
166 rev_t *rev; /* Shortcut to delta->rev */
167 char *revtext; /* Expanded text to draw */
168 branch_t *branch; /* The branch this revision belongs to */
169 branch_t **branches; /* Branches from this revision */
170 int nbranches;
171 tag_t **tags; /* Symbolic tags */
172 int ntags;
173 int w, h; /* BBox width/height */
174 int cx, y; /* BBox center-top position */
175 int stripped; /* Set if we jumped revisions due to strip_untagged */
176 } revision_t;
177
178 typedef struct __rcsfile_t
179 {
180 char *root; /* The CVS root directory */
181 char *module; /* The CVS module */
182 char *file; /* The CVS filename */
183 rev_t *head; /* Head revision */
184 rev_t *branch; /* Active branch (NULL if main trunk) */
185 ids_t *access; /* Access identifier(s) (NULL if none) */
186 tags_t *tags; /* Symbolic tags (NULL if none) */
187 idrevs_t *locks; /* Locks revisions (NULL if no locks) */
188 int strict; /* Locking strategy */
189 char *comment; /* File comment (NULL if none) */
190 char *expand; /* Keyword substitution (NULL if none, i.e. -kv) */
191 deltas_t *deltas; /* Delta admin */
192 char *desc; /* Eh... description of file? */
193 dtexts_t *dtexts; /* Diffs and logs */
194
195 /* Logical structure */
196 delta_t **sdelta; /* Sorted delta on revision */
197 int nsdelta;
198 dtext_t **sdtext; /* Sorted dtext on revision */
199 int nsdtext;
200 revision_t **srev; /* Sorted list of all revisions */
201 int nsrev;
202 branch_t **branches; /* List of branches */
203 branch_t *active; /* The active branch (translated branch of admin) */
204 int nbranches;
205 int nfolds; /* Account folds to keep total branch-count */
206 merge_t *merges; /* Merge tags from->to description */
207 int nmerges;
208 int tw, th; /* Total BBox width/height */
209 } rcsfile_t;
210
211 void set_id(void); /* Next scan is for an id */
212 void set_author(void); /* Next scan is for an author */
213 void set_sym(void); /* Next scan is for a symbol */
214 void set_skip(void); /* Everyting until ';' dropped */
215 void set_skipstr(void); /* Next string must be dropped */
216
217 int rcslex(void);
218 int rcsparse(void);
219
220 extern FILE *rcsin;
221 extern rcsfile_t *rcsfile;
222
223 #endif

  ViewVC Help
Powered by ViewVC 1.1.0 with CvsGraph 1.7.0