CVS commit: othersrc/external/bsd/agcre/dist
Module Name:othersrc Committed By: agc Date: Wed Jun 21 23:48:08 UTC 2023 Modified Files: othersrc/external/bsd/agcre/dist: agcre.c agcre.h othersrc/external/bsd/agcre/dist/tests: 62.expected Log Message: agcre version 20230621 == + agcre - added internal magic numbers to agcre to attempt to catch if misbehaving programs overwrite sections of memory + agcre - check internal magic numbers before attempting to execute regex programs + agcre - bump agcre magic number in the external structure + agcre - bump version number in header file. Fix up tests to ensure correct operation To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/agcre/dist/agcre.c cvs rdiff -u -r1.5 -r1.6 othersrc/external/bsd/agcre/dist/agcre.h cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/agcre/dist/tests/62.expected Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: othersrc/external/bsd/agcre/dist/agcre.c diff -u othersrc/external/bsd/agcre/dist/agcre.c:1.3 othersrc/external/bsd/agcre/dist/agcre.c:1.4 --- othersrc/external/bsd/agcre/dist/agcre.c:1.3 Fri Feb 24 19:01:10 2023 +++ othersrc/external/bsd/agcre/dist/agcre.c Wed Jun 21 23:48:08 2023 @@ -159,17 +159,26 @@ typedef struct threadlist_t { re_thread_t t[1]; /* the threads */ } threadlist_t; +#define MAGIC1 0xac1deaf0 +#define MAGIC2 0x41525345 +#define MAGIC3 0xd0d0d00d +#define MAGIC4 0x666f7572 + /* regular expression internals */ typedef struct re_t { + uint32_t magic1; /* magic number #1 */ instr_t *prog; /* start of instructions */ uint32_t instrc; /* # of instructions */ uint32_t gen; /* generation number */ uint32_t setc; /* # of sets */ uint32_t maxset; /* allocated # of sets */ + uint32_t magic2; /* magic number #2 */ set_t *sets; /* sets */ uint32_t flags; /* comp/exec flags */ context_t *ctxlist; /* list of contexts */ + uint32_t magic3; /* magic number #3 */ instr_t *pc; /* prog counter */ + uint32_t magic4; /* magic number #4 */ int msgc; /* # of chars in msg buffer */ char msg[256]; /* message buffer */ } re_t; @@ -2669,6 +2678,22 @@ growspace(char **buf, size_t *size, size return 1; } +/* check it was compiled properly */ +static inline int +good_struct(const agcre_regex_t *agcre) +{ + re_t *re; + + if (agcre == NULL || agcre->re_magic != AGCRE_MAGIC2) { + return 0; + } + if ((re = agcre->re_g) == NULL) { + return 0; + } + return re->magic1 = MAGIC1 && re->magic2 == MAGIC2 && + re->magic3 == MAGIC3 && re->magic4 == MAGIC4; +} + /***/ /* allocate a new structure and return it */ @@ -2697,7 +2722,13 @@ agcre_regcomp(agcre_regex_t *agcre, cons (agcre_regoff_t)(agcre->re_endp - in.s) : (agcre_regoff_t)strlen(in.s); memset(agcre, 0x0, sizeof(*agcre)); - agcre->re_g = re = in.re = calloc(1, sizeof(*re)); + if ((agcre->re_g = re = in.re = calloc(1, sizeof(*re))) == NULL) { + return AGCRE_REG_FAILURE; + } + re->magic1 = MAGIC1; + re->magic2 = MAGIC2; + re->magic3 = MAGIC3; + re->magic4 = MAGIC4; if (in.eo - in.so > AGCRE_MAX_EXPR_LENGTH) { re->msgc = snprintf(re->msg, sizeof(re->msg), "expression length %llu larger than %u", @@ -2739,7 +2770,7 @@ agcre_regcomp(agcre_regex_t *agcre, cons re->pc->op = OP_MATCH; re->pc += 1; re->instrc = re->pc - re->prog; - agcre->re_magic = AGCRE_MAGIC; + agcre->re_magic = AGCRE_MAGIC2; if (flags & AGCRE_REG_DUMP) { printprog(re); } @@ -2757,7 +2788,7 @@ agcre_regerror(int errcode, const agcre_ re_t *re; USE_ARG(errcode); - if (agcre == NULL || size == 0 || errbuf == NULL) { + if (!good_struct(agcre) || size == 0 || errbuf == NULL) { return 0; } re = agcre->re_g; @@ -2782,15 +2813,15 @@ agcre_regexec(agcre_regex_t *agcre, cons re_t *re; int ret; - if (agcre == NULL || vs == NULL || (matchc > 0 && m == NULL)) { + if (!good_struct(agcre) || vs == NULL || (matchc > 0 && m == NULL)) { return AGCRE_REG_FAILURE; } if ((re = agcre->re_g) == NULL) { return AGCRE_REG_FAILURE; } - if (agcre->re_magic != AGCRE_MAGIC) { + if (agcre->re_magic != AGCRE_MAGIC2) { re->msgc = snprintf(re->msg, sizeof(re->msg), - "bad magic number 0x%x, not 0x%x", agcre->re_magic, AGCRE_MAGIC); + "bad magic number 0x%x, not 0x%x", agcre->re_magic, AGCRE_MAGIC2); return AGCRE_REG_FAILURE; } if (matchc > AGCRE_MAX_SUBEXPR) { @@ -2942,6 +2973,9 @@ agcre_rev_regexec(agcre_regex_t *agcre, int found; int lastmatch; + if (!good_struct(agcre) || vs == NULL || (matchc > 0 && m == NULL)) { + return AGCRE_REG_FAILURE; + } if (flags & AGCRE_REG_STARTEND) { from = m[0].rm_so; to = m[0].rm_eo; @@ -2984,7 +3018,7 @@ agcre_regfree(agcre_regex_t *agcre) uint32_t i; re_t *re; - if (agcre) { + if (agcre && good_struct(agcre)) { if ((re = agcre->re_g) != NULL) { free(re->prog); for (
CVS commit: othersrc/external/bsd/agcre/dist
Module Name:othersrc Committed By: agc Date: Wed Jun 21 23:48:08 UTC 2023 Modified Files: othersrc/external/bsd/agcre/dist: agcre.c agcre.h othersrc/external/bsd/agcre/dist/tests: 62.expected Log Message: agcre version 20230621 == + agcre - added internal magic numbers to agcre to attempt to catch if misbehaving programs overwrite sections of memory + agcre - check internal magic numbers before attempting to execute regex programs + agcre - bump agcre magic number in the external structure + agcre - bump version number in header file. Fix up tests to ensure correct operation To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/agcre/dist/agcre.c cvs rdiff -u -r1.5 -r1.6 othersrc/external/bsd/agcre/dist/agcre.h cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/agcre/dist/tests/62.expected Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: othersrc/external/bsd/agcre
Module Name:othersrc Committed By: agc Date: Fri Feb 24 19:01:11 UTC 2023 Modified Files: othersrc/external/bsd/agcre/bin: Makefile othersrc/external/bsd/agcre/dist: agcre.c agcre.h othersrc/external/bsd/agcre/dist/tests: 54.expected 62.expected othersrc/external/bsd/agcre/lib: Makefile Added Files: othersrc/external/bsd/agcre: namespace.mk Log Message: 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 To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 othersrc/external/bsd/agcre/namespace.mk cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/agcre/bin/Makefile cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/agcre/dist/agcre.c cvs rdiff -u -r1.4 -r1.5 othersrc/external/bsd/agcre/dist/agcre.h cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/agcre/dist/tests/54.expected cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/agcre/dist/tests/62.expected cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/agcre/lib/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: othersrc/external/bsd/agcre/bin/Makefile diff -u othersrc/external/bsd/agcre/bin/Makefile:1.1 othersrc/external/bsd/agcre/bin/Makefile:1.2 --- othersrc/external/bsd/agcre/bin/Makefile:1.1 Wed Aug 16 23:38:13 2017 +++ othersrc/external/bsd/agcre/bin/Makefile Fri Feb 24 19:01:10 2023 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1 2017/08/16 23:38:13 agc Exp $ +# $NetBSD: Makefile,v 1.2 2023/02/24 19:01:10 agc Exp $ .include @@ -9,6 +9,8 @@ CPPFLAGS+= -I${DIST} MAN= agcre.1 WARNS= 5 +.sinclude "../namespace.mk" + DIST= ${.CURDIR}/../dist .PATH: ${DIST} Index: othersrc/external/bsd/agcre/dist/agcre.c diff -u othersrc/external/bsd/agcre/dist/agcre.c:1.2 othersrc/external/bsd/agcre/dist/agcre.c:1.3 --- othersrc/external/bsd/agcre/dist/agcre.c:1.2 Sat Dec 4 01:54:51 2021 +++ othersrc/external/bsd/agcre/dist/agcre.c Fri Feb 24 19:01:10 2023 @@ -223,6 +223,7 @@ static int unicode_isOther_Uppercase(uin static int unicode_isPattern_White_Space(uint32_t /*ch*/); static int unicode_isalnum(uint32_t /*ch*/); static int unicode_isalpha(uint32_t /*ch*/); +static int unicode_ispunct2(uint32_t /*ch*/); static int unicode_isblank(uint32_t /*ch*/); static int unicode_iscntrl(uint32_t /*ch*/); static int unicode_isdigit(uint32_t /*ch*/); @@ -233,7 +234,7 @@ static int unicode_ispunct(uint32_t /*ch static int unicode_isspace(uint32_t /*ch*/); static int unicode_isupper(uint32_t /*ch*/); static int unicode_isxdigit(uint32_t /*ch*/); -static int unicode_isident(uint32_t /*ch*/); +static int unicode_isword(uint32_t /*ch*/); static uint32_t unicode_tolower(uint32_t /*ch*/); static uint32_t unicode_toupper(uint32_t /*ch*/); @@ -417,7 +418,7 @@ emit(re_t *re, retoken_t *tok) (tok->ch == 'd' || tok->ch == 'D') ? unicode_isdigit : (tok->ch == 'p' || tok->ch == 'P') ? unicode_isprint : (tok->ch == 's' || tok->ch == 'S') ? unicode_isspace : -unicode_isident, +unicode_isword, unicode_isupper(tok->ch)); re->pc++; return 1; @@ -1169,16 +1170,16 @@ isendline(re_t *re, input_t *in) static inline int isbegword(re_t *re, input_t *in) { - return (isbegline(re, in) || !unicode_isident(in->prevch)) && - unicode_isident(in->ch); + return (isbegline(re, in) || !unicode_isword(in->prevch)) && + unicode_isword(in->ch); } /* return 1 at end of words */ static inline int isendword(re_t *re, input_t *in) { - return (isendline(re, in) || (in->c > in->so && unicode_isident(in->prevch))) && - (!unicode_isident(in->ch)); + return (isendline(re, in) || (in->c > in->so && unicode_isword(in->prevch))) && + (!unicode_isword(in->ch)); } /* do the chars match? */ @@ -1577,10 +1578,6 @@ rec_posix_class(input_t *in, set_t *set) set_add_callback(set, unicode_isgraph, 0); in->c += 8; return 1; - case /* ":ident:]" */ 0x8a1572f1: - set_add_callback(set, unicode_isident, 0); - in->c += 8; - return 1; case /* ":lower:]" */ 0x8bfc6af8: set_add_callback(set, unicode_islower, 0); in->c += 8; @@ -1593,6 +1590,10 @@ rec_posix_class(input_t *in, set_t *set) set_add_callback(set, unicode_ispunct, 0); in->c += 8; return 1; + case /* ":punct2:]" */ 0xf09af6aa: + set_add_callback(set, unicode_ispunct2, 0); + in->c += 9; + return 1; case /* ":space:]" */ 0xa876bcf2: set_add_callback(set, unicode_isspace, 0); in->c += 8; @@ -1605,6 +1606,10 @@ rec_posix_class(input_t *in, set_t *set) set_add_callback(set, unicode_isxdigit, 0); in->c += 9; return 1; + case /* ":word:]" */ 0x96b11914: + set_add_callback(set, unicode_isword, 0); + in->c += 7; + return 1; default: return 0; } @@ -1661,7 +1666,7 @@ rec_set(input_t *in) (token->ch == 'd' || t
CVS commit: othersrc/external/bsd/agcre
Module Name:othersrc Committed By: agc Date: Fri Feb 24 19:01:11 UTC 2023 Modified Files: othersrc/external/bsd/agcre/bin: Makefile othersrc/external/bsd/agcre/dist: agcre.c agcre.h othersrc/external/bsd/agcre/dist/tests: 54.expected 62.expected othersrc/external/bsd/agcre/lib: Makefile Added Files: othersrc/external/bsd/agcre: namespace.mk Log Message: 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 To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 othersrc/external/bsd/agcre/namespace.mk cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/agcre/bin/Makefile cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/agcre/dist/agcre.c cvs rdiff -u -r1.4 -r1.5 othersrc/external/bsd/agcre/dist/agcre.h cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/agcre/dist/tests/54.expected cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/agcre/dist/tests/62.expected cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/agcre/lib/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: othersrc/external/bsd/agcre/dist
Module Name:othersrc Committed By: agc Date: Sat Dec 4 03:40:29 UTC 2021 Modified Files: othersrc/external/bsd/agcre/dist: agcre.h Log Message: Change HIDE_AGCRE to be a 0/1 value, rather than defined/undef By default, don't hide (i.e. export all symbols) NFC To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/agcre/dist/agcre.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: othersrc/external/bsd/agcre/dist/agcre.h diff -u othersrc/external/bsd/agcre/dist/agcre.h:1.3 othersrc/external/bsd/agcre/dist/agcre.h:1.4 --- othersrc/external/bsd/agcre/dist/agcre.h:1.3 Sat Dec 4 01:54:51 2021 +++ othersrc/external/bsd/agcre/dist/agcre.h Sat Dec 4 03:40:29 2021 @@ -131,7 +131,12 @@ typedef struct agcre_regex_t { # define DLL_LOCAL #endif -#ifdef HIDE_AGCRE +/* by default, don't hide external symbols */ +#ifndef HIDE_AGCRE +#define HIDE_AGCRE 0 +#endif + +#if HIDE_AGCRE #define AGCRE_EXPORT DLL_LOCAL #else #define AGCRE_EXPORT DLL_PUBLIC
CVS commit: othersrc/external/bsd/agcre/dist
Module Name:othersrc Committed By: agc Date: Sat Dec 4 03:40:29 UTC 2021 Modified Files: othersrc/external/bsd/agcre/dist: agcre.h Log Message: Change HIDE_AGCRE to be a 0/1 value, rather than defined/undef By default, don't hide (i.e. export all symbols) NFC To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/agcre/dist/agcre.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: othersrc/external/bsd/agcre/dist
Module Name:othersrc Committed By: agc Date: Sat Dec 4 01:54:51 UTC 2021 Modified Files: othersrc/external/bsd/agcre/dist: agcre.c agcre.h Log Message: Add visibility definitions for agcre. For any sources embedding these routines, simply define HIDE_AGCRE, before including the agcre.h header file, and the routines will have the hidden visibility attribute set on them. For more information on that, see https://gcc.gnu.org/wiki/Visibility To stop agcre routines being exported in a .so, simply define HIDE_AGCRE - I've been doing this successfully in library Makefiles, for example, this is from elex/lib/Makefile (elex is a library that calls the agcre functions): # set symbol visibility for .so CPPFLAGS+= -DHIDE_AGCRE and the agcre symbols will be found just fine when linking and running, but will not be exported by the linker. This can save headaches, and weird crashes, especially when combined with ASLR (when two libraries define the same symbol, but with different structs or arguments). BEFORE: [2021/12/03 Fri 17:47:19] agc@netbsd-002 ~/local/elex-2025 [13781] > nm -D lib/libelex.so w _Jv_RegisterClasses w __cxa_finalize w __deregister_frame_info U __fstat50 w __register_frame_info U __sF 0020f198 D _end c240 T _fini 0ea0 T _init aa13 T agcre_new bc48 T agcre_regasub aa28 T agcre_regcomp adde T agcre_regerror ae48 T agcre_regexec b8fd T agcre_regfree b9a2 T agcre_regnsub b7e8 T agcre_rev_regexec U asprintf U calloc 27f6 T elex_dispose 2b6a T elex_exec 2f5b T elex_exec_str 2982 T elex_make_new_rule 27bb T elex_new U fclose U fopen U fprintf U free U fwrite U memchr U memcmp U memcpy U memmove U memset U mmap U munmap U printf U putchar U realloc U snprintf U strchr U strcmp U strdup c10c T striter_dispose c165 T striter_exec c1da T striter_exec_mem c0f7 T striter_new U strlen U strtol U strtoul U vsnprintf U warn U warnx [2021/12/03 Fri 17:47:22] agc@netbsd-002 ~/local/elex-2025 [13782] > AFTER adding HIDE_AGCRE (and HIDE_STRITER) to elex/lib/Makefile: [2021/12/03 Fri 17:47:45] agc@netbsd-002 ~/local/elex-2025 [13774] > nm -D lib/libelex.so w _Jv_RegisterClasses w __cxa_finalize w __deregister_frame_info U __fstat50 w __register_frame_info U __sF 0020e160 D _end bf30 T _fini 0c00 T _init U asprintf U calloc 24e6 T elex_dispose 285a T elex_exec 2c4b T elex_exec_str 2672 T elex_make_new_rule 24ab T elex_new U fclose U fopen U fprintf U free U fwrite U memchr U memcmp U memcpy U memmove U memset U mmap U munmap U printf U putchar U realloc U snprintf U strchr U strcmp U strdup U strlen U strtol U strtoul U vsnprintf U warn U warnx To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/agcre/dist/agcre.c cvs rdiff -u -r1.2
CVS commit: othersrc/external/bsd/agcre/dist
Module Name:othersrc Committed By: agc Date: Sat Dec 4 01:54:51 UTC 2021 Modified Files: othersrc/external/bsd/agcre/dist: agcre.c agcre.h Log Message: Add visibility definitions for agcre. For any sources embedding these routines, simply define HIDE_AGCRE, before including the agcre.h header file, and the routines will have the hidden visibility attribute set on them. For more information on that, see https://gcc.gnu.org/wiki/Visibility To stop agcre routines being exported in a .so, simply define HIDE_AGCRE - I've been doing this successfully in library Makefiles, for example, this is from elex/lib/Makefile (elex is a library that calls the agcre functions): # set symbol visibility for .so CPPFLAGS+= -DHIDE_AGCRE and the agcre symbols will be found just fine when linking and running, but will not be exported by the linker. This can save headaches, and weird crashes, especially when combined with ASLR (when two libraries define the same symbol, but with different structs or arguments). BEFORE: [2021/12/03 Fri 17:47:19] agc@netbsd-002 ~/local/elex-2025 [13781] > nm -D lib/libelex.so w _Jv_RegisterClasses w __cxa_finalize w __deregister_frame_info U __fstat50 w __register_frame_info U __sF 0020f198 D _end c240 T _fini 0ea0 T _init aa13 T agcre_new bc48 T agcre_regasub aa28 T agcre_regcomp adde T agcre_regerror ae48 T agcre_regexec b8fd T agcre_regfree b9a2 T agcre_regnsub b7e8 T agcre_rev_regexec U asprintf U calloc 27f6 T elex_dispose 2b6a T elex_exec 2f5b T elex_exec_str 2982 T elex_make_new_rule 27bb T elex_new U fclose U fopen U fprintf U free U fwrite U memchr U memcmp U memcpy U memmove U memset U mmap U munmap U printf U putchar U realloc U snprintf U strchr U strcmp U strdup c10c T striter_dispose c165 T striter_exec c1da T striter_exec_mem c0f7 T striter_new U strlen U strtol U strtoul U vsnprintf U warn U warnx [2021/12/03 Fri 17:47:22] agc@netbsd-002 ~/local/elex-2025 [13782] > AFTER adding HIDE_AGCRE (and HIDE_STRITER) to elex/lib/Makefile: [2021/12/03 Fri 17:47:45] agc@netbsd-002 ~/local/elex-2025 [13774] > nm -D lib/libelex.so w _Jv_RegisterClasses w __cxa_finalize w __deregister_frame_info U __fstat50 w __register_frame_info U __sF 0020e160 D _end bf30 T _fini 0c00 T _init U asprintf U calloc 24e6 T elex_dispose 285a T elex_exec 2c4b T elex_exec_str 2672 T elex_make_new_rule 24ab T elex_new U fclose U fopen U fprintf U free U fwrite U memchr U memcmp U memcpy U memmove U memset U mmap U munmap U printf U putchar U realloc U snprintf U strchr U strcmp U strdup U strlen U strtol U strtoul U vsnprintf U warn U warnx To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/agcre/dist/agcre.c cvs rdiff -u -r1.2
Re: CVS commit: othersrc/external/bsd/agcre
Ugh, I fat-fingered the commit, and meant to commit the man page changes under a separate commit. The commit message from that was going to be: "Feedback from uwe - document agcre_regfree and agcre_reg[an]sub - thanks!" On Tue, 5 Oct 2021 at 15:17, Alistair G. Crooks wrote: > Module Name:othersrc > Committed By: agc > Date: Tue Oct 5 22:17:15 UTC 2021 > > Modified Files: > othersrc/external/bsd/agcre/dist: libagcre.3 > othersrc/external/bsd/agcre/lib: Makefile > > Log Message: > add MLINKS for rev_regexec and reg[an]sub functions > > > To generate a diff of this commit: > cvs rdiff -u -r1.4 -r1.5 othersrc/external/bsd/agcre/dist/libagcre.3 > cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/agcre/lib/Makefile > > Please note that diffs are not public domain; they are subject to the > copyright notices on the relevant files. > >
CVS commit: othersrc/external/bsd/agcre/dist
Module Name:othersrc Committed By: uwe Date: Tue Oct 5 23:35:39 UTC 2021 Modified Files: othersrc/external/bsd/agcre/dist: libagcre.3 Log Message: Sprinkle more markup in previous. Sync argument names. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 othersrc/external/bsd/agcre/dist/libagcre.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: othersrc/external/bsd/agcre/dist/libagcre.3 diff -u othersrc/external/bsd/agcre/dist/libagcre.3:1.5 othersrc/external/bsd/agcre/dist/libagcre.3:1.6 --- othersrc/external/bsd/agcre/dist/libagcre.3:1.5 Tue Oct 5 22:17:15 2021 +++ othersrc/external/bsd/agcre/dist/libagcre.3 Tue Oct 5 23:35:38 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: libagcre.3,v 1.5 2021/10/05 22:17:15 agc Exp $ +.\" $NetBSD: libagcre.3,v 1.6 2021/10/05 23:35:38 uwe Exp $ .\" .\" Copyright (c) 2017,2020,2021 Alistair Crooks .\" All rights reserved. @@ -165,7 +165,7 @@ Traces execution of the regular expressi .It Dv AGCRE_REG_CTAGS This is used where a regular expression pattern was generated by the .Xr ctags 1 -program, since the syntax generated does not conform to a standard +program, since the syntax generated does not conform to a standard basic regular expression. In particular, .Xr ctags 1 @@ -353,29 +353,43 @@ functions perform substitutions using .Xr sed 1 like syntax. They return the length of -the string that would have been created if there was enough space or -1 on error, setting errno. +the string that would have been created if there was enough space +or \-1 on error, setting +.Va errno . The result is -placed in buf which is user-supplied in +placed in +.Fa buf +which is user-supplied in .Fn agcre_regnsub and dynamically allocated in .Fn agcre_regasub . -The sub argument -contains a substitution string which might refer to the first 9 regular expression strings using -.Ql \e +The +.Fa repl +argument contains a substitution string which might +refer to the first 9 regular expression strings using +.Sq Li \e Ns Ar to refer -to the nth matched item, or -.Ql & +to the +.Ar n\^ Ns th +matched item, +or +.Ql \&& (which is equivalent to .Ql \e0 ) to refer to the full match. -The match array must be -at least 10 elements long, +The +.Fa matches +array must be at least 10 elements long, and should contain the result of the matches from a previous .Fn agcre_regexec call. Only 10 -elements of the rm array can be used. -The str argument contains the source string in which transformations will be substituted. +elements of the +.Fa matches +array can be used. +The +.Fa str +argument contains the source string in which transformations will be substituted. .Pp To show the value of constant-time execution, especially for regular expressions which may be subject to abuse,
CVS commit: othersrc/external/bsd/agcre/dist
Module Name:othersrc Committed By: uwe Date: Tue Oct 5 23:35:39 UTC 2021 Modified Files: othersrc/external/bsd/agcre/dist: libagcre.3 Log Message: Sprinkle more markup in previous. Sync argument names. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 othersrc/external/bsd/agcre/dist/libagcre.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: othersrc/external/bsd/agcre
Module Name:othersrc Committed By: agc Date: Tue Oct 5 22:17:15 UTC 2021 Modified Files: othersrc/external/bsd/agcre/dist: libagcre.3 othersrc/external/bsd/agcre/lib: Makefile Log Message: add MLINKS for rev_regexec and reg[an]sub functions To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 othersrc/external/bsd/agcre/dist/libagcre.3 cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/agcre/lib/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: othersrc/external/bsd/agcre/dist/libagcre.3 diff -u othersrc/external/bsd/agcre/dist/libagcre.3:1.4 othersrc/external/bsd/agcre/dist/libagcre.3:1.5 --- othersrc/external/bsd/agcre/dist/libagcre.3:1.4 Tue Oct 5 18:56:24 2021 +++ othersrc/external/bsd/agcre/dist/libagcre.3 Tue Oct 5 22:17:15 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: libagcre.3,v 1.4 2021/10/05 18:56:24 uwe Exp $ +.\" $NetBSD: libagcre.3,v 1.5 2021/10/05 22:17:15 agc Exp $ .\" .\" Copyright (c) 2017,2020,2021 Alistair Crooks .\" All rights reserved. @@ -162,6 +162,18 @@ expression, the individual virtual machi will be printed on standard output. .It Dv AGCRE_REG_TRACE Traces execution of the regular expression. +.It Dv AGCRE_REG_CTAGS +This is used where a regular expression pattern was generated by the +.Xr ctags 1 +program, since the syntax generated does not conform to a standard +basic regular expression. +In particular, +.Xr ctags 1 +outputs function location patterns which contain an unescaped +.Ql * +character, whereas basic regular expressions will only +recognise an asterisk as a standard character if it appears +at the start of an expression. .\".It Dv AGCRE_IN_8BITS .\"This indicates to the .\".Fn agcre_regcomp @@ -240,18 +252,6 @@ should therefore use the definition. Anchoring can be specified at expression compile time, and/or at expression execution time. -.It Dv AGCRE_REG_ANCHOR -This is used where a regular expression pattern was generated by the -.Xr ctags 1 -program, since the syntax generated does not conform to a standard -basic regular expression. -In particular, -.Xr ctags 1 -outputs function location patterns which contain an unescaped -.Ql * -character, whereas basic regular expressions will only -recognise an asterisk as a standard character if it appears -at the start of an expression. .\".It Dv AGCRE_IN_8BITS .\"This indicates to the .\".Fn agcre_regexec @@ -318,7 +318,7 @@ and character sets, ranges and character classes. .Pp Because a virtual machine is used, -there are no real limits top the size of regular expression +there are no real limits to the size of regular expression which can be compiled. However, to avoid abuse, certain arbitrary limits are set: .Bl -bullet -offset indent -compact @@ -332,6 +332,51 @@ the maximum number of is set at compile-time to 1024 .El .Pp +To deallocate storage in the compiled regular expression, the +.Fn agcre_regfree +is used. +Once the storage is deallocated, it cannot be used again +without another compilation using +.Fn agcre_regcomp . +.Pp +If storage for the regular expression was allocated using +.Fn agcre_new +then that storage should be deallocated using the +.Xr free 3 +function. +.Pp +The +.Fn agcre_regnsub +and +.Fn agcre_regasub +functions perform substitutions using +.Xr sed 1 +like syntax. +They return the length of +the string that would have been created if there was enough space or -1 on error, setting errno. +The result is +placed in buf which is user-supplied in +.Fn agcre_regnsub +and dynamically allocated in +.Fn agcre_regasub . +The sub argument +contains a substitution string which might refer to the first 9 regular expression strings using +.Ql \e +to refer +to the nth matched item, or +.Ql & +(which is equivalent to +.Ql \e0 ) +to refer to the full match. +The match array must be +at least 10 elements long, +and should contain the result of the matches from a previous +.Fn agcre_regexec +call. +Only 10 +elements of the rm array can be used. +The str argument contains the source string in which transformations will be substituted. +.Pp To show the value of constant-time execution, especially for regular expressions which may be subject to abuse, the standard Index: othersrc/external/bsd/agcre/lib/Makefile diff -u othersrc/external/bsd/agcre/lib/Makefile:1.2 othersrc/external/bsd/agcre/lib/Makefile:1.3 --- othersrc/external/bsd/agcre/lib/Makefile:1.2 Tue Oct 5 01:23:39 2021 +++ othersrc/external/bsd/agcre/lib/Makefile Tue Oct 5 22:17:15 2021 @@ -1,17 +1,19 @@ -# $NetBSD: Makefile,v 1.2 2021/10/05 01:23:39 agc Exp $ +# $NetBSD: Makefile,v 1.3 2021/10/05 22:17:15 agc Exp $ LIB= agcre SRCS+= agcre.c MAN= libagcre.3 agcre_format.7 MLINKS+= libagcre.3 agcre_regcomp.3 MLINKS+= libagcre.3 agcre_regexec.3 +MLINKS+= libagcre.3 agcre_rev_regexec.3 MLINKS+= libagcre.3 agcre_regfree.3 MLINKS+= libagcre.3 agcre_regerror.3 +MLINKS+= libagcre.3 agcre_regnsu
CVS commit: othersrc/external/bsd/agcre
Module Name:othersrc Committed By: agc Date: Tue Oct 5 22:17:15 UTC 2021 Modified Files: othersrc/external/bsd/agcre/dist: libagcre.3 othersrc/external/bsd/agcre/lib: Makefile Log Message: add MLINKS for rev_regexec and reg[an]sub functions To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 othersrc/external/bsd/agcre/dist/libagcre.3 cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/agcre/lib/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: othersrc/external/bsd/agcre/dist
Module Name:othersrc Committed By: uwe Date: Tue Oct 5 19:25:28 UTC 2021 Modified Files: othersrc/external/bsd/agcre/dist: agcre.1 Log Message: Tweak markup. Sync argument names between text and synopsis. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/agcre/dist/agcre.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: othersrc/external/bsd/agcre/dist/agcre.1 diff -u othersrc/external/bsd/agcre/dist/agcre.1:1.2 othersrc/external/bsd/agcre/dist/agcre.1:1.3 --- othersrc/external/bsd/agcre/dist/agcre.1:1.2 Thu Aug 17 11:02:04 2017 +++ othersrc/external/bsd/agcre/dist/agcre.1 Tue Oct 5 19:25:28 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: agcre.1,v 1.2 2017/08/17 11:02:04 wiz Exp $ +.\" $NetBSD: agcre.1,v 1.3 2021/10/05 19:25:28 uwe Exp $ .\" .\" Copyright (c) 2017 Alistair Crooks .\" All rights reserved. @@ -35,30 +35,36 @@ .Op Fl e Ar expression .Op Fl f Ar filename .Op Fl m Ar maxmatch -.Op Fl P Ar reg_pend -.Op Fl S Ar subexpression -.Op Fl T Ar regexp_type +.Op Fl P Ar end +.Op Fl S Ar n +.Op Fl T Ar type +.Op Ar expression .Ar file ... .Sh DESCRIPTION The .Nm -utility uses +utility uses the .Xr libagcre 3 -as a regular expression library. +library to perform textual matches on files and standard input +in the same way as +.Xr grep 1 . +.Pp The library is built on Rob Pike's Virtual Machine implementation, -but also recognises back references, Unicode characters and PERL +but also recognises back references, Unicode characters and Perl patterns, and performs greedy and non-greedy matching. -.Bl -tag -width subexpressionX +.Bl -tag -width Fl .It Fl D Dump the generated virtual machine program to -.Dv stdout +.Va stdout if the regular expression compilation was successful. .It Fl e Ar expression -Use the expression provided in the argument as the expression +Use the +.Ar expression +provided in the argument as the expression to be compiled. This is useful if the expression begins with a -.Dq - +.Ql \&- character, for example. .It Fl f Ar filename Take the regular expression from the filename provided @@ -68,55 +74,52 @@ Perform matching in a case-insensitive m .It Fl l Suppress output, and merely print the filename for any expression match. -.It Fl m Ar N -Perform matching until N matches are found. +.It Fl m Ar maxmatch +Perform matching until +.Ar maxmatch +matches are found. The default is to show all matches. .It Fl n Show line numbers in files of any matches found .It Fl O Do not print matching text. Instead, print the offsets of any matching text. -.It Fl P Ar offset +.It Fl P Ar end Use .Dv AGCRE_REG_PEND to denote the end offset of the regular expression to be compiled. .It Fl r If an argument is found to be a directory, recurse into that directory and perform matching against all files in that directory. -.It Fl S Ar N -Print the subscript matching subexpression number N. +.It Fl S Ar n +Print the substring matching subexpression number +.Ar n . The default is to print the whole match, subexpression 0. -.It Fl T Ar nospec|basic|extended +.It Fl T Ar type Explicitly specify the type of matching to be performed. Possible values for this are -.Dq nospec , -.Dq basic , +.Ql nospec , +.Ql basic , and -.Dq extended . +.Ql extended . The default in .Nm -is to use extended regular expressions by default. +is to use extended regular expressions. There is no default regular expression type in .Xr libagcre 3 . .It Fl t Trace the execution of .Fn agcre_regexec by producing tracing information on -.Dv stderr . +.Va stderr . .It Fl V Print version number and then exit. .It Fl v -Perform an inverse match, showing all lines which do not match the +Perform an inverse match, showing all lines which do +.Em not +match the regular expression. .El -.Pp -The -.Nm -utility uses the -.Xr libagcre 3 -library to perform textual matches on files and standard input -in the same way as -.Xr grep 1 . .Sh SEE ALSO .Xr grep 1 , .Xr libagcre 3 ,
CVS commit: othersrc/external/bsd/agcre/dist
Module Name:othersrc Committed By: uwe Date: Tue Oct 5 19:25:28 UTC 2021 Modified Files: othersrc/external/bsd/agcre/dist: agcre.1 Log Message: Tweak markup. Sync argument names between text and synopsis. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/agcre/dist/agcre.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: othersrc/external/bsd/agcre/dist
Module Name:othersrc Committed By: uwe Date: Tue Oct 5 18:56:24 UTC 2021 Modified Files: othersrc/external/bsd/agcre/dist: libagcre.3 Log Message: Tweak markup. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/agcre/dist/libagcre.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: othersrc/external/bsd/agcre/dist/libagcre.3 diff -u othersrc/external/bsd/agcre/dist/libagcre.3:1.3 othersrc/external/bsd/agcre/dist/libagcre.3:1.4 --- othersrc/external/bsd/agcre/dist/libagcre.3:1.3 Tue Oct 5 01:23:39 2021 +++ othersrc/external/bsd/agcre/dist/libagcre.3 Tue Oct 5 18:56:24 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: libagcre.3,v 1.3 2021/10/05 01:23:39 agc Exp $ +.\" $NetBSD: libagcre.3,v 1.4 2021/10/05 18:56:24 uwe Exp $ .\" .\" Copyright (c) 2017,2020,2021 Alistair Crooks .\" All rights reserved. @@ -24,46 +24,75 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd October 1, 2021 -.Dt AGCRE-EMBED 3 +.Dt LIBAGCRE 3 .Os .Sh NAME .Nm agcre .Nd regular expression library .Sh LIBRARY -.Lb agcre +.\"Lb agcre +agcre Regular Expression Library (libagcre, \-lagcre) .Sh SYNOPSIS .In agcre.h +.\" .Ft "agcre_regex_t *" .Fo agcre_new .Fa "void" .Fc -.Ft "int" +.\" +.Ft int .Fo agcre_regcomp -.Fa "agcre_regex_t *expression" "const void *pat" "uint32_t flags" +.Fa "agcre_regex_t *expression" +.Fa "const void *pat" +.Fa "uint32_t flags" .Fc +.\" .Ft int .Fo agcre_regexec -.Fa "agcre_regex_t *expression" "const void *input" "size_t nmatch" "agcre_regmatch_t *matches" "uint32_t flags" +.Fa "agcre_regex_t *expression" +.Fa "const void *input" +.Fa "size_t nmatch" +.Fa "agcre_regmatch_t *matches" +.Fa "uint32_t flags" .Fc +.\" .Ft int .Fo agcre_rev_regexec -.Fa "agcre_regex_t *expression" "const void *input" "size_t nmatch" "agcre_regmatch_t *matches" "uint32_t flags" +.Fa "agcre_regex_t *expression" +.Fa "const void *input" +.Fa "size_t nmatch" +.Fa "agcre_regmatch_t *matches" +.Fa "uint32_t flags" .Fc +.\" .Ft void .Fo agcre_regfree .Fa "agcre_regex_t *expression" .Fc +.\" .Ft size_t .Fo agcre_regerror -.Fa "int errnum" "const agcre_regex_t *expression" "char *buf" "size_t size" +.Fa "int errnum" +.Fa "const agcre_regex_t *expression" +.Fa "char *buf" +.Fa "size_t size" .Fc +.\" .Ft ssize_t .Fo agcre_regnsub -.Fa "char *buf" "size_t size" "const char *repl" "const agcre_regmatch_t *matches" "const char *str" +.Fa "char *buf" +.Fa "size_t size" +.Fa "const char *repl" +.Fa "const agcre_regmatch_t *matches" +.Fa "const char *str" .Fc +.\" .Ft ssize_t .Fo agcre_regasub -.Fa "char **buf" "const char *repl" "const agcre_regmatch_t *matches" "const char *str" +.Fa "char **buf" +.Fa "const char *repl" +.Fa "const agcre_regmatch_t *matches" +.Fa "const char *str" .Fc .Sh DESCRIPTION The @@ -74,7 +103,7 @@ It will compile expressions described in .Xr agcre_format 7 , as well as some extensions. .Pp -A +An .Vt agcre_regex_t structure can either be allocated on the stack, or it can be allocated dynamically using @@ -89,10 +118,10 @@ A regular expression is compiled using Various flags can be specified during compilation, which will alter the regular expression which is produced. These flags are: -.Bl -tag -width AGCRE_REG_EXTENDEDXXX +.Bl -tag -width Dv .It Dv AGCRE_REG_BASIC Use basic regular expressions. -These are prserved for legacy reasons; no new code should use basic +These are preserved for legacy reasons; no new code should use basic regular expressions. For more information on regular expression formats, please refer to .Xr agcre_format 7 . @@ -100,25 +129,27 @@ For more information on regular expressi Extended regular expressions are the standard form of searching, and should be used. .It Dv AGCRE_REG_NOSUB -When searching through text, the standard searches are perfomed, +When searching through text, the standard searches are performed, but no subexpression information will be returned. .It Dv AGCRE_REG_NEWLINE Normally newline characters are treated as a standard character. With this flag, the zero width match for -.Dq ^ +.Ql \&^ before the newline character will match, as will the zero width string after the -.Dq $ . +.Ql \&$ . .It Dv AGCRE_REG_NOSPEC A standard search text will be performed, and no special characters will be recognised. In the current implementation, this will be performed using -a Horspool-modified Boyer-Moore search. +a Horspool-modified Boyer\(enMoore search. .It Dv AGCRE_REG_PEND Normally, the end of the string to be compiled will be the -first ASCII NUL character encountered. +first +.Tn ASCII NUL +character encountered. With this flag, the -.Dv re_endp +.Va re_endp field in the .Vt agcre_regex_t structure will be used to point to the last position in @@ -156,8 +187,8 @@ Traces execution of the regular expressi A regular expression, once compiled, can be execut
CVS commit: othersrc/external/bsd/agcre/dist
Module Name:othersrc Committed By: uwe Date: Tue Oct 5 18:56:24 UTC 2021 Modified Files: othersrc/external/bsd/agcre/dist: libagcre.3 Log Message: Tweak markup. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/agcre/dist/libagcre.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: othersrc/external/bsd/agcre
Module Name:othersrc Committed By: agc Date: Tue Oct 5 01:23:39 UTC 2021 Modified Files: othersrc/external/bsd/agcre/dist: Makefile.bsd Makefile.in Makefile.lib.in Makefile.libtool.in agcre.h libagcre.3 main.c othersrc/external/bsd/agcre/dist/tests: 54.expected 62.expected othersrc/external/bsd/agcre/lib: Makefile shlib_version Added Files: othersrc/external/bsd/agcre/dist: agcre.c Removed Files: othersrc/external/bsd/agcre/dist: comp.c error.c exec.c free.c internal.h lex.c lex.h new.c set.c set.h unicode.c unicode.h Log Message: 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 To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/agcre/dist/Makefile.bsd \ othersrc/external/bsd/agcre/dist/Makefile.in \ othersrc/external/bsd/agcre/dist/Makefile.lib.in \ othersrc/external/bsd/agcre/dist/Makefile.libtool.in \ othersrc/external/bsd/agcre/dist/agcre.h \ othersrc/external/bsd/agcre/dist/main.c cvs rdiff -u -r0 -r1.1 othersrc/external/bsd/agcre/dist/agcre.c cvs rdiff -u -r1.2 -r0 othersrc/external/bsd/agcre/dist/comp.c \ othersrc/external/bsd/agcre/dist/error.c cvs rdiff -u -r1.3 -r0 othersrc/external/bsd/agcre/dist/exec.c cvs rdiff -u -r1.1 -r0 othersrc/external/bsd/agcre/dist/free.c \ othersrc/external/bsd/agcre/dist/internal.h \ othersrc/external/bsd/agcre/dist/lex.c \ othersrc/external/bsd/agcre/dist/lex.h \ othersrc/external/bsd/agcre/dist/new.c \ othersrc/external/bsd/agcre/dist/set.c \ othersrc/external/bsd/agcre/dist/set.h \ othersrc/external/bsd/agcre/dist/unicode.c \ othersrc/external/bsd/agcre/dist/unicode.h cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/agcre/dist/libagcre.3 cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/agcre/dist/tests/54.expected cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/agcre/dist/tests/62.expected cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/agcre/lib/Makefile \ othersrc/external/bsd/agcre/lib/shlib_version Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: othersrc/external/bsd/agcre/dist/Makefile.bsd diff -u othersrc/external/bsd/agcre/dist/Makefile.bsd:1.1 othersrc/external/bsd/agcre/dist/Makefile.bsd:1.2 --- othersrc/external/bsd/agcre/dist/Makefile.bsd:1.1 Wed Aug 16 23:38:13 2017 +++ othersrc/external/bsd/agcre/dist/Makefile.bsd Tue Oct 5 01:23:39 2021 @@ -1,11 +1,5 @@ PROG= agcre -SRCS+= comp.c -SRCS+= error.c -SRCS+= exec.c -SRCS+= free.c -SRCS+= lex.c -SRCS+= set.c -SRCS+= unicode.c +SRCS+= agcre.c SRCS+= main.c MAN= libagcre.3 WARNS= 5 Index: othersrc/external/bsd/agcre/dist/Makefile.in diff -u othersrc/external/bsd/agcre/dist/Makefile.in:1.1 othersrc/external/bsd/agcre/dist/Makefile.in:1.2 --- othersrc/external/bsd/agcre/dist/Makefile.in:1.1 Wed Aug 16 23:38:13 2017 +++ othersrc/external/bsd/agcre/dist/Makefile.in Tue Oct 5 01:23:39 2021 @@ -1,8 +1,8 @@ -# $NetBSD: Makefile.in,v 1.1 2017/08/16 23:38:13 agc Exp $ +# $NetBSD: Makefile.in,v 1.2 2021/10/05 01:23:39 agc Exp $ PROG= agcre -OBJS= comp.o error.o exec.o free.o lex.o new.o set.o unicode.o main.o +OBJS= agcre.o main.o PREFIX=@PREFIX@ MANDIR=@MANDIR@ Index: othersrc/external/bsd/agcre/dist/Makefile.lib.in diff -u othersrc/external/bsd/agcre/dist/Makefile.lib.in:1.1 othersrc/external/bsd/agcre/dist/Makefile.lib.in:1.2 --- othersrc/external/bsd/agcre/dist/Makefile.lib.in:1.1 Wed Aug 16 23:38:13 2017 +++ othersrc/external/bsd/agcre/dist/Makefile.lib.in Tue Oct 5 01:23:39 2021 @@ -1,8 +1,8 @@ -# $NetBSD: Makefile.lib.in,v 1.1 2017/08/16 23:38:13 agc Exp $ +# $NetBSD: Makefile.lib.in,v 1.2 2021/10/05 01:23:39 agc Exp $ LIB= libagcre.a - OBJS= comp.o error.o exec.o free.o lex.o new.o set.o unicode.o +OBJS= agcre.o PREFIX=@PREFIX@ MANDIR=@MANDIR@ Index: othersrc/external/bsd/agcre/dist/Makefile.libtool.in diff -u oth
CVS commit: othersrc/external/bsd/agcre
Module Name:othersrc Committed By: agc Date: Tue Oct 5 01:23:39 UTC 2021 Modified Files: othersrc/external/bsd/agcre/dist: Makefile.bsd Makefile.in Makefile.lib.in Makefile.libtool.in agcre.h libagcre.3 main.c othersrc/external/bsd/agcre/dist/tests: 54.expected 62.expected othersrc/external/bsd/agcre/lib: Makefile shlib_version Added Files: othersrc/external/bsd/agcre/dist: agcre.c Removed Files: othersrc/external/bsd/agcre/dist: comp.c error.c exec.c free.c internal.h lex.c lex.h new.c set.c set.h unicode.c unicode.h Log Message: 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 To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/agcre/dist/Makefile.bsd \ othersrc/external/bsd/agcre/dist/Makefile.in \ othersrc/external/bsd/agcre/dist/Makefile.lib.in \ othersrc/external/bsd/agcre/dist/Makefile.libtool.in \ othersrc/external/bsd/agcre/dist/agcre.h \ othersrc/external/bsd/agcre/dist/main.c cvs rdiff -u -r0 -r1.1 othersrc/external/bsd/agcre/dist/agcre.c cvs rdiff -u -r1.2 -r0 othersrc/external/bsd/agcre/dist/comp.c \ othersrc/external/bsd/agcre/dist/error.c cvs rdiff -u -r1.3 -r0 othersrc/external/bsd/agcre/dist/exec.c cvs rdiff -u -r1.1 -r0 othersrc/external/bsd/agcre/dist/free.c \ othersrc/external/bsd/agcre/dist/internal.h \ othersrc/external/bsd/agcre/dist/lex.c \ othersrc/external/bsd/agcre/dist/lex.h \ othersrc/external/bsd/agcre/dist/new.c \ othersrc/external/bsd/agcre/dist/set.c \ othersrc/external/bsd/agcre/dist/set.h \ othersrc/external/bsd/agcre/dist/unicode.c \ othersrc/external/bsd/agcre/dist/unicode.h cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/agcre/dist/libagcre.3 cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/agcre/dist/tests/54.expected cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/agcre/dist/tests/62.expected cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/agcre/lib/Makefile \ othersrc/external/bsd/agcre/lib/shlib_version Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.