/[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.13 - (hide annotations)
Sat Oct 23 20:13:12 2004 UTC (12 years, 11 months ago) by bertho
Branch: MAIN
CVS Tags: REL_1_5_2
Changes since 1.12: +1 -0 lines
File MIME type: text/plain
Fix total branch-count when branches are folded.
1 bertho 1.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 bertho 1.6 struct __revision_t; /* Forward */
25    
26 bertho 1.1 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 bertho 1.6 char *tag;
42     rev_t *rev;
43     struct __revision_t *logrev; /* backpointer to logical revision */
44 bertho 1.7 int yofs; /* Internal drawing offset to center of the tag */
45 bertho 1.10 int ignore; /* This tag is marked ignored for drawing */
46 bertho 1.1 } tag_t;
47    
48     typedef struct __tags_t
49     {
50     tag_t **tags;
51     int ntags;
52     } tags_t;
53    
54 bertho 1.12 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 bertho 1.6 typedef struct __merge_t
68     {
69 bertho 1.12 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 bertho 1.6 } merge_t;
73    
74 bertho 1.1 typedef struct __idrev_t
75     {
76     char *id;
77     rev_t *rev;
78     } idrev_t;
79    
80     typedef struct __idrevs_t
81     {
82     idrev_t **idrevs;
83     int nidrevs;
84     } idrevs_t;
85    
86     typedef struct __ids_t
87     {
88     char **ids;
89     int nids;
90     } ids_t;
91    
92     typedef struct __dtext_t
93     {
94     rev_t *rev; /* Diff/log revision */
95     char *log; /* The log entry */
96     char *text; /* Diff text (only set if lexer send it) */
97     } dtext_t;
98    
99     typedef struct __dtexts_t
100     {
101     dtext_t **dtexts;
102     int ndtexts;
103     } dtexts_t;
104    
105 bertho 1.12 typedef enum __phrase_type_e /* Extra phrases in deltas */
106     {
107     PT_INVALID = 0,
108     PT_MERGEPOINT /* CVSNT: mergepoint1 <revision-string> */
109     } phrase_type_e;
110    
111     typedef struct __phrase_t
112     {
113     phrase_type_e type;
114     rev_t *rev;
115     } phrase_t;
116    
117     typedef struct __phrases_t
118     {
119     phrase_t **phrases;
120     int nphrases;
121     } phrases_t;
122    
123 bertho 1.1 typedef struct __delta_t
124     {
125 bertho 1.12 rev_t *rev; /* Delta revision */
126     char *date;
127     char *author;
128     char *state;
129     revs_t *branches;
130     rev_t *next; /* Next delta in this branch */
131     phrases_t *phrases; /* Extra phrases in the delta */
132     phrase_t *mergepoint; /* CVSNT: mergepoint1 */
133     int flag; /* Set if assigned a branch to prevent infinite recursion */
134 bertho 1.1 } delta_t;
135    
136     typedef struct __deltas_t
137     {
138     delta_t **deltas;
139     int ndeltas;
140     } deltas_t;
141    
142     typedef struct __branch_t /* Logical branch structure */
143     {
144     struct __revision_t **revs;
145     int nrevs;
146     struct __revision_t *branchpoint; /* Backlink to revision that spawned the branch */
147 bertho 1.8 rev_t *branch; /* Branch id */
148     tag_t **tags; /* Symbolic tags */
149 bertho 1.1 int ntags;
150 bertho 1.11 int subtree_draw; /* Set if subtree drawing should draw this branch */
151 bertho 1.8 int folded; /* Set if this branch is folded in another box */
152 bertho 1.11 struct __branch_t *folded_to; /* Set to the branch where this one is folded into */
153 bertho 1.8 struct __branch_t **folds; /* List of other branches folded into this one */
154     int nfolds;
155     int fw; /* Max width of the branch number if folds present */
156     int w, h; /* BBox width/height */
157     int cx, y; /* BBox center-top position */
158     int tw, th; /* Total BBox width/height */
159 bertho 1.1 } branch_t;
160    
161     typedef struct __revision_t /* Logical revision structure */
162     {
163     delta_t *delta;
164     dtext_t *dtext;
165     rev_t *rev; /* Shortcut to delta->rev */
166 bertho 1.2 char *revtext; /* Expanded text to draw */
167 bertho 1.1 branch_t *branch; /* The branch this revision belongs to */
168     branch_t **branches; /* Branches from this revision */
169     int nbranches;
170     tag_t **tags; /* Symbolic tags */
171     int ntags;
172     int w, h; /* BBox width/height */
173     int cx, y; /* BBox center-top position */
174 bertho 1.3 int stripped; /* Set if we jumped revisions due to strip_untagged */
175 bertho 1.1 } revision_t;
176    
177     typedef struct __rcsfile_t
178     {
179     char *root; /* The CVS root directory */
180     char *module; /* The CVS module */
181     char *file; /* The CVS filename */
182     rev_t *head; /* Head revision */
183     rev_t *branch; /* Active branch (NULL if main trunk) */
184     ids_t *access; /* Access identifier(s) (NULL if none) */
185     tags_t *tags; /* Symbolic tags (NULL if none) */
186     idrevs_t *locks; /* Locks revisions (NULL if no locks) */
187     int strict; /* Locking strategy */
188     char *comment; /* File comment (NULL if none) */
189     char *expand; /* Keyword substitution (NULL if none, i.e. -kv) */
190     deltas_t *deltas; /* Delta admin */
191     char *desc; /* Eh... description of file? */
192     dtexts_t *dtexts; /* Diffs and logs */
193    
194     /* Logical structure */
195     delta_t **sdelta; /* Sorted delta on revision */
196     int nsdelta;
197     dtext_t **sdtext; /* Sorted dtext on revision */
198     int nsdtext;
199     revision_t **srev; /* Sorted list of all revisions */
200     int nsrev;
201     branch_t **branches; /* List of branches */
202     branch_t *active; /* The active branch (translated branch of admin) */
203     int nbranches;
204 bertho 1.13 int nfolds; /* Account folds to keep total branch-count */
205 bertho 1.6 merge_t *merges; /* Merge tags from->to description */
206     int nmerges;
207 bertho 1.1 int tw, th; /* Total BBox width/height */
208     } rcsfile_t;
209    
210     void set_id(void); /* Next scan is for an id */
211 bertho 1.9 void set_author(void); /* Next scan is for an author */
212 bertho 1.1 void set_sym(void); /* Next scan is for a symbol */
213     void set_skip(void); /* Everyting until ';' dropped */
214     void set_skipstr(void); /* Next string must be dropped */
215    
216     int rcslex(void);
217     int rcsparse(void);
218    
219     extern FILE *rcsin;
220     extern rcsfile_t *rcsfile;
221    
222     #endif

  ViewVC Help
Powered by ViewVC 1.1.0 with CvsGraph 1.7.0