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 |
|
|
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 |
bertho |
1.2 |
char *revtext; /* Expanded text to draw */
|
118 |
bertho |
1.1 |
branch_t *branch; /* The branch this revision belongs to */
|
119 |
|
|
branch_t **branches; /* Branches from this revision */
|
120 |
|
|
int nbranches;
|
121 |
|
|
tag_t **tags; /* Symbolic tags */
|
122 |
|
|
int ntags;
|
123 |
|
|
int w, h; /* BBox width/height */
|
124 |
|
|
int cx, y; /* BBox center-top position */
|
125 |
bertho |
1.3 |
int stripped; /* Set if we jumped revisions due to strip_untagged */
|
126 |
bertho |
1.1 |
} revision_t;
|
127 |
|
|
|
128 |
|
|
typedef struct __rcsfile_t
|
129 |
|
|
{
|
130 |
|
|
char *root; /* The CVS root directory */
|
131 |
|
|
char *module; /* The CVS module */
|
132 |
|
|
char *file; /* The CVS filename */
|
133 |
|
|
rev_t *head; /* Head revision */
|
134 |
|
|
rev_t *branch; /* Active branch (NULL if main trunk) */
|
135 |
|
|
ids_t *access; /* Access identifier(s) (NULL if none) */
|
136 |
|
|
tags_t *tags; /* Symbolic tags (NULL if none) */
|
137 |
|
|
idrevs_t *locks; /* Locks revisions (NULL if no locks) */
|
138 |
|
|
int strict; /* Locking strategy */
|
139 |
|
|
char *comment; /* File comment (NULL if none) */
|
140 |
|
|
char *expand; /* Keyword substitution (NULL if none, i.e. -kv) */
|
141 |
|
|
deltas_t *deltas; /* Delta admin */
|
142 |
|
|
char *desc; /* Eh... description of file? */
|
143 |
|
|
dtexts_t *dtexts; /* Diffs and logs */
|
144 |
|
|
|
145 |
|
|
/* Logical structure */
|
146 |
|
|
delta_t **sdelta; /* Sorted delta on revision */
|
147 |
|
|
int nsdelta;
|
148 |
|
|
dtext_t **sdtext; /* Sorted dtext on revision */
|
149 |
|
|
int nsdtext;
|
150 |
|
|
revision_t **srev; /* Sorted list of all revisions */
|
151 |
|
|
int nsrev;
|
152 |
|
|
branch_t **branches; /* List of branches */
|
153 |
|
|
branch_t *active; /* The active branch (translated branch of admin) */
|
154 |
|
|
int nbranches;
|
155 |
|
|
int tw, th; /* Total BBox width/height */
|
156 |
|
|
} rcsfile_t;
|
157 |
|
|
|
158 |
|
|
void set_id(void); /* Next scan is for an id */
|
159 |
|
|
void set_sym(void); /* Next scan is for a symbol */
|
160 |
|
|
void set_skip(void); /* Everyting until ';' dropped */
|
161 |
|
|
void set_skipstr(void); /* Next string must be dropped */
|
162 |
|
|
|
163 |
|
|
int rcslex(void);
|
164 |
|
|
int rcsparse(void);
|
165 |
|
|
|
166 |
|
|
extern FILE *rcsin;
|
167 |
|
|
extern rcsfile_t *rcsfile;
|
168 |
|
|
|
169 |
|
|
#endif
|