/[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.8 - (show annotations)
Fri Mar 14 01:38:39 2003 UTC (14 years, 7 months ago) by bertho
Branch: MAIN
CVS Tags: REL_1_4_0
Changes since 1.7: +9 -5 lines
File MIME type: text/plain
- Fixed a bug in the initial placing of left to right displaying.
- Half-fixed a bug in the kerning code, where a loop-safeguard was triggered
  way too soon (at 100 iterations). This has now been changed to 10000, but
  should be dependent on the number of drawable branches, as the function is
  _at least_ order O(N^2). However, more analysis is required to ensure
  safe guarding under all circumstances.
- Implemented folding of empty branches. Many uses of CVS create many
  branches on the same revision but have no commits on them. This occurs
  often with stable files like .cvsignore files and the like. A new
  configuration option branch_fold enables imaging consequtive brances
  with no commits in the same branch-box. This reduces images by a huge
  factor (28000x1700 -> 2100x2300, i.e. a factor of 10). It also speeds up
  drawing considerably. The branch_fold option is *on* by default.
- Fix duplicate branch-boxes (branch_dupbox=true). No duplicates should be
  created if there are no commits on a specific branch. There is no reason
  for having two boxes on top of each other.
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 } tag_t;
46
47 typedef struct __tags_t
48 {
49 tag_t **tags;
50 int ntags;
51 } tags_t;
52
53 typedef struct __merge_t
54 {
55 tag_t *to; /* This tag is destination of a merge */
56 tag_t *from; /* This tag is origin of a merge */
57 } merge_t;
58
59 typedef struct __idrev_t
60 {
61 char *id;
62 rev_t *rev;
63 } idrev_t;
64
65 typedef struct __idrevs_t
66 {
67 idrev_t **idrevs;
68 int nidrevs;
69 } idrevs_t;
70
71 typedef struct __ids_t
72 {
73 char **ids;
74 int nids;
75 } ids_t;
76
77 typedef struct __dtext_t
78 {
79 rev_t *rev; /* Diff/log revision */
80 char *log; /* The log entry */
81 char *text; /* Diff text (only set if lexer send it) */
82 } dtext_t;
83
84 typedef struct __dtexts_t
85 {
86 dtext_t **dtexts;
87 int ndtexts;
88 } dtexts_t;
89
90 typedef struct __delta_t
91 {
92 rev_t *rev; /* Delta revision */
93 char *date;
94 char *author;
95 char *state;
96 revs_t *branches;
97 rev_t *next; /* Next delta in this branch */
98 int flag; /* Set if assigned a branch to prevent infinite recursion */
99 } delta_t;
100
101 typedef struct __deltas_t
102 {
103 delta_t **deltas;
104 int ndeltas;
105 } deltas_t;
106
107 typedef struct __branch_t /* Logical branch structure */
108 {
109 struct __revision_t **revs;
110 int nrevs;
111 struct __revision_t *branchpoint; /* Backlink to revision that spawned the branch */
112 rev_t *branch; /* Branch id */
113 tag_t **tags; /* Symbolic tags */
114 int ntags;
115 int folded; /* Set if this branch is folded in another box */
116 struct __branch_t **folds; /* List of other branches folded into this one */
117 int nfolds;
118 int fw; /* Max width of the branch number if folds present */
119 int w, h; /* BBox width/height */
120 int cx, y; /* BBox center-top position */
121 int tw, th; /* Total BBox width/height */
122 } branch_t;
123
124 typedef struct __revision_t /* Logical revision structure */
125 {
126 delta_t *delta;
127 dtext_t *dtext;
128 rev_t *rev; /* Shortcut to delta->rev */
129 char *revtext; /* Expanded text to draw */
130 branch_t *branch; /* The branch this revision belongs to */
131 branch_t **branches; /* Branches from this revision */
132 int nbranches;
133 tag_t **tags; /* Symbolic tags */
134 int ntags;
135 int w, h; /* BBox width/height */
136 int cx, y; /* BBox center-top position */
137 int stripped; /* Set if we jumped revisions due to strip_untagged */
138 } revision_t;
139
140 typedef struct __rcsfile_t
141 {
142 char *root; /* The CVS root directory */
143 char *module; /* The CVS module */
144 char *file; /* The CVS filename */
145 rev_t *head; /* Head revision */
146 rev_t *branch; /* Active branch (NULL if main trunk) */
147 ids_t *access; /* Access identifier(s) (NULL if none) */
148 tags_t *tags; /* Symbolic tags (NULL if none) */
149 idrevs_t *locks; /* Locks revisions (NULL if no locks) */
150 int strict; /* Locking strategy */
151 char *comment; /* File comment (NULL if none) */
152 char *expand; /* Keyword substitution (NULL if none, i.e. -kv) */
153 deltas_t *deltas; /* Delta admin */
154 char *desc; /* Eh... description of file? */
155 dtexts_t *dtexts; /* Diffs and logs */
156
157 /* Logical structure */
158 delta_t **sdelta; /* Sorted delta on revision */
159 int nsdelta;
160 dtext_t **sdtext; /* Sorted dtext on revision */
161 int nsdtext;
162 revision_t **srev; /* Sorted list of all revisions */
163 int nsrev;
164 branch_t **branches; /* List of branches */
165 branch_t *active; /* The active branch (translated branch of admin) */
166 int nbranches;
167 merge_t *merges; /* Merge tags from->to description */
168 int nmerges;
169 int tw, th; /* Total BBox width/height */
170 } rcsfile_t;
171
172 void set_id(void); /* Next scan is for an id */
173 void set_sym(void); /* Next scan is for a symbol */
174 void set_skip(void); /* Everyting until ';' dropped */
175 void set_skipstr(void); /* Next string must be dropped */
176
177 int rcslex(void);
178 int rcsparse(void);
179
180 extern FILE *rcsin;
181 extern rcsfile_t *rcsfile;
182
183 #endif

  ViewVC Help
Powered by ViewVC 1.1.0 with CvsGraph 1.7.0