forked from falconindy/pkgfile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnosr.h
63 lines (49 loc) · 1.02 KB
/
nosr.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef _NOSR_H
#define _NOSR_H
#include <archive.h>
#include <archive_entry.h>
#include <pcre.h>
#include "result.h"
#define DBPATH "/var/cache/nosr"
struct archive_read_buffer {
char *line;
char *line_offset;
size_t line_size;
size_t max_line_size;
char *block;
char *block_offset;
size_t block_size;
int ret;
};
struct pcre_data {
pcre *re;
pcre_extra *re_extra;
};
typedef enum _filterstyle_t {
FILTER_EXACT = 0,
FILTER_GLOB,
FILTER_REGEX
} filterstyle_t;
typedef union _filterpattern_t {
struct pcre_data re;
char *glob;
} filterpattern_t;
struct pkg_t {
char *name;
char *version;
};
struct config_t {
filterstyle_t filterby;
filterpattern_t filter;
int (*filefunc)(const char *repo, struct pkg_t *pkg, struct archive* a,
struct result_t *result);
int (*filterfunc)(filterpattern_t *filter, const char *line, int flags);
void (*filterfree)(filterpattern_t *filter);
char *targetrepo;
int binaries;
int icase;
int doupdate;
int verbose;
};
#endif /* _NOSR_H */
/* vim: set ts=2 sw=2 noet: */