1 |
#ifndef LIBLDETECT_COMMON |
2 |
#define LIBLDETECT_COMMON |
3 |
|
4 |
#include "libldetect.h" |
5 |
#include <zlib.h> |
6 |
|
7 |
#define NON_EXPORTED __attribute__((visibility("hidden"))) |
8 |
|
9 |
#pragma GCC visibility push(hidden) |
10 |
|
11 |
#define GZIP_BIN "/bin/gzip" |
12 |
|
13 |
extern char *table_name_to_file(const char *name); |
14 |
|
15 |
typedef enum { |
16 |
LOAD, |
17 |
DO_NOT_LOAD, |
18 |
} descr_lookup; |
19 |
|
20 |
extern int pciusb_find_modules(struct pciusb_entries *entries, const char *fpciusbtable, const descr_lookup, int is_pci) NON_EXPORTED; |
21 |
extern void pciusb_initialize(struct pciusb_entry *e) NON_EXPORTED; |
22 |
extern char *modalias_resolve_module(const char *modalias) NON_EXPORTED; |
23 |
extern void modalias_cleanup(void) NON_EXPORTED; |
24 |
|
25 |
#define MAX_DEVICES 100 |
26 |
#define BUF_SIZE 512 |
27 |
|
28 |
typedef struct { |
29 |
enum { ZLIB, GZIP } gztype; |
30 |
union { |
31 |
struct { |
32 |
FILE *f; |
33 |
pid_t pid; |
34 |
} gzip_fh; |
35 |
gzFile zlib_fh; |
36 |
} u; |
37 |
} fh; |
38 |
|
39 |
#define psizeof(a) (sizeof(a) / sizeof(*(a))) |
40 |
#define ifree(p) do { if (p) { free(p); p = NULL; } } while (0) |
41 |
|
42 |
extern fh fh_open(const char *name) NON_EXPORTED; |
43 |
extern char* fh_gets(char *line, int size, fh *f) NON_EXPORTED; |
44 |
extern int fh_close(fh *f) NON_EXPORTED; |
45 |
#pragma GCC visibility pop |
46 |
|
47 |
#endif |