Revision history for Parse-H 2025-11- 11 Bogdan Drozdowski * Version 0.30 Parsing fixes and improvements. Code style updates. Other small fixes and improvements. Build system improvements. Updated copyright. * lib/Parse/H.pm (parse_file): Skip functions returning enums. * lib/Parse/H.pm (parse_struct, parse_union): Fixed support for multi-line declarations with comments. Adding a newline at the end if not present. Support multiple levels of pointers. Support the (u)intXXX_t data types. Process comments in invalid or empty declarations. * lib/Parse/H.pm (parse_struct): Stop skipping 'volatile' in comments. * lib/Parse/H.pm (parse_struct, parse_union, _split_decl): Improved joining lines. * lib/Parse/H.pm (_split_decl): Simplified the procedure. * lib/Parse/H.pm, t/z_parse_file.t: Use @_ for subs with many parameters. * Makefile.PL: Put the version in a variable. * lib/Parse/H.pm, t/z*.t, Makefile.PL, README: Updated the copyright and version. 2023-10-23 Bogdan Drozdowski * Version 0.21 Quick fix for tests under Perl without taint support. * lib/Parse/H.pm: Added a command-line, for rpmlint. * t/*.t: Remove "-T" from the command line for Perl without taint support. 2023-10-15 Bogdan Drozdowski * Version 0.20 Many significant improvements and fixes in parsing, especially with structures and unions and their elements. Better parsing typedefs, multiline and multi-variable declarations. Better resistance to the callbacks returning undef. Removing attributes prior to parsing. Improvements and simplifications in tests, reaching 100% coverage. Other small changes and fixes in code and documentation. * lib/Parse/H.pm: Fixed the docs on calling the subroutines. Updated the copyright and version. Deleted the cpanratings.perl.org link (thanks to Peter John Acklam for reporting). * lib/Parse/H.pm (parse_struct): Fixed the expressions for structure names. Fixed infinite loop with "struct {};". Fixed endless loop with struct inside a struct. Fixed endless loop with struct inside a typedef. Modify the structure size only if the element size is a number. Support structure arrays. Added and updated checking for empty or forward structure declarations. Don't do output if skipping an empty structure. * lib/Parse/H.pm (parse_union): Fixed the expressions for union names. Fixed endless loop with union inside a union. Fixed endless loop with union inside a typedef. Modify the union size only if the element size is a number. Support union arrays. Fixed calling structure entry sub instead of union entry. Allow non-digit array sizes in unions. Added checking for empty or forward union declarations. Don't do output if skipping an empty union. * lib/Parse/H.pm (parse_file): Checking if some of the called subroutines return undef. Fixed the expressions when structure or union lines need to be skipped. Fixed parsing typedefs and parsing just variable types. Moved checking for forward or empty structure and union declarations to parse_struct and parse_union. Fixed joining lines with >extern "C"<. Set the next enum value only if the current is a number. Allow enums with negative values. Skip standalone "{" in output. * lib/Parse/H.pm (parse_struct, parse_union): Checking if some of the called subroutines return undef. Use _output_array_entry_size() to process array entries. Support simple 'int' entries. Fixed splitting multiple pointer variable declarations on a single line. Simplified some regexes. Fixed regexes for long ints. Parse all int types before the 'int' type itself. Fixed removing standalone "{" characters. * lib/Parse/H.pm (_output_array_entry_size): A new private subroutine for common code in struct and union array fields. * lib/Parse/H.pm (_remove_attrs): A new private subroutine for removing function and variable attributes from declarations. * lib/Parse/H.pm (parse_struct, parse_union, parse_file): Allow other line endings. Remove function and variable attributes. * t/z_parse_file.t: Simplified resetting and validating the variables. Added many more tests, especially with missing subroutines or ones which return undef. Changed $enum_end_sub returning undef to return and empty string. Added debugging statements. * README: Updated the copyright. Deleted the cpanratings.perl.org link and the plain HTTP links. 2022-10-31 Bogdan Drozdowski * Version 0.11 * t/z_parse_file.t: Added missing imports. 2022-10-17 Bogdan Drozdowski * Version 0.10 Initial version. Parsing structures, unions, enumerations, preprocessor statements, comments, typedefs and external declarations. Accepting configuration hashes. The module was created from utility scripts called CallbackCParse.pl and HParser, for the C header - to - assembly language converters, which currently are a part of Project Asmosis (https://asmosis.sourceforge.io/).