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 <a...@netbsd.org> + * Copyright (c) 2018,2021,2023 Alistair Crooks <a...@netbsd.org> * 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(&elex->s[elex->cc], &elex->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 <a...@netbsd.org> + * Copyright (c) 2018,2021,2023 Alistair Crooks <a...@netbsd.org> * 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 <inttypes.h> @@ -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 <a...@netbsd.org> + * Copyright (c) 2018,2021,2023 Alistair Crooks <a...@netbsd.org> * 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, &len); + text = elex_exec_mem(elex, "get-yytext", 0, &len); 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 othersrc/external/bsd/elex/dist/tests/28.expected:1.5 --- othersrc/external/bsd/elex/dist/tests/28.expected:1.4 Wed Jun 21 23:36:17 2023 +++ othersrc/external/bsd/elex/dist/tests/28.expected Thu Jun 22 23:16:47 2023 @@ -1 +1 @@ -main elex version 20230621 +main elex version 20230622