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
License::re_flags
int re_flags
Definition: structs.h:27
LocListItem
Tracks total lines of code, comments, and blanks for multiple languages using a linked list.
Definition: structs.h:99
LocDeltaListItem::head
struct LocDeltaListItem * head
Definition: structs.h:165
ParsedLanguage::buffer_size
int buffer_size
Definition: structs.h:184
SourceFile::filename
char * filename
Definition: structs.h:249
LocDelta::blanks_added
int blanks_added
Definition: structs.h:142
Loc::filecount
int filecount
Definition: structs.h:90
SourceFile::contents
char * contents
Definition: structs.h:267
LicenseListItem::head
struct LicenseListItem * head
Definition: structs.h:61
ParsedLanguage::comments_p
char * comments_p
Definition: structs.h:199
SourceFileListItem::sf
SourceFile * sf
Definition: structs.h:317
LocDeltaListItem::tail
struct LocDeltaListItem * tail
Definition: structs.h:171
LocListItem::head
struct LocListItem * head
Definition: structs.h:110
ParsedLanguage
Represents a single language parsed from a SourceFile.
Definition: structs.h:179
SourceFile::size
int size
Definition: structs.h:273
LicenseListItem::next
struct LicenseListItem * next
Definition: structs.h:55
License::exclude_re_flags
int exclude_re_flags
Definition: structs.h:36
LocDelta::code_added
int code_added
Definition: structs.h:130
SourceFile::license_list
LicenseList * license_list
Definition: structs.h:298
LicenseList
struct LicenseListItem LicenseList
License::name
const char * name
Definition: structs.h:15
SourceFileListItem::tail
struct SourceFileListItem * tail
Definition: structs.h:332
SourceFileListItem
Contains a set of SourceFiles.
Definition: structs.h:315
LocList
struct LocListItem LocList
LocDelta::language
const char * language
Definition: structs.h:127
ParsedLanguage::blanks_count
int blanks_count
Definition: structs.h:205
SourceFile::ext
char * ext
Definition: structs.h:252
SourceFileList
struct SourceFileListItem SourceFileList
License::nice_name
const char * nice_name
Definition: structs.h:21
LocListItem::tail
struct LocListItem * tail
Definition: structs.h:116
SourceFile::loc_list
LocList * loc_list
Definition: structs.h:304
ParsedLanguage::comments
char * comments
Definition: structs.h:196
LocDeltaListItem::next
struct LocDeltaListItem * next
Definition: structs.h:159
Loc
Tracks total lines of code, comments, and blanks for a single language.
Definition: structs.h:76
ParsedLanguageListItem
Holds a set of ParsedLanguages in a linked list.
Definition: structs.h:213
LocDeltaList
struct LocDeltaListItem LocDeltaList
SourceFile::language
const char * language
Definition: structs.h:279
LocDeltaListItem::delta
LocDelta * delta
Definition: structs.h:156
License::url
const char * url
Definition: structs.h:18
LicenseListItem::lic
License * lic
Definition: structs.h:52
LocDelta::blanks_removed
int blanks_removed
Definition: structs.h:145
LocListItem::loc
Loc * loc
Definition: structs.h:101
LocDelta
Tracks changes in lines of code, comments, and blank lines for a single language.
Definition: structs.h:125
LocListItem::next
struct LocListItem * next
Definition: structs.h:104
License::re
const char * re
Definition: structs.h:24
LicenseListItem
Holds a list of Licenses in a linked list.
Definition: structs.h:50
ParsedLanguageListItem::pl
ParsedLanguage * pl
Definition: structs.h:215
SourceFile::diskpath
char * diskpath
Definition: structs.h:258
LocDelta::comments_removed
int comments_removed
Definition: structs.h:139
SourceFile
Represents a single source code file.
Definition: structs.h:238
SourceFileListItem::next
struct SourceFileListItem * next
Definition: structs.h:320
License::exclude_regexp
pcre * exclude_regexp
Definition: structs.h:42
ParsedLanguageListItem::head
struct ParsedLanguageListItem * head
Definition: structs.h:224
SourceFile::language_detected
int language_detected
Definition: structs.h:285
LocDeltaListItem
Tracks changes in lines of code, comments, and blank lines for multiple languages using a linked list...
Definition: structs.h:154
ParsedLanguage::code
char * code
Definition: structs.h:187
License
Holds a license and its associated details and patterns.
Definition: structs.h:13
ParsedLanguage::name
const char * name
Definition: structs.h:181
License::exclude_re
const char * exclude_re
Definition: structs.h:33
ParsedLanguageListItem::next
struct ParsedLanguageListItem * next
Definition: structs.h:218
SourceFile::dirpath
int dirpath
Definition: structs.h:246
SourceFile::filepath
char * filepath
Definition: structs.h:240
LocDelta::code_removed
int code_removed
Definition: structs.h:133
ParsedLanguageList
struct ParsedLanguageListItem ParsedLanguageList
ParsedLanguage::code_count
int code_count
Definition: structs.h:193
SourceFile::parsed_language_list
ParsedLanguageList * parsed_language_list
Definition: structs.h:292
License::regexp
pcre * regexp
Definition: structs.h:39
LicenseListItem::tail
struct LicenseListItem * tail
Definition: structs.h:67
ParsedLanguage::comments_count
int comments_count
Definition: structs.h:202
ParsedLanguageListItem::tail
struct ParsedLanguageListItem * tail
Definition: structs.h:230
ParsedLanguage::code_p
char * code_p
Definition: structs.h:190
Loc::comments
int comments
Definition: structs.h:84
SourceFileListItem::head
struct SourceFileListItem * head
Definition: structs.h:326
SourceFile::filenames
char ** filenames
Definition: structs.h:307
Loc::language
const char * language
Definition: structs.h:78
Loc::blanks
int blanks
Definition: structs.h:87
Loc::code
int code
Definition: structs.h:81
LocDelta::comments_added
int comments_added
Definition: structs.h:136