/[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.6 - (hide annotations)
Sun Mar 9 22:36:50 2003 UTC (14 years, 7 months ago) by bertho
Branch: MAIN
Changes since 1.5: +13 -4 lines
File MIME type: text/plain
- add merge visualization
- Provide solution for possible XSS bug in tag expansions
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.1 } tag_t;
45    
46     typedef struct __tags_t
47     {
48     tag_t **tags;
49     int ntags;
50     } tags_t;
51    
52 bertho 1.6 typedef struct __merge_t
53     {
54     tag_t *to; /* This tag is destination of a merge */
55     tag_t *from; /* This tag is origin of a merge */
56     } merge_t;
57    
58 bertho 1.1 typedef struct __idrev_t
59     {
60     char *id;
61     rev_t *rev;
62     } idrev_t;
63    
64     typedef struct __idrevs_t
65     {
66     idrev_t **idrevs;
67     int nidrevs;
68     } idrevs_t;
69    
70     typedef struct __ids_t
71     {
72     char **ids;
73     int nids;
74     } ids_t;
75    
76     typedef struct __dtext_t
77     {
78     rev_t *rev; /* Diff/log revision */
79     char *log; /* The log entry */
80     char *text; /* Diff text (only set if lexer send it) */
81     } dtext_t;
82    
83     typedef struct __dtexts_t
84     {
85     dtext_t **dtexts;
86     int ndtexts;
87     } dtexts_t;
88    
89     typedef struct __delta_t
90     {
91     rev_t *rev; /* Delta revision */
92     char *date;
93     char *author;
94     char *state;
95     revs_t *branches;
96     rev_t *next; /* Next delta in this branch */
97     int flag; /* Set if assigned a branch to prevent infinite recursion */
98     } delta_t;
99    
100     typedef struct __deltas_t
101     {
102     delta_t **deltas;
103     int ndeltas;
104     } deltas_t;
105    
106     typedef struct __branch_t /* Logical branch structure */
107     {
108     struct __revision_t **revs;
109     int nrevs;
110     struct __revision_t *branchpoint; /* Backlink to revision that spawned the branch */
111     rev_t *branch;/* Branch id */
112     tag_t **tags; /* Symbolic tags */
113     int ntags;
114     int w, h; /* BBox width/height */
115     int cx, y; /* BBox center-top position */
116     int tw, th; /* Total BBox width/height */
117     } branch_t;
118    
119     typedef struct __revision_t /* Logical revision structure */
120     {
121     delta_t *delta;
122     dtext_t *dtext;
123     rev_t *rev; /* Shortcut to delta->rev */
124 bertho 1.2 char *revtext; /* Expanded text to draw */
125 bertho 1.1 branch_t *branch; /* The branch this revision belongs to */
126     branch_t **branches; /* Branches from this revision */
127     int nbranches;
128     tag_t **tags; /* Symbolic tags */
129     int ntags;
130     int w, h; /* BBox width/height */
131     int cx, y; /* BBox center-top position */
132 bertho 1.3 int stripped; /* Set if we jumped revisions due to strip_untagged */
133 bertho 1.1 } revision_t;
134    
135     typedef struct __rcsfile_t
136     {
137     char *root; /* The CVS root directory */
138     char *module; /* The CVS module */
139     char *file; /* The CVS filename */
140     rev_t *head; /* Head revision */
141     rev_t *branch; /* Active branch (NULL if main trunk) */
142     ids_t *access; /* Access identifier(s) (NULL if none) */
143     tags_t *tags; /* Symbolic tags (NULL if none) */
144     idrevs_t *locks; /* Locks revisions (NULL if no locks) */
145     int strict; /* Locking strategy */
146     char *comment; /* File comment (NULL if none) */
147     char *expand; /* Keyword substitution (NULL if none, i.e. -kv) */
148     deltas_t *deltas; /* Delta admin */
149     char *desc; /* Eh... description of file? */
150     dtexts_t *dtexts; /* Diffs and logs */
151    
152     /* Logical structure */
153     delta_t **sdelta; /* Sorted delta on revision */
154     int nsdelta;
155     dtext_t **sdtext; /* Sorted dtext on revision */
156     int nsdtext;
157     revision_t **srev; /* Sorted list of all revisions */
158     int nsrev;
159     branch_t **branches; /* List of branches */
160     branch_t *active; /* The active branch (translated branch of admin) */
161     int nbranches;
162 bertho 1.6 merge_t *merges; /* Merge tags from->to description */
163     int nmerges;
164 bertho 1.1 int tw, th; /* Total BBox width/height */
165     } rcsfile_t;
166    
167     void set_id(void); /* Next scan is for an id */
168     void set_sym(void); /* Next scan is for a symbol */
169     void set_skip(void); /* Everyting until ';' dropped */
170     void set_skipstr(void); /* Next string must be dropped */
171    
172     int rcslex(void);
173     int rcsparse(void);
174    
175     extern FILE *rcsin;
176     extern rcsfile_t *rcsfile;
177    
178     #endif

  ViewVC Help
Powered by ViewVC 1.1.0 with CvsGraph 1.7.0