Use __linux__ conditional, not LINUX.
[cvsps-yd.git] / cvsps_types.h
blobdba145dfa8842dc8e70bd7add1e033b74461010c
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 REV_STR_MAX 64
14 #define MIN(a, b) ((a) < (b) ? (a) : (b))
15 #define MAX(a, b) ((a) > (b) ? (a) : (b))
17 typedef struct _CvsFile CvsFile;
18 typedef struct _PatchSet PatchSet;
19 typedef struct _PatchSetMember PatchSetMember;
20 typedef struct _PatchSetRange PatchSetRange;
21 typedef struct _CvsFileRevision CvsFileRevision;
22 typedef struct _GlobalSymbol GlobalSymbol;
23 typedef struct _Tag Tag;
25 struct _CvsFileRevision
27 char * rev;
28 int dead;
29 CvsFile * file;
30 char * branch;
32 * In the cvs cvs repository (ccvs project) there are tagged
33 * revisions that don't exist. track 'confirmed' revisions
34 * so as to not let them screw us up.
36 int present;
39 * A revision can be part of many PatchSets because it may
40 * be the branch point of many branches (as a pre_rev).
41 * It should, however, be the 'post_rev' of only one
42 * PatchSetMember. The 'main line of inheritence' is
43 * kept in pre_psm, and all 'branch revisions' are kept
44 * in a list.
46 PatchSetMember * pre_psm;
47 PatchSetMember * post_psm;
48 struct list_head branch_children;
50 /*
51 * for linking this 'first branch rev' into the parent branch_children
53 struct list_head link;
56 * A list of all Tag structures tagging this revision
58 struct list_head tags;
61 struct _CvsFile
63 char *filename;
64 struct hash_table * revisions; /* rev_str to revision [CvsFileRevision*] */
65 struct hash_table * branches; /* branch to branch_sym [char*] */
66 struct hash_table * branches_sym; /* branch_sym to branch [char*] */
67 struct hash_table * symbols; /* tag to revision [CvsFileRevision*] */
68 /*
69 * this is a hack. when we initially create entries in the symbol hash
70 * we don't have the branch info, so the CvsFileRevisions get created
71 * with the branch attribute NULL. Later we need to resolve these.
73 int have_branches;
76 struct _PatchSetMember
78 CvsFileRevision * pre_rev;
79 CvsFileRevision * post_rev;
80 PatchSet * ps;
81 CvsFile * file;
83 * bad_funk is only set w.r.t the -r tags
85 int bad_funk;
86 struct list_head link;
89 /*
90 * these are bit flags for tag flags
91 * they apply to any patchset that
92 * has an assoctiated tag
94 #define TAG_FUNKY 0x1
95 #define TAG_INVALID 0x2
97 /* values for funk_factor. they apply
98 * only to the -r tags, to patchsets
99 * that have an odd relationship to the
100 * tag
102 #define FNK_SHOW_SOME 1
103 #define FNK_SHOW_ALL 2
104 #define FNK_HIDE_ALL 3
105 #define FNK_HIDE_SOME 4
107 struct _PatchSet
109 int psid;
110 time_t date;
111 time_t min_date;
112 time_t max_date;
113 char *descr;
114 char *author;
115 char *tag;
116 int tag_flags;
117 char *branch;
118 char *ancestor_branch;
119 struct list_head members;
121 * A 'branch add' patch set is a bogus patch set created automatically
122 * when a 'file xyz was initially added on branch abc'
123 * we want to ignore these. fortunately, there's a way to detect them
124 * without resorting to looking at the log message.
126 int branch_add;
128 * If the '-r' option specifies a funky tag, we will need to detect the
129 * PatchSets that come chronologically before the tag, but are logically
130 * after, and vice-versa if a second -r option was specified
132 int funk_factor;
134 /* for putting onto a list */
135 struct list_head all_link;
136 struct list_head collision_link;
139 struct _PatchSetRange
141 int min_counter;
142 int max_counter;
143 struct list_head link;
146 struct _GlobalSymbol
148 char * tag;
149 PatchSet * ps;
150 struct list_head tags;
153 struct _Tag
155 GlobalSymbol * sym;
156 CvsFileRevision * rev;
157 char * tag;
158 struct list_head global_link;
159 struct list_head rev_link;
162 #endif /* CVSPS_TYPES_H */