This library is widely available in distros.
- gperf
+- pcre (Perl Compatible Regular Expressions C library)
+
- genisoimage (NOT mkisofs any more)
- hivex >= 1.2.7 (http://libguestfs.org/download) (optional)
-- pcre (Perl Compatible Regular Expressions C library) (optional)
-
- libmagic (the library that corresponds to the 'file' command) (optional)
- libvirt (optional)
dnl For i18n.
AM_GNU_GETTEXT([external])
+dnl Check for PCRE (required)
+PKG_CHECK_MODULES([PCRE], [libpcre])
+
dnl libmagic (highly recommended)
AC_CHECK_LIB([magic],[magic_file],
[AC_CHECK_HEADER([magic.h],
],
[AC_MSG_WARN([libmagic not found, some core features will be disabled])])
-dnl Check for PCRE (highly recommended)
-PKG_CHECK_MODULES([PCRE], [libpcre],
- [AC_SUBST([PCRE_CFLAGS])
- AC_SUBST([PCRE_LIBS])
- AC_DEFINE([HAVE_PCRE],[1],[PCRE found at compile time.])
- ],
- [AC_MSG_WARN([PCRE not found, some core features will be disabled])])
-
dnl libvirt (highly recommended)
PKG_CHECK_MODULES([LIBVIRT], [libvirt],
[AC_SUBST([LIBVIRT_CFLAGS])
#include <errno.h>
#include <endian.h>
-#ifdef HAVE_PCRE
#include <pcre.h>
-#endif
#ifdef HAVE_HIVEX
#include <hivex.h>
#include "guestfs.h"
#include "guestfs-internal.h"
-#if defined(HAVE_PCRE) && defined(HAVE_HIVEX) && defined(DB_DUMP)
+#if defined(HAVE_HIVEX) && defined(DB_DUMP)
static unsigned char *convert_hex_to_binary (guestfs_h *g, const char *hex, size_t hexlen, size_t *binlen_rtn);
return bin;
}
-#endif /* defined(HAVE_PCRE) && defined(HAVE_HIVEX) && defined(DB_DUMP) */
+#endif /* defined(HAVE_HIVEX) && defined(DB_DUMP) */
#include <string.h>
#include <sys/stat.h>
-#ifdef HAVE_PCRE
#include <pcre.h>
-#endif
+
#ifdef HAVE_LIBMAGIC
#include <magic.h>
#endif
#include "guestfs-internal-actions.h"
#include "guestfs_protocol.h"
-#if defined(HAVE_PCRE) && defined(HAVE_LIBMAGIC)
+#if defined(HAVE_LIBMAGIC)
static pcre *re_file_elf;
static pcre *re_elf_ppc64;
return ret; /* caller frees */
}
-#else /* no PCRE or libmagic at compile time */
+#else /* no libmagic at compile time */
/* XXX Should be an optgroup. */
#define NOT_IMPL(r) \
- error (g, _("file-architecture API not available since this version of libguestfs was compiled without PCRE or libmagic libraries")); \
+ error (g, _("file-architecture API not available since this version of libguestfs was compiled without the libmagic library")); \
return r
char *
NOT_IMPL(NULL);
}
-#endif /* no PCRE or libmagic at compile time */
+#endif /* no libmagic at compile time */
#include <rpc/types.h>
#include <rpc/xdr.h>
-#ifdef HAVE_PCRE
#include <pcre.h>
-#endif
#define STREQ(a,b) (strcmp((a),(b)) == 0)
#define STRCASEEQ(a,b) (strcasecmp((a),(b)) == 0)
extern void guestfs___launch_send_progress (guestfs_h *g, int perdozen);
extern void guestfs___print_BufferIn (FILE *out, const char *buf, size_t buf_size);
extern void guestfs___print_BufferOut (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);
extern int guestfs___match3 (guestfs_h *g, const char *str, const pcre *re, char **ret1, char **ret2, char **ret3);
-#endif
extern int guestfs___feature_available (guestfs_h *g, const char *feature);
extern void guestfs___free_string_list (char **);
extern size_t guestfs___checkpoint_cmdline (guestfs_h *g);
extern void guestfs___call_callbacks_void (guestfs_h *g, uint64_t event);
extern void guestfs___call_callbacks_message (guestfs_h *g, uint64_t event, const char *buf, size_t buf_len);
extern void guestfs___call_callbacks_array (guestfs_h *g, uint64_t event, const uint64_t *array, size_t array_len);
-#if defined(HAVE_PCRE) && defined(HAVE_HIVEX)
+#if defined(HAVE_HIVEX)
extern int guestfs___check_for_filesystem_on (guestfs_h *g, const char *device, int is_block, int is_partnum);
extern char *guestfs___download_to_tmp (guestfs_h *g, struct inspect_fs *fs, const char *filename, const char *basename, int64_t max_size);
extern char *guestfs___case_sensitive_path_silently (guestfs_h *g, const char *);
#define safe_strndup guestfs_safe_strndup
#define safe_memdup guestfs_safe_memdup
#define safe_asprintf guestfs_safe_asprintf
-#ifdef HAVE_PCRE
#define match guestfs___match
#define match1 guestfs___match1
#define match2 guestfs___match2
#define match3 guestfs___match3
-#endif
#endif /* GUESTFS_INTERNAL_H_ */
#include <errno.h>
#include <endian.h>
-#ifdef HAVE_PCRE
#include <pcre.h>
-#endif
#ifdef HAVE_HIVEX
#include <hivex.h>
#include "guestfs-internal-actions.h"
#include "guestfs_protocol.h"
-#if defined(HAVE_PCRE) && defined(HAVE_HIVEX)
+#if defined(HAVE_HIVEX)
/* The main inspection code. */
char **
return NULL;
}
-#else /* no PCRE or hivex at compile time */
+#else /* no hivex at compile time */
/* XXX These functions should be in an optgroup. */
#define NOT_IMPL(r) \
- error (g, _("inspection API not available since this version of libguestfs was compiled without PCRE or hivex libraries")); \
+ error (g, _("inspection API not available since this version of libguestfs was compiled without the hivex library")); \
return r
char **
NOT_IMPL(-1);
}
-#endif /* no PCRE or hivex at compile time */
+#endif /* no hivex at compile time */
void
guestfs___free_inspect_info (guestfs_h *g)
#include <errno.h>
#include <endian.h>
-#ifdef HAVE_PCRE
#include <pcre.h>
-#endif
#ifdef HAVE_HIVEX
#include <hivex.h>
#include "guestfs-internal-actions.h"
#include "guestfs_protocol.h"
-#if defined(HAVE_PCRE) && defined(HAVE_HIVEX)
+#if defined(HAVE_HIVEX)
#ifdef DB_DUMP
static struct guestfs_application_list *list_applications_rpm (guestfs_h *g, struct inspect_fs *fs);
compare_applications);
}
-#else /* no PCRE or hivex at compile time */
+#else /* no hivex at compile time */
/* XXX These functions should be in an optgroup. */
#define NOT_IMPL(r) \
- error (g, _("inspection API not available since this version of libguestfs was compiled without PCRE or hivex libraries")); \
+ error (g, _("inspection API not available since this version of libguestfs was compiled without the hivex library")); \
return r
struct guestfs_application_list *
NOT_IMPL(NULL);
}
-#endif /* no PCRE or hivex at compile time */
+#endif /* no hivex at compile time */
#include <errno.h>
#include <endian.h>
-#ifdef HAVE_PCRE
#include <pcre.h>
-#endif
#ifdef HAVE_HIVEX
#include <hivex.h>
#include "guestfs-internal-actions.h"
#include "guestfs_protocol.h"
-#if defined(HAVE_PCRE) && defined(HAVE_HIVEX)
+#if defined(HAVE_HIVEX)
/* Compile all the regular expressions once when the shared library is
* loaded. PCRE is thread safe so we're supposedly OK here if
return 1;
}
-#endif /* defined(HAVE_PCRE) && defined(HAVE_HIVEX) */
+#endif /* defined(HAVE_HIVEX) */
#include <errno.h>
#include <endian.h>
-#ifdef HAVE_PCRE
#include <pcre.h>
-#endif
#ifdef HAVE_HIVEX
#include <hivex.h>
#include "guestfs-internal-actions.h"
#include "guestfs_protocol.h"
-#if defined(HAVE_PCRE) && defined(HAVE_HIVEX)
+#if defined(HAVE_HIVEX)
/* Debian/Ubuntu install disks are easy ...
*
return 0;
}
-#endif /* defined(HAVE_PCRE) && defined(HAVE_HIVEX) */
+#endif /* defined(HAVE_HIVEX) */
#include <errno.h>
#include <endian.h>
-#ifdef HAVE_PCRE
#include <pcre.h>
-#endif
#ifdef HAVE_HIVEX
#include <hivex.h>
#include "guestfs-internal-actions.h"
#include "guestfs_protocol.h"
-#if defined(HAVE_PCRE) && defined(HAVE_HIVEX)
+#if defined(HAVE_HIVEX)
/* Compile all the regular expressions once when the shared library is
* loaded. PCRE is thread safe so we're supposedly OK here if
return r;
}
-#endif /* defined(HAVE_PCRE) && defined(HAVE_HIVEX) */
+#endif /* defined(HAVE_HIVEX) */
#include <errno.h>
#include <endian.h>
-#ifdef HAVE_PCRE
#include <pcre.h>
-#endif
#ifdef HAVE_HIVEX
#include <hivex.h>
#include "guestfs-internal-actions.h"
#include "guestfs_protocol.h"
-#if defined(HAVE_PCRE) && defined(HAVE_HIVEX)
+#if defined(HAVE_HIVEX)
/* Compile all the regular expressions once when the shared library is
* loaded. PCRE is thread safe so we're supposedly OK here if
return ret;
}
-#endif /* defined(HAVE_PCRE) && defined(HAVE_HIVEX) */
+#endif /* defined(HAVE_HIVEX) */
#include <stdlib.h>
#include <string.h>
-#ifdef HAVE_PCRE
#include <pcre.h>
-#endif
#include "guestfs.h"
#include "guestfs-internal.h"
-#ifdef HAVE_PCRE
-
/* Match a regular expression which contains no captures. Returns
* true if it matches or false if it doesn't.
*/
return 1;
}
-
-#endif /* HAVE_PCRE */