search for: compile_regexp

Displaying 20 results from an estimated 100 matches for "compile_regexp".

2014 Nov 28
2
[PATCH] lib: Add COMPILE_REGEXP macro to hide regexp constructors/destructors.
...@@ -667,6 +667,30 @@ extern int guestfs___match6 (guestfs_h *g, const char *str, const pcre *re, char #define match4 guestfs___match4 #define match6 guestfs___match6 +/* Macro which compiles the regexp once when the library is loaded, + * and frees it when the library is unloaded. + */ +#define COMPILE_REGEXP(name,pattern,options) \ + static void compile_regexp_##name (void) __attribute__((constructor)); \ + static void free_regexp_##name (void) __attribute__((destructor)); \ + static pcre *name; \ + static void...
2014 Dec 02
2
[PATCH 1/5] Remove extra space in inspect-fs-unix.c
...-off-by: Nikos Skalkotos <skalkoto@grnet.gr> --- src/inspect-fs-unix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c index 01a59f1..f55e53b 100644 --- a/src/inspect-fs-unix.c +++ b/src/inspect-fs-unix.c @@ -58,8 +58,8 @@ COMPILE_REGEXP (re_scientific_linux, "Scientific Linux.*release (\\d+)\\.(\\d+)", 0) COMPILE_REGEXP (re_scientific_linux_no_minor, "Scientific Linux.*release (\\d+)", 0) - COMPILE_REGEXP (re_oracle_linux_old, - "Oracle Linux.*release (\...
2016 Feb 23
2
Re: [PATCH 1/2] lib: Allow the COMPILE_REGEXP macro to be used everywhere.
On Tue, Feb 23, 2016 at 11:35:00AM +0100, Pino Toscano wrote: > On Tuesday 23 February 2016 09:17:42 Richard W.M. Jones wrote: > > Since the daemon links to pcre and use regular expressions, and since > > the COMPILE_REGEXP macro doesn't depend on any aspects of the > > library-side code (eg. the guestfs_h handle etc), we can allow the > > daemon to use the COMPILE_REGEXP macro. Move the macro to > > "guestfs-internal-all.h" to permit this. > > --- > > LGTM -- would you pl...
2016 Feb 23
3
[PATCH 1/2] lib: Allow the COMPILE_REGEXP macro to be used everywhere.
Since the daemon links to pcre and use regular expressions, and since the COMPILE_REGEXP macro doesn't depend on any aspects of the library-side code (eg. the guestfs_h handle etc), we can allow the daemon to use the COMPILE_REGEXP macro. Move the macro to "guestfs-internal-all.h" to permit this. --- src/guestfs-internal-all.h | 26 ++++++++++++++++++++++++++ src/guestf...
2016 Feb 23
0
Re: [PATCH 1/2] lib: Allow the COMPILE_REGEXP macro to be used everywhere.
On Tuesday 23 February 2016 09:17:42 Richard W.M. Jones wrote: > Since the daemon links to pcre and use regular expressions, and since > the COMPILE_REGEXP macro doesn't depend on any aspects of the > library-side code (eg. the guestfs_h handle etc), we can allow the > daemon to use the COMPILE_REGEXP macro. Move the macro to > "guestfs-internal-all.h" to permit this. > --- LGTM -- would you please move the <pcre.h> i...
2014 Nov 28
0
Re: [PATCH] lib: Add COMPILE_REGEXP macro to hide regexp constructors/destructors.
...stfs___match6 (guestfs_h *g, const char *str, const pcre *re, char > #define match4 guestfs___match4 > #define match6 guestfs___match6 > > +/* Macro which compiles the regexp once when the library is loaded, > + * and frees it when the library is unloaded. > + */ > +#define COMPILE_REGEXP(name,pattern,options) \ > + static void compile_regexp_##name (void) __attribute__((constructor)); \ > + static void free_regexp_##name (void) __attribute__((destructor)); \ > + static pcre *name; \ > +...
2015 Sep 08
1
[PATCH] inspect: recognize the Frugalware distribution
...OS_DISTRO_COREOS, OS_DISTRO_ALPINE_LINUX, OS_DISTRO_ALTLINUX, + OS_DISTRO_FRUGALWARE, }; enum inspect_os_package_format { diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c index abbae35..65ab8ef 100644 --- a/src/inspect-fs-unix.c +++ b/src/inspect-fs-unix.c @@ -85,6 +85,7 @@ COMPILE_REGEXP (re_openbsd_duid, "^[0-9a-f]{16}\\.[a-z]", 0) COMPILE_REGEXP (re_openbsd_dev, "^/dev/(s|w)d([0-9])([a-z])$", 0) COMPILE_REGEXP (re_netbsd_dev, "^/dev/(l|s)d([0-9])([a-z])$", 0) COMPILE_REGEXP (re_altlinux, " (?:(\\d+)(?:\\.(\\d+)(?:[\\.\\d]+)?)?)\\s+\\((?:[^)]+...
2014 Dec 02
0
Re: [PATCH 1/5] Remove extra space in inspect-fs-unix.c
...r> > --- > src/inspect-fs-unix.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c > index 01a59f1..f55e53b 100644 > --- a/src/inspect-fs-unix.c > +++ b/src/inspect-fs-unix.c > @@ -58,8 +58,8 @@ COMPILE_REGEXP (re_scientific_linux, > "Scientific Linux.*release (\\d+)\\.(\\d+)", 0) > COMPILE_REGEXP (re_scientific_linux_no_minor, > "Scientific Linux.*release (\\d+)", 0) > - COMPILE_REGEXP (re_oracle_linux_old, > - &quot...
2014 Dec 02
0
[PATCH 2/5] inspect_os: Add support for detecting OpenBSD
...__check_hurd_root (guestfs_h *g, struct inspect_fs *fs); extern int guestfs___check_minix_root (guestfs_h *g, struct inspect_fs *fs); diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c index f55e53b..c6fa23e 100644 --- a/src/inspect-fs-unix.c +++ b/src/inspect-fs-unix.c @@ -80,6 +80,9 @@ COMPILE_REGEXP (re_sles_version, "^VERSION = (\\d+)", 0) COMPILE_REGEXP (re_sles_patchlevel, "^PATCHLEVEL = (\\d+)", 0) COMPILE_REGEXP (re_minix, "^(\\d+)\\.(\\d+)(\\.(\\d+))?", 0) COMPILE_REGEXP (re_hurd_dev, "^/dev/(h)d(\\d+)s(\\d+)$", 0) +COMPILE_REGEXP (re_openbsd, &...
2014 Dec 03
1
[PATCH 1/4] inspect_os: Add support for detecting OpenBSD
...__check_hurd_root (guestfs_h *g, struct inspect_fs *fs); extern int guestfs___check_minix_root (guestfs_h *g, struct inspect_fs *fs); diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c index f55e53b..ab76bc6 100644 --- a/src/inspect-fs-unix.c +++ b/src/inspect-fs-unix.c @@ -80,6 +80,9 @@ COMPILE_REGEXP (re_sles_version, "^VERSION = (\\d+)", 0) COMPILE_REGEXP (re_sles_patchlevel, "^PATCHLEVEL = (\\d+)", 0) COMPILE_REGEXP (re_minix, "^(\\d+)\\.(\\d+)(\\.(\\d+))?", 0) COMPILE_REGEXP (re_hurd_dev, "^/dev/(h)d(\\d+)s(\\d+)$", 0) +COMPILE_REGEXP (re_openbsd, &...
2014 Dec 03
0
[PATCH 2/4] Support fstab block device resolution for NetBSD
...skalkoto@grnet.gr> --- src/inspect-fs-unix.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c index ab76bc6..18be68b 100644 --- a/src/inspect-fs-unix.c +++ b/src/inspect-fs-unix.c @@ -83,6 +83,7 @@ COMPILE_REGEXP (re_hurd_dev, "^/dev/(h)d(\\d+)s(\\d+)$", 0) COMPILE_REGEXP (re_openbsd, "^OpenBSD (\\d+|\\?)\\.(\\d+|\\?)", 0) COMPILE_REGEXP (re_openbsd_duid, "^[0-9a-f]{16}\\.[a-z]", 0) COMPILE_REGEXP (re_openbsd_dev, "^/dev/(s|w)d([0-9])([a-z])$", 0) +COMPILE_REGEXP (...
2014 Dec 02
0
[PATCH 3/5] Support fstab block device resolution for NetBSD
...skalkoto@grnet.gr> --- src/inspect-fs-unix.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c index c6fa23e..3a2f81a 100644 --- a/src/inspect-fs-unix.c +++ b/src/inspect-fs-unix.c @@ -83,6 +83,7 @@ COMPILE_REGEXP (re_hurd_dev, "^/dev/(h)d(\\d+)s(\\d+)$", 0) COMPILE_REGEXP (re_openbsd, "^OpenBSD (\\d+|\\?)\\.(\\d+|\\?)", 0) COMPILE_REGEXP (re_openbsd_duid, "^[0-9a-f]{16}\\.[a-z]", 0) COMPILE_REGEXP (re_openbsd_dev, "^/dev/(s|w)d([0-9])([a-z])$", 0) +COMPILE_REGEXP (...
2015 May 19
4
[PATCH v4 0/2] inspector: recognize ppc64 and ppc64le archs (RHBZ#1211996)
Patch extracts MSB/LSB info from /bin/file output and passes it as separate parameret from elf_arch. Then it is sent to impl_file_architecture and checked/ Modified magic_for_file to handle regex changes. Now with tests for file_architecture. Fixes: RHBZ#1211996 Maros Zatko (2): inspector: recognize ppc64 and ppc64le archs (RHBZ#1211996) tests: ppc64 and ppc64le for file_architecture
2014 Dec 03
2
Re: [synnefo-devel] Re: [PATCH 1/5] Remove extra space in inspect-fs-unix.c
...spect-fs-unix.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c >> index 01a59f1..f55e53b 100644 >> --- a/src/inspect-fs-unix.c >> +++ b/src/inspect-fs-unix.c >> @@ -58,8 +58,8 @@ COMPILE_REGEXP (re_scientific_linux, >> "Scientific Linux.*release (\\d+)\\.(\\d+)", 0) >> COMPILE_REGEXP (re_scientific_linux_no_minor, >> "Scientific Linux.*release (\\d+)", 0) >> - COMPILE_REGEXP (re_oracle_linux_old, >> -...
2015 Aug 25
2
[PATCH 1/2] inspect: recognize the ALT Linux distribution
...ro { OS_DISTRO_NETBSD, OS_DISTRO_COREOS, OS_DISTRO_ALPINE_LINUX, + OS_DISTRO_ALTLINUX, }; enum inspect_os_package_format { diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c index abfa527..abbae35 100644 --- a/src/inspect-fs-unix.c +++ b/src/inspect-fs-unix.c @@ -84,6 +84,7 @@ COMPILE_REGEXP (re_openbsd, "^OpenBSD (\\d+|\\?)\\.(\\d+|\\?)", 0) COMPILE_REGEXP (re_openbsd_duid, "^[0-9a-f]{16}\\.[a-z]", 0) COMPILE_REGEXP (re_openbsd_dev, "^/dev/(s|w)d([0-9])([a-z])$", 0) COMPILE_REGEXP (re_netbsd_dev, "^/dev/(l|s)d([0-9])([a-z])$", 0) +COMPILE_REG...
2014 Sep 23
1
[PATCH] inspect: map Hurd devices, and enable fstab introspection
...unix.c b/src/inspect-fs-unix.c index 3f57cd5..b629508 100644 --- a/src/inspect-fs-unix.c +++ b/src/inspect-fs-unix.c @@ -78,6 +78,7 @@ static pcre *re_opensuse_version; static pcre *re_sles_version; static pcre *re_sles_patchlevel; static pcre *re_minix; +static pcre *re_hurd_dev; static void compile_regexps (void) __attribute__((constructor)); static void free_regexps (void) __attribute__((destructor)); @@ -137,6 +138,7 @@ compile_regexps (void) COMPILE (re_sles_version, "^VERSION = (\\d+)", 0); COMPILE (re_sles_patchlevel, "^PATCHLEVEL = (\\d+)", 0); COMPILE (re_minix,...
2015 May 19
0
[PATCH v4 1/2] inspector: recognize ppc64 and ppc64le archs (RHBZ#1211996)
--- src/filearch.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/filearch.c b/src/filearch.c index 8fb1acf..ce9d0a1 100644 --- a/src/filearch.c +++ b/src/filearch.c @@ -59,14 +59,14 @@ cleanup_magic_t_free (void *ptr) # endif COMPILE_REGEXP (re_file_elf, - "ELF.*(?:executable|shared object|relocatable), (.+?),", 0) -COMPILE_REGEXP (re_elf_ppc64, "64.*PowerPC", 0) + "ELF.*(MSB|LSB).*(?:executable|shared object|relocatable), (.+?),", 0) +COMPILE_REGEXP (re_elf_ppc64, ".*64...
2015 May 22
0
[PATCH v5] inspector: recognize ppc64 and ppc64le archs (RHBZ#1211996)
...ys, TestResultString ( [["file_architecture"; "/lib-win32.dll"]], "i386"), []; diff --git a/src/filearch.c b/src/filearch.c index 8fb1acf..a309bbe 100644 --- a/src/filearch.c +++ b/src/filearch.c @@ -59,14 +59,14 @@ cleanup_magic_t_free (void *ptr) # endif COMPILE_REGEXP (re_file_elf, - "ELF.*(?:executable|shared object|relocatable), (.+?),", 0) -COMPILE_REGEXP (re_elf_ppc64, "64.*PowerPC", 0) + "ELF.*(MSB|LSB).*(?:executable|shared object|relocatable), (.+?),", 0) +COMPILE_REGEXP (re_elf_ppc64, ".*64...
2018 Jun 12
2
[PATCH] p2v: Allow virt-v2v input and output drivers containing '-' (RHBZ#1590220).
...quot; meaning two "rhv" entries would appear in the list of output drivers. Thanks: Ming Xie. --- p2v/ssh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/p2v/ssh.c b/p2v/ssh.c index d2699fffd..2fcf0ef3e 100644 --- a/p2v/ssh.c +++ b/p2v/ssh.c @@ -181,8 +181,8 @@ compile_regexps (void) 0); COMPILE (feature_libguestfs_rewrite_re, "libguestfs-rewrite", 0); COMPILE (feature_colours_option_re, "colours-option", 0); - COMPILE (feature_input_re, "input:((?:\\w)*)", 0); - COMPILE (feature_output_re, "output:((?:\\w)*)", 0); +...
2016 May 18
0
[PATCH 2/2] inspect: switch to version struct for os major/minor version
...ion, 0); fs->arch = osinfo->arch ? safe_strdup (g, osinfo->arch) : NULL; fs->is_live_disk = osinfo->is_live_disk; diff --git a/src/inspect-fs-unix.c b/src/inspect-fs-unix.c index 82d249a..8d82d56 100644 --- a/src/inspect-fs-unix.c +++ b/src/inspect-fs-unix.c @@ -54,7 +54,6 @@ COMPILE_REGEXP (re_oracle_linux_old, COMPILE_REGEXP (re_oracle_linux, "Oracle Linux.*release (\\d+)\\.(\\d+)", 0) COMPILE_REGEXP (re_oracle_linux_no_minor, "Oracle Linux.*release (\\d+)", 0) -COMPILE_REGEXP (re_major_minor, "(\\d+)\\.(\\d+)", 0) COMPILE_REGEXP (re...