summaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2007-08-15 00:22:36 +0000
committerOlivier Blin <oblin@mandriva.com>2007-08-15 00:22:36 +0000
commit79a055cf4c8f83e8a9183de150d5906d1ff75476 (patch)
tree9521d0adfb53fdb70a81e4edeb09e22d1aaf81b6 /common.h
parent472e665be19dc391f26787bd2c73d38cdbb133b5 (diff)
downloadldetect-79a055cf4c8f83e8a9183de150d5906d1ff75476.tar
ldetect-79a055cf4c8f83e8a9183de150d5906d1ff75476.tar.gz
ldetect-79a055cf4c8f83e8a9183de150d5906d1ff75476.tar.bz2
ldetect-79a055cf4c8f83e8a9183de150d5906d1ff75476.tar.xz
ldetect-79a055cf4c8f83e8a9183de150d5906d1ff75476.zip
use zlib to read gzipped files instead of piping gzip command
Diffstat (limited to 'common.h')
-rw-r--r--common.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/common.h b/common.h
index 324bbaf..1602cf3 100644
--- a/common.h
+++ b/common.h
@@ -2,6 +2,7 @@
#define LIBLDETECT_COMMON
#include "libldetect.h"
+#include <zlib.h>
#define NON_EXPORTED __attribute__((visibility("hidden")))
@@ -20,11 +21,9 @@ extern void pciusb_initialize(struct pciusb_entry *e) NON_EXPORTED;
#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;
+typedef gzFile fh;
extern fh fh_open(const char *name) NON_EXPORTED;
-extern void fh_close(fh *f) NON_EXPORTED;
+#define fh_gets(line, size, f) gzgets(f, line, size)
+#define fh_close(f) gzclose(f);
#endif