diff options
author | Richard Jones <rjones@redhat.com> | 2010-11-09 15:59:40 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2010-11-10 10:52:12 +0000 |
commit | a0b4caa0821b759de01361b7019c9c9c9607027d (patch) | |
tree | 7cfb0b243ddce5d19f518a8f040c28692907a0fa /src/guestfs-internal.h | |
parent | ec63875f9cd7277cf2d49827684bba936add7ce2 (diff) | |
download | libguestfs-a0b4caa0821b759de01361b7019c9c9c9607027d.tar.gz libguestfs-a0b4caa0821b759de01361b7019c9c9c9607027d.tar.xz libguestfs-a0b4caa0821b759de01361b7019c9c9c9607027d.zip |
lib: Make pcre, libmagic and hivex libraries optional.
This change makes these libraries optional. If they are not
available at compile time then certain core API features will
be disabled (see below).
This also changes PCRE detection to use pkg-config instead
of the ad hoc autoconf checks.
The large inspect.c file has been split out into separate
function-specific files.
file-architecture: requires pcre & libmagic
inspection: requires pcre & hivex
Diffstat (limited to 'src/guestfs-internal.h')
-rw-r--r-- | src/guestfs-internal.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h index 9c7c96cc..067251c2 100644 --- a/src/guestfs-internal.h +++ b/src/guestfs-internal.h @@ -19,6 +19,10 @@ #ifndef GUESTFS_INTERNAL_H_ #define GUESTFS_INTERNAL_H_ +#ifdef HAVE_PCRE +#include <pcre.h> +#endif + #define STREQ(a,b) (strcmp((a),(b)) == 0) #define STRCASEEQ(a,b) (strcasecmp((a),(b)) == 0) #define STRNEQ(a,b) (strcmp((a),(b)) != 0) @@ -223,6 +227,13 @@ extern int guestfs___recv_from_daemon (guestfs_h *g, uint32_t *size_rtn, void ** extern int guestfs___accept_from_daemon (guestfs_h *g); extern int guestfs___build_appliance (guestfs_h *g, char **kernel, char **initrd, char **appliance); extern void guestfs___print_BufferIn (FILE *out, const char *buf, size_t buf_size); +#ifdef HAVE_PCRE +extern int guestfs___match (guestfs_h *g, const char *str, const pcre *re); +extern char *guestfs___match1 (guestfs_h *g, const char *str, const pcre *re); +extern int guestfs___match2 (guestfs_h *g, const char *str, const pcre *re, char **ret1, char **ret2); +#endif +extern int guestfs___feature_available (guestfs_h *g, const char *feature); +extern void guestfs___free_string_list (char **); #define error(g,...) guestfs_error_errno((g),0,__VA_ARGS__) #define perrorf guestfs_perrorf @@ -232,5 +243,10 @@ extern void guestfs___print_BufferIn (FILE *out, const char *buf, size_t buf_siz #define safe_strdup guestfs_safe_strdup #define safe_strndup guestfs_safe_strndup #define safe_memdup guestfs_safe_memdup +#ifdef HAVE_PCRE +#define match guestfs___match +#define match1 guestfs___match1 +#define match2 guestfs___match2 +#endif #endif /* GUESTFS_INTERNAL_H_ */ |