head 1.6; access; symbols; locks; strict; comment @# @; 1.6 date 2026.10.14.22.25.17; author agc; state dead; branches; next 1.5; commitid EvQuBHLEvZ6nMuZG; 1.5 date 2025.07.23.01.14.07; author agc; state Exp; branches; next 1.4; commitid rSrs7KEnJrB89O3G; 1.4 date 2023.02.24.19.01.11; author agc; state Exp; branches; next 1.3; commitid XNCIUwEY3IazkOeE; 1.3 date 2021.10.05.01.23.39; author agc; state Exp; branches; next 1.2; commitid iWez0YTivClGMybD; 1.2 date 2017.12.03.21.25.56; author agc; state Exp; branches; next 1.1; commitid gRd1k8rwIb92vuhA; 1.1 date 2017.08.16.23.38.13; author agc; state Exp; branches; next ; commitid QRh3ZHtCDsbQJu3A; desc @@ 1.6 log @Remove this old code, it's been superceded - see pkgsrc/devel/libagcre and pkgsrc/textproc/agcre @ text @/usr/include/dev/ic/nvmeio.h:136: for (i = 0; i < __arraycount(identify->lbaf); i++) /usr/include/dev/ic/nvmeio.h:192: for (i = 0; i < __arraycount(identify->psd); i++) /usr/include/rump/rumpuser_port.h:262:#ifndef __arraycount /usr/include/rump/rumpuser_port.h:263:#define __arraycount(_ar_) (sizeof(_ar_)/sizeof(_ar_[0])) /usr/include/sys/bitops.h:324: for (__i = 0; __i < __arraycount((__v)->_b); __i++) \ /usr/include/sys/cdefs.h:644:#define __arraycount(__x) (sizeof(__x) / sizeof(__x[0])) @ 1.5 log @agcre: fix up beginning of word and end of word tests - use parentheses to make it obvious to the compiler when to short-circuit. Add tests for beginning word and end of word (with and without \< and \> guards) Bump version to 20250722 @ text @@ 1.4 log @Update agcre (yet another regexp library) to version 20230224 + revamp the reverse searching functionality + bug fixes + don't terminate searches too early + update namespace protection to just use simple definitions + bump version to 20230224 @ text @d3 2 a4 2 /usr/include/rump/rumpuser_port.h:260:#ifndef __arraycount /usr/include/rump/rumpuser_port.h:261:#define __arraycount(_ar_) (sizeof(_ar_)/sizeof(_ar_[0])) @ 1.3 log @Update agcre to version 20211001 20211001 ======== + move to a single source file, which can just be included as a single file (the library method can still be used for this as well - sometimes, it's just easier to drop in a single file to other projects) + add AGCRE_EMBED_CTAGS as a primary regular expresion type (same as basic regexps, but where a '*' occurs as a non-column 0 element of the pattern, it is assumed to be a standard character, as produced by ctags(1) output; basic regular expressions only accept '*' as a standard character as the first element of the expression). Yay. + make the version string in the program a real string, so it can be found using strings(1) + add an agcre_rev_regexec(3) function, which searches the text in an efficient, reverse manner, a la strrchr(3) or memrchr(3) fashion. + add agcre_regnsub(3) and agcre_regasub(3) functions + bump the shared lib version to 1.0 + cut version 20211001 @ text @d5 2 a6 2 /usr/include/sys/bitops.h:324: for (__i = 0; __i < __arraycount(__v->_b); __i++) \ /usr/include/sys/cdefs.h:636:#define __arraycount(__x) (sizeof(__x) / sizeof(__x[0])) @ 1.2 log @remove some functions which were unused (obscured by being inline functions) preserve the compilation flags across calls to exec() update a test for current behavior @ text @d1 2 d6 1 a6 1 /usr/include/sys/cdefs.h:573:#define __arraycount(__x) (sizeof(__x) / sizeof(__x[0])) @ 1.1 log @Just what this world needs - another regexp library. However, for something I was doing, I needed a regexp library in C, BSD-licensed, and able to be exposed to a wide range of expressions, some better controlled than others. The resulting library is libagcre, which implements regular expression compilation and execution. It uses the Pike Virtual Machine approach, and features: + standard POSIX features where sane + some/most Perl escapes + lazy matching via '?' + non-capture parenthese (?:...) + in-expression case-insensitive directives are supported (?i)...(?-i) + all case-insensitivity is actioned at expression exec time. Case-insensitivity can be specified at expression compile-time, and, if so, it will be remembered. But the expression itself, once compiled, can be used to match in both a case-sensitive and insensitive manner + utf8 is supported both for expressions and for input text when matching + unicode escapes (in the Java format of \uABCD) are supported + exact multiple repetition specifiers {N}, and {N,M} are supported + backreferences are supported + utf16 (LE and BE) and utf32 (LE and BE) are supported, both for the expression and for the input being searched + at the most basic level, individual 32bit unicode characters are matched + an egrep/grep implementation for matching unicode regexps is included A simple implementation of sets is used to provide inclusion and exclusion information for unicode characters, which is taken directly from unicode.org. No bitmasks are used - ranges are specified by using an upper and a lower bound for the codepoints. Callbacks can also be added to these sets, to provide functionality similar to the ctype macros across the whole unicode character set. The standard regular expression basic3 torture test is passed with 4 known (and, I'd argue, incorrect) results flagged. As expected, the expression '(a?){9999}aaaaaaaaaaaaaaaaaaaaaaaaaaaaa' matches in linear time, as does the expression '((((((((((((((((((((((((((((((x))))))))))))))))))))))))))))))' % time agcre '(a?){9999}aaaaaaaaaaaaaaaaaaaaaaaaaaaaa' dist/tests/2.in aaaaaaaaaaaaaaaaaaaaaaaaaaaaa 0.063u 0.000s 0:00.06 100.0% 0+0k 0+0io 0pf+0w % time egrep '(a?){9999}aaaaaaaaaaaaaaaaaaaaaaaaaaaaa' dist/tests/2.in ^C88.462u 0.730s 1:29.21 99.9% 0+0k 0+0io 0pf+0w % The library and agcre utility have been run through valgrind to confirm no memory leaks. In general, the emphasis is on a modern, predictable, VM-style, well-featured regexp library, in C, with a BSD license. In particular, sljit has not been used to speed up on certain platforms, most Perl regexp features are supported, as are back references, and UTF-8, UTF-16 and UTF32. Once again, I wouldn't expect anyone to use this as the main engine in egrep. But I am always amazed at the uses for some of the things that I write. For more information about the Pike VM, and comparison to other regexp implementations, please see: https://swtch.com/~rsc/regexp/regexp2.html Alistair Crooks Tue Aug 15 07:43:34 PDT 2017 @ text @d4 1 a4 1 /usr/include/sys/cdefs.h:572:#define __arraycount(__x) (sizeof(__x) / sizeof(__x[0])) @