Hello,
Have you seen the patch I sent to Savannah? Maybe useful for you, I just added a "dump" program in the examples dir, but there were some side effects in the src dir, sorry.
Not hoping to be direct patched, but you may see the side effects as more suggestions in your refactoring, ok? Here is a summary:
1 - move Bit_Chain from bits.h to dwg.h (eliminating duplication with Dwg_Chain)
2 - apply LOG_ERROR to "crc todo" messages (many places)
3 - move version_codes[8][7] global variable from commo.c to dwg.c (make it accessible with an api function)
4 - move Dwg_Version_Type from common.h to dwg.h (maybe useful for the library user)
5 - remove Dwg_Data_Type and dwg_var_map from common.h (they are obsolete, heritage from LibDWG).
6 - remove "if (0)" non-reachable code from dwg.spec (that's ugly)
7 - isolate "encode/decode_3dsolid" functions in dwg.spec. My fault: instead of "#ifdef IS_PRINT" edit to "#ifndef IS_PRINT" (not sure if really useful, but it was necessary for me to reuse "dwg.spec" from the new dump program)
Kind regards,
Felipe Castro.