Skip to content

Commit 383f4f5

Browse files
committed
released 4.5.0
- add 7zip archive search with option -z, fix #185 - apply Unicode normalization to combining characters in regex patterns, fix #298 - improved TUI TAB directory navigation when searching from the FS root - updated ugrep.exe option -P to use PCRE2 10.42
1 parent 339a7cd commit 383f4f5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+15942
-289
lines changed

Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SUBDIRS = lib src
1+
SUBDIRS = lib lzma/C src
22

33
man1_MANS = man/ugrep.1
44

Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ target_alias = @target_alias@
382382
top_build_prefix = @top_build_prefix@
383383
top_builddir = @top_builddir@
384384
top_srcdir = @top_srcdir@
385-
SUBDIRS = lib src
385+
SUBDIRS = lib lzma/C src
386386
man1_MANS = man/ugrep.1
387387
EXTRA_DIST = README.md LICENSE.txt CONTRIBUTING.md CODE_OF_CONDUCT.md
388388
UGREP = $(shell pwd)/$(top_builddir)/bin/ugrep$(EXEEXT)

README.md

Lines changed: 73 additions & 68 deletions
Large diffs are not rendered by default.

bin/win32/ug.exe

74.5 KB
Binary file not shown.

bin/win32/ugrep.exe

74.5 KB
Binary file not shown.

bin/win64/ug.exe

79 KB
Binary file not shown.

bin/win64/ugrep.exe

79 KB
Binary file not shown.

configure

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.71 for ugrep 4.4.
3+
# Generated by GNU Autoconf 2.71 for ugrep 4.5.
44
#
55
#
66
# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
@@ -610,8 +610,8 @@ MAKEFLAGS=
610610
# Identity of this package.
611611
PACKAGE_NAME='ugrep'
612612
PACKAGE_TARNAME='ugrep'
613-
PACKAGE_VERSION='4.4'
614-
PACKAGE_STRING='ugrep 4.4'
613+
PACKAGE_VERSION='4.5'
614+
PACKAGE_STRING='ugrep 4.5'
615615
PACKAGE_BUGREPORT=''
616616
PACKAGE_URL=''
617617

