diff options
author | Dexter Morgan <dmorgan@mageia.org> | 2011-06-02 20:49:50 +0000 |
---|---|---|
committer | Dexter Morgan <dmorgan@mageia.org> | 2011-06-02 20:49:50 +0000 |
commit | db5a94788a783a716de6c79e23f2e45093aca398 (patch) | |
tree | f0448c53425509d4272a355f120cb7249d4d58e8 /common.h | |
download | ldetect-db5a94788a783a716de6c79e23f2e45093aca398.tar ldetect-db5a94788a783a716de6c79e23f2e45093aca398.tar.gz ldetect-db5a94788a783a716de6c79e23f2e45093aca398.tar.bz2 ldetect-db5a94788a783a716de6c79e23f2e45093aca398.tar.xz ldetect-db5a94788a783a716de6c79e23f2e45093aca398.zip |
Branch for updatesdistro/mga1
Diffstat (limited to 'common.h')
-rw-r--r-- | common.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/common.h b/common.h new file mode 100644 index 0000000..e6f927d --- /dev/null +++ b/common.h @@ -0,0 +1,47 @@ +#ifndef LIBLDETECT_COMMON +#define LIBLDETECT_COMMON + +#include "libldetect.h" +#include <zlib.h> + +#define NON_EXPORTED __attribute__((visibility("hidden"))) + +#pragma GCC visibility push(hidden) + +#define GZIP_BIN "/bin/gzip" + +extern char *table_name_to_file(const char *name); + +typedef enum { + LOAD, + DO_NOT_LOAD, +} descr_lookup; + +extern int pciusb_find_modules(struct pciusb_entries *entries, const char *fpciusbtable, const descr_lookup, int is_pci) NON_EXPORTED; +extern void pciusb_initialize(struct pciusb_entry *e) NON_EXPORTED; +extern char *modalias_resolve_module(const char *modalias) NON_EXPORTED; +extern void modalias_cleanup(void) NON_EXPORTED; + +#define MAX_DEVICES 100 +#define BUF_SIZE 512 + +typedef struct { + enum { ZLIB, GZIP } gztype; + union { + struct { + FILE *f; + pid_t pid; + } gzip_fh; + gzFile zlib_fh; + } u; +} fh; + +#define psizeof(a) (sizeof(a) / sizeof(*(a))) +#define ifree(p) do { if (p) { free(p); p = NULL; } } while (0) + +extern fh fh_open(const char *name) NON_EXPORTED; +extern char* fh_gets(char *line, int size, fh *f) NON_EXPORTED; +extern int fh_close(fh *f) NON_EXPORTED; +#pragma GCC visibility pop + +#endif |