ohcount
structs.h
Go to the documentation of this file.
1 // structs.h written by Mitchell Foral. mitchell<att>caladbolg.net.
2 // See COPYING for license information.
3 
4 #ifndef OHCOUNT_STRUCTS_H
5 #define OHCOUNT_STRUCTS_H
6 
7 #include <pcre.h>
8 
13 typedef struct {
15  const char *name;
16 
18  const char *url;
19 
21  const char *nice_name;
22 
24  const char *re;
25 
27  int re_flags;
28 
33  const char *exclude_re;
34 
37 
39  pcre *regexp;
40 
43 
44 } License;
45 
50 typedef struct LicenseListItem {
53 
56 
62 
68 
69 } LicenseList;
70 
76 typedef struct {
78  const char *language;
79 
81  int code;
82 
84  int comments;
85 
87  int blanks;
88 
90  int filecount;
91 
92 } Loc;
93 
99 typedef struct LocListItem {
102 
104  struct LocListItem *next;
105 
110  struct LocListItem *head;
111 
116  struct LocListItem *tail;
117 
118 } LocList;
119 
125 typedef struct {
127  const char *language;
128 
131 
134 
137 
140 
143 
146 
147 } LocDelta;
148 
154 typedef struct LocDeltaListItem {
157 
160 
166 
172 
173 } LocDeltaList;
174 
179 typedef struct {
181  const char *name;
182 
185 
187  char *code;
188 
190  char *code_p;
191 
194 
196  char *comments;
197 
199  char *comments_p;
200 
203 
206 
208 
213 typedef struct ParsedLanguageListItem {
216 
219 
225 
231 
233 
238 typedef struct {
240  char *filepath;
241 
246  int dirpath;
247 
249  char *filename;
250 
252  char *ext;
253 
258  char *diskpath;
259 
260  // The following fields should not be accessed directly. Their accessor
261  // functions should be used instead as labeled.
262 
267  char *contents;
268 
273  int size;
274 
279  const char *language;
280 
286 
293 
299 
305 
307  char **filenames;
308 
309 } SourceFile;
310 
315 typedef struct SourceFileListItem {
318 
321 
327 
333 
335 
336 #endif
Represents a single language parsed from a SourceFile.
Definition: structs.h:179
LicenseList * license_list
Definition: structs.h:298
struct LocListItem LocList
const char * re
Definition: structs.h:24
struct SourceFileListItem * tail
Definition: structs.h:332
char ** filenames
Definition: structs.h:307
int blanks
Definition: structs.h:87
int blanks_count
Definition: structs.h:205
struct ParsedLanguageListItem ParsedLanguageList
Tracks changes in lines of code, comments, and blank lines for multiple languages using a linked list...
Definition: structs.h:154
pcre * regexp
Definition: structs.h:39
char * code
Definition: structs.h:187
const char * language
Definition: structs.h:78
const char * nice_name
Definition: structs.h:21
int code
Definition: structs.h:81
struct LocListItem * tail
Definition: structs.h:116
struct LocDeltaListItem LocDeltaList
int filecount
Definition: structs.h:90
char * comments_p
Definition: structs.h:199
Holds a license and its associated details and patterns.
Definition: structs.h:13
int code_added
Definition: structs.h:130
Represents a single source code file.
Definition: structs.h:238
int size
Definition: structs.h:273
Holds a set of ParsedLanguages in a linked list.
Definition: structs.h:213
char * code_p
Definition: structs.h:190
License * lic
Definition: structs.h:52
struct SourceFileListItem * head
Definition: structs.h:326
struct LicenseListItem * tail
Definition: structs.h:67
LocList * loc_list
Definition: structs.h:304
struct LicenseListItem * next
Definition: structs.h:55
ParsedLanguage * pl
Definition: structs.h:215
int comments_removed
Definition: structs.h:139
char * ext
Definition: structs.h:252
int buffer_size
Definition: structs.h:184
Loc * loc
Definition: structs.h:101
char * diskpath
Definition: structs.h:258
int language_detected
Definition: structs.h:285
struct ParsedLanguageListItem * head
Definition: structs.h:224
int code_removed
Definition: structs.h:133
int comments_count
Definition: structs.h:202
const char * name
Definition: structs.h:181
Holds a list of Licenses in a linked list.
Definition: structs.h:50
struct LocListItem * next
Definition: structs.h:104
struct LicenseListItem LicenseList
int comments
Definition: structs.h:84
SourceFile * sf
Definition: structs.h:317
Contains a set of SourceFiles.
Definition: structs.h:315
const char * language
Definition: structs.h:279
Tracks total lines of code, comments, and blanks for multiple languages using a linked list...
Definition: structs.h:99
int exclude_re_flags
Definition: structs.h:36
struct LocDeltaListItem * next
Definition: structs.h:159
int blanks_removed
Definition: structs.h:145
int re_flags
Definition: structs.h:27
ParsedLanguageList * parsed_language_list
Definition: structs.h:292
LocDelta * delta
Definition: structs.h:156
struct ParsedLanguageListItem * next
Definition: structs.h:218
const char * exclude_re
Definition: structs.h:33
Tracks changes in lines of code, comments, and blank lines for a single language. ...
Definition: structs.h:125
const char * url
Definition: structs.h:18
const char * language
Definition: structs.h:127
int comments_added
Definition: structs.h:136
int blanks_added
Definition: structs.h:142
int code_count
Definition: structs.h:193
struct LocDeltaListItem * head
Definition: structs.h:165
struct LicenseListItem * head
Definition: structs.h:61
struct ParsedLanguageListItem * tail
Definition: structs.h:230
struct SourceFileListItem * next
Definition: structs.h:320
Tracks total lines of code, comments, and blanks for a single language.
Definition: structs.h:76
char * comments
Definition: structs.h:196
char * filepath
Definition: structs.h:240
char * filename
Definition: structs.h:249
struct SourceFileListItem SourceFileList
struct LocDeltaListItem * tail
Definition: structs.h:171
const char * name
Definition: structs.h:15
char * contents
Definition: structs.h:267
struct LocListItem * head
Definition: structs.h:110
pcre * exclude_regexp
Definition: structs.h:42
int dirpath
Definition: structs.h:246