@@ -796,6 +796,7 @@ with_lzma
796796
with_lz4
797797
with_zstd
798798
with_brotli
799+
enable_7zip
799800
with_bzip3
800801
with_bash_completion_dir
801802
with_fish_completion_dir
@@ -1379,7 +1380,7 @@ if test "$ac_init_help" = "long"; then
13791380
# Omit some internal or obsolete options to make the list less imposing.
13801381
# This message is too long to be a string in the A/UX 3.1 sh.
13811382
cat <<_ACEOF
1382-
\`configure' configures ugrep 4.4 to adapt to many kinds of systems.
1383+
\`configure' configures ugrep 4.5 to adapt to many kinds of systems.
13831384
13841385
Usage: $0 [OPTION]... [VAR=VALUE]...
13851386
@@ -1450,7 +1451,7 @@ fi
14501451

14511452
if test -n "$ac_init_help"; then
14521453
case $ac_init_help in
1453-
short | recursive ) echo "Configuration of ugrep 4.4:";;
1454+
short | recursive ) echo "Configuration of ugrep 4.5:";;
14541455
esac
14551456
cat <<\_ACEOF
14561457
@@ -1464,6 +1465,8 @@ Optional Features:
14641465
do not reject slow dependency extractors
14651466
--disable-dependency-tracking
14661467
speeds up one-time build
1468+
--disable-7zip to disable 7zip and no longer search .7z files (7z
1469+
requires more memory and takes long to decompress)
14671470
--disable-auto-color disable automatic colors, otherwise colors are
14681471
enabled by default
14691472
--enable-color deprecated, use --disable-auto-color
@@ -1623,7 +1626,7 @@ fi
16231626
test -n "$ac_init_help" && exit $ac_status
16241627
if $ac_init_version; then
16251628
cat <<\_ACEOF
1626-
ugrep configure 4.4
1629+
ugrep configure 4.5
16271630
generated by GNU Autoconf 2.71
16281631
16291632
Copyright (C) 2021 Free Software Foundation, Inc.
@@ -2160,7 +2163,7 @@ cat >config.log <<_ACEOF
21602163
This file contains any messages produced by compilers while
21612164
running configure, to aid debugging if configure makes a mistake.
21622165
2163-
It was created by ugrep $as_me 4.4, which was
2166+
It was created by ugrep $as_me 4.5, which was
21642167
generated by GNU Autoconf 2.71. Invocation command line was
21652168
21662169
$ $0$ac_configure_args_raw
@@ -3647,7 +3650,7 @@ fi
36473650

36483651
# Define the identity of the package.
36493652
PACKAGE='ugrep'
3650-
VERSION='4.4'
3653+
VERSION='4.5'
36513654

36523655

36533656
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -8094,6 +8097,8 @@ printf "%s\n" "#define HAVE_LIBZ 1" >>confdefs.h
80948097
fi
80958098

80968099

8100+
if test -n "${zlib_places}"; then
8101+
80978102
#
80988103
# Handle user hints
80998104
#
@@ -8759,6 +8764,28 @@ printf "%s\n" "#define HAVE_LIBBROTLI 1" >>confdefs.h
87598764
fi
87608765

87618766

8767+
# Check whether --enable-7zip was given.
8768+
if test ${enable_7zip+y}
8769+
then :
8770+
enableval=$enable_7zip; with_no_7zip="yes"
8771+
else $as_nop
8772+
with_no_7zip="no"
8773+
fi
8774+
8775+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --disable-7zip" >&5
8776+
printf %s "checking for --disable-7zip... " >&6; }
8777+
if test "x$with_no_7zip" = "xno"; then
8778+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
8779+
printf "%s\n" "no" >&6; }
8780+
CPPFLAGS="$CPPFLAGS -I../lzma/C"
8781+
LDFLAGS="$LDFLAGS -L../lzma/C"
8782+
LIBS="-lviiz $LIBS"
8783+
else
8784+
EXTRA_CFLAGS="-DWITH_NO_7ZIP ${EXTRA_CFLAGS}"
8785+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
8786+
printf "%s\n" "yes" >&6; }
8787+
fi
8788+
87628789

87638790
# Check whether --with-bzip3 was given.
87648791
if test ${with_bzip3+y}
@@ -8906,6 +8933,8 @@ fi
89068933

89078934
fi
89088935

8936+
fi
8937+
89098938

89108939
# Check whether --with-bash-completion-dir was given.
89118940
if test ${with_bash_completion_dir+y}
@@ -9642,7 +9671,7 @@ PTHREAD_CFLAGS=""
96429671
PTHREAD_LIBS="-lpthread"
96439672

96449673

9645-
ac_config_files="$ac_config_files Makefile lib/Makefile src/Makefile"
9674+
ac_config_files="$ac_config_files Makefile lib/Makefile src/Makefile lzma/C/Makefile"
96469675

96479676

96489677
cat >confcache <<\_ACEOF
@@ -10188,7 +10217,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
1018810217
# report actual input values of CONFIG_FILES etc. instead of their
1018910218
# values after options handling.
1019010219
ac_log="
10191-
This file was extended by ugrep $as_me 4.4, which was
10220+
This file was extended by ugrep $as_me 4.5, which was
1019210221
generated by GNU Autoconf 2.71. Invocation command line was
1019310222
1019410223
CONFIG_FILES = $CONFIG_FILES
@@ -10256,7 +10285,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
1025610285
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1025710286
ac_cs_config='$ac_cs_config_escaped'
1025810287
ac_cs_version="\\
10259-
ugrep config.status 4.4
10288+
ugrep config.status 4.5
1026010289
configured by $0, generated by GNU Autoconf 2.71,
1026110290
with options \\"\$ac_cs_config\\"
1026210291
@@ -10390,6 +10419,7 @@ do
1039010419
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
1039110420
"lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
1039210421
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
10422+
"lzma/C/Makefile") CONFIG_FILES="$CONFIG_FILES lzma/C/Makefile" ;;
1039310423
1039410424
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
1039510425
esac

configure.ac

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AC_INIT([ugrep],[4.4])
1+
AC_INIT([ugrep],[4.5])
22
AM_INIT_AUTOMAKE([foreign])
33
AC_CONFIG_HEADERS([config.h])
44
AC_COPYRIGHT([Copyright (C) 2019-2023 Robert van Engelen, Genivia Inc.])
@@ -70,6 +70,8 @@ fi
7070

7171
AX_CHECK_ZLIB([], [echo "recommended zlib not found: ugrep option -z is disabled"])
7272

73+
if test -n "${zlib_places}"; then
74+
7375
AX_CHECK_BZ2LIB([], [echo "recommended libbz2 not found: ugrep option -z cannot search .bz and .bz2 files"])
7476

7577
AX_CHECK_LZMALIB([], [echo "recommended liblzma not found: ugrep option -z cannot search .lzma and .xz files"])
@@ -80,6 +82,22 @@ AX_CHECK_ZSTDLIB([], [echo "optional libzstd not found: install if you want ugre
8082

8183
AX_CHECK_BROTLILIB([], [echo "optional brotli library not found: install if you want ugrep option -z to search .br files"])
8284

85+
AC_ARG_ENABLE(7zip,
86+
[AS_HELP_STRING([--disable-7zip],
87+
[to disable 7zip and no longer search .7z files (7z requires more memory and takes long to decompress)])],
88+
[with_no_7zip="yes"],
89+
[with_no_7zip="no"])
90+
AC_MSG_CHECKING(for --disable-7zip)
91+
if test "x$with_no_7zip" = "xno"; then
92+
AC_MSG_RESULT(no)
93+
CPPFLAGS="$CPPFLAGS -I../lzma/C"
94+
LDFLAGS="$LDFLAGS -L../lzma/C"
95+
LIBS="-lviiz $LIBS"
96+
else
97+
EXTRA_CFLAGS="-DWITH_NO_7ZIP ${EXTRA_CFLAGS}"
98+
AC_MSG_RESULT(yes)
99+
fi
100+
83101
AC_ARG_WITH(bzip3,
84102
[AS_HELP_STRING([--with-bzip3],
85103
[to enable bzip3 library to decompress .bz3 files])],
@@ -92,6 +110,8 @@ if test "x$with_bzip3_library" != "x"; then
92110
AX_CHECK_BZIP3LIB([], [echo "optional libbzip3 not found: install if you want ugrep option -z to search .bz3 files"])
93111
fi
94112

113+
fi
114+
95115
AC_ARG_WITH([bash-completion-dir],
96116
[AS_HELP_STRING([--with-bash-completion-dir[=PATH]],
97117
[install the bash auto-completion script in this directory. @<:@default=yes@:>@])],
@@ -353,6 +373,6 @@ AC_SUBST(SIMD_AVX512BW_FLAGS)
353373
AC_SUBST([PTHREAD_CFLAGS], [""])
354374
AC_SUBST([PTHREAD_LIBS], ["-lpthread"])
355375

356-
AC_CONFIG_FILES([Makefile lib/Makefile src/Makefile])
376+
AC_CONFIG_FILES([Makefile lib/Makefile src/Makefile lzma/C/Makefile])
357377

358378
AC_OUTPUT

include/reflex/posix.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ class Tables {
5656

5757
const int * range(const char *);
5858

59-
}
59+
} // namespace Posix
6060

61-
}
61+
} // namesapce reflex
6262

6363
#endif

include/reflex/setop.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ struct lazy_intersection {
265265
{
266266
return !operator==(rhs);
267267
}
268-
void find(void)
268+
void find()
269269
{
270270
while (i1 != i1_end && i2 != i2_end)
271271
{
@@ -277,7 +277,7 @@ struct lazy_intersection {
277277
break;
278278
}
279279
}
280-
void next(void)
280+
void next()
281281
{
282282
if (i1 != i1_end)
283283
i1++;
@@ -295,11 +295,11 @@ struct lazy_intersection {
295295
s1(s1),
296296
s2(s2)
297297
{ }
298-
const_iterator begin(void) const
298+
const_iterator begin() const
299299
{
300300
return const_iterator(s1, s2);
301301
}
302-
const_iterator end(void) const
302+
const_iterator end() const
303303
{
304304
return const_iterator(s1.end(), s2.end());
305305
}
@@ -358,7 +358,7 @@ struct lazy_union {
358358
{
359359
return !operator==(rhs);
360360
}
361-
void find(void)
361+
void find()
362362
{
363363
if (i1 == i1_end)
364364
{
@@ -370,7 +370,7 @@ struct lazy_union {
370370
++i2;
371371
}
372372
}
373-
void next(void)
373+
void next()
374374
{
375375
if (i1 == i1_end)
376376
{
@@ -428,11 +428,11 @@ struct lazy_union {
428428
s1(s1),
429429
s2(s2)
430430
{ }
431-
const_iterator begin(void) const
431+
const_iterator begin() const
432432
{
433433
return const_iterator(s1, s2);
434434
}
435-
const_iterator end(void) const
435+
const_iterator end() const
436436
{
437437
return const_iterator(s1.end(), s2.end());
438438
}

include/reflex/unicode.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,20 @@ namespace Unicode {
4646
class Tables : public Posix::Tables {
4747
public:
4848
Tables();
49+
typedef std::map<int,const int*> Compose;
50+
Compose compose;
4951
private:
50-
void block_scripts(void);
51-
void language_scripts(void);
52-
void letter_scripts(void);
52+
void block_scripts();
53+
void language_scripts();
54+
void letter_scripts();
55+
void composer();
5356
};
5457

5558
const int * range(const char *);
59+
int compose(int, int);
5660

5761
} // namespace Unicode
5862

59-
} // namespace reflex;
63+
} // namespace reflex
6064

6165
#endif

lib/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
noinst_LIBRARIES = libreflex.a
22
libreflex_a_CPPFLAGS = -I$(top_srcdir)/include $(SIMD_FLAGS) -DWITH_NO_INDENT -DWITH_NO_CODEGEN
3-
libreflex_a_SOURCES = $(top_srcdir)/include/reflex/abslexer.h $(top_srcdir)/include/reflex/absmatcher.h $(top_srcdir)/include/reflex/bits.h $(top_srcdir)/include/reflex/boostmatcher.h $(top_srcdir)/include/reflex/convert.h $(top_srcdir)/include/reflex/debug.h $(top_srcdir)/include/reflex/error.h $(top_srcdir)/include/reflex/flexlexer.h $(top_srcdir)/include/reflex/input.h $(top_srcdir)/include/reflex/matcher.h $(top_srcdir)/include/reflex/pattern.h $(top_srcdir)/include/reflex/posix.h $(top_srcdir)/include/reflex/ranges.h $(top_srcdir)/include/reflex/setop.h $(top_srcdir)/include/reflex/simd.h $(top_srcdir)/include/reflex/stdmatcher.h $(top_srcdir)/include/reflex/timer.h $(top_srcdir)/include/reflex/traits.h $(top_srcdir)/include/reflex/unicode.h $(top_srcdir)/include/reflex/utf8.h convert.cpp debug.cpp error.cpp input.cpp matcher.cpp matcher_avx2.cpp matcher_avx512bw.cpp pattern.cpp posix.cpp simd_avx2.cpp simd_avx512bw.cpp unicode.cpp utf8.cpp block_scripts.cpp language_scripts.cpp letter_scripts.cpp
3+
libreflex_a_SOURCES = $(top_srcdir)/include/reflex/abslexer.h $(top_srcdir)/include/reflex/absmatcher.h $(top_srcdir)/include/reflex/bits.h $(top_srcdir)/include/reflex/boostmatcher.h $(top_srcdir)/include/reflex/convert.h $(top_srcdir)/include/reflex/debug.h $(top_srcdir)/include/reflex/error.h $(top_srcdir)/include/reflex/flexlexer.h $(top_srcdir)/include/reflex/input.h $(top_srcdir)/include/reflex/matcher.h $(top_srcdir)/include/reflex/pattern.h $(top_srcdir)/include/reflex/posix.h $(top_srcdir)/include/reflex/ranges.h $(top_srcdir)/include/reflex/setop.h $(top_srcdir)/include/reflex/simd.h $(top_srcdir)/include/reflex/stdmatcher.h $(top_srcdir)/include/reflex/timer.h $(top_srcdir)/include/reflex/traits.h $(top_srcdir)/include/reflex/unicode.h $(top_srcdir)/include/reflex/utf8.h convert.cpp debug.cpp error.cpp input.cpp matcher.cpp matcher_avx2.cpp matcher_avx512bw.cpp pattern.cpp posix.cpp simd_avx2.cpp simd_avx512bw.cpp unicode.cpp utf8.cpp block_scripts.cpp language_scripts.cpp letter_scripts.cpp composer.cpp
44

55
# separately compile matcher_avx2.cpp and matcher_avx512bw (with the same content as matcher.cpp) with AVX optimizations enabled
66
libreflex_a-matcher_avx2.$(OBJEXT) : CXXFLAGS += $(SIMD_AVX2_FLAGS)

0 commit comments

Comments
 (0)