-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitward.h
More file actions
61 lines (52 loc) · 1.29 KB
/
Copy pathgitward.h
File metadata and controls
61 lines (52 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef GITWARD_H
#define GITWARD_H
#include <stddef.h>
#include <time.h>
#define GITWARD_VERSION "0.3"
#define CLUE_VALUE_MAX 4096
#define CLUE_FIELD_MAX 512
typedef enum {
CLUE_EMAIL,
CLUE_URL,
CLUE_DOMAIN,
CLUE_AUTHOR,
CLUE_COMMIT,
CLUE_FILEPATH,
CLUE_REFNAME,
CLUE_TIMESTAMP,
CLUE_SECRET,
CLUE_SUSPICIOUS,
CLUE_TAG,
CLUE_STASH,
CLUE_USERNAME,
CLUE_RELATION,
CLUE_IP,
CLUE_UNKNOWN
} ClueType;
typedef struct {
ClueType type;
char value[CLUE_VALUE_MAX];
char commit[64];
char author[CLUE_FIELD_MAX];
char path[CLUE_FIELD_MAX];
char utc[64];
char extra[CLUE_VALUE_MAX];
} Clue;
typedef struct {
Clue *items;
size_t count;
size_t cap;
char repo_path[CLUE_FIELD_MAX];
char scanned_utc[64];
} ClueList;
ClueList *cluelist_new(void);
void cluelist_free(ClueList *cl);
int cluelist_add(ClueList *cl, Clue *c);
int cluelist_has(ClueList *cl, ClueType type, const char *value);
int scan_repo(const char *path, ClueList *cl);
void inspect_repo(const char *path, ClueList *cl);
void search_clues(ClueList *cl, const char *query);
int save_clues(ClueList *cl, const char *outpath);
const char *clue_type_str(ClueType t);
void clue_now_utc(char *buf, size_t n);
#endif