/[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.1 - (show annotations)
Sun Mar 4 01:38:23 2001 UTC (16 years, 7 months ago) by bertho
Branch: MAIN
CVS Tags: REL_1_1_0
File MIME type: text/plain
Major update of the code.
- Complete new method of getting the revision structure by directly
  reading the rcs/cvs file. This should also speed things a bit
  because no external program needs to be called anymore.
  This also means that "remote-graphs" are no longer a possible
  extension of the program. But, who cares.
- Implemented branch-kerning to save place. The images are now
  much smaller in width, dependent on the settings of the exterior
  margins.
- Fixed disjoint braches by reading the structure direct from the
  rcs/cvs file. The revision/branch structure is no longer determined
  from the revision numbers, but solely from the rcs/cvs file structure.
- Fixed display of branches with no revisions attached to them. These
  only have a tag describing the new branch.
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 typedef struct __rev_t
25 {
26 char *branch;
27 char *rev;
28 int isbranch;
29 } rev_t;
30
31 typedef struct __revs_t
32 {
33 rev_t **revs;
34 int nrevs;
35 } revs_t;
36
37 typedef struct __tag_t
38 {
39 char *tag;
40 rev_t *rev;
41 } tag_t;
42
43 typedef struct __tags_t
44 {
45 tag_t **tags;
46 int ntags;
47 } tags_t;
48
49 typedef struct __idrev_t
50 {
51 char *id;
52 rev_t *rev;
53 } idrev_t;
54
55 typedef struct __idrevs_t
56 {
57 idrev_t **idrevs;
58 int nidrevs;
59 } idrevs_t;
60
61 typedef struct __ids_t
62 {
63 char **ids;
64 int nids;
65 } ids_t;
66
67 typedef struct __dtext_t
68 {
69 rev_t *rev; /* Diff/log revision */
70 char *log; /* The log entry */
71 char *text; /* Diff text (only set if lexer send it) */
72 } dtext_t;
73
74 typedef struct __dtexts_t
75 {
76 dtext_t **dtexts;
77 int ndtexts;
78 } dtexts_t;
79
80 typedef struct __delta_t
81 {
82 rev_t *rev; /* Delta revision */
83 char *date;
84 char *author;
85 char *state;
86 revs_t *branches;
87 rev_t *next; /* Next delta in this branch */
88 int flag; /* Set if assigned a branch to prevent infinite recursion */
89 } delta_t;
90
91 typedef struct __deltas_t
92 {
93 delta_t **deltas;
94 int ndeltas;
95 } deltas_t;
96
97 struct __revision_t; /* Forward */
98
99 typedef struct __branch_t /* Logical branch structure */
100 {
101 struct __revision_t **revs;
102 int nrevs;
103 struct __revision_t *branchpoint; /* Backlink to revision that spawned the branch */
104 rev_t *branch;/* Branch id */
105 tag_t **tags; /* Symbolic tags */
106 int ntags;
107 int w, h; /* BBox width/height */
108 int cx, y; /* BBox center-top position */
109 int tw, th; /* Total BBox width/height */
110 } branch_t;
111
112 typedef struct __revision_t /* Logical revision structure */
113 {
114 delta_t *delta;
115 dtext_t *dtext;
116 rev_t *rev; /* Shortcut to delta->rev */
117 branch_t *branch; /* The branch this revision belongs to */
118 branch_t **branches; /* Branches from this revision */
119 int nbranches;
120 tag_t **tags; /* Symbolic tags */
121 int ntags;
122 int w, h; /* BBox width/height */
123 int cx, y; /* BBox center-top position */
124 } revision_t;
125
126 typedef struct __rcsfile_t
127 {
128 char *root; /* The CVS root directory */
129 char *module; /* The CVS module */
130 char *file; /* The CVS filename */
131 rev_t *head; /* Head revision */
132 rev_t *branch; /* Active branch (NULL if main trunk) */
133 ids_t *access; /* Access identifier(s) (NULL if none) */
134 tags_t *tags; /* Symbolic tags (NULL if none) */
135 idrevs_t *locks; /* Locks revisions (NULL if no locks) */
136 int strict; /* Locking strategy */
137 char *comment; /* File comment (NULL if none) */
138 char *expand; /* Keyword substitution (NULL if none, i.e. -kv) */
139 deltas_t *deltas; /* Delta admin */
140 char *desc; /* Eh... description of file? */
141 dtexts_t *dtexts; /* Diffs and logs */
142
143 /* Logical structure */
144 delta_t **sdelta; /* Sorted delta on revision */
145 int nsdelta;
146 dtext_t **sdtext; /* Sorted dtext on revision */
147 int nsdtext;
148 revision_t **srev; /* Sorted list of all revisions */
149 int nsrev;
150 branch_t **branches; /* List of branches */
151 branch_t *active; /* The active branch (translated branch of admin) */
152 int nbranches;
153 int tw, th; /* Total BBox width/height */
154 } rcsfile_t;
155
156 void set_id(void); /* Next scan is for an id */
157 void set_sym(void); /* Next scan is for a symbol */
158 void set_skip(void); /* Everyting until ';' dropped */
159 void set_skipstr(void); /* Next string must be dropped */
160
161 int rcslex(void);
162 int rcsparse(void);
163
164 extern FILE *rcsin;
165 extern rcsfile_t *rcsfile;
166
167 #endif

  ViewVC Help
Powered by ViewVC 1.1.0 with CvsGraph 1.7.0