CVS commit: othersrc/external/bsd/elex/dist
Module Name:othersrc Committed By: agc Date: Thu Jun 22 23:16:47 UTC 2023 Modified Files: othersrc/external/bsd/elex/dist: agcre.c elex.c elex.h main.c othersrc/external/bsd/elex/dist/tests: 28.expected Log Message: elex-20230622 + restore bug fix lost in previous - reset yyleng to 0 when deleting input from the parser + API change to make function name more descriptive in API + bring license up to date + bump version number for header file To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 othersrc/external/bsd/elex/dist/agcre.c \ othersrc/external/bsd/elex/dist/elex.c \ othersrc/external/bsd/elex/dist/elex.h \ othersrc/external/bsd/elex/dist/main.c cvs rdiff -u -r1.4 -r1.5 othersrc/external/bsd/elex/dist/tests/28.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/elex/dist/agcre.c diff -u othersrc/external/bsd/elex/dist/agcre.c:1.4 othersrc/external/bsd/elex/dist/agcre.c:1.5 --- othersrc/external/bsd/elex/dist/agcre.c:1.4 Wed Jun 21 23:36:17 2023 +++ othersrc/external/bsd/elex/dist/agcre.c Thu Jun 22 23:16:46 2023 @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013,2017 Alistair Crooks. All Rights reserved. + * Copyright (c) 2013,2017,2023 Alistair Crooks. All Rights reserved. * All rights reserved. * * Parts of this are: Index: othersrc/external/bsd/elex/dist/elex.c diff -u othersrc/external/bsd/elex/dist/elex.c:1.4 othersrc/external/bsd/elex/dist/elex.c:1.5 --- othersrc/external/bsd/elex/dist/elex.c:1.4 Wed Jun 21 23:36:17 2023 +++ othersrc/external/bsd/elex/dist/elex.c Thu Jun 22 23:16:46 2023 @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018,2021 Alistair Crooks + * Copyright (c) 2018,2021,2023 Alistair Crooks * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -252,6 +252,7 @@ static int delete_input(elex_t *elex, size_t n) { memmove(>s[elex->cc], >s[elex->cc + n], elex->len - elex->cc - n); + elex->yyleng = 0; elex->len -= n; elex->s[elex->len] = 0x0; return 1; @@ -696,7 +697,7 @@ elex_exec(elex_t *elex, const char *info /* one function to access string values */ void * -elex_exec_str(elex_t *elex, const char *info, uint64_t n, uint64_t *size) +elex_exec_mem(elex_t *elex, const char *info, uint64_t n, uint64_t *size) { uint64_t len; Index: othersrc/external/bsd/elex/dist/elex.h diff -u othersrc/external/bsd/elex/dist/elex.h:1.4 othersrc/external/bsd/elex/dist/elex.h:1.5 --- othersrc/external/bsd/elex/dist/elex.h:1.4 Wed Jun 21 23:36:17 2023 +++ othersrc/external/bsd/elex/dist/elex.h Thu Jun 22 23:16:46 2023 @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018,2021 Alistair Crooks + * Copyright (c) 2018,2021,2023 Alistair Crooks * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,7 +23,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef ELEX_H_ -#define ELEX_H_ 20230621 +#define ELEX_H_ 20230622 #include @@ -34,7 +34,7 @@ #define elex_new ELEX_NAMESPACE(LIB_NAMESPACE, elex_new) #define elex_dispose ELEX_NAMESPACE(LIB_NAMESPACE, elex_dispose) #define elex_exec ELEX_NAMESPACE(LIB_NAMESPACE, elex_exec) -#define elex_exec_str ELEX_NAMESPACE(LIB_NAMESPACE, elex_exec_str) +#define elex_exec_mem ELEX_NAMESPACE(LIB_NAMESPACE, elex_exec_mem) #define elex_make_new_rule ELEX_NAMESPACE(LIB_NAMESPACE, elex_make_new_rule) #endif @@ -59,7 +59,7 @@ int elex_dispose(elex_t **/*elex*/); /* these functions do ALL the work */ int64_t elex_exec(elex_t */*elex*/, const char */*info*/, uint64_t /*num*/, const char */*s*/, int64_t /*cc*/); -void *elex_exec_str(elex_t */*elex*/, const char */*info*/, uint64_t /*n*/, uint64_t */*size*/); +void *elex_exec_mem(elex_t */*elex*/, const char */*info*/, uint64_t /*n*/, uint64_t */*size*/); /* with one exeception - deal with states */ int elex_make_new_rule(elex_t */*elex*/, const char */*startstate*/, Index: othersrc/external/bsd/elex/dist/main.c diff -u othersrc/external/bsd/elex/dist/main.c:1.4 othersrc/external/bsd/elex/dist/main.c:1.5 --- othersrc/external/bsd/elex/dist/main.c:1.4 Wed Jun 21 23:36:17 2023 +++ othersrc/external/bsd/elex/dist/main.c Thu Jun 22 23:16:46 2023 @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2018,2021 Alistair Crooks + * Copyright (c) 2018,2021,2023 Alistair Crooks * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -138,7 +138,7 @@ main(int argc, char **argv) } while (elex_exec(elex, "next-token", 0, NULL, 0) != 0) { type = elex_exec(elex, "get-yytype", 0, NULL, 0); - text = elex_exec_str(elex, "get-yytext", 0, ); + text = elex_exec_mem(elex, "get-yytext", 0, ); if (graphic) { switch(type) { case /* "IDENT" */ 0xdb8ea4d: Index: othersrc/external/bsd/elex/dist/tests/28.expected diff -u othersrc/external/bsd/elex/dist/tests/28.expected:1.4
CVS commit: othersrc/external/bsd/elex/dist
Module Name:othersrc Committed By: agc Date: Thu Jun 22 23:16:47 UTC 2023 Modified Files: othersrc/external/bsd/elex/dist: agcre.c elex.c elex.h main.c othersrc/external/bsd/elex/dist/tests: 28.expected Log Message: elex-20230622 + restore bug fix lost in previous - reset yyleng to 0 when deleting input from the parser + API change to make function name more descriptive in API + bring license up to date + bump version number for header file To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 othersrc/external/bsd/elex/dist/agcre.c \ othersrc/external/bsd/elex/dist/elex.c \ othersrc/external/bsd/elex/dist/elex.h \ othersrc/external/bsd/elex/dist/main.c cvs rdiff -u -r1.4 -r1.5 othersrc/external/bsd/elex/dist/tests/28.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/elex/dist
Module Name:othersrc Committed By: agc Date: Wed Feb 22 01:20:52 UTC 2023 Modified Files: othersrc/external/bsd/elex/dist: striter.c striter.h Log Message: Commit elex string iterator changes missed in previous commit: + move to a more extensible embedded library namespace protection To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/elex/dist/striter.c \ othersrc/external/bsd/elex/dist/striter.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/elex/dist
Module Name:othersrc Committed By: agc Date: Wed Feb 22 01:20:52 UTC 2023 Modified Files: othersrc/external/bsd/elex/dist: striter.c striter.h Log Message: Commit elex string iterator changes missed in previous commit: + move to a more extensible embedded library namespace protection To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/elex/dist/striter.c \ othersrc/external/bsd/elex/dist/striter.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/elex/dist/striter.c diff -u othersrc/external/bsd/elex/dist/striter.c:1.1 othersrc/external/bsd/elex/dist/striter.c:1.2 --- othersrc/external/bsd/elex/dist/striter.c:1.1 Thu Dec 9 04:15:26 2021 +++ othersrc/external/bsd/elex/dist/striter.c Wed Feb 22 01:20:52 2023 @@ -33,6 +33,7 @@ #include #include +#define LIB_NAMESPACE elex_ #include "striter.h" /* a string iterator structure */ @@ -102,14 +103,14 @@ addtext(striter_t *str, const char *s, u /*/ /* make a new string */ -STRITER_EXPORT striter_t * +striter_t * striter_new(void) { return calloc(1, sizeof(striter_t)); } /* dispose of string */ -STRITER_EXPORT int +int striter_dispose(striter_t **str) { if (str && *str) { @@ -122,7 +123,7 @@ striter_dispose(striter_t **str) } /* command with integer return */ -STRITER_EXPORT int +int striter_exec(striter_t *str, const char *info, const char *s, uint64_t n) { if (str == NULL || info == NULL) { @@ -136,7 +137,7 @@ striter_exec(striter_t *str, const char } /* command with char string return */ -STRITER_EXPORT char * +char * striter_exec_mem(striter_t *str, const char *info, size_t *size) { if (str == NULL || info == NULL || size == NULL) { Index: othersrc/external/bsd/elex/dist/striter.h diff -u othersrc/external/bsd/elex/dist/striter.h:1.1 othersrc/external/bsd/elex/dist/striter.h:1.2 --- othersrc/external/bsd/elex/dist/striter.h:1.1 Thu Dec 9 04:15:26 2021 +++ othersrc/external/bsd/elex/dist/striter.h Wed Feb 22 01:20:52 2023 @@ -23,42 +23,22 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef STRITER_H_ -#define STRITER_H_ 20211121 +#define STRITER_H_ 20230222 #include -struct striter_t; -typedef struct striter_t striter_t; - -#ifndef USE_VISIBILITY -# if defined(__GNUC__) -#if __GNUC__ >= 4 -#define USE_VISIBILITY 1 -#else -#define USE_VISIBILITY 0 -#endif -# else -#define USE_VISIBILITY 0 -# endif -#endif - -#if USE_VISIBILITY -# define DLL_PUBLIC __attribute__ ((visibility ("default"))) -# define DLL_LOCAL __attribute__ ((visibility ("hidden"))) -#else -# define DLL_PUBLIC -# define DLL_LOCAL -#endif - -#ifndef HIDE_STRITER -#define HIDE_STRITER 0 +#ifdef LIB_NAMESPACE +#define SI_CONCAT(x, y) x##y +#define SI_NAMESPACE(x, y) SI_CONCAT(x, y) +#define striter_t SI_NAMESPACE(LIB_NAMESPACE, striter_t) +#define striter_new SI_NAMESPACE(LIB_NAMESPACE, striter_new) +#define striter_dispose SI_NAMESPACE(LIB_NAMESPACE, striter_dispose) +#define striter_exec SI_NAMESPACE(LIB_NAMESPACE, striter_exec) +#define striter_exec_mem SI_NAMESPACE(LIB_NAMESPACE, striter_exec_mem) #endif -#if HIDE_STRITER -#define STRITER_EXPORT DLL_LOCAL -#else -#define STRITER_EXPORT DLL_PUBLIC -#endif +struct striter_t; +typedef struct striter_t striter_t; #ifndef __BEGIN_DECLS # if defined(__cplusplus) @@ -72,10 +52,10 @@ typedef struct striter_t striter_t; __BEGIN_DECLS -STRITER_EXPORT striter_t *striter_new(void); -STRITER_EXPORT int striter_dispose(striter_t **/*str*/); -STRITER_EXPORT int striter_exec(striter_t */*str*/, const char */*info*/, const char */*s*/, uint64_t /*n*/); -STRITER_EXPORT char *striter_exec_mem(striter_t */*str*/, const char */*info*/, size_t */*size*/); +striter_t *striter_new(void); +int striter_dispose(striter_t **/*str*/); +int striter_exec(striter_t */*str*/, const char */*info*/, const char */*s*/, uint64_t /*n*/); +char *striter_exec_mem(striter_t */*str*/, const char */*info*/, size_t */*size*/); __END_DECLS
CVS commit: othersrc/external/bsd/elex/dist
Module Name:othersrc Committed By: agc Date: Wed Feb 22 01:01:40 UTC 2023 Modified Files: othersrc/external/bsd/elex/dist: agcre.c agcre.h elex.c elex.h main.c othersrc/external/bsd/elex/dist/tests: 28.expected Log Message: Update to elex version 20230221 20230221 + protect elex embedded name space in a more extensible way + properly protect elex_make_new_rule + don't filter on symbol visibility, use LIB_NAMESPACE definition + sync agcre with bug fixes and reverse searching and other functionality updates + when searching elex start state names, use a hash value + bump version to 20230221 To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/elex/dist/agcre.c \ othersrc/external/bsd/elex/dist/agcre.h \ othersrc/external/bsd/elex/dist/elex.c \ othersrc/external/bsd/elex/dist/elex.h \ othersrc/external/bsd/elex/dist/main.c cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/elex/dist/tests/28.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/elex/dist/agcre.c diff -u othersrc/external/bsd/elex/dist/agcre.c:1.1 othersrc/external/bsd/elex/dist/agcre.c:1.2 --- othersrc/external/bsd/elex/dist/agcre.c:1.1 Thu Dec 9 04:15:26 2021 +++ othersrc/external/bsd/elex/dist/agcre.c Wed Feb 22 01:01:39 2023 @@ -36,6 +36,7 @@ #include #include +#define LIB_NAMESPACE elex_ #include "agcre.h" /* callback struct */ @@ -223,6 +224,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 +235,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 +419,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 +1171,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 +1579,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 +1591,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 +1607,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 +1667,7 @@ rec_set(input_t *in) (token->ch == 'd' || token->ch == 'D') ? unicode_isdigit : (token->ch == 'p' || token->ch == 'P') ? unicode_isprint : (token->ch == 's' || token->ch == 'S') ? unicode_isspace : - unicode_isident, + unicode_isword, unicode_isupper((uint8_t)token->ch)); break; } @@ -2612,11 +2618,20 @@ unicode_isxdigit(uint32_t ch) } static int -unicode_isident(uint32_t ch) +unicode_isword(uint32_t ch) { return unicode_isalnum(ch) || ch == '_'; } +static int +unicode_ispunct2(uint32_t ch) +{ + if (!unicode_isprint(ch) || unicode_isspace(ch) || unicode_isword(ch)) { + return 0; + } + return 1; +} + static uint32_t
CVS commit: othersrc/external/bsd/elex/dist
Module Name:othersrc Committed By: agc Date: Wed Feb 22 01:01:40 UTC 2023 Modified Files: othersrc/external/bsd/elex/dist: agcre.c agcre.h elex.c elex.h main.c othersrc/external/bsd/elex/dist/tests: 28.expected Log Message: Update to elex version 20230221 20230221 + protect elex embedded name space in a more extensible way + properly protect elex_make_new_rule + don't filter on symbol visibility, use LIB_NAMESPACE definition + sync agcre with bug fixes and reverse searching and other functionality updates + when searching elex start state names, use a hash value + bump version to 20230221 To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/elex/dist/agcre.c \ othersrc/external/bsd/elex/dist/agcre.h \ othersrc/external/bsd/elex/dist/elex.c \ othersrc/external/bsd/elex/dist/elex.h \ othersrc/external/bsd/elex/dist/main.c cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/elex/dist/tests/28.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/elex/dist/tests
Module Name:othersrc Committed By: agc Date: Thu Dec 9 04:18:00 UTC 2021 Modified Files: othersrc/external/bsd/elex/dist/tests: 14.expected 14.in 20.expected 20.in Log Message: Omit RCS Ids from test input and expected output files. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/elex/dist/tests/14.expected \ othersrc/external/bsd/elex/dist/tests/14.in \ othersrc/external/bsd/elex/dist/tests/20.expected \ othersrc/external/bsd/elex/dist/tests/20.in 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/elex/dist/tests/14.expected diff -u othersrc/external/bsd/elex/dist/tests/14.expected:1.1 othersrc/external/bsd/elex/dist/tests/14.expected:1.2 --- othersrc/external/bsd/elex/dist/tests/14.expected:1.1 Thu Dec 9 04:15:26 2021 +++ othersrc/external/bsd/elex/dist/tests/14.expected Thu Dec 9 04:18:00 2021 @@ -2,10 +2,6 @@ [1] 2 ' ' -[3] 61 '# $NetBSD: 14.expected,v 1.1 2021/12/09 04:15:26 agc Exp $' -[1] 2 ' - -' [3] 53 '# Copyright (c) 2013 Alistair Crooks ' [1] 1 ' ' Index: othersrc/external/bsd/elex/dist/tests/14.in diff -u othersrc/external/bsd/elex/dist/tests/14.in:1.1 othersrc/external/bsd/elex/dist/tests/14.in:1.2 --- othersrc/external/bsd/elex/dist/tests/14.in:1.1 Thu Dec 9 04:15:26 2021 +++ othersrc/external/bsd/elex/dist/tests/14.in Thu Dec 9 04:18:00 2021 @@ -1,7 +1,5 @@ #! /bin/sh -# $NetBSD: 14.in,v 1.1 2021/12/09 04:15:26 agc Exp $ - # Copyright (c) 2013 Alistair Crooks # All rights reserved. # Index: othersrc/external/bsd/elex/dist/tests/20.expected diff -u othersrc/external/bsd/elex/dist/tests/20.expected:1.1 othersrc/external/bsd/elex/dist/tests/20.expected:1.2 --- othersrc/external/bsd/elex/dist/tests/20.expected:1.1 Thu Dec 9 04:15:26 2021 +++ othersrc/external/bsd/elex/dist/tests/20.expected Thu Dec 9 04:18:00 2021 @@ -1,9 +1,6 @@ [3] 9 '#!/bin/sh' [1] 1 ' ' -[3] 91 '# $Header: /cvsroot/othersrc/external/bsd/elex/dist/tests/20.expected,v 1.1 2021/12/09 04:15:26 agc Exp $' -[1] 1 ' -' [3] 1 '#' [1] 1 ' ' Index: othersrc/external/bsd/elex/dist/tests/20.in diff -u othersrc/external/bsd/elex/dist/tests/20.in:1.1 othersrc/external/bsd/elex/dist/tests/20.in:1.2 --- othersrc/external/bsd/elex/dist/tests/20.in:1.1 Thu Dec 9 04:15:26 2021 +++ othersrc/external/bsd/elex/dist/tests/20.in Thu Dec 9 04:18:00 2021 @@ -1,5 +1,4 @@ #!/bin/sh -# $Header: /cvsroot/othersrc/external/bsd/elex/dist/tests/20.in,v 1.1 2021/12/09 04:15:26 agc Exp $ # # Install Perl scripts, adjusting for the correct pathname # $1 = name of perl program
CVS commit: othersrc/external/bsd/elex/dist/tests
Module Name:othersrc Committed By: agc Date: Thu Dec 9 04:18:00 UTC 2021 Modified Files: othersrc/external/bsd/elex/dist/tests: 14.expected 14.in 20.expected 20.in Log Message: Omit RCS Ids from test input and expected output files. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/elex/dist/tests/14.expected \ othersrc/external/bsd/elex/dist/tests/14.in \ othersrc/external/bsd/elex/dist/tests/20.expected \ othersrc/external/bsd/elex/dist/tests/20.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.