forked from 360trev/ME7Sum
-
Notifications
You must be signed in to change notification settings - Fork 19
/
range.h
48 lines (38 loc) · 1.32 KB
/
range.h
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
#ifndef _RANGE_H
#define _RANGE_H
#include <stdio.h>
#include <stdint.h>
#include "str.h"
#include "list.h"
struct Range {
uint32_t start;
uint32_t end;
};
struct RangeList {
struct list_head list; /* MSVC doesn't have typeof, so list must always be first */
struct Range r;
};
struct ReportRecord {
int index;
char *name; /* name of this region */
struct RangeList data; /* data ranges that it spans */
struct Range checksum; /* range of checksum data */
struct strbuf msg; /* dependency messages */
int dep_errs; /* number of other checksums found later that are in my data */
int (*callback)(void *, struct ReportRecord *);
void *cb_data; /* pointer passed to callback */
};
struct ReportRecordList {
struct list_head list; /* MSVC doesn't have typeof, so list must always
be first */
struct ReportRecord rr;
};
extern struct ReportRecord *CreateRecord(const char *name, uint32_t start, int len);
extern void AddRange(struct ReportRecord *rr, struct Range *r);
extern void AddRangeStartEnd(struct ReportRecord *rr, uint32_t start, uint32_t end);
extern void AddRangeStartLength(struct ReportRecord *rr, uint32_t start, int len);
extern void PrintRecord(FILE *fh, struct ReportRecord *rr);
extern void PrintAllRecords(FILE *fh);
extern void FreeAllRecords(void);
extern int ProcessRecordDeps(void);
#endif /* ! RANGE_H */