summaryrefslogtreecommitdiffstats
path: root/common.h
blob: 4cf5eb676d246862134966d6822e1358975d8584 (plain)
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
#ifndef LIBLDETECT_COMMON
#define LIBLDETECT_COMMON

#include "libldetect.h"

#define NON_EXPORTED __attribute__((visibility("hidden")))

extern int pciusb_find_modules(struct pciusb_entries *entries, const char *fpciusbtable) NON_EXPORTED;
extern void pciusb_initialize(struct pciusb_entry *e) NON_EXPORTED;

#define MAX_DEVICES 100
#define BUF_SIZE 512


#define psizeof(a) (sizeof(a) / sizeof(*(a)))
#define ifree(p) do { if (p) { free(p); p = NULL; } } while (0)

typedef struct {
	FILE *f;
	pid_t pid;
} fh;
extern fh fh_open(const char *name) NON_EXPORTED;
extern void fh_close(fh *f) NON_EXPORTED;

#endif