Take commitid into account
[cvsps-yd/commitid.git] / cvsps_types.h
blobf3cc33fc18edda0b7012c66ddb495a9e8500326d
1 /*
2 * Copyright 2001, 2002, 2003 David Mansfield and Cobite, Inc.
3 * See COPYING file for license information
4 */
6 #ifndef CVSPS_TYPES_H
7 #define CVSPS_TYPES_H
9 #include <time.h>
11 #define LOG_STR_MAX 65536
12 #define AUTH_STR_MAX 64
13 #define CID_STR_MAX 64
14 #define REV_STR_MAX 64
15 #define MIN(a, b) ((a) < (b) ? (a) : (b))
16 #define MAX(a, b) ((a) > (b) ? (a) : (b))
18 typedef struct _CvsFile CvsFile;
19 typedef struct _PatchSet PatchSet;
20 typedef struct _PatchSetMember PatchSetMember;
21 typedef struct _PatchSetRange PatchSetRange;
22 typedef struct _CvsFileRevision CvsFileRevision;
23 typedef struct _GlobalSymbol GlobalSymbol;
24 typedef struct _Tag Tag;
26 struct _CvsFileRevision
28 char * rev;
29 int dead;
30 CvsFile * file;
31 char * branch;
33 * In the cvs cvs repository (ccvs project) there are tagged
34 * revisions that don't exist. track 'confirmed' revisions
35 * so as to not let them screw us up.
37 int present;
40 * A revision can be part of many PatchSets because it may
41 * be the branch point of many branches (as a pre_rev).
42 * It should, however, be the 'post_rev' of only one
43 * PatchSetMember. The 'main line of inheritence' is
44 * kept in pre_psm, and all 'branch revisions' are kept
45 * in a list.
47 PatchSetMember * pre_psm;
48 PatchSetMember * post_psm;
49 struct list_head branch_children;
51 /*
52 * for linking this 'first branch rev' into the parent branch_children
54 struct list_head link;
57 * A list of all Tag structures tagging this revision
59 struct list_head tags;
62 struct _CvsFile
64 char *filename;
65 struct hash_table * revisions; /* rev_str to revision [CvsFileRevision*] */
66 struct hash_table * branches; /* branch to branch_sym [char*] */
67 struct hash_table * branches_sym; /* branch_sym to branch [char*] */
68 struct hash_table * symbols; /* tag to revision [CvsFileRevision*] */
69 /*
70 * this is a hack. when we initially create entries in the symbol hash
71 * we don't have the branch info, so the CvsFileRevisions get created
72 * with the branch attribute NULL. Later we need to resolve these.
74 int have_branches;
77 struct _PatchSetMember
79 CvsFileRevision * pre_rev;
80 CvsFileRevision * post_rev;
81 PatchSet * ps;
82 CvsFile * file;
84 * bad_funk is only set w.r.t the -r tags
86 int bad_funk;
87 struct list_head link;
90 /*
91 * these are bit flags for tag flags
92 * they apply to any patchset that
93 * has an assoctiated tag
95 #define TAG_FUNKY 0x1
96 #define TAG_INVALID 0x2
98 /* values for funk_factor. they apply
99 * only to the -r tags, to patchsets
100 * that have an odd relationship to the
101 * tag
103 #define FNK_SHOW_SOME 1
104 #define FNK_SHOW_ALL 2
105 #define FNK_HIDE_ALL 3
106 #define FNK_HIDE_SOME 4
108 struct _PatchSet
110 int psid;
111 time_t date;
112 time_t min_date;
113 time_t max_date;
114 char *descr;
115 char *author;
116 char *tag;
117 char *commitid;
118 int tag_flags;
119 char *branch;
120 char *ancestor_branch;
121 struct list_head members;
123 * A 'branch add' patch set is a bogus patch set created automatically
124 * when a 'file xyz was initially added on branch abc'
125 * we want to ignore these. fortunately, there's a way to detect them
126 * without resorting to looking at the log message.
128 int branch_add;
130 * If the '-r' option specifies a funky tag, we will need to detect the
131 * PatchSets that come chronologically before the tag, but are logically
132 * after, and vice-versa if a second -r option was specified
134 int funk_factor;
136 /* for putting onto a list */
137 struct list_head all_link;
138 struct list_head collision_link;
141 struct _PatchSetRange
143 int min_counter;
144 int max_counter;
145 struct list_head link;
148 struct _GlobalSymbol
150 char * tag;
151 PatchSet * ps;
152 struct list_head tags;
155 struct _Tag
157 GlobalSymbol * sym;
158 CvsFileRevision * rev;
159 char * tag;
160 struct list_head global_link;
161 struct list_head rev_link;
164 #endif /* CVSPS_TYPES_H */