GNU LibreDWG is a free C library to handle DWG files.
LibreDWG is in beta development stage. Not all planned features are yet
completed, but the API should stay mostly stable. At the moment our decoder
(i.e. reader) is done, just some very advanced R2010+ entities fail to read and
are skipped over. The writer is good enough for R1.1 - R2000. Among the example
applications we wrote using LibreDWG is a reader (from dwg, dxf, json), a
writer (convert from dwg, dxf, json or add from scratch), a rewriter (i.e.
saveas), an initial SVG and Postscript conversion, converters from and to DXF
and JSON, dwggrep to search for text, and dwglayer to print the list of layers.