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#define PCRE2_CODE_UNIT_WIDTH 8
8#include <pcre2.h>
9
14typedef struct {
16 const char *name;
17
19 const char *url;
20
22 const char *nice_name;
23
25 const char *re;
26
28 uint32_t re_flags;
29
34 const char *exclude_re;
35
38
40 pcre2_code *regexp;
41
43 pcre2_code *exclude_regexp;
44
45} License;
46
71
77typedef struct {
79 const char *language;
80
82 int code;
83
86
88 int blanks;
89
92
93} Loc;
94
100typedef struct LocListItem {
103
106
112
118
120
126typedef struct {
128 const char *language;
129
132
135
138
141
144
147
148} LocDelta;
149
175
180typedef struct {
182 const char *name;
183
186
188 char *code;
189
191 char *code_p;
192
195
197 char *comments;
198
201
204
207
209
234
239typedef struct {
241 char *filepath;
242
248
250 char *filename;
251
253 char *ext;
254
259 char *diskpath;
260
261 // The following fields should not be accessed directly. Their accessor
262 // functions should be used instead as labeled.
263
268 char *contents;
269
274 int size;
275
280 const char *language;
281
287
294
300
306
308 char **filenames;
309
310} SourceFile;
311
336
337#endif
Holds a list of Licenses in a linked list.
Definition structs.h:51
struct LicenseListItem * head
Definition structs.h:62
struct LicenseListItem * next
Definition structs.h:56
License * lic
Definition structs.h:53
struct LicenseListItem * tail
Definition structs.h:68
Holds a license and its associated details and patterns.
Definition structs.h:14
const char * exclude_re
Definition structs.h:34
const char * url
Definition structs.h:19
uint32_t exclude_re_flags
Definition structs.h:37
const char * nice_name
Definition structs.h:22
uint32_t re_flags
Definition structs.h:28
pcre2_code * regexp
Definition structs.h:40
const char * name
Definition structs.h:16
const char * re
Definition structs.h:25
pcre2_code * exclude_regexp
Definition structs.h:43
Tracks changes in lines of code, comments, and blank lines for multiple languages using a linked list...
Definition structs.h:155
struct LocDeltaListItem * next
Definition structs.h:160
LocDelta * delta
Definition structs.h:157
struct LocDeltaListItem * head
Definition structs.h:166
struct LocDeltaListItem * tail
Definition structs.h:172
Tracks changes in lines of code, comments, and blank lines for a single language.
Definition structs.h:126
int code_removed
Definition structs.h:134
int comments_added
Definition structs.h:137
int blanks_removed
Definition structs.h:146
int code_added
Definition structs.h:131
int blanks_added
Definition structs.h:143
int comments_removed
Definition structs.h:140
const char * language
Definition structs.h:128
Tracks total lines of code, comments, and blanks for multiple languages using a linked list.
Definition structs.h:100
struct LocListItem * head
Definition structs.h:111
Loc * loc
Definition structs.h:102
struct LocListItem * next
Definition structs.h:105
struct LocListItem * tail
Definition structs.h:117
Tracks total lines of code, comments, and blanks for a single language.
Definition structs.h:77
int comments
Definition structs.h:85
const char * language
Definition structs.h:79
int filecount
Definition structs.h:91
int code
Definition structs.h:82
int blanks
Definition structs.h:88
Holds a set of ParsedLanguages in a linked list.
Definition structs.h:214
struct ParsedLanguageListItem * next
Definition structs.h:219
ParsedLanguage * pl
Definition structs.h:216
struct ParsedLanguageListItem * tail
Definition structs.h:231
struct ParsedLanguageListItem * head
Definition structs.h:225
Represents a single language parsed from a SourceFile.
Definition structs.h:180
char * code
Definition structs.h:188
char * code_p
Definition structs.h:191
char * comments_p
Definition structs.h:200
int comments_count
Definition structs.h:203
int buffer_size
Definition structs.h:185
char * comments
Definition structs.h:197
const char * name
Definition structs.h:182
int blanks_count
Definition structs.h:206
int code_count
Definition structs.h:194
Contains a set of SourceFiles.
Definition structs.h:316
SourceFile * sf
Definition structs.h:318
struct SourceFileListItem * next
Definition structs.h:321
struct SourceFileListItem * head
Definition structs.h:327
struct SourceFileListItem * tail
Definition structs.h:333
Represents a single source code file.
Definition structs.h:239
int language_detected
Definition structs.h:286
LicenseList * license_list
Definition structs.h:299
LocList * loc_list
Definition structs.h:305
char * filename
Definition structs.h:250
int dirpath
Definition structs.h:247
const char * language
Definition structs.h:280
char ** filenames
Definition structs.h:308
char * filepath
Definition structs.h:241
char * ext
Definition structs.h:253
char * diskpath
Definition structs.h:259
char * contents
Definition structs.h:268
int size
Definition structs.h:274
ParsedLanguageList * parsed_language_list
Definition structs.h:293
struct LocDeltaListItem LocDeltaList
struct SourceFileListItem SourceFileList
struct LicenseListItem LicenseList
struct ParsedLanguageListItem ParsedLanguageList
struct LocListItem LocList