2026-11-28  Reini Urban  <reini.urban@gmail.com>

	Release 0.15
	Updated docs.
	See NEWS

	lint: clang-format

	unknown: log the new solver logs
	with 2m timeout. not yet cross-sample solved

2026-11-28  Reini Urban  <reini.urban@gmail.com>

	decode: check the handles page against the section before its CRC, GHSA-w67w-f2fw-prvj
	read_2004_section_handles and read_2007_section_handles computed the CRC
	of a handles page over hdl_dat.byte - secpos, and then read the 2 CRC
	bytes. A malformed object map advances the cursor past the decompressed
	section, so bit_calc_CRC read past the buffer.

	The reported PoC (from 00472304a) is already fixed by 595d06189, which
	stopped the r2004 handles resync at the end of the buffer. This is the
	second guard, for any other way the cursor leaves the section, and it
	also covers the r2007 reader, which has no such resync fix.

	Reported-by: GHSA-w67w-f2fw-prvj reporter

	* src/decode.c (read_2004_section_handles): Stop with
	  DWG_ERR_VALUEOUTOFBOUNDS when the page plus its CRC exceeds the section.
	* src/decode_r2007.c (read_2007_section_handles): Likewise.

2026-11-28  Reini Urban  <reini.urban@gmail.com>

	dxf: the LTYPE dash text must end in its strings_area, GHSA-37w4-c8mv-7m8f
	The texts of a decoded r2007+ LTYPE point into the 512 byte strings_area,
	and the DXF and DXFB writers convert them with the unbounded
	bit_convert_TU, which scans to a wide NUL. A text without one in the
	area reads past the allocation. c26f6f7c bounded only dwggrep.

	I could not reproduce it from the report. The decoder terminates the
	last 2 bytes of the area since 55442ad1c, so this is the bound the
	writers need anyway.

	Reported-by: GHSA-37w4-c8mv-7m8f reporter

	* src/bits.c (bit_TU_terminated_in_area): New.
	* src/bits.h: Declare it.
	* src/dwg.spec (LTYPE): Write the dash text in DXF only when it ends
	  in the strings_area.

2026-11-28  Reini Urban  <reini.urban@gmail.com>

	in_dxf: do not grow the SAT version of a 3DSOLID past its buffer, GHSA-6c66-qgw3-83w8
	add_3DSOLID_encr() rewrites the SAT version of the decrypted inline
	text to 400 and assumes the first space follows a version of at least 3
	digits. strtol skips leading white space though, so a decrypted text
	starting with a blank has sp at the start, and the memmove by 3 bytes
	wrote up to 3 bytes past the end of acis_data.

	Reported-by: GHSA-6c66-qgw3-83w8 reporter (fuzzing)

	* src/in_dxf.c (add_3DSOLID_encr): Only rewrite when the version field has
	  3 to 6 digits and starts at the beginning of the string.
	  Fix the bound of the "^ " lookahead: i + 1 < total.

2026-11-28  Reini Urban  <reini.urban@gmail.com>

	in_dxf: skip empty 310 preview chunks, GHSA-jqp7-x35p-3wvx
	A 310 value that decodes to zero bytes (invalid hex) made
	add_ent_preview() call realloc (preview, 0) for the first chunk. That
	frees the buffer and returns NULL, the function returned with the freed
	pointer still in the entity: a double free in dwg_free.

	Reported-by: GHSA-jqp7-x35p-3wvx reporter (fuzzing)

	* src/in_dxf.c (add_ent_preview): Skip chunks of length 0.

2026-11-28  Reini Urban  <reini.urban@gmail.com>

	add api: refresh the object pointers across dwg_add_object, GHSA-4cc5-r3qr-m9w3
	dwg_add_object() reallocs dwg->object[] when it is full, so every held
	Dwg_Object* is stale after an add. dwg_add_POLYLINE_* got this in
	3e7b37bcf, these functions did not: dwg_add_VIEWPORT (blkobj across
	dwg_add_VX), dwg_add_LEADER (blkobj and the annotation across
	dwg_add_DIMSTYLE), the seven dwg_add_DIMENSION_* (blkobj across
	dwg_require_DIMSTYLE_Standard), dwg_add_ATTRIB and dwg_add_Attribute
	(the INSERT across the ATTRIB, ATTDEF and SEQEND).

	Reported-by: Mercury-Redstone Research

	* src/dwg_api.c (API_ADD_ENTITY2): Resolve blkobj again. Fixes VIEWPORT,
	  LEADER and all DIMENSION_*.
	  (dwg_add_LEADER): Keep the index of the annotation object.
	  (add_attrib_links): Resolve insobj and attobj again after the SEQEND.
	  (dwg_add_ATTRIB): Resolve the INSERT object after the add.
	  (dwg_add_Attribute): Resolve it after the ATTDEF and ATTRIB adds.

2026-11-28  Reini Urban  <reini.urban@gmail.com>

	examples/unknown.pi: run the field packing solver
	The packing of the fields with several found positions was a TODO. Now
	pack/1 solves it with the picat cp module: no overlaps, the order of the
	fields, and the smallest gaps. It first tries in order, then not in
	order, and takes a quick solution if the optimization times out.

	Fields are searched only in their stream: the handles in the handle
	stream, the strings in the string stream (r2007+), all others in the
	main stream. A match across two streams was bogus.

	* examples/unknown.pi (go): Compute the three stream ranges from the
	  offsets. The result is printed behind "Most probable result:", which
	  make unknown greps for, without the TODO.
	  (stream_range, pack, pack_try, pack_set): New.
	* Makefile.am (unknown): Give picat 1m, not 30s.
	* configure.ac: Add TIMEOUT_60.

2026-11-28  Reini Urban  <reini.urban@gmail.com>

	examples/unknown: no invalid picat for a class without unknown fields
	A class with nothing to pack got "main => go0," without any go0 clause,
	and a "0/0=-nan%" summary. picat 4.0 reports that as
	"SYNTAX ERROR primary expression expected before '.'".

	* examples/unknown.c (close_pi): Write "main => true." without go
	  clauses, and a 0.0% summary for an empty class.

2026-11-28  Reini Urban  <reini.urban@gmail.com>

	make unknown: build common.lo and codepages.lo also
	examples/unknown links src/common.lo and src/codepages.lo, but only
	src/bits.lo was built before. The examples Makefile cannot build the src
	objects: "cannot open dependency file '.deps/../src/common.Tpo'". So
	regen-unknown failed in its last step.

	* Makefile.am (unknown): Build bits.lo, common.lo and codepages.lo in src.

2026-11-28  Reini Urban  <reini.urban@gmail.com>

	configure: check -fno-omit-frame-pointer for --enable-debug
	rcc defines __GNUC__, so ac_compiler_gnu is yes, but it only warns about
	the unknown option. With the -Werror of the build, --enable-debug builds
	with rcc failed: "unrecognized command-line option".

	* configure.ac (--enable-debug): Add -fno-omit-frame-pointer only if
	  the compiler accepts it with -Werror.

2026-11-27  Reini Urban  <reini.urban@gmail.com>

	rpm: add the libplot dependency of dwgplot
	* libredwg.spec: BuildRequires plotutils-devel (libplot and plot.h),
	  and package the dwgplot program and its man page.
	  libredwg.so is 0.0.15.

2026-11-27  Reini Urban  <reini.urban@gmail.com>

	examples: regen-unknown needs a DEBUG_CLASSES build
	The unstable and debugging classes are only decoded with DEBUG_CLASSES,
	so regen-unknown in any other build, like .build-tcc, writes incomplete
	alldxf_*.inc includes. Exit early then, before the old files are moved.
	Also say so when configure found no perl, instead of "No rule to make
	target".

	* examples/Makefile.am (regen-unknown-check): New, check config.h for
	  DEBUG_CLASSES. Required by regen-unknown and full-regen-unknown.
	  (regen-unknown, full-regen-unknown): Error without perl.

2026-11-27  Reini Urban  <reini.urban@gmail.com>

	make regen-dynapi

2026-11-28  Reini Urban  <reini.urban@gmail.com>

	out_dxf: write the stored major/minor of EVALEXPR and BLOCKELEMENT
	The DXF export wrote the constants 98 33 / 99 29 for all objects with an
	AcDbEvalExpr or AcDbBlockElement, instead of the values of the DWG
	(e.g. 27/52, 29/37, 31/125). The DXF roundtrip changed them to 33/29.
	Use the stored values, and the old constants only when they are not set
	(add API, or old DXF without them).

	* src/dwg2.spec (AcDbEvalExpr_fields, AcDbBlockElement_fields): Write
	  evalexpr.major/minor and be_major/be_minor in DXF.

	The expected values of the generated examples/alldxf_*.inc are from DXFs
	written with the old constants (ACSH_SWEEP_CLASS, ACSH_CHAMFER_CLASS,
	BLOCKSTRETCHACTION), they need make full-regen-unknown.

2026-11-28  Reini Urban  <reini.urban@gmail.com>

	decode_r2007: log all objects with -v4
	GH #1585. With -v4 (the prescan) the trace of an r2007 DWG stopped after
	the first object of the rescan. The decoding itself was complete, the
	JSON was identical, only the log went silent: bit_check_CRC syncs the
	global loglevel from dat->opts, and the static obj_dat and hdl_dat of
	the r2007 reader never had their opts set, so the loglevel became 0 at
	the end of the first object. The 2004 reader sets them.

	* src/decode_r2007.c (read_2007_section_handles): Set obj_dat.opts and
	  hdl_dat.opts from dwg->opts.

2026-11-27  Baptiste Teulier  <baptisteteulier@gmail.com>

	in_dxf: Preserve the defined height of ordinary MTEXT
	Handling every MTEXT group 46 as a column height bypasses the existing
	rect_height mapping from GH #135. Restrict the special case to the
	Embedded Object context.

	Check the DXF import in the existing mtext unit test, after its DWG
	checks: missing, zero, nonzero and repeated ordinary group 46 in two
	positions, and an embedded column height alongside the ordinary height.
	The synthetic DXF is read from memory, without a temporary file.

	* src/in_dxf.c (new_object): Limit the MTEXT column-height handler to the
	  embedded object context.
	* test/unit-testing/mtext.c (check_dxf_height, check_dxf_mtext)
	  (test_dxf_height): New.
	  (main): Run the DWG checks, then the DXF group 46 checks.
	* AUTHORS: Add Baptiste Teulier.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-27  Reini Urban  <reini.urban@gmail.com>

	dwgfilter: add examples
	The man page had no examples.

	* programs/dwgfilter.in (help): Add the examples. They end up in the
	  man page, which is generated with help2man.
	* programs/dwgfilter.1: Regenerated.
	* doc/LibreDWG.texi (dwgfilter): Add examples.
	* TODO: Remove the dwgfilter examples item.

2026-11-27  Reini Urban  <reini.urban@gmail.com>

	dwgfilter: fix the -i write-back
	The -i mode wrote back the unmodified temporary json, because the output
	of the updating jq query was only printed, so -i never changed anything.
	The test only checked the exit status.

	* programs/dwgfilter.in: With -i write the jq result back to the json.
	* programs/dwgfilter.test.in: Test 7 checks that the value was changed.

2026-11-27  Reini Urban  <reini.urban@gmail.com>

	TODO: Update
	much more is done now.
	and some plans changed. Just see the issues.

	TODO: drop the done items
	* pre-R13 POLYLINE and VERTEX are decoded and encoded.
	* the proxy graphics decoder (dwg_proxy_graphics) handles MESH, SHELL,
	  LWPOLYLINE, the sub entity colors, layers and model transformations.
	* the DXFIN errors of example_2000 are gone, the indxf leaks of
	  dwgwrite example_2000.dxf are gone (asan with detect_leaks=1).
	* valabind was tried and rejected.
	* the handle code changes of the dxf roundtrip are fixed, GH #1588.
	* update the lists of the unstable classes and of the types without a
	  test DWG.

2026-11-27  Reini Urban  <reini.urban@gmail.com>

	fix the codes of LAYOUT plotview and shadeplot, history_id, unknown_h
	GH #1588. The originals have code 5 for the LAYOUT plotview, 4 for the
	shadeplot (also when given by value), 3 for the 3DSOLID history_id and
	4 for the unknown_h of the r2010 tables. The encoder warned "Expected a
	CODE 4 handle, got a 3" for every history_id.

	* src/dwg.spec (LAYOUT): plotsettings.plotview 5.
	* src/dwg_spec_shared.h (3DSOLID): history_id 3.
	* src/dwg2.spec: unknown_h 4.
	* src/in_dxf.c (dxf_field_hdl_code): shadeplot 4, history_id 3.
	  (new_object): A plotsettings handle given by value is a soft pointer.

2026-11-27  Reini Urban  <reini.urban@gmail.com>

	in_dxf: use the field handle code for handles given by value
	GH #1588. find_tablehandle returns a code 5 ref for every >300 handle
	given by value, so the field specific codes of the generic importer were
	dead code. VPORT.sun (3), ACSH_HISTORY_CLASS.owner (3) and the
	EVALUATION_GRAPH nodes[].evalexpr (3) changed their code in the roundtrip.

	* src/in_dxf.c (dxf_field_hdl_code): New, the code of a generic field.
	  Add sun and the ACSH_HISTORY_CLASS owner, VIEWPORT 340 clip_boundary
	  is a soft pointer (5).
	  (new_object): Use it for handles by value, found or not.
	  (add_EVALUATION_GRAPH): evalexpr is a hard owner (3).
	* src/dwg2.spec: Likewise for ACSH_HISTORY_CLASS.owner and the
	  EVALUATION_GRAPH evalexpr.

2026-11-27  Reini Urban  <reini.urban@gmail.com>

	ASSOCDEPENDENCY: dep_on and node are soft pointers, dep_body hard
	GH #1588. The originals have code 4 for dep_on and node, and 3 for
	dep_body, the spec and the DXF import had them swapped.

	* src/dwg2.spec, src/in_dxf.c (ASSOCDEPENDENCY): Fix the codes.

2026-11-27  Reini Urban  <reini.urban@gmail.com>

	BLOCK_HEADER.entities[] are hard owner handles (3)
	GH #1588. All r2004+ DWG files of AutoCAD and ODA have code 3 for the
	entities[] of a BLOCK_HEADER, we changed them to 4 in the DXF roundtrip.

	* src/dwg.spec (BLOCK_HEADER): HANDLE_VECTOR entities with code 3.
	* src/in_dxf.c: Use code 3 for the BLOCK_HEADER entities, and push a
	  new ref instead of the code 4 last_entity link.

2026-11-27  Reini Urban  <reini.urban@gmail.com>

	in_dxf: header handle vars are hard pointers (5)
	GH #1588. CMATERIAL, INTERFEREOBJVS and INTERFEREVPVS were imported from
	DXF with code 4, the header spec and the originals have 5.

	* src/in_dxf.c (new_header_var): Use code 5.

2026-11-27  Reini Urban  <reini.urban@gmail.com>

	cellstyle: the ltype and text_style handles are hard pointers (5)
	GH #1588. The originals have code 5 for CellStyle borders[].ltype and
	content_format.text_style, the DXF import and the spec used 3, so the
	roundtrip changed them.

	* src/in_dxf.c (add_CellStyle): Use code 5.
	* src/dwg2.spec (CellStyle_fields): Likewise.

2026-11-27  Reini Urban  <reini.urban@gmail.com>

	dwg_find_tablehandle: do not alias the control entry for LTYPE vars
	GH #1588. The header vars LTYPE_BYLAYER, LTYPE_BYBLOCK and LTYPE_CONTINUOUS
	were set to the LTYPE_CONTROL entry's own handleref (code 2), so a DXF
	roundtrip wrote (2.1.16) instead of (5.1.16) for LTYPE_CONTINUOUS.

	* src/dwg.c (dwg_find_tablehandle_silent): Add a new code 5 handleref.

2026-11-26  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Remove unknown_short_1 from LEADER entity in AC1015 and later

2026-11-26  Reini Urban  <reini.urban@gmail.com>

	dxf: fix dxf r11 roundtrip losses
	EED APPID.1, the appid index as 1001 app name was missing in outdxf.
	the r11 decoder missed to overwrite some 0 handles.
	This fixes entity loss with ./dxf-check r11/ACEB10

2026-11-26  aichen2017  <34705061+aichen2017@users.noreply.github.com>

	DXF: preserve widths and bulge on ordinary 2D vertices
	rurban: removed the test

2026-11-26  Reini Urban  <reini.urban@gmail.com>

	DXF: export r2007+ $CMLSTYLE as UTF-8, not raw TU
	HEADER_HANDLE_NAME0 printed the resolved table record name directly
	with fprintf %s. For r2007+ DWGs MLINESTYLE.name is a TU wide string
	("S\0T\0A\0..."), so %s stopped at the first embedded NUL and
	$CMLSTYLE was exported as "S" instead of "STANDARD". The deferred
	name resolution in dxf2dwg then failed, and the re-encoded DWG lost
	the CMLSTYLE handle ((5.0.0) instead of (5.1.13)).

	Route the resolved-object path through dxf_cvt_tablerecord(), which
	converts TU to UTF-8 like FIELD_HANDLE_NAME already does. Also free
	the dwg_handle_name() fallback result whenever it was allocated; the
	old code leaked it when _o0 resolved with a mismatched dxfname.

	Found by dxf-check on test/test-data/2010/5151-024.dwg, regressed
	with 23e9d5517 (r11 DXF roundtrips).

	* src/out_dxf.c (HEADER_HANDLE_NAME0): use dxf_cvt_tablerecord for
	  the object path; always free the dwg_handle_name() result

2026-11-26  aichen2017  <34705061+aichen2017@users.noreply.github.com>

	DXF: delimit named FIELD child values and the result in R2007+
	rurban: removed the test

	DXF: export the packed entity transparency in group 440
	rurban: Removed the test

	JSON: preserve the sign of integer AcDbTableValue values
	rurban: Removed the unit-test

	DXF: retain explicit zero lineweight on R2000+ layers
	rurban: Removed the unit-test

2026-11-26  Saddam  <saddamr3e@gmail.com>

	spec: terminate the r2007+ LTYPE dash texts in strings_area
	The r2007+ dash texts are UCS-2 pointers into the 512-byte strings_area,
	which bit_read_TF terminates with a single 0 byte only. A text running to
	the end of the area had no 0 unit, so the DXF and DXFB writers read past
	the buffer in bit_convert_TU and wrote the heap bytes they found into the
	output. Clear the last unit of the area. In a valid area it is already
	0, as the terminator of the last text or padding.

	No test: it needs a crafted r2007+ DWG fixture. DXF output of the
	in-tree r2007+ DWGs is unchanged.

	* src/dwg.spec (LTYPE): Terminate the last UCS-2 text in the r2007+
	  strings_area on decode.

2026-11-25  Reini Urban  <reini.urban@gmail.com>

	Fix TABLECONTENT row cell count validation
	* src/dwg2.spec (TABLECONTENTs_fields): Use checked REPEAT2 for row
	cells to validate the count and handle allocation failure.

	Fixes GHSA-9c75-6gmh-hrgq, reported by r1ck9-1208
	CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
	CWE-476

2026-11-25  Reini Urban  <reini.urban@gmail.com>

	out_json: bound the TF terminator scan by the buffer length
	* src/out_json.c (json_write_TF): Do not scan beyond len when finding
	the first NUL. TF buffers need not be NUL-terminated.
	* test/unit-testing/encode_test.c (json_tf_bounds_test): Cover an exact
	one-byte unterminated allocation and zero-length input.
	* test/unit-testing/Makefile.am (encode_test_LDADD): Link out_json.lo
	for the focused regression.

	Verified: ASan/UBSan encode_test passes.

	Fixes GHSA-w3wx-hf3h-g6w6
	CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:H
	CWE-125
	Reported-by: r1ck9-1208

2026-11-25  Reini Urban  <reini.urban@gmail.com>

	decode: preserve section page pointers when growing the section map
	* src/decode.c (add_section): Rebase borrowed section-info page pointers
	before freeing the old section map. Preserve the allocation on failure.
	* test/unit-testing/decode_test.c (section_growth_test): Check borrowed
	page pointers and null entries after section-map growth.

	Verified: ASan decode_test passes with source fixtures.

	GHSA-h5w9-qxj8-jhxp
	CVE: pending
	CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:H

	Reported-by: jhtrace

2026-11-25  Reini Urban  <reini.urban@gmail.com>

	Fix dwg_fixup_viewport_ids null-deref
	reported as GHSA-wx7x-5fxx-g3j2 by r1ck9-1208
	CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
	CWE 476  NULL Pointer Dereference

	in_dxf: Refresh pointers after adding BLOCK_HEADER
	Fixes ossfuzz 587962393 Heap-use-after-free READ 8

2026-11-25  Reini Urban  <reini.urban@gmail.com>

	indxf: read the group 30 elevation of 2D POLYLINE entities
	POLYLINE_2D.elevation has no DXF group code in dwg.spec; on export it is
	folded into the z of the group-10 point. The importer therefore skipped
	group 30 and the elevation was lost (0). Read it explicitly, as the
	Autodesk POLYLINE DXF reference documents group 30 as the elevation.

	* src/in_dxf.c (new_object): A group 30 of a POLYLINE_2D sets its
	  elevation.

	Reported-by: Baptiste Teulier (BaptisteT31)

2026-11-25  Reini Urban  <reini.urban@gmail.com>

	dwgplot: expand \U+XXXX and MIF \M+nXXXX escapes to UTF-8
	The labels were plotted with the raw escape sequences. libplot escapes
	&<> for SVG itself, but the \U+ and \M+ sequences need a real expansion.

	* programs/dwgplot.c (put_label): strdup the label and bit_u_expand it
	  before utf8_to_latin1.
	* programs/escape.c (mtext_plaintext): keep a valid \M+nXXXX escape
	  intact, as for \U+XXXX, so it survives for the expander.
	* src/bits.h (bit_u_expand): export it for the programs.
	* src/bits.c (bit_u_expand): an unconvertible \M+ code (uc 0) wrote a
	  NUL byte and so truncated the rest of the string; drop the escape
	  instead.

	(cherry picked from commit 407a59b52795149f21f0aa18f5fe1bb3b2a8b31f)

2026-11-25  Saddam  <saddamr3e@gmail.com>

	escape: XML-escape the expanded ASCII \U+ chars in mtext_escape_line
	mtext_escape_line wrote an expanded \U+XXXX code point straight into the
	SVG, past the XML escaping, so an MTEXT \U+003Cscript\U+003E in a DWG
	gave a live <script> element in the dwg2SVG output.

	* programs/escape.c (mtext_escape_line): Escape an expanded code point
	  below 0x80 like the literal char.

2026-11-25  Reini Urban  <reini.urban@gmail.com>

	decode: trace the real rcount3 and rcount4 indices, GH #1053
	* src/logging.c, src/logging.h (trace_idx_name): Substitute [rcount3]
	  and [rcount4] too, with two new arguments.
	* src/dec_macros.h: Pass rcount3 and rcount4. The generic REPEAT
	  decoders declare them with an initial 0, as MSVC rejects reading
	  uninitialized ones.
	  (VALUE_HANDLE): Log the name through LOG_TRACE_NM instead of the
	  mallocing format_field_name, which knew only rcount1 and rcount2.
	* src/decode.c, src/decode2.c, src/decode_r11.c: Declare the new
	  globals next to rcount1 and rcount2.
	* src/decode_r2007.c: Add rcount3 and rcount4 to the section decoders.

2026-11-24  Reini Urban  <reini.urban@gmail.com>

	decode: trace the real indices in all field names, GH #1053
	* src/dec_macros.h (TRACE_NM, LOG_TRACE_NM): New. Log the field name
	  with the indices of the enclosing vectors and REPEATs.
	  (FIELD_G_TRACE, FIELD_TF*, FIELD_CMC, FIELD_ENC, VALUE_HANDLE*, ...):
	  Use it, so that no [rcount1] is printed literally anymore.
	* src/decode*.c: Declare vcount where the trace macros need it.

2026-11-24  Reini Urban  <reini.urban@gmail.com>

	decode: trace the real indices of vector elements, GH #1053
	The DWG trace printed the loop variable names instead of the indices,
	e.g. "pts[vcount]: (34.5, 4.5) [2RD 1011]", and the sub-vectors
	"indexes: { 1 2 }" without the owner.

	* src/dec_macros.h (trace_idx_name): New helper. Replaces [vcount],
	  [rcount1] and [rcount2] in a field name by the actual indices.
	  (FIELD_VEC_TRACE_N, FIELD_2PT_TRACE, FIELD_3PT_TRACE): Use it, without
	  the strrplc allocations.
	  (SUB_FIELD_VECTOR, SUB_FIELD_VECTOR_N, SUB_FIELD_VECTOR_INL): Log the
	  owner path with the indices, and the count.
	* src/decode.c, src/decode_r11.c: Declare vcount in the header variables
	  and preR13 DIMENSION decoders, as the trace macros use it now.

	Now: pts[0]: (34.5, 4.5) [2RD 1011], hdls[0].indexes (2): { 1 2 } [*BL 94]

2026-11-24  Reini Urban  <reini.urban@gmail.com>

	free: free the VBA_PROJECT as the stable fixed type it is
	VBA_PROJECT is a stable fixed type (DWG_TYPE_VBA_PROJECT 0x51), not a
	class. But dwg_free_object and dwg_free_object_private only had its case
	under the never defined DEBUG_VBA_PROJECT. So it was freed by the default
	branch as a variable class: "No class for VBA_PROJECT type 81 found", and
	as an unknown object, which does not free its data. An import from DXF or
	JSON leaked them.

	* src/free.c: remove the DEBUG_VBA_PROJECT guards, the generated
	  dwg_free_VBA_PROJECT exists.
	* src/dwg2.spec (VBA_PROJECT): free the data also with a version before
	  r2000, the block with the data is SINCE r2000b, but an import from DXF
	  allocates them for any version.
	* programs/alive.test.in: dxf2dwg of sample_r14.dxf with a VBA_PROJECT
	  added.

	12 bytes leaked and the warning gone with ASan. make -j4 check passes.

2026-11-24  Reini Urban  <reini.urban@gmail.com>

	in_dxf: reconcile the size of a binary 310 field
	GH #1564. The size of a binary TF field, 93 in bits for
	PROXY_OBJECT.data_numbits or 90 in bytes for VBA_PROJECT.data_size, has
	a pair of its own, before or after the 310 chunks. The encoders write the
	data by that size, so a 93 above the data overread it (ASan heap overflow
	in bit_write_bits, dwg_encode_PROXY_OBJECT_private).

	* src/in_dxf.c (dxf_reconcile_binary_size): called once the pairs of an
	  object are read, so the order of the pairs does not matter. An absent
	  size is derived from the data, a size which does not match the bytes
	  of the chunks drops the data with an error. The reversal of the last
	  partial byte of a size in bits moved here, as it needs the final size:
	  it was skipped when the 93 came after the 310.
	* programs/alive.test.in: dxf2dwg of sample_r14.dxf with the 93 of its
	  first ACAD_PROXY_OBJECT raised to 61000.

	Reported as PR #1564 by saddamr3e, implemented without looking at the
	patch. Reproduced with ASan: the 93 of 610 raised to 61000 crashed, now an
	error and the data dropped. The 93 after the 310, and an absent 93, give
	the same objects as the original, 616 bits for the absent one. make -j4
	check passes. A VBA_PROJECT with 90 of 60000 and 5 bytes of 310 is dropped
	too.

2026-11-24  nameloCmaS  <namelocmas@gmail.com>

	downconvert_DIMSTYLE: no guessed DIMJAG/DIMTALN EED
	* src/downconvert.c (downconvert_DIMSTYLE): Remove the
	ACAD_DSTYLE_DIMJAG and ACAD_DSTYLE_DIMTALN APPIDs and EED, whose
	values were guesses. AutoCAD cannot open a file whose DIMSTYLE has
	this EED, and AutoCAD LT 2027 writes neither the EED nor the APPIDs
	when saving to r2000.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-24  nameloCmaS  <namelocmas@gmail.com>

	BLOCKLOOKUP*: the subclass markers spelled LookUp
	* src/dwg2.spec (BLOCKLOOKUPGRIP, BLOCKLOOKUPPARAMETER): Subclass
	markers AcDbBlockLookUpGrip and AcDbBlockLookUpParameter, as AutoCAD
	writes them. The CLASSES section keeps "Lookup".
	* src/dynapi.c: Regenerated.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-24  nameloCmaS  <namelocmas@gmail.com>

	dwg_write_file: unmap before ftruncate
	* src/dwg.c (dwg_write_file): Unmap the file before shrinking it.
	Windows cannot change the size of a file with a mapped view, so
	ftruncate failed and the DWG kept the zero padding of the mapping.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-24  nameloCmaS  <namelocmas@gmail.com>

	SORTENTSTABLE: write the block owner as DXF 330
	* src/dwg2.spec (SORTENTSTABLE): DXF 330 for block_owner, the model
	or paper space block whose entities are sorted.
	* src/dynapi.c, doc/dynapi.texi: Regenerated.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-24  nameloCmaS  <namelocmas@gmail.com>

	DXF: no 52 in a rotated dimension for 0.0
	* src/dwg.spec (DIMENSION_LINEAR): Write the oblique_angle 52 only
	when non-zero, as dim_rotation 50.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-24  nameloCmaS  <namelocmas@gmail.com>

	bits: empty T and r2007+ TU strings without a NUL
	* src/bits.c (bit_write_T): Write an empty string as length 0,
	without a NUL.
	(bit_write_TU): Do not count or write a terminating NUL.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-24  nameloCmaS  <namelocmas@gmail.com>

	encode: TU strings of r2007+ drawings in pre-r2007 TV fields
	* src/enc_macros.h (FIELD_TV): Convert a TU string of an r2007+
	source with bit_write_T for a pre-r2007 target.
	(FIELD_T16): Write a TU string as 8-bit chars for a pre-r2007 target.
	* src/encode.c (encode_classes): Write appname and cppname with
	bit_write_T.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-24  nameloCmaS  <namelocmas@gmail.com>

	LAYER: keep a written material
	* src/dwg.spec (LAYER): In the encoder, clear the material only when
	it does not resolve to a MATERIAL.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-24  Reini Urban  <reini.urban@gmail.com>

	cmake: build dxfwrite
	alive.test runs dxfwrite for all write versions. linux-cmake runs the
	tests now, and failed with 210 dxfwrite failures, as CMake did not build
	it, only autotools.

	* CMakeLists.txt: dxfwrite with the other writers.

	alive.test passes with cmake in the source tree as on CI.

2026-11-23  Reini Urban  <reini.urban@gmail.com>

	cmake: no examples with MSVC
	The examples need unistd.h and getopt.h, which MSVC lacks: the vs2019 and
	vs2019-ninja jobs failed with C1083 on examples/dwgadd.c.

	* CMakeLists.txt: build the examples only if not MSVC.

2026-11-23  Reini Urban  <reini.urban@gmail.com>

	dwgplot: draw the ignored entities
	GH #229.

	* programs/dwgplot.c: TRACE, ATTRIB (with their INSERT), ATTDEF, MINSERT
	  arrays, TOLERANCE, POLYLINE_3D, POLYLINE_MESH, POLYLINE_PFACE, LEADER with
	  its arrow, MULTILEADER lines, doglegs and text, MLINE with the elements
	  of its style, TABLE grids and cell text, HATCH boundaries (solid ones
	  filled, as compound path, with the holes), HELIX, MESH, IMAGE, WIPEOUT,
	  UNDERLAY and OLE2FRAME frames, 3DLINE, the wireframe cache of 3DSOLID,
	  REGION, BODY and the *SURFACEs. All DIMENSIONs and ARC_DIMENSION draw
	  their generated *D block. TEXT, ATTRIB and ATTDEF honour the
	  alignments, %%d %%p %%c %%nnn codes, and write the Latin Extended-A
	  letters as their ASCII letter. SOLID corners 3 and 4 are swapped as in
	  the DXF, no bowtie anymore.
	  VIEWPORT, the preR13 block markers, LIGHT and UNKNOWN_ENT are silently
	  not graphical. Still ignored: SHAPE, which needs its shx font, and the
	  old r13 OLEFRAME.
	* programs/alive.test.in: libplot leaks its parameters, no leak check
	  under asan.
	* doc/LibreDWG.texi: what is drawn.

	Of the 403 sample drawings none crashes, and valgrind finds only the
	libplot leaks. Dimensions, hatches, leaders, tables and a multileader were
	checked in svg, rendered to png. Not drawn: hatch patterns, the contents of
	viewports, merged table cells, rich MTEXT.

2026-11-23  Reini Urban  <reini.urban@gmail.com>

	dwg_style_font_file: do not free what bit_TV_to_utf8 did not copy
	bit_TV_to_utf8 may return its argument. dwg_style_font_file then returned
	a pointer into the EED or STYLE, which the caller frees: invalid free on
	r13/Leader.dwg, MLeader.dwg and Text.dwg, found by dwgplot.

	* src/dwg.c (dwg_style_font_file): strdup the result if it is the source.

2026-11-23  Reini Urban  <reini.urban@gmail.com>

	doc: fix the duplicate dwgplot anchor
	* doc/LibreDWG.texi: the dwgplot item belongs into the table of the
	  programs, after dwg2ps, not into the examples. Drop the "Planned" text.

	makeinfo builds it without warnings.

2026-11-23  Reini Urban  <reini.urban@gmail.com>

	dwgplot: convert a DWG with libplot
	GH #229. dwgplot is dwg2SVG with the output of GNU plotutils libplot
	instead of the SVG text: png, pnm, gif, svg, ps, ai, cgm, fig, pcl, hpgl,
	regis, tek, or the plot(5) meta format for plot(1).

	* programs/dwgplot.c: the entities of dwg2SVG on the libplot path
	  functions (lines, arcs, Beziers, ellipses, labels). INSERTs use the
	  libplot coordinate transformation, nested with savestate. The first pass
	  measures the extents of what is drawn, as the extents in the header
	  are often wrong, the second pass draws in a square space of that size.
	  XLINE and RAY are clipped to the extents.
	* configure.ac, programs/Makefile.am: build dwgplot with libplot and
	  plot.h (no pkg-config file exists). --enable-release errors without.
	* CMakeLists.txt: dwgplot, and the examples dwgadd, dwg2svg2, load_dwg
	  and dwgfuzz. The dwgfilter script for dwgfilter.test, which was not
	  there, configured as executable (needs cmake 3.19).
	* .github/workflows/main.yml: libplot-dev and plotutils in the Linux jobs
	  and macOS. linux-cmake builds the programs and examples now, and runs
	  their tests.
	* programs/alive.test.in: dwgplot -T ps, svg and png.
	* dwg2SVG and dwg2ps are deprecated in their help, doc/LibreDWG.texi and
	  NEWS, to be replaced by dwgplot.
	* programs/dwgplot.1, NEWS, doc, .gitignore.

	Tested with .build-plot (gcc -Werror): the Ceco and libereco drawings in
	svg, png, ps, hpgl and meta, 61 sample drawings without a crash, alive.test,
	configure --enable-release with and without libplot, and cmake with all
	13 ctest tests. Not tested: MSVC, mingw, macOS, text with non-Latin1.

2026-11-23  Reini Urban  <reini.urban@gmail.com>

	README: how to install GNU plotutils (libplot) for dwgplot

2026-11-23  Reini Urban  <rurban@cpan.org>

	WIP add dwgplot
	deprecate dwg2SVG, dwg2svg2 and dwg2ps.
	instead use GNU Plotutils to create several vector and bitmap formats.
	This can tesselate, clip, fill bounded regions, and supports most output
	formats, even pcl/5 and hpgl/2.

2026-11-23  Reini Urban  <reini.urban@gmail.com>

	ci: more time and check-less for the --enable-release job
	The release job was canceled after 50 minutes, the job timeout-minutes, in
	the middle of the dist tarball. The step timeout-minutes 65 did not apply.

	* .github/workflows/main.yml (linux): 90 minutes for --enable-release,
	  and --enable-check-less for its check, as for distcheck.

2026-11-23  Reini Urban  <reini.urban@gmail.com>

	ci: distcheck with --enable-check-less, except for tags
	The linux --enable-release distcheck timed out. --enable-check-less sets
	CHECK_MINIMAL for the programs, examples and unit-tests.

	* .github/workflows/main.yml: Pass DISTCHECK_CONFIGURE_FLAGS=
	  --enable-check-less to make distcheck, unless it is a release tag.

2026-11-23  Reini Urban  <reini.urban@gmail.com>

	alive.test: skip the --as tests in examples/
	make check in examples/ runs this alive.test with its own PROGS, which have
	no dwgwrite, dwgrewrite, dxf2dwg, dwg2dxf and dxfwrite. 1080 failures with
	linux (CC=clang) and macOS.

	* programs/alive.test.in: Do not run the --as loop in the examples/ dir.

2026-11-23  Reini Urban  <reini.urban@gmail.com>

	in_dxf: fix -Werror=type-limits with mingw32
	A 32-bit size_t or preview_size is never >= the 64-bit MAX_SIZE_BUF.

	* src/in_dxf.c (add_proxy_entity_data, add_preview): Drop the compare
	  with MAX_SIZE_BUF, the 16MB limit is lower anyway.

2026-11-23  Reini Urban  <reini.urban@gmail.com>

	encode: downconvert sections and pface faces to r10/r11
	dwgrewrite --as=r10 of r2004+ failed with "Too many sections: 30", and
	--as=r11 with "offset -16" at the polyface mesh face vertices.

	* src/dwg.c (dwg_sections_init): Reset the section counts of a R13+
	  source for a pre-R13 target.
	* src/encode.c (encode_preR13_entities): A VERTEX_PFACE_FACE from a R13+
	  source needs the flag, the 4 indices and no x, y, as
	  dwg_add_VERTEX_PFACE_FACE() sets them.

2026-11-23  Reini Urban  <reini.urban@gmail.com>

	encode: write the pre-R13 tables from a R13+ source
	dwgrewrite --as=r2.0 ... r11 of a R13+ DWG wrote tables which the
	decoder rejected ("Wrong STYLE.number 1 or size 13", "LTYPE.size
	overflow"). 53 of 150 alive.test runs failed, now 9 (r10, r11 only).

	* src/encode.c (encode_preR13_section): Use the table sizes, not the
	  obj->size of the R13+ object, for the control and the records. Count only
	  the records which are written (preR13_table_number), and take them from
	  the control entries[], not by position (preR13_table_object). No
	  *Model_Space and *Paper_Space in the BLOCK table (preR13_block_wanted).
	  Trust objid_r11 only for pre-R13 sources.
	  (calc_preR13_ctrl_size): The STYLE record has 130 bytes before r2.4, as
	  it has no bigfont_file.

2026-11-23  Reini Urban  <reini.urban@gmail.com>

	dwg_model_space_ref: find the model space by its standard handle
	dxf2dwg --as=r1.4 ... r11 of example_r14.dxf failed to encode with
	DWG_ERR_INVALIDDWG, without a message. The r14 example names its model
	space BLOCK_RECORD 1F "*U", so the DXF import had no BLOCK_CONTROL
	model_space ref, and downconvert_LWPOLYLINE found no model space.

	* src/dwg.c (dwg_model_space_ref): Fall back to the BLOCK_HEADER with the
	  standard handle 0x1F for R13+ sources, and set BLOCK_RECORD_MSPACE.
	* src/downconvert.c (lwpolyline_to_polyline): Log the missing model or
	  paper space.

2026-11-23  Reini Urban  <reini.urban@gmail.com>

	alive.test: skip the --as tests with check-minimal
	* programs/alive.test.in: The 5 programs times 15 revisions times all data
	  files are too slow for CHECK_MINIMAL.

	Use this for appveyor, as it runs now in the 1hr timeout

2026-11-23  Reini Urban  <reini.urban@gmail.com>

	Fix dwgwrite/dxf2dwg --as leaks, enable down/upconvert tests
	When encoding to another version than the source, the encoder allocates
	strings which the source version does not have. free uses from_version,
	so it skipped them.

	* src/dwg2.spec (Rowstyle_fields): Free rs.format_string for all
	  versions (TABLESTYLE, --as=r2007 from older).
	* src/insert.spec: Free block_name for all versions (--as=r1.4 from
	  later versions).
	* programs/alive.test.in: Add r2004, r2007, r2010, r2013, r2018 to
	  WRITE_REVS and enable the dwgwrite, dwgrewrite, dxf2dwg, dwg2dxf and
	  dxfwrite --as tests again.

2026-11-23  Saddam  <saddamr3e@gmail.com>

	in_dxf: don't let a surface profile size outgrow its 310 data
	The sweep and revolve profiles of EXTRUDEDSURFACE, REVOLVEDSURFACE,
	SWEPTSURFACE, the ACSH sweep, extrusion and revolve classes and the
	ACSH_LOFT_CLASS profiles are a size in bits (90, for the loft 94/97) and
	the 310 data. The size was only clamped to the data when the 310 run
	arrived, so a size group after the run was taken as given. The encoder
	then copied up to 64 KiB past the heap buffer into the DWG: ASan
	heap-buffer-overflow READ in bit_write_TF via
	dwg_encode_EXTRUDEDSURFACE_private, also via the REVOLVEDSURFACE,
	SWEPTSURFACE and ACSH_SWEEP_CLASS encoders.

	No testcase: it needs a crafted DXF. Reproducer: add a "90 524288" pair
	after the AcDbExtrudedSurface 310 run of test/test-data/2004/Surface.dxf
	and run dxf2dwg --as r2007.

	* src/in_dxf.c (dxf_acsh_sweep_size, dxf_surface_size): After its data,
	  do not raise the size above the clamped value.
	  (new_object): Likewise for the ACSH_LOFT_CLASS profile size.

2026-11-23  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix POINTCLOUDCOLORMAP for class version = 4

	Fix parsing of UMC

2026-11-23  Reini Urban  <reini.urban@gmail.com>

	examples: guard HAVE_UNISTD_H for msvc

	ci: update the pinned actions with pinact run -u
	* .github/workflows/cifuzz.yml: google/oss-fuzz actions, upload-artifact
	  v7.0.2.
	* .github/workflows/codeql-analysis.yml: codeql-action v4.39.4.
	* .github/workflows/main.yml: ccache-action v1.2.26, setup-python v7.1.0,
	  setup-msys2 v2.34.0, action-gh-release v3.0.4, upload-artifact v7.0.2.
	* .github/workflows/oda.yml: ccache-action v1.2.26, setup-python v7.1.0.

2026-11-23  Reini Urban  <reini.urban@gmail.com>

	in_json: fix leaks of objects without type, reject huge eed size
	Fixes oss-fuzz 589206481 (llvmfuzz json_eed). The null-deref itself was
	fixed already with 0443a3dff, the remaining reports were leaks.

	dwg_free_object selects the destructor by fixedtype, which only the
	type key sets. An object without type, esp. the last one in the array,
	which the loop never checked, kept fixedtype UNUSED, and its payload and
	eed leaked.

	* src/in_json.c (json_free_partial_object): New. Derive fixedtype from
	  the object name before dwg_free_object.
	  (json_OBJECTS): Use it for the skipped previous objects, and check the
	  last object after the loop.
	  (json_eed): Reject eed size > 0xFFFF, which overflowed the calloc size
	  or the int have counter.

2026-11-23  Reini Urban  <reini.urban@gmail.com>

	dwggrep: add -R, -r, --recursive
	GH #1135. A directory argument is walked for *.dwg files, sorted, with
	the directory names as filename prefix. Without a path -R searches the
	cwd. Symlinked directories are not followed, nesting is limited to 64.
	A named file is searched whatever its extension.

	* programs/dwggrep.c: grep_file is the old per-file loop body,
	  grep_path walks the directories with opendir/readdir (POSIX, mingw)
	  or _findfirst (MSVC).
	* programs/alive.test.in: -R in a temp tree with .DWG, a subdir and a
	  non-dwg file gives the same count as the files named.
	* NEWS, doc/LibreDWG.texi.

	Tested with .build-asan (alive.test, a tree with a symlink loop and an
	empty dir) and the mingw64 dwggrep.exe under wine. The MSVC branch is
	not compiled locally.

2026-11-23  Reini Urban  <reini.urban@gmail.com>

	Add dwg_style_font_file
	GH #312. A TrueType STYLE with a non-ASCII font name (SimHei) has an
	empty font_file, its typeface and flags are only in the ACAD EED.

	* src/dwg.c, include/dwg.h: new dwg_style_font_file returns the
	  font_file, or if empty the typeface of the ACAD EED, as new UTF-8
	  string, and optionally the ttf flags (EED 71).
	* NEWS.

	The Text.dwg of GH #312 gives arial.ttf 0x22 for Standard and Annotative
	and SimHei 0x8631 for FS. make -j4 check passes. No unit test added.

2026-11-23  nameloCmaS  <namelocmas@gmail.com>

	encode_test: the r2004 container as AutoCAD writes it
	Walks the r2004+ container of AutoCAD's files in test-data
	(example_2004 - example_2018, AutoCAD 2018's saves, and 2013/Arc,
	AutoCAD 2013's, with gaps) and of the encoder's output of the same
	drawings, also r2018 saved as r2004 and r2010. The sections are read
	with decompress_R2004_section, byte by byte, so the checks do not
	depend on the host's endianness:

	- bytes 0xEC..0xFF of the file header are the magic sequence;
	- the encoder writes no gaps and no gap tree;
	- the empty section 0 is first in the section map;
	- AcDb:Classes: the size counts the bytes after the size words, the
	  r2010+ high size word is 0, then the CRC, the end sentinel and 8 zero
	  bytes;
	- AcDb:AcDbObjects starts with 0x0dca;
	- AcDb:Handles pages are at most 2032 bytes, each with its CRC;
	- the encoder's output is read back with all its objects.

	maint_version and app_maint_version are 0xff in AutoCAD LT 2027's save
	to an older release (2007/block_acad2027.dwg) and in the encoder's
	r2004 - r2013 output of an r2018 drawing, not in its r2018 output.

	AutoCAD's files pass all checks. With master's encoder 10 of the 17 new
	checks fail, every rule at least once.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-23  nameloCmaS  <namelocmas@gmail.com>

	encode: r2004 file header and section map as AutoCAD writes them
	- no gap tree: the pages are written without gaps;
	- the empty section 0 first in the section map;
	- the section info of every written section type;
	- the bytes 0xEC..0xFF of the header from the magic sequence;
	- maint_version and app_maint_version 0xff when saving to an older
	  release (r2004-r2013), as AutoCAD does.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-23  nameloCmaS  <namelocmas@gmail.com>

	encode: r2004+ objects section start and handle map pages
	The AcDbObjects section starts with RL 0x0dca (ODA spec 20) and the
	object map offsets count from the section start; the handle map
	pages hold at most 2032 bytes (0x7F0 with the size field), as
	AutoCAD writes them.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-23  nameloCmaS  <namelocmas@gmail.com>

	encode: r2010+ classes section size words
	With the r2010+ high size word (maint_version > 3, and r2018+) the
	size excludes that word, as in the header section, and the high
	word holds the high 32 bits of the bit size, not a byte size.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-22  Reini Urban  <reini.urban@gmail.com>

	ci: use ccache for mingw and make distcheck
	* .github/workflows/main.yml: mingw: install the msys2 ccache, cache its
	  dir with actions/cache and configure with CC="ccache gcc".
	  distcheck: set CCACHE_BASEDIR and CCACHE_NOHASHDIR, so that compiles in
	  the distcheck build dirs hit the cache of the normal build (the
	  ccache-action was already enabled for the --enable-release job).

	Not run on CI yet.

2026-11-22  Reini Urban  <reini.urban@gmail.com>

	free: free R13+ objects in a preR13 dwg
	A DXF without a version is read as preR13, but may contain R13+ classes
	(ARC_DIMENSION, BLOCKMOVEACTION, ...). free_preR13_object logged
	"Unhandled preR13 class" and leaked the object and its entity struct.
	Found with the OSS-Fuzz 589206476 testcase.

	* src/free.c (free_preR13_object): return 0 for a non-preR13 class, and
	  dwg_free_object then frees it with the generic destructors.

	The testcase leaks nothing now, make -j4 check passes.

2026-11-22  Reini Urban  <reini.urban@gmail.com>

	out_dxf: only follow the entity links of entities
	OSS-Fuzz 589206476: SEGV in dxf_process_VERTEX_MESH. The chain walk of
	the vertices and attribs read o->tio.entity of any object. For a
	non-entity (a dropped or invalid DXF object) that reads the object as
	entity, and its next_entity is garbage.

	* src/out_dxf.c (decl_dxf_process_VERTEX, decl_dxf_process_INSERT): use
	  the entity only if o->supertype is DWG_SUPERTYPE_ENTITY.

	The testcase no longer crashes, make -j4 check passes. It still leaks
	944 bytes in new_object (ARC_DIMENSION, BLOCKMOVEACTION), as before
	this change.

2026-11-22  Reini Urban  <reini.urban@gmail.com>

	encode preR13: keep the flags_r11 of the CONTROL objects
	GH #758. Importing JSON or DXF did not set the flags_r11 of the header
	section tables, so the encoder computed them: r2.10 files lost their
	0x8010 and got 0x800f.

	* src/encode.c (ENCODE_CTRL_TO_TABLE): use the flags_r11 of the CONTROL
	  object before calculating them.

	DWG -> JSON -> DWG -> JSON of the r2.10 block and entities samples now
	keeps the flags_r11; all the other preR13 samples (r1.4, r2.6, r9, r10,
	r11) were unchanged. make -j4 check passes.

2026-11-22  Reini Urban  <reini.urban@gmail.com>

	in_dxf: find the object type by hash, not by name compares
	GH #912. new_object compared the DXF name with every entity and object
	name of objects.inc, about 205 strcmp per object, which was 15% of the
	whole dxf2dwg run.

	* src/in_dxf.c (new_object): look up the type with the gperf
	  dwg_object_name and switch over the DWG_TYPE_ of objects.inc.

	dxf2dwg, -O0, 2013/flipped.dxf 11.3s -> 6.7s, 2007/colorwh.dxf
	2.2s -> 1.4s. make -j4 check passes. No older baseline was measured, so
	this does not show whether there was a regression.

2026-11-22  Reini Urban  <reini.urban@gmail.com>

	SORTENTSTABLE: bound num_ents by the object size
	GH #394. A SORTENTSTABLE with 69415 entries (555340 bytes) was rejected
	by the fixed limit of 50000, which lost the whole draw order of that
	block in the DXF.

	* src/dwg2.spec: on decode limit num_ents by obj->size, as each handle
	  takes at least one byte, instead of by 50000.
	* src/decode_r2007.c: an r2007 section map entry without pages is
	  normal, trace it instead of an ERROR.

	The sample of GH #394 now writes all sort entries (DXF grows by 1.8 MB)
	and has no ERROR. make -j4 check passes.

2026-11-22  Reini Urban  <reini.urban@gmail.com>

	geojson: write the crs, WGS 84 by default
	GH #1197. The GeoJSON had no coordinate reference system, so GIS tools
	had to guess one.

	* src/out_geojson.c: write the "crs" member (GeoJSON 2008 spec) of the
	  FeatureCollection: WGS 84 as CRS84 (urn:ogc:def:crs:OGC:1.3:CRS84,
	  longitude, latitude) by default, which the RFC 7946 also assumes. A
	  GEODATA with an EPSG:NNNN in its coordinate system definition
	  overrides it (urn:ogc:def:crs:EPSG::NNNN).
	* NEWS.

	Valid JSON for example_2000 and the GEODATA sample (Ceco.NET), make -j4
	check passes. The EPSG override is not tested: none of the samples has a
	coordinate system definition.

2026-11-22  Reini Urban  <reini.urban@gmail.com>

	reedsolomon.h: add the include guard
	encode_r2007_test.c includes both encode_r2007.c and decode_r2007.c, which
	include reedsolomon.h: gcc -Werror=redundant-decls failed the
	--enable-release, make distcheck, s390x and ppc64 builds of PR 1562.

2026-11-22  nameloCmaS  <namelocmas@gmail.com>

	encode_r2007: write the container as AutoCAD does
	- the sections in AutoCAD's order (ODA writes SummaryInfo first and
	  FileDepList last);
	- the unused bytes of a page filled with the padding of the file's
	  random_seed: the first 0x80 words of its random table (ODA spec
	  5.11), little endian, repeated every 512 bytes, not zeros;
	- raw pages (encoding 1) Reed-Solomon coded too, not interleaved: the
	  data padded to 8 with zeros, then the 4 parity bytes of each block
	  of 251 data bytes, the last block completed with the padding for
	  the parity, then the padding. A raw page has the Reed-Solomon coded
	  size of its section's max_size (max_size and 4 parity bytes per
	  block of 251, rounded to 32), as in all of AutoCAD's r2007 files.
	  AutoCAD 2027 rejects an AppInfoHistory page without the parity and
	  crashes on a raw page of only ROUND32 (data) bytes;
	- the mirrored CRC of the file header from a new chain, each element
	  from the one before (ODA spec 5.2.1.1.5);
	- the sections map: page sizes as allocation sizes (at least the
	  section's max size), and the empty section at the end, without a
	  name, counted in num_sections.
	AutoCAD needs these to read LibreDWG's r2007 output, but they are not
	enough on their own: with only these AutoCAD LT 2027 opens none of 12
	test-data drawings rewritten as r2007. With the other encoder changes
	of the full set (string, class and object sections), 9 of the 12 open,
	8 of them AUDIT-clean; the drawings from R2000 and R2004 sources do
	not open yet.

	Test: encode_r2007_test (new, in check_minimal next to encode_test)
	includes encode_r2007.c and decode_r2007.c:
	- the section order, pad_fill, raw_page_size, the raw pages of
	  make_data_page and the sections map;
	- every page of three AutoCAD r2007 files (2007/block_acad2027.dwg
	  from AutoCAD LT 2027, 2007/Line.dwg, example_2007.dwg), found with
	  the decoder's own map readers: the Reed-Solomon parity of each block
	  of every page, and for the raw pages (AppInfoHistory, AppInfo,
	  Preview) their size and padding, with each file's random_seed;
	- the same for the encoder's output with a 1240-byte AppInfoHistory,
	  which is read back unchanged.
	With the previous encoder 26 of its checks fail; AutoCAD's files pass
	either way.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-22  nameloCmaS  <namelocmas@gmail.com>

	r2007: the class dwg_version and maint_version are BL
	As in r2004 and r2010+: AutoCAD's r2007 files store them as BL
	(e.g. MLEADERSTYLE with maint_version 427). Reading them as BS takes
	the wrong number of bits for values of 256 and more, and every class
	after such a class is misread (e.g. ACDBSECTIONVIEWSTYLE with
	dwg_version 64680 and 256 instances). The encoder writes them as BL
	too.

	Tests:
	- decode_test: test-data/2007/block_acad2027.dwg, AutoCAD LT 2027's
	  r2007 save of r2.10/block.dxf, has MLEADERSTYLE maint_version 427;
	  its classes are read as AutoCAD wrote them.
	- encode_test: an r2007 class dwg_version above 0xFFFF, which no BS
	  holds, is read back.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-22  nameloCmaS  <namelocmas@gmail.com>

	unit-testing: decode_test finds the test data under CMake
	Makefile.am passes top_srcdir in TESTS_ENVIRONMENT, CMake did not, so
	decode_test skipped its fixtures. Also keep the test's own loglevel:
	dwg_read_file sets the global loglevel from dwg.opts.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-22  Reini Urban  <reini.urban@gmail.com>

	classes: promote MLEADEROBJECTCONTEXTDATA, allow DXF
	The layout: the AcDbObjectContextData (class_version, is_default), the
	scale handle, then the same AnnotContext as the MULTILEADER (ctx: the
	leaders, the content, the base points, text_top/bottom since r2010), but
	without its CONTEXT_DATA{ wrapper in the DXF. Checked with the 100 objects
	of 2000/MLeader.dwg and 2010/ACI_20160321_A_30_east.dwg: no decode errors,
	and the DXF has the same records as ODA's.

	* include/dwg.h: Dwg_Object_MLEADEROBJECTCONTEXTDATA has the ctx.
	* src/dwg2.spec: MLEADER_CONTEXT_DATA_body and MLEADER_LEADERS_fields are
	  shared by the MULTILEADER and the object. The DXF writes the LEADER{ 302
	  and } 303 per leader and the LEADER_LINE{ 304 and } 305 per line, as ODA
	  does, not once for all of them. 272 comes before 273 in the object.
	  The scale handle of all the OBJECTCONTEXTDATA classes is a hard pointer
	  (5), as in the DWGs, not 2.
	* src/in_dxf.c: import the object with the MULTILEADER importer
	  (mleader_ctx). Fixed the block content location, which was set as the
	  normal.x (15 is the location), and the block_table is absolute.
	* src/classes.inc, objects.in, objects.c: unstable, with DXF in/out.
	* unit test, NEWS, TODO, doc.

	dxf-check passes for 2000/MLeader, 2004/MLeader and the 2010 sample, and
	all fields of all the 100 objects (with the handle codes) are the same
	after the DXF roundtrip. The only difference of the DXF to ODA is one
	leader line of r2010 which ODA writes without its 170-93 fields. make -j4
	check with leak detection, dxf.test, dxfb.test and json.test pass.

	make regen-dynapi follows.

2026-11-21  Reini Urban  <reini.urban@gmail.com>

	classes: promote ASSOCALIGNEDDIMACTIONBODY and ASSOCSWEPTSURFACEACTIONBODY
	Both decode without error in the samples (ASSOCALIGNEDDIMACTIONBODY in
	example_2000 - 2018, ASSOCSWEPTSURFACEACTIONBODY in 2018/Surface.dwg) and
	have proper field names. The other debugging classes either have no
	sample, no fields (ACMESCOPE, CSACDOCUMENTOPTIONS,
	MLEADEROBJECTCONTEXTDATA), unknown field names (ASSOCPERSSUBENTMANAGER) or
	decode errors (ASSOCEDGEACTIONPARAM action_type 47, LOFTEDSURFACE).

	ASSOCALIGNEDDIMACTIONBODY has DXF in- and output, ASSOCSWEPTSURFACEACTIONBODY
	DWG only, as the other ASSOC*SURFACEACTIONBODY.

	* src/classes.inc, objects.in, objects.c: unstable.
	* src/dwg2.spec: both out of the debug-only area. The ParamBased
	  action body handles are hard owner (deps, 3) and soft pointer (assocdep,
	  4), as in the DWG. The r2013+ annotation action body has the
	  AcDbAssocActionBody subclass and a 90 0 in the DXF, as ODA writes it.
	* src/in_dxf.c: add_ASSOCALIGNEDDIMACTIONBODY, for the r2010 and the r2013+
	  layout. The handles are absolute with the code of the DWG (a soft
	  pointer with an obj would become relative, which ODA does not write).
	* unit tests: no more "crashes".

	dxf-check passes for example_2000 .. 2018, and the DXF of the record is
	identical to ODA's. All fields, with the handle codes, are the same after
	the roundtrip (before: all lost for the r2013+ layout). make -j4 check
	with leak detection, dxf.test, dxfb.test and json.test pass.

	make regen-dynapi follows.

2026-11-21  Reini Urban  <reini.urban@gmail.com>

	Fix the EXTRUDEDSURFACE DXF roundtrip: r2013+ surfaces with an inline SAB
	2018/Surface.dwg failed dxf-check in ODA ("Object improperly read:
	AcDbExtrudedSurface"), as 2004/Surface.dwg before. The r2013+ surfaces
	which ODA writes have the acis_empty_bit 0 after their wireframe data.
	Then follow the unknown bit, the version 2 and the inline ASM SAB until
	End-of-ASM-data (the same SAB is also in the AcDs), and only then the
	num_materials BL. We skipped it, read the SAB bits as num_materials
	(2796101761 materials: invalid), and lost the rest of the entity: the
	DXF got a zeroed surface without the profile and the SAT, which ODA
	rejects. This affected the EXTRUDEDSURFACE and the NURBSURFACE of the
	sample, not only the EXTRUDEDSURFACE.

	* src/dwg_spec_shared.h: decode_3dsolid_ex reads the inline part for
	  these, after the acis_empty_bit (decode_3dsolid is the same without it).
	  Found with the bits of the object: "ASM BinaryFile" at bit 12.
	  Also keep the PRE macro out of a bare else, it is two statements.
	* NEWS.

	dxf-check passes now for 2018/Surface, 2004/Surface, the 2018 *surface
	samples, JW, sun_and_sky_demo and example_2010, and the fields except the
	wireframe cache are the same afterwards. make -j4 check (with leak
	detection), dxf.test, dxfb.test and json.test pass.

2026-11-21  Reini Urban  <reini.urban@gmail.com>

	classes: promote NURBSURFACE to unstable, allow DXF
	The fields (the 3DSOLID fields, u_isolines, v_isolines and, since r2013,
	short170, cv_hull_display, uvec1, vvec1, uvec2, vvec2) are right: the DXF
	roundtrip of 2018/nurbsurface.dwg and of the 4 NURBSURFACEs of
	2018/Surface.dwg keeps all of them.

	The wireframe is not in the DXF, by design
	------------------------------------------
	Every ACIS based entity (3DSOLID, REGION, BODY and the *SURFACEs) has two
	parts in the DWG:

	 1. The ACIS body (SAB, or SAT v1 before r2013): the real geometry. It is
	    written to the DXF as the SAT lines (groups 1 and 3), and read back.
	 2. A cached wireframe for display: point (the 3BD, group none), the
	    isolines count, the wires[] (type, selection_marker, color,
	    acis_index, points, transform) and the silhouettes[]. The viewers draw
	    these without a modeler, which is why the DWG has them.

	The DXF has no group codes for part 2, neither do AutoCAD nor ODA write
	it: their DXF has just AcDbModelerGeometry (the SAT) and the surface
	subclass. When AutoCAD or ODA load such a DXF or DWG without the cache
	(wireframe_data_present = 0), they recalculate the wires, isolines and
	silhouettes from the ACIS body with their modeler. That is why
	dxf-check of nurbsurface.dwg passes ODA with no wireframe, and no field
	value is lost: only the cache is.

	So the wires, silhouettes, point, isoline_present and isolines of
	Surface.dwg (12 wires per surface) are lost on DWG -> DXF -> DWG, and
	come back as wireframe_data_present: 0, point_present: 0. They are kept
	by DWG -> DWG (dwgrewrite) and JSON. It is the same for EXTRUDEDSURFACE
	and all the others, not specific to NURBSURFACE.

	Recalculating the cache would need an ACIS evaluator: for a NURBSURFACE
	the SAT has the knots, degrees and control points, so the isolines are
	plain NURBS evaluations at u_isolines x v_isolines. Trimmed solids and
	their silhouettes need a real kernel. OpenCascade cannot import ACIS, so it
	does not help. Only our own renderers (dwg2SVG, dwg2ps, GeoJSON) would
	profit, AutoCAD and ODA do not need it.

	* src/classes.inc, objects.in, objects.c: unstable, with DXF in/out.
	* src/dwg2.spec: out of the debug-only area, without the unknown bits.
	* test/unit-testing/nurbsurface.c: not only with DEBUG_CLASSES.
	* NEWS, TODO, doc.

	dxf-check of nurbsurface passes (ODA reads it, no lost fields).

2026-11-21  Reini Urban  <reini.urban@gmail.com>

	in_json: harden GHSA-p4hw-gv7c-cf35, zero the dwg after the error free
	dwg_read_json frees the partial dwg itself with an unexpected non-string
	key, and the caller frees it again, as documented. The first dwg_free left
	all the other freed pointers in the struct.

	On the current master the double free of the advisory does not reproduce
	anymore: c1f0c5dc1 zeroes the header_vars in dwg_free, FREE_IF nulls the
	object and object_ref arrays, and an r11 JSON with an appended numeric key
	(the "Unexpected JSON key" path) is clean with asan and the caller's
	dwg_free. So this is the hardening which the advisory suggests, not a
	fix of a reproducible bug.

	* src/in_json.c (dwg_read_json): memset the dwg after the internal
	  dwg_free.

	Reported-by: lcfrateschi

2026-11-21  Reini Urban  <reini.urban@gmail.com>

	in_dxf: fix GHSA-7cvw-9rmm-gpr5, NULL BLOCK_HEADER name in ENDBLK
	dxf_blocks_read compared the name of the BLOCK_HEADER of an ENDBLK owner
	with "*PAPER_SPACE" without checking that it has one. A BLOCK_RECORD
	without a name (code 2) and an ENDBLK owned by it crashed with a NULL
	strcasecmp.

	* src/in_dxf.c (dxf_blocks_read): check _hdr->name.

	Checked with a DXF with an unnamed BLOCK_RECORD 1E and an ENDBLK owned by
	1E: SEGV in strcasecmp before, fine now.

	Reported-by: lcfrateschi

2026-11-21  Reini Urban  <reini.urban@gmail.com>

	DXF: write the LWPOLYLINE bulges when there are fewer than points
	The DXF writer emitted the bulges (42) only if num_bulges equalled
	num_points. A polyline with 3 points and one bulge for its first segment
	lost it, the curved segment became a straight line.

	* src/dwg.spec (LWPOLYLINE): write the bulge for each vertex within
	  num_bulges. The trailing vertices have the DXF default 0.

	Checked with an in-memory 3 point LWPOLYLINE with one bulge of 0.5: the
	DXF has the 42 0.5 for the first vertex, ODA reads it (no .err) and
	writes the 0.5 back. dxf-check example_2000 (ODA roundtrip), dxf.test
	and dxfb.test pass.

	Reported-by: aichen2017 (GitHub PR #1555)

2026-11-21  Reini Urban  <reini.urban@gmail.com>

	DXF: write the LWPOLYLINE const_width (43) once
	The DXF writer wrote the const_width (group 43) unconditionally and then
	again with the flag 4, so a polyline with a constant width had two group
	43 tags.

	* src/dwg.spec (LWPOLYLINE): write it once in the DXF (and DXFB) output,
	  as AutoCAD does, also when it is 0.0, as in the reference
	  example_2000.dxf. The flagged write is only for DWG and JSON.

	Checked: a DXF roundtrip of example_2000.dxf with two constant widths
	of 2.5 gives exactly one 43 per LWPOLYLINE (11), with 2.5 for the two.
	dxf.test and dxfb.test pass.

	Reported-by: aichen2017 (GitHub PR #1554)

2026-11-21  Saddam  <saddamr3e@gmail.com>

	in_json: ignore the ACSH shsw_num_blocks key
	Since f783db9 the method 37 profile of ACSH_SWEEP_CLASS and
	ACSH_EXTRUSION_CLASS has a 3DSOLID ACIS, which acsh_acis_copy copies
	by shsw_num_blocks + 1 entries of shsw_block_size. The JSON importer
	took shsw_num_blocks as given, independent of the shsw_block_size
	array, so a larger count read past that heap buffer in dwgwrite.
	out_json does not write the method 37 ACIS, and shsw_encr_sat_data and
	shsw_acis_data cannot be imported, so there is nothing to count.

	* src/in_json.c (_set_struct_field): ignore shsw_num_blocks, as the
	  num_ fields, cfb_size and sab_size.

2026-11-21  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Remove DEBUG_HERE_OBJ from DATATABLE object

2026-11-21  Reini Urban  <reini.urban@gmail.com>

	NEWS: all remaining in_dxf leaks are fixed

	NEWS: the OSS-Fuzz issues closed since 0.14
	45 issues, grouped by crash type.

2026-11-21  Reini Urban  <reini.urban@gmail.com>

	dwg_find_tablehandle*: initialize hdlname
	OSS-Fuzz 588507950 (libredwg:llvmfuzz: Abrt in _int_free, UBSAN).

	The hdlname of the three table entry loops was used uninitialized by
	the LOG_HANDLE and the checks when dwg_dynapi_entity_utf8text fails.
	valgrind found it with the testcase, in dwg_decode_LAYOUT_private ->
	dwg_find_tablehandle ("Conditional jump depends on uninitialised
	value", stack allocation), and it is clean now.

	The Abrt in _int_free itself does not reproduce here with asan (VER 0-15,
	OUT 0-4, SEED 0-40), so this may not be the final fix of the issue.

	* src/dwg.c (dwg_find_tablehandle, dwg_find_tablehandle_index,
	  dwg_handle_name): hdlname = NULL.

2026-11-21  Reini Urban  <reini.urban@gmail.com>

	Fix the DXF import leaks found by alive.test
	alive.test runs dxf2dwg over the test-data DXF files, now with leak
	detection.

	* src/dwg.spec: SPLINE: free knots, ctrl_pts and fit_pts for any
	  scenario, a DXF import has all of them.
	* src/classes.inc, src/free.c: the importers create the unhandled
	  (DEBUGGING in a non-debug build) classes by name, as
	  ASSOCPERSSUBENTMANAGER and ASSOCALIGNEDDIMACTIONBODY. Free them by
	  their fixedtype (UNHANDLED_CLASS_RETURN), not only their unknown bits.
	* src/dwg_spec_shared.h: pre-R13 DIMENSION.user_text is set by the DXF
	  importer without the R11OPTS flag. Free it.

	make -j4 check in .build-asan passes without leaks.

2026-11-21  Reini Urban  <reini.urban@gmail.com>

	Fix the leaks found by asan without detect_leaks=0
	The unit tests, dxf.test, dxfb.test and json.test are now clean with
	leak detection.

	* src/dwg2.spec: BLOCKLOOKUPPARAMETER.unknown_t was never freed.
	  TABLE: the r2004 text cell read cells[].text_style twice, the second
	  overwrote the unregistered NULL ref of the first.
	* src/free.c: dwg_free_acds returns early with more than 0x7ff segments,
	  which are already allocated: free segidx and segments in any case.
	  Free the class dxfname_u for any version, DXF and JSON import and
	  dwg_add_class set it also for older versions (GH #151).
	  A dwg without from_version (JSON without FILEHEADER) is freed as r2018,
	  the LTYPE dashes were not freed.
	* test/unit-testing/dxf_test.c: free the last dwg, also if it has no
	  objects, and the subf on break.
	* test/unit-testing/encode_test.c: free the downconverted table cell
	  values.

2026-11-21  Reini Urban  <reini.urban@gmail.com>

	tests: check for leaks with asan
	Do not set ASAN_OPTIONS=detect_leaks=0 for the unit tests, dxf.test,
	dxfb.test, dxfread.test and the dxf2dwg of alive.test anymore. The
	indxf leaks of GH #151 are gone, and the rest should be fixed, not hidden.
	The remaining overrides in alive.test (load_dwg, dwgfuzz, dwgadd,
	dwgrewrite) are for known leaks of single samples.

	Known leaks which fail now (asan builds only):
	- BLOCK*PARAMETER/GRIP/ACTION: bit_read_TU in
	  dwg_decode_BLOCKLOOKUPPARAMETER_private (2 bytes)
	- dxf_test: acds_private in read_2004_section_acds
	- encode_test: json_OBJECTS _set_struct_field, TABLE handleref

2026-11-21  Reini Urban  <reini.urban@gmail.com>

	in_dxf: PROXY_ENTITY: do not trust the DXF 93 data size
	GH #1557. add_proxy_entity_data silently clamped a 93 data_numbits which
	was larger than the 310 data, and accepted one which was much smaller.

	* src/in_dxf.c (add_proxy_entity_data): error and drop the data if
	  (data_numbits + 7) / 8 differs from the data size, or if there is no
	  data but data_numbits.

	The cad.dwg of the issue still roundtrips through DXF without errors or
	leaks, and a cad.dxf with a 93 increased by 800 is rejected with
	"Invalid PROXY_ENTITY.data_numbits".

2026-11-21  Reini Urban  <reini.urban@gmail.com>

	dwg.spec: undo the clang-format of 050ced9d6
	The PROXY data_numbits commit ran clang-format over the whole src/dwg.spec
	(+5360 -4711 lines), which is not a C file and is not formatted. Restore
	the previous layout and keep only the data_numbits check.

	The release CI (make distcheck) has failed dxf.test, dxfb.test and
	dxfread.test (roundtrip: got 6 entities) since that commit, and passed
	before it.

	* src/dwg.spec: PROXY_ENTITY and PROXY_OBJECT data_numbits check only.

2026-11-20  Reini Urban  <reini.urban@gmail.com>

	Move PACKAGE_VERSION and PACKAGE_STRING out of config.h
	They change with every commit (git describe), which rebuilt all objects
	and invalidated their ccache entries, although only 4 library files and
	the programs printed the version.

	* src/version.c.in: new, generated to src/version.c by configure and
	  cmake. The only library object which has the version:
	  dwg_api_version_string and the new dwg_api_package_string.
	* configure.ac: drop PACKAGE_STRING and PACKAGE_VERSION from confdefs.h
	  before config.status writes src/config.h (it has /* #undef */ now),
	  and generate src/version.c.
	* src/Makefile.am: nodist_libredwg_la_SOURCES = version.c, EXTRA_DIST.
	* CMakeLists.txt, src/cmakeconfig.h.in: the same.
	* src/dwg_api.c, out_dxf.c, out_dxfb.c, out_json.c, out_geojson.c,
	  programs/*.c, examples/*.c: use the two functions.
	* include/dwg.h, include/dwg_api.h: declare dwg_api_package_string.
	* .gitignore: /src/version.c

2026-11-20  Reini Urban  <reini.urban@gmail.com>

	PROXY_ENTITY, PROXY_OBJECT: check data_numbits, do not trust it
	GH #1557. data_numbits was (hdlpos - bit position) & 0xFFFFFFFF, which
	wrapped to ~4G bits when the stream was already past the handles, so the
	DXF output got hundreds of MB of 310 data per proxy.

	* src/dwg.spec: compute it signed. If it is negative or larger than the
	  object, error with DWG_ERR_VALUEOUTOFBOUNDS and no data.

	The cad.dwg of the issue gives a 660 KB DXF with 36 ACAD_PROXY_ENTITY and
	no error. proxy_entity and proxy_object unit tests pass.

2026-11-20  Saddam  <saddamr3e@gmail.com>

	decode: don't resync the r2004 handles map past the buffer end
	At the end of the decompressed AcDb:Handles buffer bit_read_UMC fails
	without advancing and returns 0, and the resync moved hdl_dat.byte one
	past the end on every entry until the page size was consumed. The page
	CRC then read past the heap buffer. Found by mutating
	test/test-data/2013/PolyLine3D.dwg (offset 30463, 0x1B -> 0x8C).

	* src/decode.c (read_2004_section_handles): Resync only inside the
	  buffer.

2026-11-20  Reini Urban  <reini.urban@gmail.com>

	ACSH method 37: no static inline for the ACIS helpers
	gcc -O2 -Werror=inline (make distcheck, --enable-release) refused to
	inline acsh_acis_copy and acsh_decode_acis. They are only unused in some
	of the files which include the specs, so mark them unused instead.

	* src/dwg_spec_shared.h: ACSH_ACIS_STATIC.
	* src/out_dxf.c, src/out_dxfb.c: plain static prototypes.

2026-11-20  Reini Urban  <reini.urban@gmail.com>

	dynapi: type the ACSH sweep shsw_encr_sat_data as char **
	gen-dynapi.pl only knew encr_sat_data by that exact name. The
	shsw_encr_sat_data of ACSH_SWEEP_CLASS and ACSH_EXTRUSION_CLASS became a
	TV, and dynapi_test.c failed with -Werror=format in the cmake build.

	* src/gen-dynapi.pl: match *encr_sat_data, count shsw_num_blocks.
	* include/dwg.h: declare it as char** as the generator expects.
	* src/dynapi.c, doc/dynapi.texi, test/unit-testing/dynapi_test.c:
	  make regen-dynapi.

2026-11-20  Reini Urban  <reini.urban@gmail.com>

	ACSH method 37: fix the gcc build of the other spec users
	free.c, print.c, out_json.c and others include dwg2.spec without the
	ACIS helpers: implicit declaration errors with gcc -Werror.

	* src/dwg2.spec: use the ACSH_DECODE_ACIS, ACSH_ENCODE_ACIS and
	  ACSH_DXF_ACIS macros.
	* src/dwg_spec_shared.h: define them only for the decoder, encoder and
	  DXF exporters (empty otherwise). Move acsh_acis_copy and
	  acsh_acis_free_tmp before their users.
	* src/out_dxf.c, src/out_dxfb.c: declare them before the spec include.

2026-11-20  Reini Urban  <reini.urban@gmail.com>

	make regen-dynapi
	For ACSH_LOFT_CLASS.

2026-11-20  Reini Urban  <reini.urban@gmail.com>

	classes: promote ACSH_LOFT_CLASS, allow DXF
	The layout was checked with the two lofts of the condominium: no
	major/minor in the DWG (the DXF has the constants 33 and 29), but
	the number of cross sections, each with the method (93), the size in
	bits (94) and the data (310), the number of guides, a BL (DXF 98), the
	draft angles and magnitudes (BD 41-44), 8 flags (B 290-297), and
	last the plane_normal_lofting_type (BL 70, which is written before the
	BDs in the DXF).

	* include/dwg.h: new Dwg_ACSH_LOFT_profile for the cross sections and
	  guides, which replace the handle arrays. New draft and flag fields.
	  The major and minor are gone.
	* src/dwg2.spec: the new layout, out of the debugging-only area.
	* src/in_dxf.c: import the 92-97 and 310 profile groups, ignore the
	  constant 90 and 91.
	* classes.inc, objects.in, objects.c: unstable, with DXF in/out.
	* Unit test, NEWS, TODO, doc.

	The guides (DXF 96/97 for them) are unverified: no sample has any.

	dxf-check passes for the condominium, and the fields of both lofts are
	the same afterwards (except the evalexpr file version). The unit tests,
	dxf.test, dxfb.test and json.test pass.

	make regen-dynapi follows.

2026-11-20  Reini Urban  <reini.urban@gmail.com>

	make regen-dynapi
	For the ACIS fields of ACSH_SWEEP_CLASS and ACSH_EXTRUSION_CLASS.

2026-11-20  Reini Urban  <reini.urban@gmail.com>

	ACSH_SWEEP_CLASS, ACSH_EXTRUSION_CLASS: support the method 37
	The AutoCAD r2007-r2010 profile of a sweep or extrusion (method 37) is
	an ACIS instead of the binary profile: the 3DSOLID header (acis_empty,
	unknown, version 2), the SAB until its End-of-ASM-data marker, and then
	the 93. Found in the bits of the conference room (the SAB 22 bits
	after the method).

	* include/dwg.h: new ACSH_SWEEPBASE_fields shsw_acis_empty,
	  shsw_acis_unknown, shsw_acis_version (DXF 70), shsw_num_blocks,
	  shsw_block_size, shsw_encr_sat_data, shsw_sab_size, shsw_acis_data.
	  (Not named as the 3DSOLID fields, which dynapi_test pins to the 3DSOLID
	  offsets.)
	* src/dwg_spec_shared.h: reuse decode_3dsolid and encode_3dsolid with a
	  temporary 3DSOLID (acsh_decode_acis, acsh_encode_acis). The encoder and
	  the DXF exporter work on a deep copy (acsh_acis_copy), as they convert
	  the SAB to the SAT v1.
	* src/out_dxf.c, src/out_dxfb.c (acsh_dxf_acis): the SAT lines as
	  dxf_3dsolid and dxfb_3dsolid write them. No more skip of the method 37.
	* src/in_dxf.c (add_ACSH_acis): the 70 version and the SAT lines (1, 3)
	  with add_3DSOLID_encr, which builds the SAT v1 blocks.
	* src/dwg2.spec: the method 37 branch of the profile. Free the ACIS.

	dxf-check passes for the conference room and ATMOS-DC22S, the objects
	are there again after the roundtrip (as SAT v1, ODA reads it), and the
	other samples with extrusions and sweeps (JW, sun_and_sky_demo,
	example_2010, the condominium, the aerial) still pass. The unit tests,
	dxf.test, dxfb.test and json.test pass.

	make regen-dynapi follows.

2026-11-20  Reini Urban  <reini.urban@gmail.com>

	make regen-dynapi
	For the ACSH_EXTRUSION_CLASS and ACSH_SWEEP_CLASS struct changes.

2026-11-20  Reini Urban  <reini.urban@gmail.com>

	classes: promote ACSH_EXTRUSION_CLASS, allow DXF
	The ACSH_EXTRUSION_CLASS is the ACSH_SWEEP_CLASS with a different last
	subclass (AcDbShExtrusion). The layout was checked with JW.dwg and
	sun_and_sky_demo.dwg: the sweep options and then the profile, of which
	a second one is only there with a non-zero 93 (the path).

	* src/dwg2.spec: share the profile and the option fields of the two
	  (ACSH_SWEEP_profile_fields, ACSH_SWEEP_dxf_fields, ACSH_SWEEP_dwg_fields;
	  named *_fields, so that gen-dynapi.pl finds the DXF codes). The
	  method 37 (r2007-r2010 AutoCAD) has an ACIS SAB with the 3DSOLID
	  header instead of the binary profile, which is not supported yet: it
	  is not decoded (the raw bits are kept for DWG output).
	* src/out_dxf.c: skip ACSH_SWEEP_CLASS and ACSH_EXTRUSION_CLASS with
	  the method 37 in the DXF, as no profile could be written.
	* include/dwg.h: the fields common to both are ACSH_SWEEPBASE_fields.
	* src/in_dxf.c: import the extrusion like the sweep.
	* classes.inc, objects.in, objects.c, dwg.h, dwg_api.*, dwg.i: unstable,
	  with DXF in/out. Unit test, NEWS, TODO, doc.

	dxf-check passes for JW, sun_and_sky_demo, ATMOS-DC22S, the conference
	room, the condominium and example_2010, and the fields of the extrusions
	are the same afterwards (except the evalexpr file version). The unit
	tests, dxf.test, dxfb.test and json.test pass.

	make regen-dynapi follows.

2026-11-20  Reini Urban  <reini.urban@gmail.com>

	PLANESURFACE: fix the r2007+ layout, allow DXF again
	The r2010 PLANESURFACE of the DXF import made ODA fail with a "General
	modeling failure" on the plane and on the ACIS solids read after it
	(visualization_-_conference_room.dwg). The plane is the one object it
	could not read, as our encoder differed from AutoCAD in two bits.

	* src/dwg_spec_shared.h (COMMON_3DSOLID): The surfaces have the
	  num_materials BL since r2007 also with an inline SAT v1, and not only
	  with a SAB. And the encoder sets the acis_empty_bit for them, as
	  AutoCAD does for the inline SAB (as the ODA reader needs).
	* src/out_dxf.c: SAB to SAT conversion: write the doubles with 17
	  digits, as ODA does, instead of the 6 digits of %g, which move the
	  vertices off their planes.
	* src/classes.inc: PLANESURFACE with DXF in/out again.

	dxf-check passes for the conference room and the aerial (r2010), the
	r2018 lone samples and the condominium. The unit tests, dxf.test,
	dxfb.test and json.test pass. 2004/Surface.dwg still fails on its
	EXTRUDEDSURFACE (ODA-written layout), as before.

2026-11-20  Reini Urban  <reini.urban@gmail.com>

	make regen-dynapi
	For the ACSH_SWEEP_CLASS and ACSH_REVOLVE_CLASS struct changes.

2026-11-20  Reini Urban  <reini.urban@gmail.com>

	classes: promote ACSH_SWEEP_CLASS and ACSH_REVOLVE_CLASS, allow DXF
	The DWG layout, derived from the raw bits of example_2010.dwg and the
	visualization_-_conference_room.dwg (the 4 BD doubles and the matrices
	located in the stream, and the profile sizes in bits):

	* src/dwg2.spec (ACSH_SWEEP_CLASS): the sweep options come first, in
	  the order of SWEPTSURFACE (the 6 BD, the 290 bit, BS 70 and 71, the
	  292-294 bits, the twist vector, the 295 and 296 bits, the two
	  matrices), then the two profiles (method, size in bits, data). The
	  DXF has the profiles first. The sizes were taken as bytes. 45 is the
	  twist_angle and 48 the scale_factor, not the other way around.
	  ACSH_REVOLVE_CLASS: the direction is a 3BD, then the angles, the draft
	  distances, the solid and close_to_axis bits and the profile last
	  (the DXF has the profile before the draft distances).
	* include/dwg.h: ACSH_SWEEP_CLASS align_option and miter_option are BS,
	  twist_angle and scale_factor swap their DXF codes. ACSH_REVOLVE_CLASS:
	  direction is a 3BD, bd44, bd45 and b290 are draft_start_distance,
	  draft_end_distance and solid, new method, bindata_size and bindata
	  instead of the sweep_entity handle.
	* src/in_dxf.c: import the profile groups of the two classes; the
	  evalexpr 98 is the major, not the minor; a missing 70 means no value
	  (-9999); the DXF has the history node matrix codes 50-55 in degrees;
	  the 62 of the history node color sets the method; import vectors of
	  BL (ACSH_FILLET_CLASS.edges), which were ignored, so the FILLET
	  roundtrip lost its edges and radiuses.
	* src/dwg2.spec (AcDbShHistoryNode_fields), src/out_dxf.c: out_dxf
	  converts only the codes 50-54 to degrees, but ODA writes the 55 also
	  in degrees. A ByLayer color without an index is the 256, not the 0 of
	  ByBlock.
	* src/dwg_spec_shared.h: surfaces have no history handle in any version
	  (checked with a r2010 PLANESURFACE), also not the AcDb3dSolid DXF
	  subclass.
	* classes.inc: PLANESURFACE DXF is disallowed again. The DXF of the r2010
	  planes with ACIS makes ODA fail to read the other ACIS solids of the
	  visualization_-_conference_room.dwg, even without any field difference.
	  The r2018 lone sample was fine. To be investigated.
	* Unit tests, NEWS, TODO, doc.

	The fields of the objects are the same after dxf-check (except the
	evalexpr file version, which is 33.29 in the DXF), ODA reads the
	re-encoded files of example_2010, JW, ATMOS-DC22S, the conference room
	and the condominium. The unit tests, dxf.test, dxfb.test and json.test
	pass. ACSH_EXTRUSION_CLASS and ACSH_LOFT_CLASS stay debugging: the
	extrusions of the r2007-r2010 files have an ACIS SAT text instead of the
	binary profile.

	make regen-dynapi follows.

2026-11-20  Reini Urban  <reini.urban@gmail.com>

	classes: promote DATATABLE and MTEXTATTRIBUTEOBJECTCONTEXTDATA, allow DXF
	* src/dwg2.spec (DATATABLE): REPEAT rejected the rows of a column,
	  since it estimates 32 bits per Dwg_DATATABLE_row, but a double or
	  integer cell takes 2 bits. Check num_cols * num_rows against the
	  available bits once. The column type 6 is a handle (DXF 360), which
	  the DWG has in the handle stream. Removed the unknown bits, so the
	  fields are really encoded.
	* src/dwg2.spec (MTEXTATTRIBUTEOBJECTCONTEXTDATA): removed the unknown
	  bits.
	* src/in_dxf.c (add_AcDbDataTable): import the columns and their cells.
	  MTEXTATTRIBUTEOBJECTCONTEXTDATA: the 290 of AcDbMTextAttribute-
	  ObjectContextData is enable_context, not is_default.
	* classes.inc, objects.in, objects.c, dwg.h, dwg_api.*, dwg.i: unstable,
	  with DXF in/out.
	* Unit tests, NEWS, TODO, doc/LibreDWG.texi.

	All DATATABLE objects of the test data (example_*, TS1, gh209_1, fr05_*)
	decode now, their fields are equal after dxf-check, and the handles
	resolve to the XRECORDs. ODA reads the re-encoded files. The unit tests,
	dxf.test, dxfb.test and json.test pass.

2026-11-20  Reini Urban  <reini.urban@gmail.com>

	make regen-dynapi
	For the REVOLVEDSURFACE, SWEPTSURFACE, EXTRUDEDSURFACE and PLANESURFACE
	struct changes.

2026-11-20  Reini Urban  <reini.urban@gmail.com>

	classes: promote REVOLVEDSURFACE and SWEPTSURFACE, fix the surface layouts
	Checked all *SURFACE entities against the AutoCAD r2004 and r2018
	Surface.dwg samples and the DXF of ODA. The r2013+ DWG layouts, derived
	from the raw bits (the GUIDs and the sweep data located in the stream),
	were wrong in several places:

	* src/dwg2.spec: The surfaces read the modeler_format_version again,
	  although ACTION_3DSOLID already has the version. Removed (L, R, S,
	  PLANE), as well as HANDLE_UNKNOWN_BITS.
	  REVOLVEDSURFACE: the DWG has the draft options, the solid and
	  close_to_axis bits first, then the axis, the angles and the matrix,
	  and the profile (class_version, size in bits, data) last. The DXF has
	  the profile first, as with EXTRUDEDSURFACE.
	  SWEPTSURFACE: the sweep options with the two option matrices, the
	  sweep and path matrices (DXF 40, 41, which were missing), then the
	  sweep and the path profile. There is no sweep_entity_id; the 91 is
	  the path_entity_id.
	  SweepOptions_dwg_fields: the twist reference vector sits between
	  base_point_set and the sweep_entity_transform_computed bit (AutoCAD
	  SWEPTSURFACE). The old order is the same bit string for the
	  EXTRUDEDSURFACE sample, where both are 0.
	  Share the profile data macro (SurfaceBits).
	  PLANESURFACE is just the isolines.
	* src/dwg_spec_shared.h (COMMON_3DSOLID): The surfaces have the
	  acis_empty2 bit instead of num_materials only without wireframe data
	  (files written by ODA). With wireframe data (AutoCAD) they have the
	  num_materials BL like the other solids.
	* src/in_dxf.c: Import the 90, 310, 70, 71 and the matrix groups of
	  AcDbExtrudedSurface, AcDbSweptSurface and AcDbRevolvedSurface
	  explicitly, the dynapi cannot tell them apart. REVOLVEDSURFACE has the
	  42 matrix.
	* include/dwg.h: SWEPTSURFACE: new sweep_transmatrix, path_transmatrix,
	  without sweep_entity_id. REVOLVEDSURFACE: the id is the bindata_size,
	  new bindata. Removed the unused modeler_format_version and class_version
	  fields. Move REVOLVEDSURFACE and SWEPTSURFACE into the unstable lists
	  (classes.inc, objects.in, objects.c, dwg_api.*, dwg.i), with DXF in/out
	  for them and PLANESURFACE.
	* test/unit-testing: Enable and adjust the REVOLVEDSURFACE and
	  SWEPTSURFACE tests, fix the PLANESURFACE test.
	* NEWS, TODO, doc/LibreDWG.texi: Document.

	The DXF of the AutoCAD r2018 REVOLVEDSURFACE and SWEPTSURFACE equals
	the ODA DXF (except the padding byte of the data), and so does the r2004
	PLANESURFACE, REVOLVEDSURFACE and SWEPTSURFACE (ODA rounds the data
	size up to the byte). dxf-check passes for the lone ODA-written r2018
	EXTRUDEDSURFACE, REVOLVEDSURFACE, SWEPTSURFACE and PLANESURFACE, and
	dwgrewrite keeps the AutoCAD ones. The unit tests, dxf.test, dxfb.test
	and json.test pass.

	NOT promoted: LOFTEDSURFACE and NURBSURFACE. Their samples were written
	by ODA, with an unknown 20 bit layout after the wireframe data (also
	EXTRUDEDSURFACE with wireframe data), and LOFTEDSURFACE needs the
	profile data array per cross section. They stay debugging only.

	regen-dynapi follows.

2026-11-20  Reini Urban  <reini.urban@gmail.com>

	Guard against incomplete BLOCK_HEADERs and objects from JSON/DXF imports
	Follow-up of GHSA-vj62-wp5x-vw7v, comment 382065: a BLOCK_HEADER
	reconstructed from JSON or DXF may lack its parent or its object data,
	and the walkers and writers dereferenced these unchecked (SEGV at
	dwg_next_object via dxfb_block_write, NULL deref in the MLINESTYLE
	encoder, and the table walk).

	* src/dwg.c (dwg_next_object): NULL for an object without parent or
	  without the object array. Also compare against num_objects directly,
	  (num_objects - 1) underflowed for an empty array.
	  (owned_block_header): New. get_first_owned_entity,
	  get_next_owned_entity, get_first_owned_block, get_next_owned_block,
	  get_next_owned_block_entity and get_last_owned_block return NULL for
	  an incomplete header. get_first/next_owned_subentity check the owner,
	  and the pre-R2000 branches the next object, which is NULL at the end
	  of the array.
	* src/out_dxf.c, src/out_dxfb.c: dxf_block_write and dxfb_block_write
	  skip an incomplete BLOCK_HEADER with a non-critical error. The
	  generated DWG_ENTITY and DWG_OBJECT entry points check tio.entity
	  and tio.object like out_json already does, before emitting a record.
	  The BLOCK_CONTROL of the table walk is checked, and the initializer
	  of the dead VX_CONTROL block.
	* src/out_geojson.c: check the object data of the INSERT block header.
	* src/dwg.spec (MLINESTYLE): the header LTYPE_BYBLOCK, BYLAYER and
	  CONTINUOUS handles may be missing in an imported file.
	* test/unit-testing/add_test.c (test_incomplete_block_header): New.
	  Walkers on a header without parent and without object data, and the
	  ASCII and binary DXF writers on a drawing with an incomplete header.
	  Crashed before.
	* NEWS: Document.

2026-11-19  Reini Urban  <reini.urban@gmail.com>

	EXTRUDEDSURFACE: decode r2013+ correctly, allow DXF in/out
	dxf-check on a r2018 EXTRUDEDSURFACE ended with ODA "improperly read".
	The decode was misaligned right after the common entity data, shown by
	a hex dump of the entity against ODA's own DXF (GUID, u/v isolines,
	sweep matrices and the 480 bit sweep profile all located in the
	stream). The real r2013+ layout is:

	  wireframe_data_present, acis_empty_bit, acis_empty2, has_revision_guid,
	  GUID, end_marker, u/v_isolines, the 6 sweep BDs, the 8 option bits,
	  the 3BD twist vector, the 46 and 47 matrices, sweep_vector,
	  sweep_transmatrix, class_version (35), the profile size in bits (480),
	  and the profile data.

	* src/dwg_spec_shared.h (COMMON_3DSOLID): a r2013+ EXTRUDEDSURFACE has
	  a bit (acis_empty2) instead of the num_materials BL, and no history
	  handle in the handle stream or the DXF (SOLID_SURFACE_R2013).
	* src/dwg2.spec (EXTRUDEDSURFACE): the DWG order of the sweep options
	  (SweepOptions_dwg_fields) and the sweep profile (class_version,
	  bindata_size in bits, bindata) last. The DXF keeps ODA's order. No
	  profile data in JSON, which cannot tell bits from bytes.
	* src/in_dxf.c (new_object): the dynapi has no DXF codes for these, and
	  71 (u_isolines, path_flags), 90 (twice) and the matrices 40, 46, 47
	  are ambiguous. Import them explicitly for AcDbExtrudedSurface, and
	  share the 310 chunk reader (dxf_read_binary_chunks) with the generic
	  TF import. Never claim more bits than the data holds.
	* src/classes.inc: UNSTABLE_CLASS_DXF_ALLOW_DXF for EXTRUDEDSURFACE.

	The extrudedsurface unit test no longer fails sweep_transmatrix and
	reference_vector_for_controlling_twist, and dxf-check on
	2018/extrudedsurface.dwg passes with no ODA errors and the same entity
	fields before and after. Only EXTRUDEDSURFACE is verified. The other
	surfaces stay as they are.

2026-11-19  Reini Urban  <reini.urban@gmail.com>

	classes: promote EXTRUDEDSURFACE to unstable

2026-11-19  Reini Urban  <reini.urban@gmail.com>

	in_dxf: import binary TF fields, skip PROXY_OBJECT like ODA
	dxf2dwg -y -v2 example_r14.dxf crashed with a heap-buffer-overflow in
	new_object: the new generic TF field import treated the 310 pair value
	as a hex string (strlen + sscanf), but dxf_read_pair already decodes
	DWG_VT_BINARY pairs to raw bytes (pair->value.s.ptr/len). strlen on
	binary data stopped at the first NUL, the byte count came out wrong
	and the PROXY_OBJECT data_numbits/8 reversal read past the buffer.

	* src/in_dxf.c (new_object): copy the pre-decoded 310 chunks with
	  memcpy using pair->value.s.len. NUL-terminate, keep the terminating
	  0-pair for the caller via the new end_object_loop label, reverse the
	  last partial byte MSB-first to LSB-first per the PROXY_OBJECT spec,
	  and only when (numbits / 8) is within the imported data.
	* src/out_dxf.c (dwg_dxf_object): skip DWG_TYPE_PROXY_OBJECT. Writing
	  our raw data+string-stream dump is not readable back (ODA: "Object
	  improperly read"), and ODA itself drops AcDbProxyObject records on
	  DXF export.
	* dxf-check: filter PROXY_ENTITY like UNKNOWN_ENT on both sides. The
	  original DWG stores proxies with their class number, the roundtripped
	  one as the fixed ACAD_PROXY_ENTITY type; same proxies, different
	  names.

	clang-format whitespace in dxf_class_skipped and the BITCODE_BL
	alignment in in_dxf.c comes from the pre-commit hook.

	Verified: dxf2dwg on example_r14.dxf (68 proxy objects with data),
	dxf.test 8/8, dxf-check td/2018/extrudedsurface.dwg exit 0.

2026-11-19  Saddam  <saddamr3e@gmail.com>

	in_dxf: reset ASSOCVARIABLE.num_var_deps with a repeated subclass
	add_ASSOCVARIABLE allocates a new var_deps array for each AcDbAssocVariable
	subclass, but sets num_var_deps only after each dependency read. A
	repeated subclass whose first 330 is missing kept the old, larger count
	with the new, smaller array, and the encoder read past it.

	* src/in_dxf.c (add_ASSOCVARIABLE): free the old var_deps and reset
	num_var_deps before reading the new ones.

2026-11-19  Reini Urban  <reini.urban@gmail.com>

	dwgadd_test.sh: ACSH_init_evalgraph evalexpr doesnt leak anymore
	Fixes GH #529

	dxfb: more big-endian support

2026-11-19  Reini Urban  <reini.urban@gmail.com>

	Add public dxf_write_file, dwg_write_json, dwg_write_geojson
	GH #992: export DXF, JSON and GeoJSON by filename, without exposing
	the internal Bit_Chain.  Existing files are not overwritten.

	* include/dwg.h: Declare dxf_write_file, dwg_write_json and
	  dwg_write_geojson.
	* src/dwg.c (dwg_write_stream_file, dxf_write_file, dwg_write_json,
	  dwg_write_geojson): New.
	* src/out_json.c, src/out_geojson.c, src/out_json.h: Rename the
	  Bit_Chain based dwg_write_json and dwg_write_geojson to *_dat.
	* programs, examples, test/unit-testing: Adjust callers, add tests.
	* NEWS, doc/LibreDWG.texi: Document.

2026-11-19  Reini Urban  <reini.urban@gmail.com>

	dxf: write the string stream of an unknown entity proxy
	GH #1546: 2018/Surface, ODA read the SWEPTSURFACE proxy 5A1 as an
	improperly read AcDbProxyEntity. R2007+ proxies need a string stream of
	their own after the class data, the TU "cn:" + C++ class name, its size
	as RS and the has_strings bit.

	* src/out_dxf.c (dxf_write_unknown_entity): append this stream to the
	  93/310 data for r2007+ sources, and write the CLASSES number of the
	  class as it is read back, not the number of the source file.
	  (dxf_class_skipped, dxf_class_number, dxf_proxy_string_stream,
	  dxf_put_bits): New.
	  (dxf_classes_write): Use dxf_class_skipped.
	* NEWS: Document.

	Closes GH #1546

2026-11-19  Reini Urban  <reini.urban@gmail.com>

	unit-test: add more nodist coverages

2026-11-19  Saddam  <saddamr3e@gmail.com>

	dxf_read_file: keep page-aligned DXF input NUL-terminated
	Since eada5b4 a DXF that needs no trailing newline (ASCII ending in \n,
	or any binary DXF) is mapped without overshoot and without a NUL, which
	then only exists in the zero-filled tail of a partial last page.  When
	the file size is a multiple of the page size the readers run off the
	mapping: strlen/strcpy in the binary branch of dxf_read_string, sscanf
	for a \M+ MIF char (it strlen()s its input), and strtol/strtod, which
	skip newlines.

	Map such input only when it ends with a NUL or its size is not a
	multiple of 4K, else fall back to dat_read_size, which terminates it.

	No testcase: the overread goes past an mmap, which ASan does not track,
	and it only faults when the following page is unmapped.

	* src/dwg.c (dxf_read_file): Do not mmap a page-aligned DXF that does
	  not end with a NUL.

2026-11-19  Reini Urban  <reini.urban@gmail.com>

	doc: add a Security Advisory chapter
	Warn that the C library likely still has memory corruption and
	out-of-bounds bugs, with a huge attack vector (150 MB), though it is
	constantly fuzzed and AI-checked.  Not recommended with untrusted input
	in non-hardened environments such as WASM converters on the open web, or
	for accepting JSON.  Better hardened than AutoCAD(R) though.

2026-11-19  Reini Urban  <reini.urban@gmail.com>

	Harden the JSON importer against type confusion
	GHSA-v28x-qfr4-w4vm: an OBJECTS entry could declare one object and a
	type key (500+) selecting another class, so the destructor of the other
	class was applied to the token (invalid free, heap corruption).

	* src/in_json.c (json_OBJECTS): validate the type key.  Reject values
	  outside 1..500+num_classes and a class dxfname that does not match the
	  allocated object.  Force a lying CLASS number to its index.
	* NEWS: Document.

2026-11-19  garcialeal  <garcialeal2@gmail.com>

	dwg2ps, geojson: a spline-fit POLYLINE_2D as its curve
	As in dwg2SVG: not a zigzag through all its frame and fit vertices.
	dwg2ps draws the Bezier curves with curveto, a quadratic one raised to
	a cubic one; GeoJSON writes points on the curve within the SPLINE
	tolerance.

	* programs/dwg2ps.c (ps_ocs_point, ps_bezier, ps_polyline_spline): New.
	(create_postscript): Use it.
	* src/out_geojson.c (polyline_2d_spline_points): New.
	(dwg_geojson_object): Use it.
	* programs/json.test.in: Check 2000/PolylineSplineFit.dxf.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-19  garcialeal  <garcialeal2@gmail.com>

	geom, api: add bezier_chain_flatten and polyline_2d_get_spline
	* src/geom.c (bezier_chain_flatten): New, from spline_flatten: points
	on a chain of Bezier curves.
	(spline_flatten): Use it.
	* src/geom.h: Declare it.
	* src/dwg_api.c (dwg_object_polyline_2d_get_spline): New, the Bezier
	curves of a spline-fit POLYLINE_2D in its OCS, or else its fit
	vertices as curves of degree 1.
	(polyline_2d_vertex_points, polyline_2d_fit_chain): New.
	* include/dwg_api.h: Declare it.
	* test/unit-testing/polyline_2d.c (check_spline): New.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-19  garcialeal  <garcialeal2@gmail.com>

	api: check the size before writing a POLYLINE_3D point
	dwg_object_polyline_3d_get_points wrote ptx[i] before checking
	i > num_points, so one vertex too many would write past the array.
	Check i >= num_points first.

	* src/dwg_api.c (dwg_object_polyline_3d_get_points): Check the size
	before writing, in both vertex walks.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-19  Reini Urban  <reini.urban@gmail.com>

	classes: promote PERSUBENTMGR to unstable

2026-11-19  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix PERSUBENTMGR object

2026-11-19  garcialeal  <garcialeal2@gmail.com>

	dwg2SVG: draw a spline-fit POLYLINE_2D as its curve
	It was drawn through all its frame and fit vertices, as a zigzag.  Now
	it is the curve of its frame by polyline_spline_to_bezier, exact with C
	or Q; without a usable frame only the fit vertices, as AutoCAD draws
	them.

	* programs/dwg2SVG.c (polyline_2d_spline, polyline_2d_drop_frame)
	(polyline_2d_spline_fit): New.
	(output_POLYLINE_2D): Use them.
	* test/test-data/2000/PolylineSplineFit.dxf: New, made with ezdxf.
	* test/Makefile.am: Add it.
	* programs/svg.test.in: Check it.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-19  garcialeal  <garcialeal2@gmail.com>

	geom, api: add polyline_spline_to_bezier and polyline_2d_get_flags
	The curve of a spline-fit POLYLINE (flag 4) is the uniform B-spline of
	its frame vertices (flag 16), clamped when open and periodic when
	closed; AutoCAD stores 8 fit vertices (flag 8) per knot span on it.
	Checked with AutoCAD 2013 files, cubic and quadratic, open and closed.

	* src/geom.c (polyline_spline_to_bezier): New, as Bezier curves like
	spline_to_bezier: through it when open, by the uniform B-spline
	formulas when closed.
	* src/geom.h: Declare it.
	* src/dwg_api.c (dwg_object_polyline_2d_get_flags): New, the vertex
	flags as dwg_object_polyline_2d_get_bulges gives the bulges.
	* include/dwg_api.h: Declare it.
	* test/unit-testing/polyline_2d.c (check_flags): New.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-19  garcialeal  <garcialeal2@gmail.com>

	api: follow the entity links to the R13-R2000 POLYLINE vertices
	From R13 to R2000 the vertices of a POLYLINE are chained by their
	next_entity links, not by their handles: vertices added later, like the
	fit vertices of a spline-fit POLYLINE, come after the SEQEND.  The
	POLYLINE_2D and POLYLINE_3D vertex functions went by the handles and
	lost them, as out_dxf did before.

	* src/dwg_api.c (polyline_next_vertex): New, by dwg_next_entity, with
	a step limit against a cyclic chain.
	(dwg_object_polyline_2d_get_numpoints, polyline_2d_vertices_r13)
	(dwg_object_polyline_3d_get_numpoints)
	(dwg_object_polyline_3d_get_points): Use it.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-18  Reini Urban  <reini.urban@gmail.com>

	Import the 3DSOLID history_id 350 as the hard owner code 3
	GH #1546: 2013/JW. 350 is a hard owner, the DWG stores code 3. ODA now
	converts our DXF of the modeler solids without errors.

	* src/in_dxf.c: dwg_add_handleref (..., 3, ...) for the AcDb3dSolid 350.

2026-11-18  Reini Urban  <reini.urban@gmail.com>

	Fix the DIMASSOC DWG decode of the xrefpaths, part 2
	* src/enc_macros.h, src/out_dxf.c, src/out_dxfb.c, src/out_json.c,
	  src/print.c, src/free.c: FIELD_VECTOR_TS alias.
	* NEWS: 258 of 262 DWGs roundtrip.

2026-11-18  Reini Urban  <reini.urban@gmail.com>

	Fix the DIMASSOC DWG decode of the xrefpaths
	GH #1546: 2013/gh44-error, ODA "Object improperly read: AcDbDimAssoc".

	The DIMASSOC refs read several BS fields as BL (num_xrefs,
	main_subent_type, num_xrefpaths, intersec_subent_type,
	num_intersec_xrefpaths), shifting the bitstream, and the xrefpaths T
	strings were read from the object data instead of the r2007+ split
	string stream.

	* src/dwg2.spec (DIMASSOC): SUB_FIELD_BS for the BS fields,
	  FIELD_VECTOR_TS for the path strings.
	* src/dec_macros.h (FIELD_VECTOR_TS): read T vectors from str_dat since
	  r2007, as FIELD_T does. Aliased to FIELD_VECTOR_T in the other actions.
	* test/unit-testing/dimassoc.c: check the BS fields as BS.
	* NEWS: 258 of 262 DWGs roundtrip.

2026-11-18  Reini Urban  <reini.urban@gmail.com>

	NEWS: GH #1546 progress
	The *UNDERLAY files, the large r2010 examples and the first Surface proxy
	now roundtrip through ODA: 257 of 262.

2026-11-18  Reini Urban  <reini.urban@gmail.com>

	Write the r2010+ bitsize_hi layout for low maintenance versions
	GH #1546: 2010/civil_example-imperial and mechanical_example-imperial
	were unreadable by ODA, "Out of range". Writing a DWG with maint_version
	<= 3 from DXF skipped the bitsize_hi in the section headers, which ODA
	and AutoCAD do not accept.

	* src/encode.c (dwg_encode): bump maint_version to 4 for R2010+ when it
	  is <= 3. The decoder accepts both layouts.

2026-11-18  Reini Urban  <reini.urban@gmail.com>

	dxf: write the object ids and 94 of an ACAD_PROXY_ENTITY
	GH #1546: 2018/Surface, ODA read the EXTRUDEDSURFACE 2D8 as an invalid proxy.

	* src/out_dxf.c (dxf_write_unknown_entity): export the handle stream after
	  the class data as 330/340/350/360, and the final 94 0, as ODA does.

2026-11-18  Reini Urban  <reini.urban@gmail.com>

	Read the *UNDERLAY entities with the *REFERENCE DXF record name
	GH #1546: 2018/dgnunderlay, dwfunderlay and dwfdefinition were decoded as
	UNKNOWN_ENT, and written as ACAD_PROXY_ENTITY, which ODA cannot read.

	* src/classes.inc: STABLE_CLASS_DXF aliases PDFREFERENCE, DGNREFERENCE,
	  DWFREFERENCE for the PDF-, DGN- and DWFUNDERLAY.

2026-11-18  Reini Urban  <reini.urban@gmail.com>

	Promote ASSOCVARIABLE and ASSOC2DCONSTRAINTGROUP to stable
	Their unit tests pass now, and they roundtrip through DXF.

	* src/classes.inc: STABLE_CLASS_DXF.
	* src/objects.in, src/objects.c, include/dwg.h, include/dwg_api.h,
	  src/dwg_api.c, bindings/dwg.i: make regen-dynapi regen-gperf.
	* doc/LibreDWG.texi, TODO, NEWS: Document.

2026-11-18  Reini Urban  <reini.urban@gmail.com>

	classes: re-sort the list, no changes

	Fix the ASSOCVARIABLE/ASSOC2DCONSTRAINTGROUP unit tests, EVALUATION_GRAPH EED import
	* test/unit-testing/assocvariable.c, assoc2dconstraintgroup.c: num_values
	  was checked as a ASSOCNETWORK/ASSOCACTION field, which failed on Dynblocks.
	* src/in_dxf.c: the EED 1001 after the EVALUATION_GRAPH edges was an
	  invalid DXF code, the object was dropped (Dynblocks 2018).

2026-11-18  Reini Urban  <reini.urban@gmail.com>

	Promote 8 ASSOC*/BLOCK* classes to stable
	Unit tests exist and pass for them, they are written to DXF and read back.
	ASSOCVARIABLE and ASSOC2DCONSTRAINTGROUP stay unstable (Dynblocks 2018
	unit test fails).

	* src/classes.inc: STABLE_CLASS for ASSOCDEPENDENCY, ASSOCVALUEDEPENDENCY,
	  ASSOCDIMDEPENDENCYBODY, BLOCKPARAMDEPENDENCYBODY, BLOCKREPRESENTATION,
	  BLOCKHORIZONTALCONSTRAINTPARAMETER, BLOCKVERTICALCONSTRAINTPARAMETER,
	  EVALUATION_GRAPH.
	* src/gen-dynapi.pl: Recognize UNSTABLE_CLASS*_ALLOW_DXF, else they would
	  be generated as stable.
	* src/objects.in, src/objects.c, include/dwg.h, include/dwg_api.h,
	  src/dwg_api.c, bindings/dwg.i: make regen-dynapi regen-gperf.
	* doc/LibreDWG.texi, TODO, NEWS: Document.

2026-11-18  Reini Urban  <reini.urban@gmail.com>

	Write the ASSOC*/BLOCK* classes to DXF and import them
	* src/classes.inc: new UNSTABLE_CLASS_ALLOW_DXF and
	  UNSTABLE_CLASS_DXF_ALLOW_DXF. Allow the DXF output of ASSOCDEPENDENCY,
	  ASSOCVALUEDEPENDENCY, ASSOCVARIABLE, ASSOCDIMDEPENDENCYBODY,
	  ASSOC2DCONSTRAINTGROUP, BLOCKPARAMDEPENDENCYBODY, BLOCKREPRESENTATION,
	  BLOCKHORIZONTALCONSTRAINTPARAMETER, BLOCKVERTICALCONSTRAINTPARAMETER and
	  EVALUATION_GRAPH. They stay unstable for DWG.
	* src/in_dxf.c (add_EVALVARIANT_70, add_ASSOCVALUEDEPENDENCY,
	  add_ASSOCVARIABLE): import the AcDbAssocValueDependency and
	  AcDbAssocVariable subclasses, with their EvalVariant.
	* src/classes.c (object_alias): ACDB_BLOCKREPRESENTATION_DATA.
	* programs/dxf.test.in: ASSOCDEPENDENCY is written now.
	* NEWS: Mention it.

	civil_example-imperial.dwg: 76 -> 7 "Object handle not found" in the
	roundtrip, the rest are dangling in the source.

2026-11-18  Reini Urban  <reini.urban@gmail.com>

	free: log TABLESTYLE sub-handles at INSANE level
	* src/free.c (SUB_FIELD_HANDLE): LOG_INSANE instead of LOG_HANDLE.

	lint: clang-format src/decode.c

	NEWS: OSS-Fuzz fixes
	Document the OSS-Fuzz issues fixed in the last commits.

2026-11-18  Reini Urban  <reini.urban@gmail.com>

	Fix dxfb_ENDBLK_empty name leak
	oss-fuzz testcase 5647996143075328 (Direct-leak, dwg_setup_ENDBLK).

	* src/out_dxfb.c (dxfb_ENDBLK_empty): free the dxfname/name that
	  dwg_setup_ENDBLK strdup'd on import.

2026-11-18  Reini Urban  <reini.urban@gmail.com>

	Fix stale BLOCK_CONTROL entries in DXF/DXFB output
	oss-fuzz 583321233 (Heap-use-after-free READ, dxf_tables_write).

	* src/out_dxf.c (dxf_tables_write), src/out_dxfb.c (dxfb_tables_write):
	  dwg_block_control() returns a copy, whose entries are stale after
	  dwg_add_BLOCK_HEADER reallocs. Use the BLOCK_CONTROL object.

2026-11-18  Reini Urban  <reini.urban@gmail.com>

	Fix double dwg_free use-after-free of header handles
	oss-fuzz testcase 6383958498279424 (Heap-use-after-free READ, dwg_free).

	* src/free.c (dwg_free): zero header_vars, its global refs are freed.
	  dwg_read_json frees on error, and the caller frees again.

2026-11-18  Reini Urban  <reini.urban@gmail.com>

	Fix BLOCK.xref_pname leak when freeing a failed DXF BLOCK
	oss-fuzz 583030510.

	* src/dwg.spec (BLOCK): free xref_pname for all versions.

2026-11-18  Reini Urban  <reini.urban@gmail.com>

	Fix leaked objects on skipped DXF table records
	oss-fuzz 584519764, 583321233, 583030510.

	* src/in_dxf.c (new_object): free the dropped object and its dxfname
	  for "Unknown DXF AcDbSymbolTableRecord" and "Empty _obj".

2026-11-18  Reini Urban  <reini.urban@gmail.com>

	Fix add_TABLESTYLE pair leaks on DXF import
	oss-fuzz 583321233.

	* src/in_dxf.c (add_TABLESTYLE): free the pair on the early returns.

2026-11-18  Reini Urban  <reini.urban@gmail.com>

	Fix duplicate SEQEND for one owner on DXF import
	oss-fuzz 584255889 (Heap-buffer-overflow READ, dxf_process_VERTEX_2D),
	584519764 (SEQEND owned list leak).

	* src/in_dxf.c (dxf_postprocess_SEQEND): ignore a second SEQEND for an
	  owner with a SEQEND, it listed the first SEQEND as owned vertex.
	  Free the replaced owned array.

2026-11-18  Reini Urban  <reini.urban@gmail.com>

	Fix NULL deref in dwg_require_class
	oss-fuzz 587110816 (Null-dereference READ, dwg_encode).

	* src/dxfclasses.in (dwg_require_class): skip classes without dxfname.
	* src/dxfclasses.c: Regenerate.

2026-11-18  Reini Urban  <reini.urban@gmail.com>

	Fix EED string/binary overflow on truncated objects
	oss-fuzz 586576797, 587020301, 583493833 (heap-buffer-overflow in
	dwg_encode_eed_data, dxf_write_eed, json_eed).

	* src/decode.c (eed_need_dat): reject EED strings and binary data
	  beyond the end of the chain. Reads past the end do not advance, so
	  the shrunken EED data was shorter than its stored length.
	  (dwg_decode_eed_data): zero the length when no string was read, store
	  the length of the data really read for code 4.

2026-11-18  Reini Urban  <reini.urban@gmail.com>

	NEWS: security fixes of the last two commits

	Fix polyline add UAF and r2007 page lookup (rest of 4 GHSAs)

	Fix 4 triaged GHSAs: polyline add UAF, acds and r2007 quadratic scans

	NEWS: 0.15 DXF fixes

	dwg2dxf --as r2000: ATTRIB/VERTEX of R2004+ sources, \U+ strings
	* src/out_dxf.c, src/out_dxfb.c: INSERT and POLYLINE of a r2004+ source
	  have no first/last entity links. Use the chain only with links for a
	  R2000 target, else the owned array. Fixes GH #1547.
	* src/out_dxf.c (dxf_fixup_TU, FIELD_T0), src/out_dxfb.c
	  (dxfb_convert_TU): The strings of a R2007+ source are written as
	  \U+XXXX into a DXF before R2007, which has the text in the
	  $DWGCODEPAGE, not as raw UTF-8. Fixes GH #1548.

	PROXY_ENTITY: write the DXF data format 70 as 0
	* src/dwg.spec (PROXY_ENTITY): ODA cannot read the binary 310 data of a
	  proxy with the original data format 1 (DXF) from a DXF. It rejected the
	  record (Object improperly read). Fixes the dxf-check roundtrips of the
	  six 2018/pointcloud* files and acad_proxy_entity.

	VBA_PROJECT: write the VBAProject section
	* src/encode.c: Encode the AcDb:VBAProject section from the decoded
	  section, or the VBA_PROJECT object data (e.g. from DXF).
	* src/dwg2.spec (VBA_PROJECT): Since r2004 the data is in the section,
	  not in the object. The decoder takes the object data from the section,
	  instead of claiming an invalid data_size. Fixes the ODA roundtrip of
	  2018/vba_project.

	in_dxf: import the SECTION_MANAGER sections
	* src/in_dxf.c: The 330 handles after AcDbSectionManager are the
	  sections, not the owner. They were lost in the DXF roundtrip and ODA
	  reported the SectionManager as improperly read (2018/LiveSection,
	  LiveSection1).

	in_dxf: accept the DWGCODEPAGE UTF-8, sign TIMEZONE
	* src/codepages.c (dwg_codepage_int): Accept UTF-8 and UTF-16 with a
	  dash, as ODA writes them. The import failed with an invalid codepage
	  255, and ODA could not write the DXF of ~30 roundtrips (Invalid input).
	* src/in_dxf.c: The $TIMEZONE 70 is signed.

	out_dxf: fix -Wshadow of j in dxf_write_unknown_entity
	* src/out_dxf.c: VALUE_BINARY declares j. Fixes the CI builds.

	PROXY_ENTITY: DXF roundtrip of unknown entities for ODA
	* src/out_dxf.c (dxf_write_unknown_entity): Write the AcDbProxyEntity
	  subclass in the ODA order (90, 91, 95, 70, graphics 92/310, then the
	  class data 93/310). The data were missing, ODA could not read the
	  proxy of a known class (surfaces).
	* src/common_entity_data.spec: Skip the common preview in the DXF for
	  unknown entities also.
	* src/dwg.spec (PROXY_ENTITY): The raw data of a r2007+ source holds the
	  string stream footer, also from DXF. Derive the r2018 dwg_version and
	  maint_version from DXF 95.

	PROXY_ENTITY: fix ODA roundtrips of the same version, DXF class id
	* src/dwg.spec (PROXY_ENTITY): The raw r2007+ data already holds the
	  string stream footer. Do not write another has_strings bit when
	  encoding to the same version, not from DXF, as in PROXY_OBJECT.
	* src/out_dxf.c (dxf_write_unknown_entity): DXF 91 is the class id
	  (500 + the class index), not the item_class_id 498. Move the comments
	  out of the macros, which clang-format kept reflowing.

	in_dxf: fix -Wshadow of j in the FIELDLIST import
	* src/in_dxf.c (new_object): Rename the loop index. Fixes the CI
	  builds with -Werror=shadow.

	in_dxf: import the FIELDLIST fields
	* src/in_dxf.c: The 330 handles after AcDbIdSet are the fields, not the
	  owner. The fields were lost in the DXF roundtrip, and ODA reported
	  the FIELDLIST as improperly read.

	in_dxf: fix the 3DSOLID revision_guid, update dxf-check
	* src/in_dxf.c: The dynapi names are revision_guid and revision_bytes,
	  not with the array size. The import failed with an ERROR and lost the
	  guid. Set has_revision_guid for a non-zero guid.
	* dxf-check: ARC_DIMENSION, WIPEOUT and SECTIONOBJECT are stable, only
	  HELIX is skipped in the DXF.

	JSON roundtrip: fix ODA "needs recovery" for ACIS solids
	* src/dwg_spec_shared.h (COMMON_3DSOLID): Encode the history_id handle
	  only since R2007 (r2004 files have none), and write a NULL for the
	  JSON [0,0], not an invalid code 0 handle.
	* src/in_json.c: Keep the alpha_type from alpha_raw/alpha_type when
	  "alpha" follows in the CMC. It was reset to 3.

	decode: fix wrong Not enough space for HEADER error
	Fixes GH #1523
	Reported-by: 1095327780 (AHao)

	decode: loosen DBG_MAX_COUNT from 1MB to 16MB
	Fixes GH #1522
	Reported-by: 1095327780 (AHao)

	decode: loose compressed section size checks
	some objects are highly compressable, more than factor 10.
	Eg. DGN
	Fixes GH #1521
	Reported-by: 1095327780 (AHao)

	json.test: 2018/Dynblocks is too large
	times out

2026-11-18  Reini Urban  <reini.urban@gmail.com>

	PROXY_OBJECT: fix JSON roundtrips for r2007+
	ODA: Object improperly read: <AcDbProxyObject>, json-check
	2018/Constraints.

	* src/in_json.c (json_OBJECT): keep an exact data_numbits given before
	  data, instead of rounding it up to whole bytes.
	* src/dwg.spec (PROXY_OBJECT): the raw r2007+ data already holds the
	  string stream footer. Do not write another has_strings bit, when
	  encoding to the same version, not from DXF.
	  Normalize the last data bits to MSB-first on decode, as PROXY_ENTITY.
	  Keep consecutive duplicate objids, PUSH_HV dropped them. Read up to the
	  last full byte of the handle stream.

2026-11-18  Reini Urban  <reini.urban@gmail.com>

	LTYPE: derive has_strings_area when encoding
	* src/dwg.spec (LTYPE): has_strings_area is only set by the decoder and
	  not stored in JSON. Derive it from the dashes shape_flag & 2 in the
	  encoder, so the r2007+ strings_area is written.
	  Fixes ODA "Object improperly read: <AcDbLinetypeTableRecord>" for
	  json-check 2013/gh44-error.

	Fix JSON roundtrip to r2007, ODA "Out of range"
	* src/dwg.c (dwg_bmp), src/out_json.c, src/out_dxf.c, src/out_dxfb.c:
	  Dwg_Chain is not layout-compatible with Bit_Chain since the mmap
	  field. Use Dwg_Chain directly, so thumbnail.byte is honored.
	* src/bits.c (bit_write_T32), src/enc_macros.h (FIELD_T32): write TU32
	  for r2007+ when not from TU, and always write the size, even for NULL.
	  Fixes the unreadable AcDb:FileDepList section.
	* src/encode.c (dwg_encode_add_object): treat all objects with raw
	  unknown_bits as raw_unknown, keeping bitsize (e.g. TABLESTYLE).
	* src/encode_r2007.c: add AcDb:AppInfoHistory to the section table.

	json.test: test ODA roundtrips for all dwgs

2026-11-18  garcialeal  <garcialeal2@gmail.com>

	dwg2SVG, dwg2ps: the elevation of TEXT, SOLID and polylines
	transform_OCS_2d maps only the x and y of an OCS point, so with a
	tilted extrusion the elevation, its z, was lost: a TEXT, SOLID,
	LWPOLYLINE or POLYLINE_2D at an elevation was drawn moved by the
	elevation times the extrusion.  Map the 3D point instead, as ARC and
	CIRCLE do.

	* programs/dwg2SVG.c (transform_OCS_elevation): New.
	(output_TEXT, output_SOLID, output_POLYLINE_2D, output_LWPOLYLINE):
	Use it.
	* programs/dwg2ps.c (transform_OCS_elevation): New.
	(ps_polyline): Add the elevation, use it.
	(create_postscript): Pass the elevation.
	* test/test-data/2000/OcsElevation.dxf: New, made with ezdxf.
	* test/Makefile.am: Add it.
	* programs/svg.test.in: Check the LWPOLYLINE and TEXT of
	2000/OcsElevation.dxf.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-18  garcialeal  <garcialeal2@gmail.com>

	dwg2SVG: no leak of the entity color
	entity_color returned a malloced "#rrggbb" for an ACI 8..255 or true
	color, but only common_entity freed it: every such TEXT and MTEXT
	leaked 8 bytes.  Write it into a buffer of the caller instead, so there
	is nothing to free.

	* programs/dwg2SVG.c (entity_color): Write into buf, return const.
	(common_entity, output_TEXT, output_MTEXT, output_GRAPHICS): Pass a
	local buffer.

	No test: a leak is only seen with ASan, e.g. on the MTEXT of
	2007/ATMOS-DC22S.dwg.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-18  Saddam  <saddamr3e@gmail.com>

	in_json, in_dxf: keep OLE2FRAME.cfb_size in sync with data
	OLE2FRAME.data holds only the MS-CFB, and the DWG, JSON and DXF
	writers copy cfb_size bytes from it. The DWG decoder bounds cfb_size,
	but the importers did not tie it to the buffer: a JSON cfb_size key
	was kept as given next to a shorter hex data string, and a second DXF
	90 reallocated data but kept the cfb_size of the previous 310 stream.
	Both overread the heap into the written DWG.

	* src/in_json.c (_set_struct_field): Set cfb_size from the data
	  length, and ignore the cfb_size key, like sab_size.
	* src/in_dxf.c (new_object): Reset cfb_size with a new 90 buffer.

	No testcase: a JSON or DXF OLE2FRAME needs a CFB payload, which
	would exceed the 15 lines that do not need a copyright assignment.

2026-11-17  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix decoding of EED layer for < R13

2026-11-17  Saddam  <saddamr3e@gmail.com>

	out_dxf, out_dxfb: check the SAB header by sab_size, not strlen
	The AcDs SAB records of r2013+ DWG and DXF input are assigned as
	acis_data with their exact size and no terminator, of any length.
	The DXF writers checked their header as a C string of 15 bytes:
	a record shorter than 4 bytes overread in the "ASM " memcmp, and
	strlen on the binary SAB read past a record without a zero byte.

	* src/out_dxf.c (dwg_convert_SAB_to_SAT1): check sab_size, and a
	  plain memcmp of the 15 byte header, as encode_3dsolid does.
	  (dxf_3dsolid): compare "ASM " only with 4 bytes of sab_size.
	* src/out_dxfb.c (dxfb_3dsolid): Likewise.

2026-11-17  Reini Urban  <reini.urban@gmail.com>

	in_dxf: remove the old DEBUG_CLASSES add_MATERIAL
	* src/in_dxf.c: The WIP add_MATERIAL and its MAT_* macros redefined the
	  new add_MATERIAL with --enable-debug. Fixes the linux (--enable-debug)
	  CI job.

	MATERIAL: keep channel_flags 0 in the DXF roundtrip
	* src/dwg2.spec (MATERIAL): Always write DXF 94 channel_flags. in_dxf
	  defaults to 127 when it is missing, so 0 was read back as 127.
	* test/unit-testing/add_test.c (test_material_dxf): Check 94 = 0.

2026-11-17  Reini Urban  <rurban@cpan.org>

	indxf: work on MATERIAL
	halfway-through.
	first stab at BD0, optional dxf codes. (with dat->byte reset)

2026-11-16  Reini Urban  <reini.urban@gmail.com>

	prep release 0.15
	it will be a major, not a minor bump.
	MX for cpan.org is gone.

	proxy graphics: little-endian on big-endian hosts
	* src/dwg.c (gfx_RD): Assemble the double from little-endian bytes, not
	  memcpy. Fixes s390x and ppc64 CI.
	* test/unit-testing/add_test.c (test_proxy_graphics): Write the test
	  graphics little-endian (gfx_num).

2026-11-16  Reini Urban  <reini.urban@gmail.com>

	PROXY_ENTITY: rename proxy_data to proxy_graphics, keep DXF roundtrips
	The proxy graphics are in the preview of the common entity data (ODA
	chapter 29), not separate bytes after it. proxy_graphics is a copy of
	it, for DXF 92/310: copied on decode, and set as preview from JSON on
	encode. The decoder no longer reads proxy_data bytes from the stream.

	DXF import reads the 92/310 graphics and the 93/310 entity data in any
	chunking, and the export writes them only in the AcDbProxyEntity
	subclass. The last partial byte of the entity data is now MSB-first on
	decode, as bit_write_bits and the DXF have it, so that the example_r14
	and r14/Leader ACAD_PROXY_ENTITY roundtrips are byte identical.

	* include/dwg.h (Dwg_Entity_PROXY_ENTITY): Rename proxy_data{,_size} to
	  proxy_graphics{,_size}.
	* src/dwg.spec (PROXY_ENTITY): Copy the preview, bit order.
	* src/common_entity_data.spec: No common 92/310 in DXF for PROXY_ENTITY.
	* src/in_dxf.c (add_proxy_entity_data): New.
	* src/encode.c: Set the preview from proxy_graphics.
	* src/in_json.c: Renamed keys.
	* src/dynapi.c, doc/dynapi.texi, test/unit-testing/dynapi_test.c:
	  Regenerate.
	* test/unit-testing/add_test.c (test_dxf_proxy_entity): New.
	* NEWS: Document.

2026-11-16  Reini Urban  <reini.urban@gmail.com>

	PROXY_ENTITY: decode the proxy graphics for dwg2SVG
	Add dwg_proxy_graphics() and dwg_free_proxy_graphics() with the
	Dwg_Proxy_Graphic struct, which decode the proxy graphics of an entity
	(ODA chapter 29) from its preview data into primitives: circle, arc,
	polyline, polygon, text, xline, ray, the sub entity colors, layers,
	linetypes, transformations and clips. Other chunks (MESH, SHELL,
	LWPOLYLINE, ...) and truncated chunks keep their raw payload. Invalid
	headers are rejected without a partial result.

	dwg2SVG renders the graphics for PROXY_ENTITY and as fallback for
	entities without a handler, e.g. LEADER.

	* include/dwg.h: Add Dwg_Proxy_Graphic_Type, Dwg_Proxy_Graphic and the API.
	* src/dwg.c (dwg_proxy_graphics): New.
	* programs/dwg2SVG.c (output_GRAPHICS): New.
	* test/unit-testing/add_test.c (test_proxy_graphics): New.
	* NEWS, TODO: Document.

2026-11-16  Reini Urban  <reini.urban@gmail.com>

	OLE2FRAME: decode the MS-CFB, fix the DXF in/out
	Read oleclient from the \1CompObj stream of the MS-CFB, with bounds
	checks on the FAT, DIFAT, directory and mini stream chains.

	DXF 310 is the 128 byte header + the MS-CFB, as in ACAD, and DXF 90 is
	128 + cfb_size. Write and read it separately from DWG and JSON, and
	write the pt1 and pt2 only once. Normalize data_size from cfb_size in
	the encoder and the DXF writer.

	* src/decode.c (cfb_compobj_usertype): New. (dwg_decode_ole2): Use it.
	* src/dwg.spec (OLE2FRAME): DXF branch with the header + data stream.
	* src/in_dxf.c: Split the 310 stream into the header fields and data.
	* test/unit-testing/ole2frame.c: oleclient is a TF, not a string field.
	* NEWS, TODO: Document.

2026-11-16  Reini Urban  <reini.urban@gmail.com>

	decode: OLE2FRAME decode the 128 byte header
	Decode unknown_rs, the 4 corner points pt1, pt_ur, pt2, pt_ll,
	unknown_rl1-6, unknown_rs2 and cfb_size in the spec. data now holds
	only the MS-CFB (data_size - 128), starting with D0CF11E0A1B11AE1.
	Reject a cfb_size > data_size - 128 and data_size < 128.

	* include/dwg.h (Dwg_Entity_OLE2FRAME): Add the header fields.
	* src/dwg.spec (OLE2FRAME): Read them, check the sizes.
	* src/decode.c (dwg_decode_ole2): Only set oleversion and oleclient,
	  check cfb_size and the CFB signature.
	* src/dwg_api.c (dwg_add_OLE2FRAME): Set pt_ur.
	* src/dynapi.c, doc/dynapi.texi, test/unit-testing/dynapi_test.c:
	  Regenerate.

2026-11-16  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix handle parsing CRC check

2026-11-16  Reini Urban  <rurban@cpan.org>

	decode: prescan_objects with -v4
	all handles in two phases.
	first until the type, 2nd everything into the already allocated object.

	only to display the referenced HANDLE type (name not yet)

2026-11-16  Reini Urban  <reini.urban@gmail.com>

	ACIS: fix the DXF import of SAT v1 solids, ODA roundtrips
	* src/in_dxf.c (add_3DSOLID_encr): Convert the DXF encrypted SAT text to
	  the DWG encryption, in blocks of 4096, and the SAT version to 400.
	  The DXF form ("^ " for A) was written into the DWG.
	* src/dwg_spec_shared.h (COMMON_3DSOLID): r2007+ REGION, 3DSOLID and BODY
	  with SAT v1 also have the unknown BL and the history handle (ODA spec
	  20.4.41).
	* src/encode.c: Create the ACDBPLACEHOLDER class when missing, so
	  unsupported objects are not written as DUMMY, which ODA rejects.
	* src/dwg2.spec (Rowstyle_fields): Write an empty format_string for
	  TABLESTYLE r2007 from older versions.
	* test/unit-testing/add_test.c: Add test_dxf_sat_v1.
	* NEWS: Document.

	in_dxf: keep the raw TABLESTYLE border lineweight
	* src/in_dxf.c (add_TABLESTYLE): The DXF 274-279 value is the raw BSd
	  (-2 ByBlock), not a lineweight in 1/100 mm. It was mapped to 30 by
	  dxf_find_lweight, which broke the dxf-check roundtrip of
	  example_2000.dwg.

	TABLESTYLE: map a custom cell style on downconvert, regen-dynapi
	* src/downconvert.c (downconvert_TABLESTYLE): Use the first custom cell
	  style as data rowstyle without the standard one, warn about dropped ones.
	* src/dynapi.c, src/objects.in, include/dwg.h, doc/dynapi.texi,
	  bindings/dwg.i, src/dwg_api.c, include/dwg_api.h: Regenerate.
	* test/unit-testing/encode_test.c: Add downconvert_TABLESTYLE_custom_test.
	* NEWS: Document.

	TABLESTYLE: promote to stable
	* src/classes.inc: TABLESTYLE is STABLE_CLASS, the embedded field names
	  are final.
	* NEWS, TODO: Document.

	TABLESTYLE: finish embedded rowstyles
	* include/dwg.h: Rename TABLESTYLE.cellstyle to cellstyle_handle.
	* src/dwg2.spec: Rowstyle_fields macro for the embedded data, title and
	  header rowstyles, fix the cellstyle type name.
	* src/downconvert.c: Convert to and from the embedded rowstyles.
	* src/free.c (free_TABLESTYLE_r2010): Free the embedded rowstyles.
	* src/dynapi.c: cellstyle_handle.
	* test/unit-testing: Adjust tablestyle, cellstylemap, dynapi_test and
	  encode_test, fix the CHK_SUBCLASS_* macros.

	TABLESTYLE: remove redundant free, fix in_json heap-overflow
	* src/free.c: Remove free_TABLESTYLE_r2010() — the spec-generated free macros now
	  handle rowstyles and sty/ovr cellstyle via the embedded struct fields.
	* src/encode.c (downconvert_TABLESTYLE): Remove manual rowstyles allocation that
	  compensated for missing spec field structures.  The spec macros handle this now.
	* src/in_dxf.c (add_TABLESTYLE): Use pointer-to-struct (rowstyles[i]->border[j])
	  instead of error-prone local copies.  Add tablestyle_rowstyle_border() helper
	  to map DXF border codes to the six named struct members.
	* src/in_json.c (_set_struct_field): Fix heap-buffer-overflow in subclass array
	  path.  Since commit 2c369e769 the off pointer was computed from the outer
	  struct (_obj) instead of the separately-allocated elems buffer, causing
	  writes past the allocation boundary for types like MLINESTYLE_line.
	  Also fix pre-existing sb1→subclass1 typo.
	* src/dwg2.spec (TABLESTYLE): Rename cellstyle→cellstyle_handle for the handle
	  field; fix Dwg_TABLESTYLE_CellStyle→Dwg_TABLESTYLE_cellstyle casing.
	* src/dynapi.c: Whitespace indentation fix.

2026-11-16  Reini Urban  <rurban@cpan.org>

	TABLESTYLE: more embedded structs
	inline them all.
	need to support embedded structs in in_json. for now we just
	had embedded arrays.

2026-11-15  Reini Urban  <reini.urban@gmail.com>

	GeoJSON: MLINE, MINSERT, SOLID, TRACE, 3DFACE, RAY, XLINE, PFACE, MESH
	* src/out_geojson.c: new geojson_points and geojson_rings helpers.
	  MLINE a LineString, MINSERT a MultiPoint of the grid, SOLID, TRACE and
	  3DFACE a Polygon, RAY and XLINE a unit segment, POLYLINE_PFACE a
	  MultiPolygon of the faces, POLYLINE_MESH a MultiLineString of the rows
	  and columns.
	* NEWS, TODO.

	encode r2007: free the section buffers, no duplicate declaration
	* src/encode.c: dwg_encode left the sec_dat buffers of the r2007 path
	  leaking (ASAN, dwgrewrite).
	* test/unit-testing/encode_test.c: decompress_r2007 is declared in
	  decode.h (-Werror=redundant-decls).

	CI: link reedsolomon into the unit tests, C99 Page initializers
	* src/encode_r2007.c: Page initializers without missing fields
	  (-Werror=missing-field-initializers).
	* test/unit-testing/Makefile.am, CMakeLists.txt: bits_test, decode_test
	  and encode_test need reedsolomon.
	* test/unit-testing/decode_test.c: remove() instead of unlink(), no
	  unistd.h on MSVC.

	encode r2007: rewrite r2007 as r2007, all versions writable
	* src/encode.c: r2007 objects with a split string stream, or raw
	  unknown objects (str_dat is dat), called obj_string_stream, which
	  repositioned dat to the start of the object section and overwrote it.
	  Clear the stale bitsize of the source for r2007, the object hdlpos is
	  relative to the object address.
	* programs/dwgrewrite.c: no fallback to r2010 for r2007.
	* programs/dxf2dwg.c, dwgrewrite.c, dwgwrite.c, man pages: all versions
	  are valid versions.
	* README, doc/LibreDWG.texi, NEWS, TODO: all DWG versions can be read and
	  written.

2026-11-15  Reini Urban  <reini.urban@gmail.com>

	downconvert_TABLESTYLE: empty format string per rowstyle, r2007 docs
	The r2007 TABLESTYLE writes a TU format string per rowstyle into the string
	stream; the downconverted rowstyles had none, the stream was too short and
	ODA rejected the object.

	* src/downconvert.c, src/free.c: allocate and free the empty format_string.
	* NEWS (major feature), TODO, README, doc/LibreDWG.texi, man pages,
	  dwgwrite usage: the r2007 encoder.

2026-11-15  Reini Urban  <reini.urban@gmail.com>

	encode_r2007: CRCs, compression, ODA reads the container
	The r2007 writer now sets all the check values of ODA spec ch. 5:
	the 64-bit CRCs (normal ECMA-182 and mirrored, with the byte order of
	the 2 byte words of the 8 byte blocks), the 32-bit data page checksum,
	the pseudo random encoder for the seeds and the check data of the
	file header, the hashcodes of the sections, the system page sizes and
	repeat counts. All formulas are verified against example_2007.dwg.

	The r2007 LZ77 compressor, the inverse of decompress_r2007, is new, with
	the permuted literal runs. Compressed are the data pages, the system
	pages and the file header.

	ODAFileConverter reads such a file, if the objects are converted
	properly. Known:
	* TABLESTYLE converted from r2010+ is rejected by ODA.
	* Rewriting an r2007 DWG as r2007 keeps stale object sizes, so
	  dwgrewrite still writes r2010 for those.

	* src/encode_r2007.c: the above. The section names are zero terminated
	  and the sections amount is +1, the sections in the order of ODA, the
	  addresses of the preview, summaryinfo and appinfo are set.
	* src/encode.c: the r2010 bitsize_hi word is not written for r2007.
	  compress_R2004_section is static again.
	* programs/dxf2dwg.c: allow r2007.
	* test/unit-testing/encode_test.c: compress_r2007 roundtrip and an r2007
	  encode and decode test.
	* NEWS, TODO, doc/LibreDWG.texi.

2026-11-15  Reini Urban  <reini.urban@gmail.com>

	WIP encode_r2007: write the r2007 container, ODA rejects it
	dwg_encode fell back to r2010 for r2007. Now src/encode_r2007.c writes
	the r2007 file from the section buffers of the r2004+ path: the 0x400
	file header (3 Reed-Solomon (255,239) blocks), the pages map and the
	sections map, repeated twice, the data pages Reed-Solomon (255,251)
	coded, and the copy of the file header. Uses rs_encode_block and
	rs_encode_data_block.

	LibreDWG reads such a file back: same 208 objects and 17 classes as the
	r2010 JSON it was written from. ODAFileConverter rejects it with "CRC
	does not match", because the CRC64 and the checksums of the file header,
	the system pages and the section pages are zero. Their algorithms are not
	known. Plain CRC64 variants (ECMA, ISO, Jones, XZ, with the seeds and
	data of the header) do not match the values of example_2007.dwg.

	* The pages and the file header are stored uncompressed. The LZ77 of
	  r2007 is not that of r2004: compress_R2004_section output fails
	  decompress_r2007 for 300 of 300 random buffers (the r2007 literals are
	  stored in permuted 8 byte groups). ACadSharp has no r2007 writer, its
	  AC21 file header writer is a stub and its AC21 compressor throws.
	* encode.c: no fallback to r2010. compress_R2004_section is exported.
	  Fix the EED strings of r2007, the pre-r2007 format was written for
	  r2007 also, and the bitsize_hi word of the header section, which
	  r2007 does not have.
	* dxf2dwg and dwgwrite still do not advertise r2007.

2026-11-15  Reini Urban  <reini.urban@gmail.com>

	decode_r2007: fix the comments about the Reed-Solomon flag
	The section header has an Encoding field (4 RS coded, 1 raw), as ACadSharp
	uses it. We read it as section->encoded but decide by the page size. There
	is no flag per page. The comments said there is no flag at all.

2026-11-15  Reini Urban  <reini.urban@gmail.com>

	decode_r2007: correct the Reed-Solomon errors of the pages
	decode_rs only de-interleaved the blocks, and dropped the parity bytes,
	the call of rs_decode_block was disabled. Now every block of the system
	pages (255,239) and the data pages (255,251) is decoded, errors are
	corrected and uncorrectable blocks are warned about.

	* src/reedsolomon.c: the code is generic now, with the (255,251) code of
	  the data pages, primitive polynomial 0x11d, 4 parity bytes, corrects 2
	  errors: rs_encode_data_block, rs_decode_data_block. Same roots
	  alpha^1.. and layout as the system pages.
	* src/decode_r2007.c (decode_rs): decode each block. Only with the full 255
	  bytes per block in the page, else as before.

	Verified with the 33 r2007 test DWGs: all 516 data and 23 system blocks of
	example_2007.dwg are valid codewords, and no file has a block with errors,
	so the parameters of the data pages (0x11d, roots alpha^1) are right. A
	flipped byte in a data page is corrected in 11 of 30 random positions
	(the others are not RS coded), and the JSON is the same as of the clean file.

	* decode_test: a flipped byte of example_2007.dwg gives the same objects.
	  It fails without the correction.
	* bits_test: (255,251) blocks.

	ACadSharp (../ACadSharp, DwgReader.reedSolomonDecoding) also only
	de-interleaves the blocks, with the same strides and block sizes (239 for
	the system and 251 for the data pages), and has no error correction.

2026-11-15  Reini Urban  <reini.urban@gmail.com>

	reedsolomon: a new implementation of the (255,239) code
	Replaces the unused code which was written by Alex Papazoglou, for
	which we have no copyright assignment, by a new one written from the
	textbook algorithms: syndromes, Berlekamp-Massey, Chien search and
	Forney's formula. Same field (0x169), roots alpha^1..alpha^16 and
	block layout.

	* src/reedsolomon.c, reedsolomon.h: same API, rs_encode_block and
	  rs_decode_block. It encodes the same parity as the old code (compared
	  with the old code for random blocks of 0..239 bytes) and corrects up to
	  8 errors in a block, where the old one failed at 8. More than 8 errors
	  are rejected.
	* bits_test: encode/decode 40 blocks with 0..8 errors, 9 errors, and a
	  short block against its zero-padded one.
	* TODO: drop the reed-solomon item. NEWS.

2026-11-15  nameloCmaS  <namelocmas@gmail.com>

	in_dxf: free TABLEGEOMETRY cell geometry before rebuilding
	This is part of the DXF importer allocation-ownership cleanup found while reviewing Fuzzing Action LeakSanitizer reports.

	Free existing TABLEGEOMETRY cells and nested cell geometry before rebuilding cell content from DXF counts.

	For commits considered too large, a request for a GNU copyright assignment covering PAST AND FUTURE CHANGES has been sent already.

	This does not overlap the parsing or semantics scope of PR #1312-#1322.

	* src/in_dxf.c (free_TABLEGEOMETRY_cells): New helper.

	* src/in_dxf.c (add_TABLEGEOMETRY_Cell): Free existing cells and per-cell geometry before replacement.

2026-11-15  Reini Urban  <reini.urban@gmail.com>

	TODO: update the done and the open items
	* test coverage: DGNUNDERLAY DWFUNDERLAY LONG_TRANSACTION OLEFRAME
	  DWFDEFINITION LIGHTLIST VBA_PROJECT have a 2018 DXF, TOLERANCE and
	  DETAILVIEWSTYLE are in example_2018.
	* DXFIN errors: Drawing_2007/2010/2018 read without errors now. The
	  example_2000 errors are other ones.
	* encode for 2010+ is done. GeoJSON SPLINE is done.
	* reed-solomon: src/reedsolomon.c is used by decode_r2007.

	NEWS: DXF testcases for the entities and objects without coverage
	48 new files in test/test-data/2018 since 0.14. Most of them cannot be
	converted to a proper DWG by ODA, they become proxies.

	doc: update the class stability lists since 0.14
	* doc/LibreDWG.texi: the unstable and debugging class lists are generated
	  from src/objects.in (92 unstable, 66 debugging). The old lists were
	  stale: they still had MATERIAL, ARC_DIMENSION, DIMASSOC and some
	  OBJECTCONTEXTDATA as unstable or unhandled. ARCALIGNEDTEXT has a
	  coverage testcase now.
	* TODO: the same, and note what was promoted to stable.
	* NEWS: stability changes since 0.14: stable are MATERIAL, TABLE,
	  MLEADERSTYLE, DIMASSOC, ARC_DIMENSION, ACIDBLOCKREFERENCE, LAYER_FILTER
	  and 5 OBJECTCONTEXTDATA classes. ARCALIGNEDTEXT and TABLECONTENT are
	  unstable now.

2026-11-15  Reini Urban  <reini.urban@gmail.com>

	test-data: add 2018/arcalignedtext.dxf, an ARCALIGNEDTEXT testcase
	A DXF made with ezdxf (R2018): one ARC and a hand-injected CLASSES entry and
	ENTITIES block for ARCALIGNEDTEXT, whose arc_handle (330) is the ARC. The
	class has the same app string as test-data/2000/plan.dxf. No test DXF
	had a real ARCALIGNEDTEXT entity, only the class. The attributes are
	plausible defaults, not from a real ATEXT drawing. $HANDSEED is FFF,
	above the entity handle F00.

	Checked with ODAFileConverter and libredwg:

	* ODA reads the DXF without errors and writes a 2018 DXF. It keeps the
	  entity as a proxy (160/310 binary graphic), without the fields. So
	  this only shows that the DXF is well-formed.
	* dxf2dwg --as r2018 imports all fields. The D2T values 41-46 are kept
	  as text, e.g. text_size "1.500000". dwgread -O json shows text_value,
	  font_name, xscale, text_size, char_spacing, radius, start_angle and
	  end_angle, and keeps unknown_bits as well.
	* ODA reading the DWG which we write silently drops the ARCALIGNEDTEXT
	  entity and keeps the ARC, without an error. So ODA does not confirm
	  our ARCALIGNEDTEXT DWG encoding, as with other unstable Express Tools
	  classes.
	* dwg2dxf does not write the entity back, because the class is unstable.
	  So a DXF roundtrip loses it.

	PR #1536, GH #1530.

	Also fix a infinite recursion in realpath() with rcc. the symbol is glibc's _FORTIFY_SOURCE
	wrapper, the inline realpath in bits/stdlib.h. It calls __realpath_alias, which resolves back
	to realpath.

2026-11-15  Reini Urban  <reini.urban@gmail.com>

	regen: dynapi and objects

2026-11-15  mlightcad  <mlightcad@outlook.com>

	spec: FIELD_D2T uses FIELD_T; promote ARCALIGNEDTEXT to unstable
	ARCALIGNEDTEXT stores its numeric fields as text-stream strings (same
	as FIELD_T on r2007+). FIELD_D2T aliased FIELD_TV, so those values were
	read from the wrong stream. Promote the class so release builds decode
	it.

	* src/spec.h (FIELD_D2T): Use FIELD_T instead of FIELD_TV.
	* src/classes.inc, src/objects.in, src/objects.c: ARCALIGNEDTEXT
	  DEBUGGING -> UNSTABLE.

2026-11-15  Saddam  <saddamr3e@gmail.com>

	dwggrep: do not match converted UTF-8 text as UCS-2
	The no-PCRE2_16 MATCH_TYPE and match_LTYPE convert the r2007+ strings
	to UTF-8 first, but passed is16=1 to do_match. pcre2_match_16 then
	scanned the UTF-8 bytes as UTF-16, and print_match ran bit_convert_TU
	on them again, reading past the len+1 byte buffer: ASan
	heap-buffer-overflow in bit_convert_TU with dwggrep . on
	test/test-data/2013/gh44-error.dwg. The LTYPE dash texts of r2007+
	drawings were also never found.

	No test: alive.test counts with -c, which never prints a match.

	* programs/dwggrep.c (MATCH_TYPE, match_LTYPE): Pass is16 0 for the
	  converted text.

2026-11-15  Reini Urban  <reini.urban@gmail.com>

	Fix pre-R14 binary DXF EOF parsing

	Fix DXF input termination with mmap
	Only terminate ASCII DXF input when needed. Avoid extending Windows
	file views, and buffer POSIX inputs when the terminator would cross
	an EOF page boundary.

2026-11-15  Reini Urban  <reini.urban@gmail.com>

	mmap: fix Windows file mapping for reads and overshoot
	Windows file views cannot extend past EOF: CreateFileMapping rejects a
	section larger than the file, and MapViewOfFile(Ex) rejects a view larger
	than the section.  The previous code tried to map size+64KiB for every
	read, which always failed on Windows.

	- dat_mmap_read: only request overshoot for the DXF append path
	  (dat_read_size), where chain[size] and chain[size+1] may be written.
	  DWG reads (dat_read_file) map exactly the file size so Windows can use
	  a real file view.
	- mman.c mmap(): when len > filesize on a MAP_PRIVATE map, fall back to
	  calloc+ReadFile - identical semantics (zeroed tail, private writes).
	- Replace MapViewOfFileEx+VirtualAlloc with MapViewOfFile: the former
	  requires 64KiB-aligned base which VirtualAlloc does not guarantee.

2026-11-15  Reini Urban  <reini.urban@gmail.com>

	mmap: cap section size at file size on Windows
	CreateFileMapping fails with ERROR_NOT_ENOUGH_MEMORY when the section
	size exceeds the file size for PAGE_WRITECOPY/PAGE_READWRITE.  Cap
	maxsize at the file size; MapViewOfFileEx into reserved address space
	still provides the full len bytes.

	mmap: log CreateFileMapping/MapViewOfFileEx errors
	Still failing on MinGW/MSVC - need the actual Win32 error code to
	diagnose whether CreateFileMapping or MapViewOfFileEx rejects the
	beyond-EOF view.

	mmap: make dwg_fstat_size a real function
	static in header caused unused-function warnings (bits.c doesn't call
	it) and -Werror=inline on mips. Define once in mman.c, declare in
	mmap.h; mman.h now included unconditionally.

	mmap: drop inline on dwg_fstat_size
	static inline fails -Werror=inline on mips32 (call is unlikely and
	code size would grow).

	my_stat: use io.h for _access on MSVC
	io.h declares _access with C linkage; the manual decl conflicted with
	UCRT (C2375). access() callers need the declaration too.

	my_stat: declare _access with C linkage on MSVC
	mman.h now pulls in <sys/stat.h> -> UCRT io.h which declares _access
	with C linkage; the previous C++-linkage decl in my_stat.h conflicted
	(C2375). Keep the access() macro - programs use it.

	my_stat: drop redundant _access decl on MSVC
	mman.h now includes <sys/stat.h> on Windows, which pulls in the UCRT
	io.h that already declares _access with C linkage; the manual
	declaration here conflicted (C2375 different linkage). access() is
	unused in the tree.

	mman: fix Windows/MSVC/MinGW build and beyond-EOF mappings
	* src/mman.h: include proper headers per platform; add dwg_mmap_off_t
	  (off_t is absent on MSVC, 32-bit on 32-bit MinGW); MSVC fileno/ftruncate
	  shims; dwg_fstat_size() helper avoiding struct stat/_stat differences.
	* src/mman.c: mmap() signature uses dwg_mmap_off_t; map via
	  VirtualAlloc(MEM_RESERVE)+MapViewOfFileEx so views may extend past EOF
	  (read path maps size+64KiB for its append overshoot) - pages past EOF
	  fault in as zero like POSIX private maps; munmap decommits+releases.
	* src/bits.c, src/dwg.c: guard unistd.h includes; use dwg_fstat_size()
	  instead of fstat/struct stat; keep dat_mmap_read defined without
	  DWG_HAVE_MMAP.
	* src/cmakeconfig.h.in: add missing HAVE_SYS_MMAN_H cmakedefine.
	* test/unit-testing: link mman.c/mman.lo into tests that compile
	  bits.c/dwg.c directly.

2026-11-15  Reini Urban  <reini.urban@gmail.com>

	Use mmap for DWG and DXF file buffers
	Map regular input files privately and output files shared, with ownership tracking and a Windows compatibility layer. Preserve exact encoder growth semantics and final file sizes to avoid truncation and runaway sparse files.

	* src/mman.c, src/mman.h: Add portable mmap compatibility.
	* src/bits.c, src/bits.h: Track and safely resize mapped chains.
	* src/dwg.c: Map reads and writes and finalize output sizes.
	* src/encode.c: Initialize temporary chains without mmap ownership.
	* src/Makefile.am, CMakeLists.txt: Build the compatibility layer.

	GH #242

2026-11-15  Reini Urban  <rurban@cpan.org>

	WIP mmap the files to dat->chain
	Saves massive amounts of memory.
	Implements GH #242

	* double fclose fixed
	* dat.chain may not be zero-terminated, which could break strstr()

	TODO:
	* in_json needs to mmap +WRITE

2026-11-15  Reini Urban  <reini.urban@gmail.com>

	decode: reserve object_ref in whole chunks
	The object_ref vector grows by REFS_PER_REALLOC when the count reaches a
	multiple of it, but the first reservation was HANDSEED, no multiple.
	Reserve a multiple, and cap it: HANDSEED comes from the file, and the
	vector grows in chunks anyway. GH #1526, PR #1532.

	* src/decode.c (dwg_decode_add_object_ref): round up and cap max_refs.
	* add_test: test_object_ref_chunks.

	Reported-by: mlightcad

2026-11-15  Saddam  <saddamr3e@gmail.com>

	encode: use the \U+ expanded TU length for T16, EED and xdata
	Since deea2c4 bit_utf8_to_TU expands \U+XXXX and \M+xxxxx escapes
	before the conversion, so the result has fewer chars than strlen() of
	the input and is allocated only that long. The r2007+ TV branch of
	bit_write_T16, the TV EED and xdata string writers, and the r2007+ xdata
	import of DXF and JSON still took the char count from strlen() of the
	UTF-8 input, and copied the heap bytes past the converted string into
	the written DWG.

	* src/bits.c (bit_write_T16): Take the length from the converted string.
	* src/encode.c (dwg_encode_eed_data, dwg_encode_xdata): Clamp to the
	  converted length, not strlen.
	* src/in_dxf.c (add_xdata): Set the r2007+ xdata string size to the
	  converted length.
	* src/in_json.c (json_xdata): Likewise.
	* test/unit-testing/bits_test.c (bit_write_TV_tests): Add a \U+ T16
	  check.

2026-11-15  mlightcad  <mlightcad@outlook.com>

	spec: keep LEADER.endptproj on R2010+; drop box size after R2007
	R2010+ (AC1024+) still stores endptproj and no longer stores
	box_height/box_width. Reading those two BDs after skipping endptproj
	folded endptproj.y into box_width and shifted arrowhead_on, so leader
	arrows vanished on AC1027 drawings.

	PR #1524

	* src/dwg.spec (LEADER): Read endptproj since R_13c3; read box_height
	  and box_width only until R_2007.

2026-11-15  mlightcad  <mlightcad@outlook.com>

	spec: guard MPOLYGON spline fitpts like HATCH
	HATCH already skips fitpts/tangents when num_fitpts is 0. MPOLYGON still
	called FIELD_2RD_VECTOR on a zero count (VALUEOUTOFBOUNDS) and omitted
	the start/end tangents that follow a non-empty fit-point edge.

	* src/dwg.spec (MPOLYGON): Read fitpts and tangents only when
	  num_fitpts > 0; fix default curve_type assignment to use segx[].

2026-11-15  Reini Urban  <reini.urban@gmail.com>

	dec_macros: always include ctype.h for FIELD_TFF
	ctype.h is ISO C. FIELD_TFF uses isprint(), which C99 builds reject as an
	implicit declaration when HAVE_CTYPE_H is not set in config.h.

	From PR #1537 by mlightcad. Fixes #1531.

2026-11-15  garcialeal  <garcialeal2@gmail.com>

	dwg2SVG: place INSERTs right
	A block was written in page coordinates, and its <use> moved it again by
	the insertion point, so the page offset was added twice: every INSERT
	was out of place, often off the page.  Its rotation also turned the
	wrong way, as y is flipped, and a mirrored OCS was ignored.

	Blocks are now written in their own coordinates from their base point,
	and the <use> of an INSERT is translate(insertion point) scale(-1 1)
	for a mirrored OCS, rotate(-rotation) and scale(x y).  The page is
	written as before.

	* programs/dwg2SVG.c (transform_X, transform_Y): Use origin_x, origin_y
	and origin_h.
	(block_origin): New.
	(output_INSERT): Turn the rotation, and mirror x for a mirrored OCS.
	(output_SVG): Set the origin of the page and of each block.
	* test/test-data/2000/Inserts.dxf: New, made with ezdxf.
	* test/Makefile.am: Add it.
	* programs/svg.test.in: Check a rotated INSERT of 2000/entities-2d.dwg
	and the INSERTs of 2000/Inserts.dxf.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-14  Reini Urban  <reini.urban@gmail.com>

	decode_r2007: thumbnail.size keeps the END sentinel, like r2004
	The r2007 preview size excluded both sentinels, but the DXF writer and
	the encoder expect the r2004 convention: the size from the offset 16,
	including the END sentinel. So the DXF output dropped 16 bytes of each
	valid thumbnail, and the encoder wrote no END sentinel when converting
	r2007 to r2004. Also part of GHSA-63vm-xrm5-37jj.

2026-11-14  Reini Urban  <reini.urban@gmail.com>

	out_dxf: no thumbnail size underflow in dxf_thumbnail_write
	A crafted R2007 preview section of 43-47 bytes has a thumbnail.size
	below the offset of 16, so size - offset wrapped and VALUE_BINARY read
	beyond the buffer.

	* src/out_dxf.c (dxf_thumbnail_write): require size > byte.

	GHSA-63vm-xrm5-37jj

2026-11-14  Reini Urban  <reini.urban@gmail.com>

	MATERIAL: drop procedural textures without DEBUG_CLASSES, fix -Warray-bounds
	* dwg2.spec: a map with a procedural texture (source 2) is written as a map
	  without a file in the encoder and DXF output, with a warning. The DXF
	  import does not read them, and the nested textures are recursive.
	* downconvert.c: allocate the whole Dwg_Eed_Data union for the EED items
	  (-Werror=array-bounds with gcc -O2).
	* add_test: test_material_dxf checks the procedural map.

	MATERIAL: finish the r2000 downgrade, fix indxf
	* downconvert.c: dwg_downgrade_MATERIAL: no ACAD EED for ByLayer and
	  ByBlock, like ODA, and x=0 for Global. The values of other materials are
	  unknown, use the most common ones in ODA's DXFs.
	  New dwg_downgrade_entity_material: entities with a material get the
	  ACAD_MATERIAL_MAPPER and ACAD_MATERIAL_MAPPER_2 EEDs of ODA. There is no
	  RTMaterial EED in any ODA sample.
	* encode.c: do both in the pre-pass, before the tables are written, not
	  when encoding the object. Names of r2007+ sources are TU.
	* dwg2.spec: write an identity transmatrix for a map without one. The
	  decoder always reads 16 BD, the DWG of a DXF with only ODA's fields was
	  invalid.
	* in_dxf.c: ODA's DXF omits the default fields, and has only a name or a
	  72 for ByLayer and ByBlock, which were rejected. Start add_MATERIAL on
	  any of its codes, and init with the defaults of ODA's DWG.
	* add_test: test_material_dxf.

2026-11-14  Reini Urban  <reini.urban@gmail.com>

	classes: promote MATERIAL to stable
	DWG, JSON and DXF roundtrips keep all MATERIAL objects, and ODA accepts
	the results.

	* classes.inc: STABLE_CLASS MATERIAL, replacing UNSTABLE_CLASS_ALLOW_DXF.
	* objects.in, objects.c: MATERIAL is STABLE (gperf regenerated).

2026-11-14  Reini Urban  <reini.urban@gmail.com>

	classes: write MATERIAL to DXF, fix -Werror builds
	* classes.inc: new UNSTABLE_CLASS_ALLOW_DXF. MATERIAL stays unstable for
	  DWG, but its DXF output is allowed, and the DXF import handles it.
	* encode.h: declare dwg_downgrade_MATERIAL (-Werror=missing-prototypes).
	* encode.c, downconvert.c: disable the unused disable_3DSOLID_materials
	  and downconvert_relative_handle (-Werror=unused-function).

	encode: dwg_downgrade_MATERIAL, add ACAD eed
	WIP still fixed values

	encode: re-enable MATERIAL
	GH #954

	ci: ppc64 check-minimal must pass
	It passes since the big-endian fixes, so a failure fails the job.

	ci: add an s390x big-endian job
	Cross-compile with gcc-s390x-linux-gnu and run make check-minimal under
	qemu-user.  Unlike the ppc64 job, a failure fails the job: all tests
	pass on s390x.

2026-11-14  Reini Urban  <reini.urban@gmail.com>

	Fix big-endian hosts (s390x)
	On s390x most r2007+ DWGs, DXFs and JSONs could not be read.  With the
	sysroot of Fedora and qemu-user all tests, also the programs/alive.test,
	pass now.

	* bit_read_H, bit_H_to_dat, dwg_set_handle_size: the handle value is a
	  number, not an array of bytes in little-endian order.
	* bit_read_DD, bit_write_DD: work on the numeric value of the double.
	* bit_read_BLL: assemble the bytes numerically.
	* decode_r2007: the UTF-16LE section names need their bytes swapped.
	* dwg_dynapi_common_value/set_value: preview_size copies the low 4 bytes
	  of the BLL, which are the last on big-endian.
	* dwg_find_tablehandle*, dwg_handle_name, in_dxf: num_entries is a BS, not
	  a BL, when it is read via dynapi.
	* in_json: the integers set via dynapi must have the size of the field,
	  not of an uint32_t.
	* in_dxf: the same for the DXF integers, and make the int, unsigned and
	  long views of Dxf_Pair.value the same number.
	* tests: the r2007 TU test strings and the CRC of bits_test are not
	  different on big-endian.

2026-11-14  Reini Urban  <reini.urban@gmail.com>

	ci: remove the mips32 job
	gcc-mips-linux-gnu is not available on the current Ubuntu runner.
	The ppc64 job still tests big-endian.

	add_test: no strncpy into a smaller buffer
	gcc -Werror=stringop-truncation failed the cmake, mingw and i686 builds.

2026-11-14  Reini Urban  <reini.urban@gmail.com>

	Write LWPOLYLINE and the R13+ entities as pre-R13 DXF (GH #1386)
	dwg2dxf --as r12 of an R13+ DWG wrote an empty ENTITIES section, or lost
	the vertices and attribs, and the LWPOLYLINEs.

	* dwg_write_dxf, dwg_write_dxfb: for a pre-R13 target from an R13+ source
	  build the BLOCK_HEADER.entities list from the entity chain of R13-R2000
	  DWGs (fill_owned_entities), and convert the LWPOLYLINEs to POLYLINEs
	  (downconvert_LWPOLYLINE).
	* out_dxf.c: write the vertices and attribs of POLYLINE and INSERT for a
	  pre-R13 target, from the owned list if there is one, else the links.
	* dwg_insert_entity: free the replaced decoded next_entity ref of the
	  previous entity, it leaked.

	Add a regression test.  72 generated R2000 DWGs now write the same
	entities to R12 DXF, and to R2000 DXF.

2026-11-14  Reini Urban  <reini.urban@gmail.com>

	downconvert_LWPOLYLINE: fail without model and paper space
	dwg_insert_entity() asserts a model space, which a fuzzed DWG may not
	have.  Found by CIFuzz.

	ci: fix the --enable-release setup and the mips32 job on new runners
	libxslt 1.1.39 does not build with the libxml2 of the newer Ubuntu
	runner, and the failed setup cancelled all other linux jobs by fail-fast.
	Install the system xsltproc, and use it if building libxslt fails.
	gcc-mips-linux-gnu is not available anymore on the new Ubuntu, so the
	mips32 job is allowed to fail.

2026-11-14  Reini Urban  <reini.urban@gmail.com>

	Write LWPOLYLINE to pre-R13 as POLYLINE with VERTEXes (GH #1386)
	Pre-R13 has no LWPOLYLINE, it was skipped.  Before a pre-R13 DWG is
	encoded from an R13+ source, convert each LWPOLYLINE in place to a
	POLYLINE_2D with its VERTEX_2Ds and SEQEND.  The points, bulges, widths,
	elevation, thickness, extrusion and the closed flag are kept, and so are
	layer, color, linetype and lineweight.  The new objects are created with
	the add API and moved to the position of the LWPOLYLINE, so that block
	entities stay in their block.

	Add a regression test.  250 generated drawings now keep all their
	polylines in every conversion between R12 and R2000.

2026-11-14  Reini Urban  <reini.urban@gmail.com>

	cmake: do not redefine _POSIX_C_SOURCE
	glibc 2.42 defines _POSIX_C_SOURCE as 202405L, and -Werror failed the
	cmake build with a redefinition.  Guard it with #ifndef, as configure.ac
	does for config.h.

2026-11-14  Reini Urban  <reini.urban@gmail.com>

	Keep the entities after a block POLYLINE, resolve ownerless sub-entities
	R2000 -> r2000 dropped every entity following a POLYLINE inside a block:
	the next_entity chain runs through the vertices, which are owned by the
	POLYLINE.  get_next_owned_block_entity and get_next_owned_entity took
	that for the end of the block, and returned NULL.  Skip the sub-entities,
	and check the owner only of the entity which is returned.

	* common.h: add the helpers is_attrib_vertex and is_insert_polyline, and
	  use them where the owner of a sub-entity is searched.
	* out_dxf.c (dxf_entities_write): ownerless VERTEX/SEQEND/ATTRIB of
	  pre-R13 files find their POLYLINE/INSERT by searching backwards and go
	  where it goes, instead of deciding on their own entmode.

	All of R12 -> r11/r12/r2000 and R2000 -> r11/r12/r2000 of 250 generated
	drawings now read back with every entity in its block.  GH #1386

2026-11-14  Reini Urban  <reini.urban@gmail.com>

	Fix the pre-R13 writer and DXF import gaps (GH #1386)
	Converting between pre-R13 and R13+ produced unreadable or incomplete
	DWGs.  Measured with generated R12 and R2000 DXF files, all of
	R12 -> r11/r12/r2000 and R2000 -> r11/r12 now convert and read back
	without errors, with every entity in the block it came from.

	* bits.c (bit_write_TV): the string length format follows the target
	  version, not the source.  A pre-R13 source written as r2000 used the
	  16-bit r11 length, which shifted every following field.
	* encode.c (encode_preR13_entities): VERTEX/SEQEND of R13+ polylines have
	  no entmode of their own, they follow their owner. They were dropped, so
	  POLYLINEs had no vertices.  Skip entities without a pre-R13 type
	  (LWPOLYLINE, MTEXT, ELLIPSE, SPLINE, RAY, ...) with a warning, they were
	  written with a bogus type and corrupted the rest of the file.
	* in_dxf.c (dxf_blocks_read): pre-R13 block entities have no owner. File
	  them under the open BLOCK_HEADER, and give handle-less BLOCK, ENDBLK,
	  SEQEND objects their handle right away, for block_entity, endblk_entity,
	  the owned list and the entity links.
	* in_dxf.c (dxf_postprocess_SEQEND): build the owned vertex/attrib list
	  also for pre-R13 sources, which may be written as R13+, and do not
	  modify the ownerhandle refs in place.  They are shared by code and
	  value, which changed the owner of the BLOCK entity to the POLYLINE.
	* out_dxf.c (dxf_entities_write): do not write the ownerless VERTEX/SEQEND
	  of block polylines into ENTITIES.
	* Add regression tests (add_test: handle-less R12 DXF blocks to r2000,
	  bits_test: TV length follows the target).

	Not fixed: R2000 -> r2000 drops the entities following a POLYLINE inside
	a block (the SEQEND has no next_entity link).  This was already so before.

2026-11-13  Reini Urban  <reini.urban@gmail.com>

	Write pre-R13 REPEAT spans as arrayed INSERTs in DXF
	REPEAT/ENDREP were emitted as bogus DXF entities, silently losing the array. Convert each span to an anonymous block plus INSERT/MINSERT with the ENDREP counts and spacing, for ASCII, binary and minimal output. Drop LOAD with a warning. Add add_test regression. GH #1354.

2026-11-13  Reini Urban  <reini.urban@gmail.com>

	dwgfilter: honor EXEEXT for dwgread/dwgwrite
	The script looked for dwgread and dwgwrite without the executable
	suffix, so on cross builds run via Wine (.exe) dwgfilter.test could not
	find the programs.

	* programs/dwgfilter.in: Append @EXEEXT@ to the dwgread and dwgwrite
	  paths. Empty on native builds.

2026-11-13  Reini Urban  <reini.urban@gmail.com>

	in_dxf: new_object dxfname is not nonnull
	clang -Werror,-Wpointer-bool-conversion rejected the dxfname test in
	new_object, as the parameter was declared __nonnull but is reset to
	NULL and tested when it is consumed or freed.

	* src/in_dxf.c (new_object): Drop dxfname from the __nonnull list.

2026-11-13  Reini Urban  <reini.urban@gmail.com>
	    omp + GPT 6.1 Terra  <codex@openai.com>

	Fix 4 DXF and JSON GH security advisories
	Preserve model-space and OLE client ownership during DXF import,
	initialize evaluation graph nodes,
	and derive SAB sizes from JSON data.

2026-11-12  Reini Urban  <reini.urban@gmail.com>

	Fix ATTRIB lock flags and roundtrips
	Preserve attribute lock flags and fix DWG and DXF stream handling.
	Fixes GH #1399

2026-11-12  garcialeal  <garcialeal2@gmail.com>

	geojson: transform the OCS of ARC, CIRCLE, polylines, TEXT, INSERT, HATCH
	These entities have their points in the OCS of their extrusion, but they
	were written as such: with the extrusion (0,0,-1), as MIRROR can make,
	an entity was written mirrored to the other side of the y axis.  Their
	points, with the elevation as z, now go through transform_OCS.  A
	mirrored CIRCLE is reversed, as RFC 7946 asks for its ring.  The test
	data has no such entity, so the GeoJSON of all test DWGs is unchanged.

	* src/out_geojson.c (geojson_is_wcs, geojson_ocs_points)
	(geojson_wcs_points, geojson_circle_wcs): New.
	(hatch_rings, dwg_geojson_LWPOLYLINE, dwg_geojson_object): Transform
	the OCS points of HATCH, LWPOLYLINE, POLYLINE_2D, ARC, CIRCLE, TEXT and
	INSERT.
	* test/test-data/2000/OcsEntities2.dxf: New, made with ezdxf.
	* test/Makefile.am: Add it.
	* programs/json.test.in: Check the OCS entities of both OcsEntities
	DXFs.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-12  Mar Dominguez  <mardgez13@gmail.com>

	in_dxf: keep the default GUIDs and *Model_Space name TV
	dynapi stores the strings of an imported drawing TV in every version
	(IS_FROM_TU_DWG), and 470dd3f3 keeps the HATCH, MULTILEADER, CellStyle
	and color name strings TV too. Two strings in_dxf makes itself were
	still TU for an r2007+ DXF: the default $FINGERPRINTGUID and
	$VERSIONGUID, set when the header has none, and the name of the initial
	*Model_Space BLOCK_HEADER, replaced at $ACADVER. dxfwrite and dxf2dwg
	wrote both GUIDs as "{", and dxf2dwg of an r2007+ DXF without a TABLES
	section named the model space block "*". Keep them TV, as
	dwg_add_u8_input made that name.

	* src/in_dxf.c (dxf_header_read): Keep the *Model_Space name TV.
	  (dxf_fixup_header): Store the default GUIDs TV.

2026-11-12  Reini Urban  <reini.urban@gmail.com>

	decode: fix invalid handle errors
	e.g. with 2018/Dynblocks

2026-11-11  Mar Dominguez  <mardgez13@gmail.com>

	out_dxf, out_dxfb: write xdata strings in the width they are stored in
	dxf_write_xdata, dxfb_write_xdata and dxfb_write_eed chose a string's
	width by the chain (IS_FROM_TU), not by the string's own is_tu, as
	dxf_write_eed, out_json and the encoder do. A DXF import for an r2007+
	target (dxfwrite without --as) stores its XRECORD and EED strings as
	TU, while dwg_write_dxf reads its T strings as TV (DWG_OPTS_IN), so
	dxfwrite wrote each XRECORD string of an r2007+ DXF as its first
	character ("ACDMAC" as "A", in every XRECORD of test-data
	2007/Text.dxf, 2010/Leader.dxf and 2018/Dynblocks.dxf).

	decode left an empty r2007+ xdata string with is_tu 0 and no data;
	mark it TU too, so that is_tu matches the chain for every decoded
	drawing and its DXFB output stays an empty TU string.

	* src/out_dxf.c (dxf_write_xdata), src/out_dxfb.c (dxfb_write_xdata,
	  dxfb_write_eed): Write a string by its is_tu.
	* src/decode.c (dwg_decode_xdata): An empty r2007+ string is TU.

2026-11-11  Hung Chu  <hungcqrt@gmail.com>

	decode, encode: the color book handle follows the xdic handle
	The color book handle of an entity (ENC flag 0x40) was read and written
	as the first handle of the handle stream. ODA 20.4.2 lists it after the
	owner, reactors and xdic handles and the R13-R2000 links, before the
	layer. The two places are the same unless the entity has an owner
	handle, reactors or an xdic. With one of them, e.g. the VERTEX_2D and
	SEQEND of a polyline with a color book color, the owner handle was
	taken for the color book handle and the color book handle for the
	owner.

	* src/common_entity_data.spec: Leave the color book handle to
	common_entity_handle_data.spec in the decoder too.
	* src/common_entity_handle_data.spec: Read and write it before the
	layer handle.
	* src/encode.c (dwg_encode_common_entity_handle_data): Don't write it
	first.

	No testcase: no drawing in test/test-data has an entity with a color
	book color.

2026-11-10  Reini Urban  <reini.urban@gmail.com>

	lint: prek changes

	Move conversion helpers to downconvert.c
	less code in encode.c, it's big enough already

2026-11-10  Reini Urban  <reini.urban@gmail.com>

	bits: unescape \U+/\M+ in bit_utf8_to_TU
	bit_utf8_to_TU converts UTF-8 input to the stored UCS-2 (BITCODE_TU)
	form for the add path (dwg_add_u8_input, in_dxf, in_json, encode).
	For R2007+ DWG (IS_FROM_TU) the stored UCS-2 MTEXT is written verbatim
	to DXF by the VALUE_TU path (bit_convert_TU, no bit_u_expand), so a
	literal \U+XXXX / \M+xxxxx escape sequence stayed literal in the
	output instead of expanding to the actual glyph.

	Expand the escape sequences at the point the string is converted into
	UCS-2, the same way AutoCAD decodes them and the way bit_TV_to_utf8
	already does on the TV path. Run bit_u_expand on a copy of the input
	because it shrinks in place and str is the caller's restrict buffer;
	it is a no-op for strings without a real \U+ / \M+ sequence.

	* src/bits.c (bit_utf8_to_TU): expand \U+XXXX / \M+xxxxx to the
	  actual UTF-8 characters before the UTF-8->UCS-2 conversion.

	GH #1414

2026-11-10  Mar Dominguez  <mardgez13@gmail.com>

	bits: write a TU source of T16 for r2007+ by its characters
	bit_write_T16 wrote a TU source (an r2007+ DWG) for an r2007+ target
	with chain[i], one byte per RS: the first half of its bytes, instead of
	its characters. dwgrewrite --as r2013 of an r2010 DWG wrote its
	Template description back as its first character. Write the TU units,
	as the TV branch above does with the converted string.

	* src/bits.c (bit_write_T16): Write the TU units for r2007+.

2026-11-10  garcialeal  <garcialeal2@gmail.com>

	dwg2SVG, dwg2ps: OCS of LINE, POINT, MTEXT and ARC
	The points of LINE, POINT and MTEXT are WCS, but they were taken
	through the OCS: before R13 every LINE and POINT was drawn at one
	point, and the MTEXT of 2007/ATMOS-DC22S.dwg was out of the drawing.
	A mirrored ARC took its ends around the transformed center with
	unmirrored angles.  dwg2ps gave PS_arc radians for degrees, and did
	not stroke ARC and CIRCLE.

	* programs/dwg2SVG.c (output_MTEXT, output_LINE, output_POINT): Use the
	WCS points.
	(arc_point): New.
	(output_ARC): Take the ends from the OCS, and the sweep from
	transform_OCS_2d_is_mirrored.
	* programs/dwg2ps.c (ps_arc_angle, ps_arc): New.
	(create_postscript): Use the WCS points of LINE.  Draw ARC with ps_arc.
	Stroke CIRCLE.
	* test/test-data/2000/OcsEntities.dxf: New, made with ezdxf.
	* test/Makefile.am: Add it.
	* programs/svg.test.in: Check it, a LINE of r11/entities-2d.dwg and the
	MTEXT of 2007/ATMOS-DC22S.dwg.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-10  garcialeal  <garcialeal2@gmail.com>

	geom: fix transform_OCS from OCS to WCS
	For an extrusion other than (0,0,1) and (0,0,-1), transform_OCS and
	transform_OCS_2d applied the transposed matrix, WCS to OCS: with the
	extrusion (0.6,0,0.8) the point (1,2,3) became (2,1,3), not
	(0.2,1,3.6).  transform_OCS also took the extrusion (0,0,0) of
	entities before R13 as a direction, and gave no number; and with
	(0,0,-1) it kept z.

	* src/geom.c (transform_OCS_2d, transform_OCS): Map the point to the
	OCS axes.
	(transform_OCS): Keep the point for (0,0,0), as transform_OCS_2d does.
	Negate z for (0,0,-1).
	* test/unit-testing/geom_test.c (ocs_transform_tests): New.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-09  garcialeal  <garcialeal2@gmail.com>

	dwg2SVG: draw ARC across angle 0 and ELLIPSE arcs
	An ARC across angle 0 with a span over pi got the large-arc flag 0, as
	the span was end - start without normalizing, so the short arc was
	drawn: 37 of the 659 arcs in the test data.  An ELLIPSE arc was drawn
	as the full ellipse: 94 arcs.

	* programs/dwg2SVG.c (output_ARC): Take the span in (0, 2 pi].
	(ellipse_point): New.
	(output_ELLIPSE): Write an arc as a path with an elliptical arc: the
	minor axis is axis_ratio * (extrusion x major axis), the sweep is
	set for a clockwise arc.  A full ellipse stays an <ellipse>.
	* programs/svg.test.in: Check an ARC of example_2000.dwg and an
	ELLIPSE arc of 2013/gh109_1.dwg.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-09  garcialeal  <garcialeal2@gmail.com>

	geojson: close a full ELLIPSE with rounded angles
	A full ELLIPSE whose angles are a few ulp off a full turn, such as
	pi to 3 pi + 4e-15 in 2013/gh109_1.dwg, left a span of 4e-15 and was
	written as a tiny LineString.  #1508 missed this case.

	* src/out_geojson.c (dwg_geojson_ELLIPSE): Close also a span below 1e-9.
	* programs/json.test.in: Check the full ellipse 4F1 of 2013/gh109_1.dwg.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-09  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Remove trailing text_style from 0x08 cell flag
	There is 0x10 cell flag for it.

2026-11-09  Reini Urban  <reini.urban@gmail.com>

	in_dxf: fix Dxf_Pair and object leaks on DXF import
	ASAN (LSan) on dxf2dwg of the example_* corpus showed leaks:

	- in_dxf.c: the add_AcDbSectionViewStyle/add_AcDbDetailViewStyle
	  dispatch overwrote the triggering pair without freeing it. Those
	  helpers read their own pairs via FIELD_* macros and never consume
	  the caller's pair, unlike the pair-taking siblings.
	- in_dxf.c: BLOCK_HEADER reuse freed only the BLOCK_HEADER struct;
	  use dwg_free_object to free all fields and the generic struct.
	- in_dxf.c: the DIMENSION subtype branches replaced obj->dxfname
	  without freeing the old one; also keep dxfname=NULL so the fail
	  path does not double-free the caller's copy.
	- dwg.spec: FREE xref_pname (BLOCK, r13+) and column_heights
	  (MTEXT) - DXF-import-only allocations.
	- dwg2.spec: FREE classname in AcDbAssocPersSubentId_fields -
	  DXF-import-only allocation.

	Verified: ASAN corpus ea2000..ea2018 all leak-free; make check
	all 23 tests pass.

2026-11-09  Mar Dominguez  <mardgez13@gmail.com>

	in_dxf: read $DWGCODEPAGE in the width dynapi stored it
	dxf_set_DWGCODEPAGE guessed a TU name from a 0 second byte once
	header.version is r2007+. But an imported $DWGCODEPAGE is TV: dynapi
	stores a string as TU only if IS_FROM_TU_DWG, which is never the case
	for a DXF import (and when it chose by header.version, that was still
	R_INVALID while the HEADER of an r2007+ DXF is read). So a
	one-character name is a 2-byte TV, and bit_convert_TU read it 2 bytes
	past its end (heap-buffer-overflow). Decide by IS_FROM_TU_DWG, as
	dynapi does.

	* src/in_dxf.c (dxf_set_DWGCODEPAGE): Read the name as TU only if
	  IS_FROM_TU_DWG.

2026-11-09  Reini Urban  <reini.urban@gmail.com>

	encode_test: pass the document opts to the AcDs SAB roundtrip
	dwg_add_Document sets DWG_OPTS_INDXF for r2013+, so the header strings
	are TV. dwg_encode copies dwg->opts into dat->opts only when dat->version
	is unset, and the test sets it, so the encoder read the TV strings as TU
	and bit_wcs2len ran past the buffer (ASAN heap-buffer-overflow). Set
	dat.opts explicitly for the encode, and clear it again for the binary
	decode.

2026-11-09  Reini Urban  <reini.urban@gmail.com>

	json: roundtrip the AcDs data records
	The data records of the AcDs section which do not belong to an ACIS
	entity we have, i.e. the thumbnail PNG, are kept in acds.records, but
	the JSON AcDs section has only the segment layout. A DWG to JSON to DWG
	roundtrip lost them: 14720 instead of 16768 bytes for example_2018.dwg,
	and the records of entities we cannot decode were lost with their data.

	Write them as AcDs.records, with the handle, the schema index, the size
	and the data as hex, and read them back. The SAB data of the ACIS
	entities is in the entities, and was already kept. The AcDs section of
	example_2018.dwg is now identical, byte by byte, after the JSON
	roundtrip.

	* src/acds.spec (IS_JSON): Write the records.
	* src/in_json.c (json_AcDs_Records): New, read them in json_AcDs.
	* test/unit-testing/encode_test.c (acds_records_json_test): New.

	GH #1411

2026-11-09  Reini Urban  <reini.urban@gmail.com>

	acds: read and write the SAB data of ACIS entities, r2013+
	AutoCAD r2013+ keeps the SAB data of the ACIS entities (3DSOLID, REGION,
	BODY, surfaces) in the AcDb:AcDsPrototype_1b section, not in the entity,
	which has only has_ds_data. We found the SAB only by searching the
	section for an "ACIS BinaryFile" header, which AutoCAD does not write,
	it writes "ASM BinaryFile4", so all those entities stayed empty. We did
	not write the section either, and the ACDSDATA section of the DXF was
	ignored on import, not written on export. The geometry was silently
	lost in each conversion.

	Read the data records by the handle: the data index entries point to
	the record headers (size, 1, handle, local offset) of the _data_
	segments, the data starts at the object data alignment offset of the
	segment, with an UInt32 size, or the marker 0xBB106BB1 for a blob
	reference to the pages in blob01 segments (data > 0x40000). Records
	which are not for a ACIS entity we have, i.e. the thumbnail PNG, or an
	entity we cannot decode, are kept in acds.records, to be written back.

	Write the section from the entities when encoding to r2013+: the
	segidx, datidx, _data_, schidx, schdat and search segments, the schema
	segments are constant. The result for example_2018.dwg is identical to
	AutoCAD's section, byte by byte. With blob01 pages the order of the
	segments is as ODA writes it. The entities then have has_ds_data and
	the acis_empty_bit set.

	The DXF r2013+ has the SAB in the ACDSDATA section, with the constant
	ACDSSCHEMA elements and an ACDSRECORD per entity with the handle 320
	and the data 310, and an empty entity. Read and write it, also as
	binary DXF.

	Checked with ODAFileConverter: it reads our section of example_2018, of
	a DXF REGION by ezdxf, and with large data in blob01 pages (0.3 and 1.2
	MB), and we read ODA's sections with blob pages. The issue reproducer
	(ezdxf REGION, dxf2dwg --as r2018, dwg2dxf) now has the 5489 bytes SAB
	and the ACDSDATA.

	The SAB cannot be written to R2000 and older, we convert it to SAT v1
	there, as the DXF export does. The ASM SAB of r2013+ cannot be converted
	to the SAT or to older versions, and is not written there. SAT v1 data
	cannot be converted to SAB, and is not written to r2013+.

	* include/dwg.h (Dwg_AcDs_Record): New, the other data records.
	  (Dwg_AcDs): Add num_records, records.
	  (Dwg_Data): Remove the temporary acis_sab_hdl.
	  (dwg_obj_get_sab, dwg_obj_set_sab): New.
	* src/acds.c: New. acds_assign_sab reads the data records into the
	  entities, acds_collect_records lists the records to write.
	* src/acds.h: New.
	* src/acds.spec: No search for the SAB, see acds.c.
	* src/decode.c, src/decode_r2007.c (read_*_section_acds): Call
	  acds_assign_sab, also with a damaged later segment.
	* src/encode_acds.c: New, encode_acds writes the section.
	* src/encode.c (encode_r2004): Write the SECTION_ACDS, compressed.
	* src/common_entity_data.spec: Set has_ds_data from the SAB data.
	* src/dwg_spec_shared.h (encode_3dsolid): Set the acis_empty_bit for
	  r2013+, convert the SAB to SAT v1 for r2000-, no ASM SAB before r2013.
	  (free_3dsolid): Free block_size and encr_sat_data also with acis_empty,
	  which the encoder sets for the data it cannot write.
	* src/dwg.c (dwg_obj_get_sab, dwg_obj_set_sab): New.
	* src/free.c: Free the records, and no acis_sab_hdl.
	* src/out_dxf.c, src/out_dxfb.c (dxf_acds_write): The ACDSDATA section.
	  (dxf_3dsolid, dxfb_3dsolid): No data in the entity for r2013+.
	* src/in_dxf.c (dxf_acds_read): Read the ACDSDATA section.
	* src/Makefile.am, CMakeLists.txt: Add acds.c and encode_acds.c.
	* test/unit-testing/encode_test.c (acds_sab_test): New, 3 REGIONs, one
	  in a blob, roundtripped.
	* test/unit-testing/Makefile.am (decode_test_LDADD, encode_test_LDADD):
	  Add acds.lo, encode_acds.lo.
	* test/unit-testing/CMakeLists.txt (decode_test): Add acds.c.

	GH #1411
	Reported-by: kentruong174

2026-11-09  Mar Dominguez  <mardgez13@gmail.com>

	out_json, out_geojson: take DWG_OPTS_IN from the drawing
	An imported (DXF, JSON) drawing keeps its T strings as TV, as dynapi
	stores them (IS_FROM_TU_DWG). dwg_write_dxf and dwg_write_dxfb take
	DWG_OPTS_IN from dwg->opts into the chain, so IS_FROM_TU (dat) reads
	them as TV, but dwg_write_json and dwg_write_geojson did not: through a
	chain naming an r2007+ from_version they read them as TU.
	json_header_write read past each header string in print_wcquote
	(heap-buffer-overflow), and dwg_geojson_feature freed the layer name,
	which dwg_obj_table_get_name returns uncopied for such a drawing
	(heap-use-after-free at the next entity of that layer).

	* src/out_json.c (dwg_write_json), src/out_geojson.c
	  (dwg_write_geojson): Take DWG_OPTS_IN from the drawing, as
	  dwg_write_dxf does.

2026-11-08  Reini Urban  <reini.urban@gmail.com>

	dynapi_test: TABLE col_widths and row_heights counts
	With ACAD_TABLE stable in objects.c, dynapi_test no longer forgives the
	failed TABLE tests (7 files, rc=7). The generated tests for
	TABLE.col_widths and TABLE.row_heights looked for the non-existing
	count fields num_col_widths and num_row_heights, but the sizes are
	num_cols and num_rows.

	* src/gen-dynapi.pl (%countfield): col_widths => num_cols,
	  row_heights => num_rows.
	* test/unit-testing/dynapi_test.c: Regenerate.

2026-11-08  Reini Urban  <reini.urban@gmail.com>

	dxf: write the TABLE block record handle as 343
	The ACAD_TABLE had the block name as DXF 2, but not the handle of its
	anonymous block (*T) as 343 in the AcDbTable subclass, which AutoCAD and
	ODA write. FIELD_HANDLE (block_header, 5, 2) writes the name, and a
	handle with another dxf code writes only the handle, so write both.

	Checked with the table.dwg of GH #1062: our DXF has 2 *T115 and 343 28B,
	as ODAFileConverter writes it for the same drawing, ODA reads our DXF,
	and dxf2dwg reads it back with the same block_header (the name looks it
	up, the 343 is not needed).

	* src/dwg2.spec (TABLE): In the DXF write block_header also as 343.

	GH #1062

2026-11-08  Reini Urban  <reini.urban@gmail.com>

	objects.c: regenerate, ACAD_TABLE is stable
	* src/objects.c: Regenerate with make regen-gperf, from objects.in
	  where TABLE was made stable in da34cdf6a, and in classes.inc for the DXF
	  before.

2026-11-08  Reini Urban  <reini.urban@gmail.com>

	TABLE: the pre-R2007 cell alignment is a BS, not a RS
	An AC1015 TABLE with cell overrides was decoded wrongly after the first
	cell with an alignment override: the cells got garbage, and decoding
	ended with "Invalid ACAD_TABLE.cells x 24" or buffer overflows, leaving
	the rest of the entity as unknown bits.

	The cell alignment, present with bit 0x01 of the cell flag override, is
	a bitshort, as the other values around it, not a raw short as the ODA
	spec says. Checked on the table.dwg of GH #1062 (6 columns x 4 rows, 24
	cells, overrides in many cells, in AC1015): all cells now decode with
	the same texts, flags, merges, text heights (2.0, 1.5) and alignments as
	ODAFileConverter reads them (it only omits the default alignment 1), no
	errors, and a dwgrewrite roundtrip reads back the same.

	The regeneration also moves TABLE to the stable objects in dwg_api.h
	and objects.in, which was missed with the TABLE class made stable for
	the DXF.

	* include/dwg.h (Dwg_TABLE_Cell): cell_alignment is a BITCODE_BS.
	* src/dwg2.spec (TABLE): Read and write it as BS.
	* src/dynapi.c, doc/dynapi.texi, include/dwg_api.h, src/dwg_api.c,
	  src/objects.in, bindings/dwg.i: Regenerate.

	No test added: the unit tests have no AC1015 table with overrides, and
	the sample of the issue is not in the tree.

	GH #1062

2026-11-08  Reini Urban  <reini.urban@gmail.com>

	downconvert: move TABLE/TABLESTYLE conversion out of encode.c
	out_dxf.c calls downconvert_TABLE and downconvert_TABLESTYLE via
	dwg2.spec (IS_DXF), but encode.c is not built with --disable-write,
	which failed to link with undefined references.

	* src/downconvert.c: New, with downconvert_TABLE, downconvert_TABLESTYLE,
	  upconvert_TABLESTYLE and their static helpers, moved from encode.c.
	* src/encode.c: Remove them.
	* src/Makefile.am (libredwg_la_SOURCES): Add downconvert.c, always built.
	* CMakeLists.txt (libredwg_SOURCES): Likewise.

2026-11-08  Reini Urban  <reini.urban@gmail.com>

	dxf: write ACAD_TABLE in the pre-R2010 form, read R2007 rowstyles
	The TABLE entity was not written to DXF at all, as its class was
	unstable. AutoCAD and ODA write ACAD_TABLE in the pre-R2010 form for
	every DXF version, so R2010+ tables are downconverted first.

	Checked with ODA: ODAFileConverter reads our R2000 and R2018 DXF of
	example_2000/example_2018 into tables with 20 rows x 9 columns, the
	merged first row and the cell texts. dxf2dwg reads them back as well:
	texts, merges, widths, heights and flags are the same as in the DWG.

	The R2007 TABLESTYLE rowstyles have a data type, unit type and format
	string after the borders, which were commented out. Without them the
	title and header rowstyles of all R2007 files were misread (text height
	1.0 and 0.0 instead of 6.0 and 4.5).

	* src/classes.inc: Make the TABLE class stable for DXF.
	* src/dwg2.spec (TABLE): In the DXF only the pre-R2010 cells, after
	  downconvert_TABLE. R2007+ cells have the CELL_VALUE .. ACVALUE_END
	  block (301, 304) and the text only there, as ODA. The cell flag
	  override 177 before R2007 is 16 bit signed.
	  (TABLESTYLE): Read the R2007 rowstyle data_type, unit_type and
	  format_string. downconvert_TABLESTYLE also for the DXF.
	* src/dwg_spec_shared.h (TABLE_value_fields): R2007+ string values as
	  DXF 1 without the data size.
	* src/out_dxf.c: Drop the ACAD_TABLE/TABLECONTENT special case. Add
	  FIELD_TABLE_STRING.
	* src/out_dxfb.c: Include encode.h.
	* src/in_dxf.c (add_AcDbTableCells): 177 is 16 bit, 91 is the R2007+
	  cell flag override, both set additional_data_flag.
	* src/encode.c (downconvert_TABLE): Also set the R2007+ string value.
	* src/free.c (free_TABLE_r2010): Free it.

	make check: only the known solid_background hang fails.

2026-11-08  Reini Urban  <reini.urban@gmail.com>

	tablestyle: read the three R2010+ cell styles, convert both ways
	The R2010+ TABLESTYLE has, after the "Table" cell style, a count (3) and
	then the title, header and data cell styles. We read the count as
	numoverrides and then only one cell style (ovr), with a misplaced
	unknown_bl3. That left 6688 bits unread in example_2018, and made the
	down- and up-conversion guess: the title style was written as the data
	rowstyle, the margins were lost, the border order, invisibility and fill
	color were wrong.

	Each entry is the cell style id (1 title, 2 header, 3 data), the cell
	style (type 5, as the Table style), the cell style id again, the class
	and the name (_TITLE, _HEADER, _DATA). The first id is always the same
	as the last one: checked in all 141 R2010+ sample files, always 3
	styles. The main stream now ends exactly at the start of the string
	stream.

	Checked against AutoCAD's own files: the rowstyles downconverted from
	example_2018 are identical to the native example_2000 rowstyles in every
	field, the cell styles upconverted from example_2000 are identical to
	the example_2018 cell styles, and a same-version rewrite is identical.

	* include/dwg.h (Dwg_Object_TABLESTYLE): Replace numoverrides,
	  unknown_bl3 and ovr by num_cellstyles and cellstyles.
	* src/dwg2.spec (TABLESTYLE): Read the cell styles. Not in the DXF,
	  where they only exist in the CELLSTYLEMAP. flow_direction is 0 or 1.
	  Downconvert before the margins are written.
	* src/encode.c (downconvert_TABLESTYLE): Use the cell styles by id, map
	  the border edge flags to the rowstyle border order, invert the
	  invisibility, use the table cell style margins, default fill color as
	  AutoCAD. Do not share strings, copy non-global handles.
	  (upconvert_TABLESTYLE): Write the three cell styles from the rowstyles
	  and the AutoCAD defaults for the Table cell style.
	* src/free.c (free_TABLESTYLE_r2010): Simplified.
	  (free_TABLESTYLE_upconverted): New, free() follows from_version.
	* src/gen-dynapi.pl: Drop the ovr special case.
	* src/dynapi.c, doc/dynapi.texi, test/unit-testing/dynapi_test.c:
	  Regenerate.
	* test/unit-testing/encode_test.c (downconvert_TABLESTYLE_test): New.

	Custom cell styles (id > 100), content formats, and border line types
	and double lines are lost when downconverting.

2026-11-08  Reini Urban  <reini.urban@gmail.com>

	encode: downconvert R2010+ TABLE to the pre-R2010 cells
	Writing a R2010+ TABLE as R2000-R2007 produced an empty table
	(0 columns, 0 rows), because the pre-R2010 branch of the spec only looks
	at the old cell fields, while the R2010+ data is kept in the table
	content (LinkedTableData). downconvert_TABLE existed, but was never
	called, read the cell text from the wrong field, and the columns stayed
	unset.

	R2010+ stores the cell strings as UTF-16LE bytes in value.data_date, not
	as value.data_string. Merged cells follow what AutoCAD writes itself in
	example_2000.dwg: the top left cell holds the extent (merged_width_flag
	x merged_height_flag), the covered cells have is_merged_value set.

	The converted table of example_2010/2013/2018 is identical to the native
	example_2000 table: 20 rows x 9 columns, same cell texts, merge, widths,
	heights, flag_for_table_value 0x16 and horiz_direction.

	* src/dwg2.spec (TABLE): Call downconvert_TABLE when encoding a TABLE
	  that came from R2010+ to <R2010.
	* src/encode.c (downconvert_TABLE): Check obj before use. Skip tables
	  which have pre-R2010 cells already. Convert column widths, row heights,
	  text (or block with scale and attribute texts) of the first cell
	  content and merged cells. Set horiz_direction and the table flag.
	  Strings keep the TU/TV flavour of the source.
	  (table_dup_T, table_ascii_to_T, table_value_text): New helpers.
	* src/free.c (free_TABLE_r2010): Free the downconverted cells, which the
	  R2010+ spec does not know. Like free_TABLESTYLE_r2010, free() follows
	  from_version, not version. Found with valgrind.
	* test/unit-testing/encode_test.c (downconvert_TABLE_test): New.

	Not converted: cell styles, formats, borders, additional cell contents.

2026-11-08  Reini Urban  <reini.urban@gmail.com>

	decode: cap the REPEAT size check per element; read r2010+ tables
	REPEAT_CHKCOUNT compares count * sizeof (struct), as a number of bits,
	with the remaining bits. The memory size of a struct is no wire bound:
	a Dwg_TableRow holds many pointers, so the r2010+ TABLEs of
	example_2010/2013/2018 were rejected (Invalid ACAD_TABLE.tdata.rows) and
	left as unknown bits. Cap the per-element size at 32, which only
	loosens the check. The unit stays one bit per struct byte, a stricter
	bound would reject valid small repeats (MLINE lines, evaluation graph
	nodes), leaking what was already allocated.

	With this the r2010+ tables decode fully: insert data, the table
	content (columns, rows, cells), the horizontal direction and the break
	data, ending with a verified CRC and no leftover. Checked on
	example_2010/2013/2018.

	Part of GH #1446. The rest of it (the r2010+ TABLESTYLE cell styles,
	downconvert_TABLE, ACAD_TABLE in DXF) needs the ODA 20.4.101 layout and
	is not in this commit.

	* src/dec_macros.h (REPEAT_CHKCOUNT, REPEAT_CHKCOUNT_LVAL): Cap the
	  per-element size at 32.

2026-11-08  Reini Urban  <reini.urban@gmail.com>

	in_dxf: rename scan variable to avoid shadow

2026-11-08  Reini Urban  <reini.urban@gmail.com>

	in_dxf: join MTEXT text chunks before codepage conversion
	The text of an MTEXT entity is split into 250-char chunks: code 3 for
	the leading chunks and code 1 for the last one. dxf_read_pair converts
	each r2007+ UTF-8 string to the pre-r2007 target codepage on its own, so
	a multi-byte character that spans a chunk boundary was corrupted
	("∅" read back as "âˆ…", "隔日" as mojibake).

	Keep the chunks as raw UTF-8 while reading (dxf_mtext_text) and convert
	the joined text once at the end of the entity, like dxf_pair_string
	does for the other text fields. A r2007+ target keeps the UTF-8;
	bit_write_T converts it to TU.

2026-11-08  Reini Urban  <reini.urban@gmail.com>

	dxf: more DXF import and export fixes
	Reimplemented from the description of PR #1445, each checked against a
	drawing that shows the problem.

	* src/in_dxf.c (new_LWPOLYLINE): The flag 70 only sets the closed and
	  plinegen bits and keeps the others. A width given only by 41 is valid.
	  The vertex ids set their flag.
	  (dxf_scan_modelspace_handle): New. The generated *Model_Space takes the
	  handle of the BLOCK_RECORD *Model_Space of the ASCII DXF, not 0x1F.
	  gh209_1.dxf had the handles 0x1F and 0xB twice.
	  (add_embedded_MTEXT): New. The embedded MTEXT of multi-line ATTDEF and
	  ATTRIB (r2018) after the 101 marker is read into mtext, and does not
	  overwrite the attribute's own fields. sample_AC1032 failed with
	  "Invalid DXF code 90 for ATTRIB". The ATTRIB attribute type is 71 in
	  the AcDbXrecord subclass.
	  SPATIAL_FILTER: its own reader for the clip vertices 10/20, the origin
	  11/21/31 and all doubles 40, front and back clip z, inverse and
	  transform matrix. The first clip vertex lost its x, the origin was
	  appended as a vertex and the inverse matrix was NaN (gh44-error.dwg).
	  Header defaults for TEXTSIZE, DIMTXT, LTSCALE, CELTSCALE, DIMLFAC,
	  DIMTFAC and DIMALTF, where 0 is invalid. FreeCAD omits two of them.
	* src/dwg.spec (LWPOLYLINE): Clear the vertex id flag before r2010.
	* src/dwg2.spec (SPATIAL_FILTER): The back clip z is DXF 40.
	* src/encode.c: VX_CONTROL takes the handle 0xB only if it is free.
	* src/out_dxf.c (decl_dxf_process_INSERT, decl_dxf_process_VERTEX): Follow
	  the entity links to the last attrib/vertex, not the next objects. The
	  SEQEND may lie between the attribs: sample_AC1014/AC1015 wrote 2 of 4.
	  (dwg_dxf_variable_type): R13/R14 drawings keep their newer classes,
	  they are only skipped when converting a newer drawing to R13/R14.

	Not reproducible on master: SHAPE name, HATCH seed (0,0), 3DSOLID revision
	guid, the UTF-8 to codepage conversion.

2026-11-08  Reini Urban  <reini.urban@gmail.com>

	dxf: EED 1003, off-layer colors, hatch names, standard names
	More of PR #1445, the parts still broken:

	- EED 1003 is the layer NAME in DXF. in_dxf did not implement it; out_dxf
	  wrote the handle number. Now the name is resolved to the layer handle on
	  import and back to the name on export.
	- The negative color of an off layer was written into the DWG as index
	  65529. The off bit says off, the color stays positive, as AutoCAD.
	- HATCH/MPOLYGON: the stored pattern name with its island suffix
	  ("SOLID,_O") is kept, as AutoCAD writes it.
	- The standard names STANDARD/BYLAYER/BYBLOCK/*ACTIVE were downcased in
	  every r2000+ DXF. Only when converting from pre-R2000, as a newer
	  drawing may really have "STANDARD" (gh109_1).

	* src/in_dxf.c (add_eed): EED 1003.
	* src/out_dxf.c (dxf_eed): 1003 writes the layer name. Include dynapi.h.
	  (dxf_object_value): downcase only from pre-R2000.
	* src/dwg.spec (LAYER, HATCH, MPOLYGON): the above.

2026-11-08  Reini Urban  <reini.urban@gmail.com>

	dxf: table lookup, tags, 420 colors; write entities when downconverting
	From the PR #1445 description, the parts which are still broken:

	- dwg_find_tablehandle matched ignoring case in the same pass as the exact
	  match, so with STANDARD and Standard (gh109_1) the wrong entry won. Now
	  two passes: exact first, then ignoring case.
	- dwg_is_valid_tag rejected every char but $ _ - # and alnum without
	  lowercase, so a tag like SPACEOBJECTS:NUMBER (aec_objects) was rejected.
	  AutoCAD allows any character but space and !; the ASCII variant also
	  accepted the empty tag. add_test follows.
	- out_dxf wrote the 420 true color with the method byte and as %li
	  (negative on Windows). It is a 24bit RGB.
	- dwg2dxf --as r2000 of r2004+ drawings wrote an empty ENTITIES section:
	  the owned-entity getters only followed the first_entity chain, which an
	  r2004+ source does not have. They now fall back to the entities[] list.

	* src/dwg.c (dwg_find_tablehandle): exact match first.
	  (get_first_owned_entity, get_next_owned_block_entity): entities[] fallback.
	* src/dwg_api.c (dwg_is_valid_tag): any char but space and !.
	* src/out_dxf.c (dxf_CMC): 420 without the method byte.
	* test/unit-testing/add_test.c: follows the tag rule.

2026-11-08  Reini Urban  <reini.urban@gmail.com>

	HACKING: recommend rcc as compiler

2026-11-08  garcialeal  <garcialeal2@gmail.com>

	geojson: fix ELLIPSE and ARC geometry
	A full ELLIPSE collapsed to one point, as both angles were normalized
	and 2 pi became 0.  An elliptic or circular arc was written as a closed
	Polygon without its end point, and a mirrored ELLIPSE, with extrusion
	(0,0,-1), was drawn on the wrong side of its major axis.

	* src/out_geojson.c (dwg_geojson_ELLIPSE): New.  The minor axis is
	  axis_ratio * (extrusion x major axis).  A closed ELLIPSE is a Polygon,
	  an arc a LineString up to its end point.
	  (dwg_geojson_object) <ARC>: Write a LineString up to the end point.
	* programs/json.test.in: Check an ellipse arc of 2013/gh109_1.dwg and
	  the ellipse and arcs of example_2000.dwg.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-07  Reini Urban  <reini.urban@gmail.com>

	encode: write R2000 from newer (and R13/R14) drawings as AutoCAD does
	Checked by rewriting ACadSharp's sample_AC1014..AC1032 (AutoCAD's own
	saves of one drawing) as R2000 and reading them with ACadSharp, against
	AutoCAD's own sample_AC1015.dwg. Not needed anymore, or fixed here:

	- VERTEX and ATTRIB links: R2004+ keeps the owned entities in a handle
	  list, R13-R2000 in a chain. first_vertex/first_attrib were written as
	  null. A pre-pass builds first/last from the lists, as absolute handles
	  (code 4) like AutoCAD, not relative.
	- EED strings of r2007+ sources: the codepage was written little-endian
	  (0x1E00), the length was that of the UTF-16 string, and the buffer
	  checks were inverted. Now RS_BE, the converted length.
	- MTEXT of R13/R14 sources: no line spacing in R2000+, a 0 collapses the
	  lines. Default 1 and 1.0 when writing pre-R2000.
	- LAYER of R13/R14 sources: no plot flag and lineweight. Default plot
	  and DEFAULT when writing pre-R2000.
	- Names: BYBLOCK, BYLAYER, CONTINUOUS, STANDARD, *ACTIVE of R13/R14
	  become ByBlock, ByLayer, Continuous, Standard, *Active, also the
	  dictionary keys, as AutoCAD's R2000 saves.
	- Colors: the r2004+ entity color (ENC) has no method byte, so every
	  ByBlock entity became ByLayer. A true color now keeps the ACI index
	  next to it, else the nearest palette color, not the low byte. The ACI
	  palette (rgb_palette) is now AutoCAD's table (agrees with ezdxf,
	  ACadSharp in 251 of 256 entries); the one common_test value follows.
	- Lineweight of R13/R14 entity sources: 0 (0.00 mm), now ByLayer.
	- MLINESTYLE lines: R2018+ keeps the linetype as handle, earlier as
	  index. The handle is now converted (ByLayer 32767, ByBlock 32766,
	  CONTINUOUS 0, else the position in LTYPE_CONTROL).
	- MTEXT line breaks and gradients: LF of newer sources is written as
	  \P as AutoCAD does; a gradient HATCH becomes a solid fill (R2000 has
	  no gradients).

	All six sample_AC1014..AC1032 rewritten as R2000 are read by ACadSharp
	with no error and 146 entities, the same as AutoCAD's own sample_AC1015.

	The remaining PR item (LWPOLYLINE vertex id flag) is already correct.
	LWPOLYLINE flags equal AutoCAD's save.

	* src/encode.c (upconvert_standard_names, link_owned_entities,
	  fix_mtext_hatch): New pre-passes.
	  (dwg_encode_eed_data): RS_BE codepage, converted length, buffer checks.
	* src/dwg.spec (MTEXT, LAYER, MLINESTYLE): The defaults and the index.
	* src/common_entity_data.spec (linewt): ByLayer from pre-R2000.
	* src/bits.c (bit_downconvert_CMC): ENC and true color index,
	  nearest_aci.
	* src/dwg.c (rgb_palette): AutoCAD's ACI palette.
	* test/unit-testing/common_test.c: follows the new palette.

2026-11-07  Reini Urban  <reini.urban@gmail.com>

	escape: do not read past an unterminated MTEXT format code
	mtext_plaintext skipped the inline codes \S \A \C \H \Q \T \W \F \p up to
	the terminating ';' and then stepped over the character it stopped at.
	A code without ';' at the end of the string stops at the NUL, the extra
	step went one byte past it and the outer loop read past the buffer
	(heap-buffer-overflow with ASan, found with dwg2SVG on an MTEXT ending in
	"\H2.5"). Do not step past the terminator.

	Reported-by: saddamr3e

	* programs/escape.c (mtext_plaintext): Guard the advance.
	* test/unit-testing/common_test.c (escape_mtext_plaintext_tests): New,
	  with exactly sized strings for ASan.

2026-11-07  nameloCmaS  <namelocmas@gmail.com>

	in_dxf: free LWPOLYLINE arrays before rebuilding vertices
	Free existing LWPOLYLINE point, bulge, vertex-id, and width arrays before rebuilding vertex data from DXF input. Allocate the vertex-id array on its first actual group 91, including when an earlier vertex omitted that group.

	Preserve master's newer first-group-40 width allocation and DWG width-flag handling.

	* src/in_dxf.c (free_LWPOLYLINE_data): New helper beside its consumer.\n\n* src/in_dxf.c (new_LWPOLYLINE): Free existing arrays before replacement and allocate vertex IDs on first use.

2026-11-07  nameloCmaS  <namelocmas@gmail.com>

	in_dxf: free LTYPE dash data before rebuilding
	This is part of the DXF importer allocation-ownership cleanup found while reviewing Fuzzing Action LeakSanitizer reports.

	Free existing LTYPE dash entries, dash text, and strings_area before rebuilding dash data from DXF input. Also free a dash text string before replacing it inside the dash loop.

	For commits considered too large, a request for a GNU copyright assignment covering PAST AND FUTURE CHANGES has been sent already.

	This does not overlap the parsing or semantics scope of PR #1312-#1322.

	* src/in_dxf.c (free_LTYPE_dashes): New helper.

	* src/in_dxf.c (add_LTYPE_dashes): Free old dash data before replacement allocation and free dash text before assigning a new string.

2026-11-07  nameloCmaS  <namelocmas@gmail.com>

	in_dxf: free block parameter/action replacement data
	This is part of the DXF importer allocation-ownership cleanup found while reviewing Fuzzing Action LeakSanitizer reports.

	Free existing block action arrays, connection point names, visibility states, property-info connections, value-set data, and prop-state arrays before rebuilding replacement data from DXF input.

	For commits considered too large, a request for a GNU copyright assignment covering PAST AND FUTURE CHANGES has been sent already.

	This does not overlap the parsing or semantics scope of PR #1312-#1322.

	* src/in_dxf.c (free_BLOCKVISIBILITYPARAMETER_states): New helper.

	* src/in_dxf.c (free_BLOCKPARAMETER_propinfo): New helper.

	* src/in_dxf.c (free_BLOCKPARAMVALUESET_data): New helper.

	* src/in_dxf.c (add_AcDbBlockAction): Free actions and deps before rebuilding.

	* src/in_dxf.c (add_BlockAction_ConnectionPts): Preserve old names until replacement names are assigned, then free them.

	* src/in_dxf.c (add_AcDbBlockMoveAction): Free connection names before replacement.

	* src/in_dxf.c (add_AcDbBlockVisibilityParameter): Free blocks and states before rebuilding.

	* src/in_dxf.c (add_BlockParam_PropInfo): Free connection data before rebuilding.

	* src/in_dxf.c (add_AcDbBlock2PtParameter): Free prop_states before rebuilding.

	* src/in_dxf.c (add_AcDbBlockParamValueSet): Free desc and valuelist before rebuilding.

2026-11-07  nameloCmaS  <namelocmas@gmail.com>

	in_dxf: grow DICTIONARY item arrays through temporaries
	This is part of the DXF importer allocation-ownership cleanup found while reviewing Fuzzing Action LeakSanitizer reports.

	Grow DICTIONARY itemhandles and texts through temporary variables before assigning them back, so a failed realloc does not overwrite the original pointers.

	This explicitly captures the temporary-allocation rewrite used to avoid losing existing allocations on growth failure.

	For commits considered too large, a request for a GNU copyright assignment covering PAST AND FUTURE CHANGES has been sent already.

	This does not overlap the parsing or semantics scope of PR #1312-#1322.

	* src/in_dxf.c (add_dictionary_itemhandles): Use temporary realloc results for itemhandles and texts before assigning them back.

2026-11-07  nameloCmaS  <namelocmas@gmail.com>

	in_dxf: free preview buffers before rebuilding
	Keep the current rejection of duplicate completed entity previews. Free a stale zero-sized entity preview before rebuilding it, and free existing block preview data before replacement.

	Grow both preview buffers through temporary realloc results so allocation failure does not lose the original pointer.

	* src/in_dxf.c (add_ent_preview): Preserve duplicate-preview handling, free stale preview data, and assign realloc results through a temporary.\n\n* src/in_dxf.c (add_block_preview): Free existing preview data and assign realloc results through a temporary.

2026-11-07  Reini Urban  <reini.urban@gmail.com>

	dxfread.test: use the C locale for tr and awk
	With the JSON codepage fix, dxfread writes the DXF of an r2000 file in
	its codepage, with non-ASCII bytes as it should. BSD tr on macOS rejects
	those in a UTF-8 locale ("tr: Illegal byte sequence"), the roundtrip
	counted 0 entities, and dxfread.test failed.

	* programs/dxfread.test.in (count_entities, pipe test): LC_ALL=C.

2026-11-07  Reini Urban  <reini.urban@gmail.com>

	in_json: convert non-ASCII UTF-8 strings to the codepage
	json_string and json_fixed_string only converted strings with a
	backslash escape through bit_utf8_to_TV. A raw UTF-8 string such as
	"Bemaßung (ISO)" was kept as UTF-8 bytes, and the TV to TU conversion
	of the encoder then took each byte as a codepage char: "BemaÃ".
	Convert whenever there are non-ASCII bytes, so the strings are in the
	codepage, with \U+xxxx for the unrepresentable chars, as all other TV
	producers.

	Found with json-check on DR_Suspension_right.dwg (r2013).

	* src/in_json.c (json_str_needs_conv): New.
	  (json_string, json_fixed_string): Use it.

2026-11-07  Reini Urban  <reini.urban@gmail.com>

	Add the ACIDBLOCKREFERENCE entity, read and write Inventor's blocks
	Inventor drawings place their sheet contents via AcIdBlockReference
	entities, an AcDbBlockReference with the layout of an INSERT. They were
	UNKNOWN_ENT and so dropped. Read them as the new native entity
	ACIDBLOCKREFERENCE, which keeps its class and DXF name, and share all
	fields with INSERT, so they are written back as ACIDBLOCKREFERENCE,
	with their attributes and SEQEND.

	The INSERT fields move to src/insert.spec, included by both
	DWG_ENTITY (INSERT) and DWG_ENTITY (ACIDBLOCKREFERENCE). The type is
	Dwg_Entity_ACIDBLOCKREFERENCE, the same struct as INSERT, as with the
	UNDERLAYs. All places which test for an INSERT, e.g. to find its
	attribs or its owner for a SEQEND, now also accept it.

	Verified by turning an INSERT of example_2000 into an ACIDBLOCKREFERENCE
	with a throwaway program: it roundtrips via DWG, DXF in/out and JSON,
	ODA reads the DWG. No real Inventor file is in the tree, so the
	unit test has no coverage yet.

	GH #1490
	Reported-by: gereoffy

	* include/dwg.h (DWG_TYPE_ACIDBLOCKREFERENCE, Dwg_Entity_ACIDBLOCKREFERENCE,
	  dwg_setup_ACIDBLOCKREFERENCE): New.
	* src/insert.spec: New, the INSERT fields.
	* src/dwg.spec (INSERT, ACIDBLOCKREFERENCE): Use it.
	* src/classes.inc, src/classes.c, src/objects.in, src/objects.inc,
	  src/dxfclasses.in: Add the class. Regenerate objects.c, dxfclasses.c.
	* src/gen-dynapi.pl: Parse insert.spec, alias the INSERT fields.
	  Regenerate dynapi.c, dwg_api.[ch], dwg.i, dynapi.texi, dynapi_test.c.
	* src/dwg.c, src/classes.c, src/decode.c, src/encode.c, src/in_dxf.c,
	  src/out_dxf.c, src/out_dxfb.c, src/out_geojson.c, src/geom.c,
	  programs/dwg2SVG.c, programs/dwggrep.c, examples/dwg2svg2.c: Treat it as
	  an INSERT where needed. out_dxf, out_dxfb: write its attribs.
	* test/unit-testing/acidblockreference.c: New.

2026-11-07  garcialeal  <garcialeal2@gmail.com>

	geojson: write block attributes as properties
	As asked in GH #849, the attributes of an INSERT or MINSERT were missing
	in GeoJSON. Each ATTRIB is now written as a "TAG": "value" property of its
	INSERT, an empty value as "". A tag repeating a key of the feature or an
	earlier tag is skipped, so the JSON keys stay unique. The ATTRIBs are
	found as in out_dxf.c: following the INSERT before R13, linked from
	first_attrib to last_attrib until R2000, in a vector since R2004.

	* src/out_geojson.c (geojson_attribs_of, geojson_linked_attrib)
	(geojson_vector_attrib, geojson_next_attrib, geojson_text)
	(geojson_key_used, geojson_pair, geojson_insert_attribs): New.
	(dwg_geojson_feature): Write the attributes of INSERT and MINSERT.
	* programs/json.test.in: Check the ETIKEDO attributes of
	example_2000.dwg.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-07  garcialeal  <garcialeal2@gmail.com>

	test: split hatch_path_tests
	CodeFactor found hatch_path_tests too complex after the robustness tests
	were added. Split it into one function per topic: polylines, edges, the
	path size with a SPLINE, the clockwise arc and the rejected data, with
	check_rejected for the repeated rejection check. The 14 tests are
	unchanged.

	* test/unit-testing/geom_test.c (check_rejected, hatch_polyline_tests)
	(hatch_edge_tests, hatch_size_test, hatch_cw_arc_test)
	(hatch_reject_tests): New, from hatch_path_tests.
	(hatch_path_tests): Remove.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-07  garcialeal  <garcialeal2@gmail.com>

	geom: count all SPLINE points in the size of a HATCH path
	hatch_path_size, which sets the tolerance of the arcs of a path, counted
	only the first control point of a SPLINE edge and none of its fit points.
	A path with a large SPLINE and a small arc got a much finer tolerance than
	its size needs: closing a SPLINE of height 100 with a half circle of
	radius 1 took 22 points for the arc, now 5.

	* src/geom.c (box_add_spline): New.
	(box_add_edge): Use it.
	* test/unit-testing/geom_test.c (hatch_path_tests): Test it.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-07  garcialeal  <garcialeal2@gmail.com>

	geojson: nest HATCH rings also where they touch
	A ring was taken as inside another if its first point was.  When that
	point lies on the boundary of the other ring, as for a hole touching the
	outer boundary at a vertex, the even-odd test says nothing reliable: for
	a hole touching the right edge the ray crosses no edge, so the hole was
	written as a second area.  polygon_in_polygon decides by the first
	vertex that is not on the boundary.  The new hatch H11 in HatchEdges.dxf,
	a square with a diamond hole touching its right edge, is now a Polygon
	with a hole of area 76, not a MultiPolygon of 124.

	* src/geom.c (point_on_polygon, polygon_in_polygon): New.
	* src/geom.h: Declare polygon_in_polygon.
	* src/out_geojson.c (ring_in_ring): Use it.
	* test/test-data/2000/HatchEdges.dxf: Add the hatch H11.
	* test/unit-testing/geom_test.c (polygon_tests): Test a touching hole.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-07  garcialeal  <garcialeal2@gmail.com>

	geom: reject HATCH rings with non-finite or degenerate data
	hatch_path_points converted the number of arc steps to int even for a
	NaN angle or radius from a corrupt DWG, which is undefined behaviour
	(UBSan: "nan is outside the range of representable values of type
	'int'"), and wrote "nan" coordinates, which is no valid JSON.  It also
	accepted rings of zero area, like three points on a line.  Now a
	non-finite arc makes the whole ring unusable, rather than a ring
	without that arc, and a ring needs finite coordinates and a non-zero
	area relative to its size.

	* src/geom.c (ring_add_ellipse_sweep): Reject non-finite parameters,
	and bound the step count before the conversion to int.
	(ring_is_usable): New.
	(ring_finish): Use it.
	* test/unit-testing/geom_test.c (hatch_path_tests): Test a NaN angle,
	an infinite radius and a zero area.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-07  garcialeal  <garcialeal2@gmail.com>

	test: add 2000/HatchEdges.dxf for the HATCH boundary edges
	The test DWGs have no HATCH with elliptical arc or SPLINE edges, nor
	islands in holes or the Ignore style.  This DXF, made with ezdxf, has ten
	hatches: lines, arcs in both directions, a full ellipse and a clockwise
	elliptical arc, SPLINE edges by control points and by fit points, a
	polyline with bulges, a frame with a hole and an island in the styles
	Normal, Outer and Ignore, and two areas in one HATCH.  As for the 2018
	DXFs, the DXF is in git and its DWG can be generated.

	* test/test-data/2000/HatchEdges.dxf: New.
	* test/Makefile.am (TESTDATA): Add it.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-07  garcialeal  <garcialeal2@gmail.com>

	geojson: write HATCH as Polygon or MultiPolygon
	HATCH entities were not written at all.  Each boundary path becomes a
	closed ring by hatch_path_points; its nesting depth, from point in
	polygon tests, and the HATCH style decide what is filled: Normal fills
	by parity, an island in a hole being an area again, Outer fills the
	outermost area with its holes, and Ignore the outermost area only.  The
	boundaries around texts are skipped.  One area is a Polygon, several are
	a MultiPolygon, with the rings oriented as in RFC 7946.  All 33 HATCHes
	of the test DWGs are now written, and on a test DXF made with ezdxf the
	three styles give the expected areas.

	* src/out_geojson.c (HATCH_GEOJSON_TOL, hatch_ring, ring_in_ring,
	hatch_ring_role, hatch_ring_roles, geojson_ring, geojson_polygon,
	hatch_rings, geojson_hatch_coordinates, dwg_geojson_HATCH): New.
	(dwg_geojson_object): Write HATCH.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-07  garcialeal  <garcialeal2@gmail.com>

	geom: add hatch_path_points, polygon_area and point_in_polygon
	The boundary paths of a HATCH become closed rings of points: polylines
	with their bulges, and edges of lines, circular and elliptical arcs and
	SPLINEs, within a tolerance relative to the path size.  A clockwise arc
	or ellipse edge is defined in a mirrored system, as in DXF, which makes
	it the counter-clockwise arc from -end to -start.  Over a test DXF made
	with ezdxf, with all edge types, both arc directions and nested islands,
	the 17 rings match ezdxf's own boundary paths within 0.2% of their size.

	* src/geom.c (polygon_area, point_in_polygon, ring_add,
	ring_add_ellipse_sweep, ring_add_ellipse_arc, ring_add_spline, box_add,
	box_add_edge, hatch_path_size, ring_add_edge, ring_add_polyline,
	ring_finish, hatch_path_points): New.
	* src/geom.h: Declare polygon_area, point_in_polygon and
	hatch_path_points.
	* test/unit-testing/geom_test.c (check_ring, polygon_tests,
	hatch_path_tests): New.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-07  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	use indexed field-name helper for TV vector logging
	Add LOG_TRACE_TV_NAME_I() and switch the TV vector logging path in FIELD_VECTOR_T to
	format_field_name(), keeping the commit scoped to the remaining vector-side TV changes.

	use indexed field-name helper for TV logging
	Add LOG_TRACE_TV_NAME() and switch the non-vector TV logging paths to
	format_field_name(), while keeping the vector-specific TV helper and
	refactors out of this commit.

	deduplicate TV logging helpers
	Factor the shared TV string logging flow into LOG_TRACE_TV_DO and define
	LOG_TRACE_TV and LOG_TRACE_TV_N on top of it. This keeps the codepage
	conversion and logging tail logic in one place without pulling in the
	dec_macros.h refactor.

	use indexed field-name helper for TU vector logging
	Add LOG_TRACE_TU_NAME_I() and switch the TU vector logging path in
	FIELD_VECTOR_T to format_field_name(), keeping the broader TV-side
	refactor out of this commit.

	use indexed field-name helper for TU logging
	Add LOG_TRACE_TU_NAME() and switch three TU logging call sites to the
	shared format_field_name() helper, without bringing in the broader TV
	logging refactor yet.

	use indexed field-name helper for handle logging
	Switch handle logging in dec_macros.h to format_field_name() so ref-like
	paths can expand [rcount1], [rcount2], and [vcount] through the shared
	helper without pulling in the broader text-logging refactor yet.

	add helper for indexed logging field names
	Introduce format_field_name() as a shared helper for expanding logging
	placeholders such as [rcount1], [rcount2], and [vcount] into concrete
	indexes. This centralizes field-name formatting so logging call sites
	can migrate to one implementation incrementally.

2026-11-07  Reini Urban  <reini.urban@gmail.com>

	out_dxf, out_dxfb: write the NOD first, not the first DICTIONARY
	dxf_objects_write picked dwg_get_first_object (DICTIONARY), the first
	DICTIONARY in object order. An extension dictionary may precede the NOD
	(gh209_1.dwg: NOD 0xB, extension dictionary 0x3), then readers that take
	the first OBJECT as root dictionary lose e.g. all ACAD_LAYOUT names.

	Add dwg_find_nod: HEADER.DICTIONARY_NAMED_OBJECT, else the only
	DICTIONARY without an owner, else the first DICTIONARY as before.

	GH #1413
	Reported-by: hallelk

	* include/dwg.h, src/dwg.c (dwg_find_nod): New.
	* src/out_dxf.c, src/out_dxfb.c (dxf_objects_write, dxfb_objects_write):
	  Use it.

2026-11-06  Reini Urban  <reini.urban@gmail.com>

	in_dxf: keep the DIMENSION elevation from the z of text_midpt
	The z (group 31) of a DIMENSION's 2D text_midpt (group 11) is its
	elevation, a separate field with the same DXF code. new_object dropped
	that z as for any 2D point, so the elevation was always 0 and
	dwg2dxf wrote 31 = 0.0.

	GH #1503
	Reported-by: House41M5

	* src/in_dxf.c (new_object): set elevation when dropping the z of
	  text_midpt.

2026-11-06  Reini Urban  <reini.urban@gmail.com>

	ci: restore the 50 min timeout of the linux job
	The 30 min limit from 19f576822 cancels the --enable-release job in its
	final make distcheck step. It needs 32 min, it passed with 50 before.

	* .github/workflows/main.yml (linux): timeout-minutes 30 back to 50.

2026-11-06  Reini Urban  <reini.urban@gmail.com>

	out_dxf: always close an INSERT/MINSERT attrib sequence with SEQEND
	For r13-r2000 a broken first_attrib/last_attrib chain returned before the
	SEQEND was written, after the INSERT with 66 1 was already out. That is
	invalid DXF, rejected by ezdxf. Write the SEQEND anyway; the error is
	still returned.

	The shipped dwgadd.example no longer triggers this on master (ATTRIB and
	SEQEND are both written), this only guards files that reach the path
	some other way.

	GH #1351

	* src/out_dxf.c (DECL_DXF_PROCESS_INSERT): goto the SEQEND on a missing
	  first/last attrib or a missing next object.

2026-11-06  Reini Urban  <reini.urban@gmail.com>

	ci: better timeouts

2026-11-06  Reini Urban  <reini.urban@gmail.com>

	dwgrewrite: write r2010+ as is, not down-converted to r2004
	dwgrewrite forced every r2007+ input to r2004 ("we cannot yet write
	2007+"), which is outdated. The r2010 to r2004 down-conversion produced
	files ODA rejects with "Unexpected end of file". Keep the version, only
	r2007, which the encoder cannot write, becomes r2010. The rewritten
	sample_2010, sample_2018, example_2010, example_2013 and example_2018
	now load in ODA without any message.

	* programs/dwgrewrite.c (main): do not clamp to r2004.

2026-11-06  Reini Urban  <reini.urban@gmail.com>

	encode: fix memmove of overlarge (>0x7fff) objects losing the tail
	When an object grows past 0x7fff bytes, the MS size field grows from 2
	to 4 bytes and the object is moved right by 2. The memmove length was
	size + 3, but the moved span is the MS size, the handlestream size and
	the type (obj->address - dat->byte) plus the size data bytes. Up to 3
	bytes, the end of the handle stream, were lost: the 74 KB AcDbXrecord
	0x140 of sample_2010 got a garbage reactor handle and ODA reported
	"Object improperly read". sample_2010 now passes dxf-check (RC=0).

	* src/encode.c (dwg_encode_add_object): compute the memmove length from
	  obj->address, in both the grow and shrink cases.

2026-11-06  Reini Urban  <reini.urban@gmail.com>

	in_dxf, encode: fix r2010+ DXF imports that ODA rejects
	Writing example_2018.dxf as r2018 gave ODA "Invalid Layer", "Color index
	65535", and a fatal "AcDbAttributeDefinition improperly read". Fixes:

	- dynapi: restore 5222bb4b6 "store TU strings only if IS_FROM_TU_DWG".
	  The regeneration in e47cb45d2 reverted it, because gen-dynapi.pl was
	  never updated. Imports then stored TU strings while the encoder
	  expects TV, so "Standard" was written as "S" and the layer linetype
	  lookup failed.
	- in_dxf: keep TV strings for HATCH, MULTILEADER and CellStyle strings
	  and color names, as the encoder converts them. A truncated
	  MULTILEADER text was "improperly read" by ODA.
	- ACI colors (method 0xc3) carry the index in the low byte, like ODA
	  does (0xc3000007), not the palette rgb. ODA read 0xc3ffffff as color
	  index 65535. Fix bit_upconvert_CMC, bit_downconvert_CMC and the DXF
	  importer.
	- in_dxf: MULTILEADER text colors written by out_dxf as negative signed
	  ints (0xc0000000 ByLayer) were taken for an index. Use an unsigned
	  compare, add dxf_set_CMC_value.
	- in_dxf: keep the sign of 16-bit DXF ints for BLd fields, and the raw
	  MULTILEADER leader line linewt (-2), instead of 65534 or an index.
	- dwg.spec ATTDEF/ATTRIB: out_dxf wrote mtext_type as group 70, which
	  the importer read back as flags (invisible). Write flags as 70 and
	  mtext_type as 71, import 71 in the attribute subclass, and encode
	  mtext_type 0 as 1 (single line) for r2018, which ODA requires.
	- 3DSOLID encoder: since r2013 there is no leading acis_empty bit and
	  the trailer is that of version 2, as the decoder reads it. Without
	  this the REGION stream was misaligned. The SAB body is in AcDs, which
	  we cannot write yet, so the body is dropped with a warning.

	Remaining ODA complaints, not fixed here: REGION/3DSOLID "General
	modeling failure" (no AcDs body), MLEADER 0x640 in example_2018 and the
	large AcDbXrecord 0x140 in sample_2010 "improperly read".

	* src/bits.c (bit_upconvert_CMC, bit_downconvert_CMC): ACI index in the
	  low byte.
	* src/in_dxf.c (dxf_set_CMC_index, dxf_set_CMC_value, dxf_read_CMC,
	  add_HATCH, add_MULTILEADER, add_CellStyle, new_object): the above.
	* src/dwg.spec (ATTDEF, ATTRIB): flags 70, mtext_type 71.
	* src/dwg_spec_shared.h (encode_3dsolid, COMMON_3DSOLID): r2013+ layout.
	* src/dynapi.c, src/gen-dynapi.pl (dynapi_set_helper): IS_FROM_TU_DWG;
	  mtext_type dxf code 71.

2026-11-06  Reini Urban  <reini.urban@gmail.com>

	encode: ODA-compatible r2010+ output, fix header size and LZ pages
	ODA rejected every r2010/r2013/r2018 DWG we wrote with "CRC does not
	match", while r2000 and r2004 passed. Bisected by repacking sections
	into an ACadSharp-style container: the container was fine, only the
	AcDb:Header section content made ODA fail.

	Root cause: for r2010 (maintenance > 3) and r2018+ the Header section
	has a 4 byte bitsize_hi word after the size. ODA's size excludes that
	word, ours included it, so ODA computed the section CRC over 4 bytes
	too many. With this fixed, sample_2013 and sample_2018 pass dxf-check.

	While there, make the r2004+ section writer follow the ODA/ACadSharp
	conventions, as the compressed pages were never validated before:

	- Compress the data pages with the LZ77 compressor (a port of the
	  ACadSharp DwgLZ77AC18Compressor), per ODA: Header, Classes, Handles,
	  AcDbObjects, ObjFreeSpace, Template, RevHistory, AuxHeader. The
	  descriptors now say compressed=2 for these, 1 for raw sections.
	- Terminate every LZ stream with 0x11 0x00 0x00, not just 0x11.
	- Pad every page to a multiple of 32 bytes with the leading bytes of
	  the magic sequence. Replaces the 16-byte zero padding.
	- The data page header size field is the padded on-disk page size
	  (32 + compressed + pad), not the decompressed size.
	- The section info page entries carry the real compressed page sizes,
	  which are only known after the pages were written, so patch them in
	  before writing the Section Info page.
	- Do not write bogus nameless descriptors for the Section Info and Page
	  Map system pages, ODA would try to read them as data sections.
	- Never flag sections as encrypted, as ODA and AutoCAD do.
	- Raw sections (SummaryInfo, Preview, AppInfo, FileDepList) get one
	  page of the content size rounded up to 32, not max_decomp_size. This
	  shrinks r2004 output of a small DXF from 1.3MB to 12KB.

	The remaining ODA warnings on some r2010+ files (Invalid Layer, Color
	index 65535, an unreadable AcDbXrecord) are object encoding issues and
	no longer container ones.

	* src/encode.c (encode_header_vars): exclude bitsize_hi from the r2010+
	  header section size.
	  (section_encrypted): return 0 for all sections.
	  (section_compressed): enable, used for the descriptors.
	  (pad_R2004_page): New, pad pages to 32 with the magic sequence.
	  (store_R2004_section, stored_R2004_section_size, compress_R2004_section):
	  terminate with 0x11 0x00 0x00. Drop the HAVE_COMPRESS_R2004_SECTION
	  gate.
	  (dwg_encode): Compress data pages, size raw pages to their content,
	  pad all pages, set the page size header field, patch the info page
	  sizes, and skip the system sections in the descriptor list.

2026-11-06  Reini Urban  <reini.urban@gmail.com>

	encode: pad r2004+ section pages to 16-byte alignment
	The r2004+ section map only stores (number, size) pairs and the reader
	accumulates section addresses from 0x100, so every size but the last
	must be a multiple of 16 to keep the next section address aligned.
	Original AutoCAD and ODA files all honor this; our writer did not:

	- Preview pages were written as raw copies of 0x7fff bytes (r2013/
	  2018, max_decomp_size from GH #1045), drifting every later section
	  by 15.
	- The SECTION_INFO page (20-byte header + content) was not padded.

	Zero-pad data section pages (32 + comp_data_size) and the
	SECTION_INFO page (20 + comp_data_size) to 16-byte boundaries.
	This keeps the section addresses ODA accumulates aligned. It is a
	necessary but not sufficient fix for ODA accepting our r2010+ output;
	the residual rejection is the separate known limitation that raw-copy
	data pages are not yet ODA-compatible (the LZ compressor is #if 0'd).

	* src/encode.c (dwg_encode): pad r2004+ data pages and SECTION_INFO
	  to 16-byte boundaries before writing.

2026-11-05  Reini Urban  <reini.urban@gmail.com>

	cmake: strip trailing CR from LIBREDWG_SO_VERSION on Windows
	On a CRLF checkout (core.autocrlf=true), get-so-version.pl captured the
	trailing \r of configure.ac because its regex "(.+)" matches \r but not
	\n.  The resulting "0:14:0\r" was substituted into src/config.h, leaving
	a line break inside the string literal and failing the compile of the
	first file including config.h with "missing terminating " character".

	Strip the whitespace in the execute_process call and also stop the perl
	regex at \r or \n, so either layer alone is sufficient.

	CMakeLists.txt:
	  * Add OUTPUT_STRIP_TRAILING_WHITESPACE to the get-so-version.pl
	    execute_process.

	build-aux/get-so-version.pl:
	  * Capture LIBREDWG_SO_VERSION with ([^\r\n]+) instead of (.+).

	Fixes GH #1501

	Reported-by: Pascal J. Bourguignon <informatimago@gmail.com>

2026-11-05  Reini Urban  <reini.urban@gmail.com>

	dwg_api: set only INDXF, not INJSON, for fresh documents
	A fresh document from dwg_add_Document (dwg_new_Document, dwgadd) sets
	DWG_OPTS_IN (= INDXF | INJSON) so that IS_FROM_TU_DWG stays false and the
	add API stores codepage (TV) strings.  Since f939c3778 "add api: convert
	the UTF-8 string args", dwg_add_u8_input already converted the UTF-8
	input to the target codepage at add time.  The INJSON bit then made
	bit_write_TV convert the already-converted TV bytes again, this time
	parsing them as UTF-8: on a fresh R2000 file, "TEST ØST" (TV "D8") was
	re-decoded as the overlong/invalid UTF-8 pair D8 53 and re-encoded as
	the escape "\U+0613", corrupting every non-ASCII character.

	After a readdwg the import flags were dropped by dwg_read_file, so the
	append path stayed correct while the fresh path corrupted.  Both were
	reported in GH #1499.

	Set only DWG_OPTS_INDXF: it still suppresses IS_FROM_TU_DWG and keeps
	the dynamic-dxfname (strdup/free) pairing of the add API, but does not
	mark the in-memory strings as UTF-8, so bit_write_TV writes them
	verbatim.  All DWG_OPTS_IN (0xC0) usesites match, as INDXF (0x40) is a
	subset; the only behavioral change is the removal of the double
	conversion.  This also avoids treating raw TV name fields of fresh
	R2007+ documents as UTF-16 in the DXF writer (heap-buffer-overflow in
	bit_convert_TU seen under ASan when INJSON/IN were dropped entirely).

	examples/dwgadd_test.sh.in:
	  * Add a GH #1499 regression test: create a fresh R2000 file with a
	    UTF-8 TEXT ("TEST ØST"), append another TEXT ("NY DØR ÆØÅ") after
	    readdwg, then check both values in the JSON dump.

	Fixes GH #1499
	Reported-by: Paal-Andre

2026-11-05  Reini Urban  <reini.urban@gmail.com>

	indxf: fix dxfname double-free in dxf_tables_read on failed new_object
	CIFuzz found a double-free on a 256 B TABLES-section DXF (STYLE entry,
	invalid group code): the fail: path of new_object() added in
	a1314c757 (which fixed the 7 B 4521024671252480 direct-leak) frees
	the caller's dxfname via dwg_free_object(), but dxf_tables_read()
	still freed its own copy of the same pointer afterwards.

	* src/in_dxf.c
	  - dxf_tables_read: mark dxfname as consumed after the new_object()
	    call, matching the three other new_object() callsites
	  - new_object: free dxfname in the fail: path if it was not yet
	    consumed into obj->dxfname by ADD_OBJECT/ADD_ENTITY (object
	    dropped before the macros ran, or no object created); new_object()
	    now takes ownership of dxfname on every path

2026-11-05  Reini Urban  <reini.urban@gmail.com>

	encode: free dropped cellstyle border ltype refs in downconvert_TABLESTYLE
	downconvert_TABLESTYLE() copies the R2007+ cellstyle border properties
	into the pre-R2007 rowstyle borders and then frees the
	sty.cellstyle.borders array. The pre-R2007 border has no ltype field,
	so the border ltype handle refs were orphaned: object-owned (non-global)
	refs were never freed, leaking 6 x 48 B Dwg_Object_Ref (288 B) for
	example_2010/2013.dwg encoded to R2000/R2004.

	* encode.c
	  - downconvert_TABLESTYLE: free the non-global sty.cellstyle border
	    ltype refs before freeing the borders array (global refs are freed
	    with dwg->object_ref)

	Reproduced with example_2010.dwg OUT=0 VER=13/14/18/19 (R2000/R2004
	output, from_version R2010 triggers the downconvert).

2026-11-05  Reini Urban  <reini.urban@gmail.com>

	bits: stop infinite buffer doubling on truncated UTF-8 tail
	bit_utf8_to_TV() returned NULL for a 3-byte UTF-8 lead byte at the very
	end of the input (no continuation bytes left), because all three
	sub-branches require s + 1 <= ends and the final else then returns
	NULL. Since that NULL does not depend on the destination size, callers
	looping on "grow the buffer and retry" (bit_write_TV doubles destlen
	until success) allocated 2^n bytes forever and hit a 64 GB OOM.

	* bits.c
	  - bit_utf8_to_TV: drop a stray 3-byte lead byte at the end of the
	    input and continue, like the 2-byte branch already does; only
	    return NULL for a genuinely undersized destination

	Reproduces oss-fuzz testcase 5960115027771392
	(OOM in bit_write_TV, 0x1000000000-byte realloc, json input
	{"HEADER"{"MENU""P\xE8"}}).

2026-11-05  Reini Urban  <reini.urban@gmail.com>

	in_json: free previous string on duplicate key in FIELD_T macros
	The FIELD_T, FIELD_T32, FIELD_T16 and FIELD_TU16 macros assigned the
	new json_string()/json_wstring() result to the field without freeing
	the previous value. A JSON object with a duplicated string key (e.g.
	{"AppInfo":{"version":"aaa","version":"bbb"}}) therefore orphaned the
	first allocation on every re-assignment.

	* in_json.c
	  - FIELD_T, FIELD_T32, FIELD_T16, FIELD_TU16: free(_obj->nam) before
	    assigning a new string or NULL

	Reproduces oss-fuzz testcase 5166841123897344
	(Direct leak json_string <- json_AppInfo <- dwg_read_json).
	All string bitcodes are heap pointers (BITCODE_T/T16/T32 = char*),
	so free-before-assign is safe; free(NULL) on a first-time field is a
	no-op.

2026-11-05  Reini Urban  <reini.urban@gmail.com>

	encode: free R2004+ section chains on early exit
	oss-fuzz testcase 6452812331155456 (Direct-leak)

	The R2004+ encoder encodes each section into its own sec_dat[] chain
	(first allocated while writing the section, e.g. the handle of the
	first section object), and frees them in the final stream-order
	write loop. Three paths left the chains allocated:

	- "SECTION_SYSTEM_MAP not found" returned
	  DWG_ERR_SECTIONNOTFOUND before the write loop.
	- the "Encode overwrite pos 0" check returned
	  DWG_ERR_INVALIDDWG the same way.
	- the write loop skipped sections without an info entry
	  (continue) and never freed their possibly pre-allocated chains.

	Free all sec_dat[] chains before the two early returns, and free the
	chain in the write loop when no section info entry exists.

	* src/encode.c (dwg_encode): clean up sec_dat[] on the early
	  returns and the !info write-loop path

2026-11-05  Reini Urban  <reini.urban@gmail.com>

	encode: free handle stream on early entity/object exit
	oss-fuzz testcase 6080946684887040 (Direct-leak)

	The generated dwg_encode_<token>() wrappers allocated per-object
	handle (and string) streams via bit_chain_init_dat(). They were
	supposed to be freed by DWG_ENTITY_END/DWG_OBJECT_END at the end of
	the _private() function, but a _private() body can return early
	(e.g. HATCH with an invalid path segment curve_type returns 0 from
	the repeat block) and skip that epilogue. The wrapper only cleaned
	up on DWG_ERR_VALUEOUTOFBOUNDS, leaking the 128 byte hdl_dat chain
	(and the str_dat chain on R2007+) otherwise.

	bit_chain_free() NULLs the chain, so a live chain after _private()
	returns is a reliable early-exit indicator. Free both streams
	unconditionally when they are still allocated.

	* src/encode.c (DWG_ENTITY, DWG_OBJECT): free hdl_dat/str_dat when
	  still live after _private() returns

2026-11-05  Reini Urban  <reini.urban@gmail.com>

	encode: fix leaks in fixup_invalid_tag
	oss-fuzz testcase 6560428814303232 (Direct-leak)

	fixup_invalid_tag() leaked on both paths:

	- for utf8 tags (source < R_2007 or IN) the temporary
	  bit_utf8_to_TU() copy was only freed when the tag actually
	  changed and the target is pre-R_2007. Any other result (e.g. a
	  tag that is invalid only because of a character the fixup loop
	  does not replace, like "A@B") returned without freeing it.

	- when a replacement string was returned for a utf8 tag, the
	  original tag was replaced by the caller and never freed.

	Free the temporary copy and, when returning a replacement, the
	original tag (both utf8 variants; the TU variant already freed the
	replaced original).

	* src/encode.c (fixup_invalid_tag): free wstr/tag on all exits

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	encode: free TU string in add_DUMMY_eed for R2007+ DUMMYs
	oss-fuzz testcase 5881555340558336 (Direct-leak)

	When encoding an unknown object as a DUMMY placeholder into an
	R_2007+ file, add_DUMMY_eed() converts the name via
	bit_utf8_to_TU() and copies it into the EED data, but never freed
	the allocated BITCODE_TU (24 bytes per DUMMY object; 120 bytes in
	5 allocations for test/test-data/example_2000.dwg encoded to
	R_2013).

	* src/encode.c (add_DUMMY_eed): free (wstr) after the memcpy

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	indxf: free dxfname of a failed object in new_object
	oss-fuzz testcase 4521024671252480 (Direct-leak, 7 bytes)

	When a DXF entity fails to decode (e.g. an invalid group code),
	new_object() goes to fail:, removes the object from dwg->object
	and calls dwg_free_object(). The old code set obj->dxfname = NULL
	first, so the dynamically allocated dxfname string (here "SEQEND",
	7 bytes) was never freed: dwg_free_object() only frees it via
	FREE_IF() under the IN/INDXF/INJSON opts, which is a no-op on NULL,
	and the caller's copy was already consumed by new_object.

	Drop the NULLing so dwg_free_object() frees obj->dxfname as it
	already does for every other freed object.

	* src/in_dxf.c (new_object): remove obj->dxfname = NULL in fail:

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	encode: fix null-deref in dwg_encode_xdata for payloadless strings
	OSS-Fuzz testcase 5419762499518464 (null-dereference READ) crashed
	dwg_encode_xdata when a decoded XRECORD xdata string claims a size
	but carries no payload (u.data/u.wdata == NULL): a corrupted R2000
	file re-encoded to R_2013/R_2018.

	The R_2007a+ string branch strlen()ed the NULL payload; its is_tu
	half indexed the NULL wide string; the pre-R_2007a TU branch
	strlen()ed the NULL result of bit_embed_TU_size(); the INJSON
	conversion passed NULL to bit_utf8_to_TV().

	Guard all four like the existing DWG_VT_BINARY case: log an error
	and write the string as empty.

	* src/encode.c (dwg_encode_xdata): guard NULL string payloads in all
	  four string branches.

	Repro: OUT=0 VER=16 llvmfuzz_standalone
	  tz/rw/clusterfuzz-testcase-minimized-llvmfuzz-5419762499518464.dwg
	crashed with SEGV in dwg_encode_xdata; clean over all OUT=0..4 x
	VER=0..19 after the fix.

2026-11-04  saddamr3e  <saddamr3e@users.noreply.github.com>

	bits: NUL-terminate the codepage buffer in bit_write_T16
	bit_write_T16 converts a TU source (r2007+ DWG) to codepage for a
	pre-r2007 target into a fixed char dest[1024] via bit_utf8_to_TV,
	then calls strlen (dest). bit_utf8_to_TV stops once the buffer is
	full without writing a terminator, so a string of 1024 or more
	codepage bytes (e.g. the AcDb:Template description, which the
	decoder reads without a length limit, and dwgrewrite downgrades
	r2007+ DWGs to r2004 by default) leaves dest unterminated: strlen
	reads off the stack array (ASan stack-buffer-overflow READ of size
	1030 in strlen, called from encode_template) and bit_write_RC
	copies the stack bytes behind it into the output DWG.

	Terminate dest[1023] after the conversion, as the in_dxf.c callers
	converting into the same 1024-byte dest already do, so the string
	is cut at 1023 codepage bytes.

	test/unit-testing/bits_test.c:
	- Add a bit_write_TV test writing an 1100-char TU string to a
	  pre-r2007 target and expecting the RS length 1024 (1023 chars
	  plus NUL); fails without the fix, passes with it.

2026-11-04  garcialeal  <garcialeal2@gmail.com>

	dxf: write the knots and control points of fit point SPLINEs
	A SPLINE given by fit points was written to DXF with 0 knots and 0
	control points.  AutoCAD writes them too, so compute them with
	spline_from_fit_points.  They match the DXF of AutoCAD within 1e-12 for
	the 8 such SPLINEs in the test DXFs, and ezdxf reads the result with the
	curve through the fit points.  With a fit tolerance > 0, AutoCAD only
	approximates the fit points, and its control points differ.

	* src/dwg.spec (SPLINE): Write num_knots and num_ctrl_pts, the knots and
	the control points of a fit point SPLINE in DXF.  Remove the FIXME.
	* src/out_dxf.c, src/out_dxfb.c: Include geom.h.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	dxfread: add Makefile.am, manpage, tests, and docs
	Add the build system integration (Makefile.am, configure.ac), manpage
	(dxfread.1), test suite (dxfread.test.in), and texinfo documentation
	for the dxfread DXF<->JSON converter.

	Also fix dxfread.c:
	- Add enforce_null_termination as a static function (was extern to
	  a function only in examples/llvmfuzz.c, causing link failure).
	- Use dat.fh for output (bit_chain_free is not exported from libredwg).
	- Track orig_buf to avoid leaking the input buffer when
	  enforce_null_termination makes a copy.
	- Fix up dwg.header.version from from_version before writing, like
	  dxf2dwg.c does: dwg_read_json (unlike dwg_read_dxf) leaves
	  header.version unset, so dat.version was R_INVALID. The writer then
	  emitted $ACADVER INVALI and skipped the version-gated TABLES/BLOCKS/
	  OBJECTS sections, truncating the roundtrip output to just
	  HEADER/CLASSES/empty ENTITIES (75 of 1476 group 0 lines on
	  sample_2000.dxf under Wine/mingw CI).

	And fix the --disable-write link failure ("undefined reference to
	dwg_read_dxf / dwg_read_json"): in_dxf.c/in_json.c are read sources,
	independent of DWG write support, but src/Makefile.am gated them on
	USE_WRITE. Build them whenever DXF/JSON is enabled. They also use
	read-side helpers that lived in the write-only encode.c
	(in_postprocess_SEQEND, in_postprocess_handles, find_prev_entity,
	dwg_link_prev, dwg_link_next, dwg_encode_get_class, dxf_encode_alias);
	move them to the always-built classes.c.

	Test fixes (dxfread.test.in):
	- Disable ASAN leak detection (library-internal leaks).
	- Fix pipe test to use '-' for stdin.
	- Skip jq validation when jq is not available (mingw CI has no jq;
	  the old [ -n "$JQ" ] && jq ... condition reported a false "jq fail").
	- The roundtrip check counted every "0" line (group codes AND values)
	  and was not CRLF-tolerant. It now counts group 0 entity records in
	  the ENTITIES section (group codes are the odd lines of a
	  well-formed DXF, \r stripped) and tolerates up to 25% entity loss,
	  since the JSON roundtrip currently drops some non-essential objects
	  (MATERIAL, polyline vertices in some files), while a
	  catastrophically truncated output (<=25%) still fails.
	- Skip dxfread in alive.test (reads DXF/JSON, not DWG).
	- Register dxfread.test in configure.ac AC_CONFIG_FILES so make dist
	  generates it from dxfread.test.in (was missing, breaking make dist).

	Verified with an x86_64-w64-mingw32 cross-build run under Wine:
	before the version fix, sample_2000.dxf roundtripped to 75 group 0
	lines with $ACADVER INVALI; after, the ENTITIES section roundtrips
	6/6 (sample_2000), 70/88 (example_2000), 84/88 (example_2004) with
	valid JSON output and a working stdout/stdin pipe path.

	Reported-by: fr-an-k

2026-11-04  garcialeal  <garcialeal2@gmail.com>

	geom_test: build with MSVC, split spline_flatten_tests
	MSVC math.h defines M_SQRT1_2 only with _USE_MATH_DEFINES, which broke
	the vs2019 builds of geom_test.  CodeFactor reported spline_flatten_tests
	as a complex method.

	* test/unit-testing/geom_test.c (M_SQRT1_2): Define if missing.
	(check_flatten): New.
	(spline_flatten_tests): Use it.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-04  garcialeal  <garcialeal2@gmail.com>

	geojson: write points on the SPLINE curve
	A SPLINE was written as its control points, or its fit points, but the
	curve does not pass through its control points: over the test DWGs they
	are up to 6% of the spline size away from it.  Write points on the
	curve by spline_flatten, within 1/1000 of the spline size.  The old
	points stay as the fallback.

	* src/out_geojson.c (SPLINE_GEOJSON_TOL): New.
	(dwg_geojson_SPLINE): New, from dwg_geojson_object, using
	spline_flatten.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-04  garcialeal  <garcialeal2@gmail.com>

	geom: add spline_flatten, adaptive de Casteljau subdivision
	Outputs without curves need points on a SPLINE.  spline_flatten halves
	each Bezier curve of the SPLINE by de Casteljau until all its control
	points are within the tolerance of its chord, which bounds the distance
	of the curve to the polyline, as the curve lies in the convex hull of
	its control points.  SPLINEs with only fit points are interpolated
	first.  Over the 602 SPLINEs of the test DWGs the curve stays within 83%
	of the tolerance; a 10 times finer tolerance takes 2.8 times the points.

	* src/geom.c (point_list, point_list_add, segment_distance,
	bezier_is_flat, bezier_halves, bezier_flatten, points_size,
	spline_eval_points, spline_flatten): New.
	* src/geom.h (BEZIER_MAX_DEPTH, SPLINE_MAX_POINTS, SPLINE_EVAL_STEPS):
	New.  Declare spline_flatten.
	* test/unit-testing/geom_test.c (spline_flatten_tests): New.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-04  garcialeal  <garcialeal2@gmail.com>

	dwg2SVG: draw fit point SPLINEs as exact Bezier curves
	A SPLINE with only fit points was drawn as a polyline through them.  Now
	its control points come from spline_from_fit_points, so it is drawn as
	exact Bezier curves through the fit points.  The polyline stays as the
	fallback.

	* programs/dwg2SVG.c (spline_bezier): New.
	(output_SPLINE): Use it.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-04  garcialeal  <garcialeal2@gmail.com>

	geom: add spline_from_fit_points, AutoCAD's fit point interpolation
	A SPLINE defined by fit points has no control points in the DWG.  This
	reproduces the cubic interpolation of AutoCAD: chord length knots, the
	curve through every fit point, and at each end the unit tangent if given,
	else the natural end condition, solved as a tridiagonal system.  It
	matches the control points AutoCAD writes to DXF within 1e-9, for all 8
	such SPLINEs in the test DXFs.  A fit tolerance > 0, where AutoCAD only
	approximates the fit points, is interpolated too.

	* src/geom.c (fit_row, point_axpy, point_div, unit_tangent, fit_t,
	fit_rows, solve_tridiagonal, spline_fit_points_valid, fit_chord_params,
	fit_result, spline_from_fit_points): New.
	* src/geom.h: Declare spline_from_fit_points.
	* test/unit-testing/geom_test.c (check_fit,
	spline_from_fit_points_tests): New.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-04  garcialeal  <garcialeal2@gmail.com>

	dwg2SVG: draw SPLINEs
	SPLINEs were ignored.  A clamped non-rational SPLINE of degree 2 or 3 is
	now drawn exactly as a chain of Bezier curves with Q or C, by
	spline_to_bezier; other SPLINEs through 16 points per knot span by
	spline_eval, and a SPLINE with only fit points as a polyline through them.
	Over the test DWGs no SPLINE is ignored any more, and all SVGs are valid
	XML.

	* programs/dwg2SVG.c (spline_path_bezier, spline_path_points,
	spline_fit_points_usable, spline_path_fit_points, output_SPLINE): New.
	(output_object): Draw SPLINEs.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-04  garcialeal  <garcialeal2@gmail.com>

	geom: add spline_to_bezier, Boehm's knot insertion
	SVG paths draw cubic Bezier curves exactly, with C.  Inserting every
	interior knot of a clamped non-rational SPLINE until it is repeated
	degree times turns the control polygon into a chain of Bezier curves,
	without changing the curve.  Over the test DWGs all 573 SPLINEs with
	control points convert, matching spline_eval within 1e-9.

	* src/geom.c (spline_is_clamped, spline_insert_knot): New.
	(spline_to_bezier): New.
	* src/geom.h: Declare spline_to_bezier.
	* test/unit-testing/geom_test.c (check_bezier, spline_to_bezier_tests):
	New.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-04  garcialeal  <garcialeal2@gmail.com>

	geom: add spline_eval, de Boor's algorithm for SPLINE
	out_geojson writes a SPLINE as its control polygon, but the curve does
	not pass through its control points.  Over the test DWGs the polygon is
	up to 6% of the spline size away from the curve.  spline_eval gives the
	points on the curve, for rational splines too, as a base for GeoJSON
	and SVG.

	* src/geom.c (spline_knots_valid, spline_ctrl_pts_valid): New.
	(spline_is_valid, spline_eval): New.
	* src/geom.h (SPLINE_MAX_DEGREE): New.  Declare them.
	* test/unit-testing/geom_test.c (check_spline_point, spline_eval_tests):
	New.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	no bool in exported api, fixes gen-dynapi

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	dynapi: store TU strings only if IS_FROM_TU_DWG
	The dynapi_set_helper function chose the string width (TV vs TU) based
	on the target dwg_version. This is wrong: an imported drawing (DXF/JSON)
	keeps every T string TV whatever its version or target, and a decoded
	drawing keeps the width of its from_version, also after its target
	version changed.

	Fix: use IS_FROM_TU_DWG (which checks the source from_version and the
	DWG_OPTS_IN flag) instead of the target dwg_version. This ensures that
	imports keep TV strings and decoded r2007+ drawings keep TU strings.

	Reported-by: tuxiasumari

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	dwg2SVG: render MTEXT entities
	dwg2SVG did not render MTEXT: it was listed as a TODO and skipped by
	the entity dispatcher, so drawings that use it lost a substantial part
	of their text.

	Add MTEXT rendering:

	* programs/escape.{c,h}: new helpers:
	  - htmlutf8escape: escape UTF-8 text for XML, replacing code points
	    XML cannot represent.
	  - mtext_plaintext: flatten MTEXT formatting controls to a plain-text
	    intermediate representation, preserving \U+XXXX escapes.
	  - mtext_escape_line: expand \U+XXXX and XML-escape a single line.
	  - mtext_wrap_text: word-wrap to the MTEXT rectangle width using an
	    approximate character advance (no font metrics).
	  - mtext_attachment_anchor / _first_offset: map the 9 attachment
	    points to SVG text-anchor and a vertical offset.
	  - mtext_line_height: line pitch from linespace_style/factor.
	  - mtext_svg_angle: planar rotation from x_axis_dir, sign-flipped for
	    SVG's downward Y axis.

	* programs/dwg2SVG.c:
	  - output_MTEXT: one <text> per entity with one <tspan> per line;
	    output_object dispatches DWG_TYPE_MTEXT.
	  - text_fontfamily: extracted from output_TEXT for reuse, with a
	    null-object guard around the STYLE dereference. Normal TEXT
	    rendering is unchanged.

	Handled: pre-R2007 codepage and R2007+ TU strings normalized to UTF-8;
	formatting controls \P \~ \X \L/\l \O/\o \K/\k \S...; \A \C
	\H \Q \T \W \F...; \p...;; \U+XXXX escapes; all 9 attachment
	points; rotation from x_axis_dir; line spacing and rectangle-width
	wrapping; STYLE font family; entity color.

	Reported-by: tuxiasumari

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	dwg: remove three quadratic costs from the ref-adding path
	Profiling a loop of dwg_add_LINE into modelspace (glibc/Linux, -O2)
	showed three independent quadratic costs on the same path:

	1. PUSH_HV / PUSH_HV_NEW realloced to exactly num+1 on every push. A
	   handle vector has no tracked capacity and some call sites allocate one
	   to its exact size, so the realloc-per-push stays - but the requested
	   size is now rounded up to the next power of two: calls between two
	   crossings resolve to the same usable size and do not copy, and realloc
	   knows the vector's real old size, so the push is correct however the
	   vector was last allocated. N pushes copy O(N) handles instead of
	   O(N^2).

	2. Ref_cmp compared handleref.code first, so a new ref - whose handle is
	   the highest so far - sorted to the end of its code block, in the
	   middle of the ordered index, and every ordered_ref_add memmoved all
	   higher-code refs one slot up. With absolute_ref as the primary key a
	   new ref lands at the end and the memmove copies nothing. The order is
	   private to ordered_ref_add/ordered_ref_find, which both use this
	   comparator.

	3. dwg_decode_add_object_ref set dirty_refs = 1 every time the ref
	   pointer array grew by a chunk (16384 refs). That realloc moves only
	   the array of pointers; the refs and their cached ref->obj are
	   untouched. Its sibling dwg_add_object already demonstrates the
	   correct criterion - dirty only when dwg->object itself moved. The
	   spurious flag made the next dwg_ref_object run a full
	   dwg_resolve_objectrefs_silent sweep, once per 16384 refs.

	Measured (loop of dwg_add_LINE, glibc/Linux, -O2): 640k adds 29.62s ->
	1.84s; per-add cost now flat. dxf2dwg --as r2000 of a 300k-entity DXF:
	2.49s -> 1.71s, output byte-identical.

	Reported-by: tuxiasumari

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	out_dxf: emit an ACAD_PROXY_ENTITY for unparseable classes
	An entity whose class LibreDWG cannot parse (UNKNOWN_ENT - Civil 3D road
	objects, custom-application entities) was returned as
	DWG_ERR_UNHANDLEDCLASS by dwg_dxf_object and vanished from the DXF
	entirely, taking its proxy graphics with it. ODA-based converters instead
	preserve it as an ACAD_PROXY_ENTITY carrying the graphics blob, so viewers
	draw the geometry even without the object enabler.

	Emit the same when the class is unparseable: the common entity data
	(including the proxy graphics in the preview, groups 92/310), and the
	proxy class markers (90=498, 91=class id, 95=version, 70=0).

	Round-trip safe: LibreDWG's own in_dxf reads that back via
	add_ent_preview, so the DXF still round-trips through dxf2dwg. One
	subtlety: group 95 must be emitted decimal, not hex - dxf_read_rl parses
	it decimal, and a hex value desyncs the reader.

	The class data section (group 93 stream + its object-id reference lists)
	is not emitted: it is not reconstructible without parsing the class, and
	is useless to a reader without the object enabler anyway.

	Reported-by: tuxiasumari

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	in_dxf: MINSERT column/row count default to 1 when the group is omitted
	DXF omits INSERT groups 70/71 when the count is 1 (ezdxf and AutoCAD both
	do), but the importer materialized the missing group as 0, and dwg2dxf
	then wrote the explicit 0 back out. Apply the documented defaults when
	the MINSERT completes, next to the existing 3DFACE default in the same
	chain. (Setting them earlier, at the AcDbMInsertBlock upgrade, does not
	work: the generic field matcher refuses to overwrite an already-set field
	when the real 70/71 group arrives.)

	Reported-by: tuxiasumari

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	encode: fix the pre-R13 writer
	Once --as r12 is reachable, the written DWG was unreadable: the address
	patch loop was gated on from_version < R_13b1 (with a FIXME for modern
	sources), and the entmode fixup compared the owning block name with
	case-sensitive strcmp against *MODEL_SPACE / *PAPER_SPACE, while r13+
	sources spell them *Model_Space / *Paper_Space.

	Two halves:

	1. The address patch loop: the conversion the FIXME asked for already
	   happens - ENCODE_CTRL_TO_TABLE fills the section tables from the
	   CONTROL objects while writing them, for all source versions.

	2. The entmode fixup: compare the block name case-insensitively, so model
	   space entities are not reclassified as block content.

	A single-LINE R2000 DXF through --as r12 now round-trips.

	Reported-by: tuxiasumari

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	encode: fix r13/r14 linetype state on round-trip
	Round-trip fuzzing dxf2dwg --as r14 showed every entity losing its
	linetype state: ByLayer entities came back with an empty group 6,
	CONTINUOUS became ByLayer, and every custom ltype_scale (group 48)
	vanished. Four defects:

	1. isbylayerlt was written before it was computed: the encoder fixup
	   deriving it from ltype_flags lived in common_entity_handle_data.spec,
	   which runs after common_entity_data.spec already emitted the bit, and
	   was additionally gated on from_version == R_2000 exactly. Move the
	   fixup to common_entity_data.spec, before the bit is written.

	2. A dead ternary in the decoder: the : 3 arm could never execute under
	   the if (isbylayerlt). (Already fixed on master.)

	3. ByBlock/Continuous have no handle to write: r13/r14 knows only
	   bylayer-or-handle - no r2000 flags 1/2 - so those entities must
	   reference the BYBLOCK/CONTINUOUS LTYPE records by handle. Materialize
	   the handle via dwg_find_tablehandle.

	4. Group 48 was gated on R_2000b in the DXF writer, though per-entity
	   ltype_scale exists since R13. Write it for r13+.

	Reported-by: tuxiasumari

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	out_dxf: skip a BLOCK_HEADER without first_owned_block instead of aborting
	dxf_block_write treats one header without first_owned_block as fatal for
	r2004+ (return DWG_ERR_INVALIDDWG), aborting every remaining block and the
	ENTITIES section, while the r2000 code path falls through and survives. A
	single broken/empty header thus produced a DXF with zero entities, exit
	status 0.

	Skip just the broken header (warn) instead: one damaged table entry must
	not throw away the model space. Same rationale as the get_*_owned_entity
	skip (PR #1359).

	Found by a round-trip fuzzer.

	Reported-by: tuxiasumari

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	out_dxf: skip stale ATTRIB/VERTEX subentities instead of duplicating
	dwg_dxf_object already warns 'stale subentity' for ATTRIB/VERTEX objects
	that appear in the block's entity chain (as dxf2dwg used to write them),
	but then writes them anyway, while the SEQEND and ENDBLK cases right
	above return 0. The result: every POLYLINE vertex is emitted twice, once
	through the owner's vertex walk and again after the SEQEND. Importers
	drop the trailing vertices or keep them as stray entities.

	Make the six ATTRIB/VERTEX cases behave like SEQEND: warn and skip for
	r13+. They are always written through their parent entity's process
	function; a second copy at the top level is never valid r13+ DXF. This
	also repairs reading the LibreDWG-written DWGs already out in the wild.

	Found by a round-trip fuzzer.

	Reported-by: tuxiasumari

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	in_dxf: never file ATTRIB/VERTEX/SEQEND under a block header
	DWGs written by dxf2dwg stored ATTRIB/VERTEX/SEQEND unlike AutoCAD
	does: ODA-based readers silently dropped the ATTRIBs of every INSERT
	and the last VERTEX of every POLYLINE (a 3-vertex 3D polyline came
	back with 2). The importer filed them under the block header (their
	DXF 330 points at the block record, how ezdxf and AutoCAD write DXF),
	with entmode 2, while the SEQEND (owner rewritten to the parent by
	dxf_postprocess_SEQEND) silently failed add_to_BLOCK_HEADER and stayed
	entmode 0, outside every chain.

	Two fixes:

	* dxf_entities_read never files ATTRIB/VERTEX*/SEQEND under a block
	  header: they belong to their parent INSERT/POLYLINE, not the block.

	* dxf_postprocess_SEQEND sets each child's ownerhandle to the parent
	  entity and entmode 0, whatever their 330 pointed to - same for the
	  SEQEND itself.

	After this the emitted structure matches the ODA reference field for
	field: subentity entmode 0, ownerhandle the parent, block header chain
	top-level entities only. ODA reads back all vertices and attributes.

	Reported-by: tuxiasumari

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	dwg2SVG: fix blank output (viewBox origin, stroke width, model space)
	example_r14.dwg rendered blank for four independent reasons; each one
	alone is enough:

	1. Model space was never drawn. output_BLOCK_HEADER returns how many
	   entities we did print, and output_SVG falls back to model space when
	   that is zero. But output_object started at num=1 and only the
	   default branch cleared it, so it returned 1 for every type it
	   recognised, including VIEWPORT and SEQEND which draw nothing, and
	   for entities skipped as invisible. Every paper space holds a
	   VIEWPORT, so the count was never zero and the fallback never fired.
	   The walk now counts only entities that actually put coordinates on
	   the page.

	2. Every stroke was zero width. dxf_cvt_lweight gives 100ths of a mm,
	   so mm is lw/100, not lw/1000. With the extra factor of ten a 0.25mm
	   line became 0.025, which %.1f printed as stroke-width:0.0. And
	   lw==0 is a legitimate value meaning thinnest line. Widths are now
	   emitted in mm with vector-effect:non-scaling-stroke, which keeps a
	   hairline visible whatever the viewBox spans.

	3. The viewBox origin contradicted the coordinates. transform_X
	   returns x-model_xmin and transform_Y returns
	   page_height-(y-model_ymin), so every emitted coordinate lives in
	   [0,page_width]x[0,page_height]. The viewBox started at
	   (model_xmin, model_ymin) instead of (0,0), displacing the content
	   out of view by exactly the model origin.

	On 95 real drawings from a 1657-file corpus, each rendered to a
	200x200 PNG and scored by ink pixels: drawings that show a drawing
	went from 1 to 68; 0 got worse; total ink pixels 80 -> 55775.

	Fixes #523 and #1012 (partially - the defs-symbols double-translation
	and the viewBox being the header box rather than the drawing box are
	follow-ups).

	Reported-by: tuxiasumari

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	decode: treat a missing pre-R13 table sentinel as a warning
	An r11 drawing here has three empty tables (VIEW, UCS, VPORT) that the
	writer only terminated with a single VPORT_END sentinel, occupying the
	16 bytes where APPID_BEGIN would go. The decoder rejected the whole file
	(4060 errors, no DXF output) over the missing delimiters, although all
	553 entities and the LAYER/STYLE/LTYPE tables had already decoded fine.

	The sentinel is a delimiter, not the locator: records are read from
	tbl->address (stated independently by the header) and each carries its
	own CRC, which is already verified. A wrong address is caught on its own
	merits instead of being inferred from a missing delimiter.

	So a sentinel that is genuinely absent now logs a warning and reads the
	table from its header address, carrying on. DWG_ERR_INVALIDDWG stays
	fatal: that one means the 16 bytes could not be read at all, so the
	position itself is nonsense.

	The not-found message becomes a warning for the same reason: fatality is
	the caller's decision, and a file that now converts perfectly still
	logged six ERROR lines, which any CI or bench grepping for ERROR reads
	as a failure.

	Fixes #767.

	Reported-by: tuxiasumari

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	decode: resync the object map after a failed modular char read
	bit_read_UMC returns 0 on nine or more consecutive high-bit bytes, and the
	handle map loop then warned and used the garbage anyway, fabricating a
	multi-megabyte object and derailing every entry after it.

	Resync one byte later instead of trusting the failed read, so the stray
	bytes are skipped and the entry stream resumes on the page boundary.
	Only on !handleoff: the other conditions in the same check also fire on
	entries that parsed fine, and resyncing on them costs good entries
	(Leader.dwg would lose all of its modelspace entities).

	Fixes #1355.

	Reported-by: tuxiasumari

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	dwg: skip unresolvable owned entities instead of ending the layout
	get_first_owned_entity, get_next_owned_entity and
	get_next_owned_block_entity return NULL both for 'the list is over' and
	for 'this entry does not resolve', and the walkers (out_dxf, out_dxfb,
	dwggrep, dwg2SVG) use while (obj). So one dangling reference ended the
	whole layout and every entity behind it was dropped, silently, with exit
	status 0.

	Skip the unresolvable entries (logging a warning for each) instead, and
	use < rather than == against num_owned: with ==, an iterator bumped past
	the count never terminates and walks off the end of entities[].

	Reported-by: tuxiasumari

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	examples: add llvmfuzz_dwgapi fuzzer target for the DWG API
	Add a new libfuzzer/OSS-Fuzz target that reads a DWG/DXF/JSON file
	and then exercises the DWG API (dwg_add_LINE, dwg_add_CIRCLE) and the
	encoder (dwg_encode) to find bugs in the API and encoder layers.
	Complements the existing llvmfuzz.c (which only tests the readers).

	Reported-by: tuxiasumari

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	in_dxf: skip invalid objects and continue parsing
	Many DXF files fail to parse with error 0x800 (DWG_ERR_INVALIDDWG)
	because of some exotic structure that the importer does not handle.
	Previously the import terminated on the first such object. Now it logs
	a warning with the object name, skips the rest of the object (read
	pairs until the next 0 code), and continues parsing. This allows
	drawings with a few bad objects to be partially imported, and gives
	a way of logging what went wrong to improve the importer.

	The four new_object call sites (table entries, objects, entities,
	and the objects section) are all changed to skip and continue. The
	other DWG_ERR_INVALIDDWG returns (HEADER, CLASSES, DWG-not-DXF)
	remain fatal, as they indicate a file that is not a valid DXF at all.

	Reported-by: tuxiasumari

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	dwg_next_handle: scan all objects for the max seed
	The seed loop took the handle of the last object with a nonzero handle and
	stopped. That is only the maximum when objects are appended in increasing
	handle order. During a DXF import they are not: pre-created table objects
	carry high handles before the file's own low handles arrive, so fresh
	objects got handles already in use (duplicate handle errors, and the
	object map pointed two objects at one handle).

	Scan all objects for the true maximum, matching the comment and the refs
	pass below it (which already scans everything).

	Reported-by: tuxiasumari

2026-11-04  garcialeal  <garcialeal2@gmail.com>

	geom_test, polyline_2d, dwg2ps: split complex functions
	CodeFactor reported the new test functions as complex methods, and the
	bulges made create_postscript more complex with two copies of the same
	polyline loop.

	* test/unit-testing/geom_test.c (check_arc, check_straight,
	check_split): New.
	(bulge_to_arc_tests, bulge_split_tests): Use them.
	* test/unit-testing/polyline_2d.c (check_vertex_chain, check_bulges):
	New, from api_process.
	* programs/dwg2ps.c (ps_polyline): New, the shared polyline loop.
	(create_postscript): Use it.  Free the POLYLINE_2D points also on an
	error, and skip a LWPOLYLINE without points.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-04  garcialeal  <garcialeal2@gmail.com>

	api: share the POLYLINE_2D vertex walk of get_points and get_bulges
	dwg_object_polyline_2d_get_points and _get_bulges each had the same
	three-way vertex walk, for R2004+, R13-R2000 and preR13, with a
	cyclomatic complexity of 19-20 (CodeFactor: Complex Method).  Walk the
	vertices once in small helpers and copy the points or the bulges from
	that.  The output is unchanged.

	* src/dwg_api.c (polyline_2d_add_vertex, polyline_2d_vertices_r2004,
	polyline_2d_vertices_r13, polyline_2d_vertices_preR13,
	polyline_2d_vertices): New.
	(dwg_object_polyline_2d_get_points, dwg_object_polyline_2d_get_bulges):
	Use them.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-04  garcialeal  <garcialeal2@gmail.com>

	geom.h: avoid double linkage on windows with geom_test
	geom_test.c includes geom.c, so with a shared mingw build the functions
	it defines were also declared EXPORT, i.e. dllimport, and failed with
	"redeclared without dllimport attribute" under -Werror.

	* src/geom.h [GEOM_TEST_C]: Define EXPORT empty, as bits.h does for
	its tests.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-04  garcialeal  <garcialeal2@gmail.com>

	geom_test: cast NAN and INFINITY to double
	NAN and INFINITY are float constants.  Passing them as a double broke
	the clang build of the tests with -Werror,-Wdouble-promotion (CIFuzz).
	gcc does not warn as the macros come from a system header.

	* test/unit-testing/geom_test.c (bulge_to_arc_tests): Cast NAN and
	INFINITY to double, as in add_test.c.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-04  garcialeal  <garcialeal2@gmail.com>

	dwg2ps: stroke a polyline once, after all its segments
	PS_stroke ends the path, so stroking after every segment left the
	following PS_lineto calls outside of a path, and pslib dropped them
	with "PS_lineto must be called within 'path' scope".  Only the first
	segment of each POLYLINE_2D and LWPOLYLINE was drawn.  Over the
	test-data DWGs this was 66808 dropped calls, now none.

	* programs/dwg2ps.c (create_postscript) <POLYLINE_2D, LWPOLYLINE>:
	Stroke once after the closing segment.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-04  garcialeal  <garcialeal2@gmail.com>

	dwg2SVG, dwg2ps, geojson: draw polyline bulges as arcs
	Bulged segments of LWPOLYLINE and POLYLINE_2D were drawn as straight
	lines.  SVG and PostScript now write native arcs, GeoJSON splits them
	into points with calc_curve_segments, like ARC and CIRCLE.  The
	closing segment of a closed polyline gets the bulge of its last vertex.

	* programs/dwg2SVG.c (path_segment): New.
	(output_POLYLINE_2D, output_LWPOLYLINE): Use it.  Free pts on the
	early return of output_POLYLINE_2D.
	* programs/dwg2ps.c (ps_segment): New.
	(create_postscript): Use it for POLYLINE_2D and LWPOLYLINE.
	* src/out_geojson.c (bulge_points): New.
	(dwg_geojson_LWPOLYLINE): Use it.  Return early on zero points.
	(dwg_geojson_object) <POLYLINE_2D>: Use it.  The closed flag of a
	POLYLINE_2D is 1, not the LWPOLYLINE flag 512.  Free the points of
	a polygon also when its orientation is kept.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-04  garcialeal  <garcialeal2@gmail.com>

	geom: add bulge_to_arc and bulge_split; api: add polyline_2d_get_bulges
	A polyline vertex bulge is the tangent of a quarter of the included
	angle of the segment to the next vertex.  These helpers turn it into
	the arc, or into points, so the SVG, PostScript and GeoJSON outputs
	can draw bulged segments instead of straight lines.

	* src/geom.c (bulge_to_arc, bulge_split): New.
	(transform_OCS_2d_is_mirrored): New.  A mirroring OCS reverses the
	sense of a bulge.
	* src/geom.h: Declare them.
	* src/dwg_api.c (dwg_object_polyline_2d_get_bulges): New, the bulges
	in the order of dwg_object_polyline_2d_get_points.
	(dwg_ent_vertex_2d_get_bulge, dwg_ent_vertex_2d_set_bulge): A bulge is
	tan (angle / 4), not radians.
	* include/dwg_api.h: Declare dwg_object_polyline_2d_get_bulges.
	* test/unit-testing/geom_test.c: Test the new functions.
	* test/unit-testing/polyline_2d.c (api_process): Test
	dwg_object_polyline_2d_get_bulges.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-04  garcialeal  <garcialeal2@gmail.com>

	geom: fix arc_split for a full circle
	Since arc_split normalizes both angles, an end angle of 2*PI became 0,
	the span collapsed to zero and all points were the start point.
	out_geojson writes a CIRCLE via arc_split (..., 0, 2*PI, ...), so every
	CIRCLE came out as a degenerate polygon.  Treat a span of a full turn
	or more as a full circle.

	* src/geom.c (arc_split): Keep a full turn.
	* test/unit-testing/geom_test.c: New.
	* test/unit-testing/Makefile.am (check_minimal): Add geom_test.
	* test/unit-testing/CMakeLists.txt: Add geom_test.
	* test/unit-testing/.gitignore: Add geom_test.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-04  garcialeal  <garcialeal2@gmail.com>

	api: don't drop the last vertex of R13-R2000 POLYLINE_2D/3D
	For R13 to R2000 the vertices are walked from first_vertex to
	last_vertex, but the loop stopped before processing last_vertex, so
	dwg_object_polyline_{2d,3d}_get_numpoints and _get_points always
	returned one vertex too few.  A 2-vertex polyline came back as a
	single point.  This affects dwg2SVG, dwg2ps and the GeoJSON output.

	* src/dwg_api.c (dwg_object_polyline_2d_get_numpoints,
	dwg_object_polyline_2d_get_points, dwg_object_polyline_3d_get_numpoints,
	dwg_object_polyline_3d_get_points): Stop after processing last_vertex,
	not before it.
	* test/unit-testing/polyline_2d.c (api_process): Check numpoints
	against the vertices from first_vertex to last_vertex.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	out_dxf: dxf_needs_cquote: guard against NULL
	VALUE_TV/VALUE_TV0 now call dxf_needs_cquote() before the r2007 check,
	and a string field can be NULL (unset). dxf_needs_cquote dereferenced
	its argument without a NULL check, so dwg2dxf SEGV'd on
	example_2004.dxf (a LAYOUT with a NULL string field), breaking the ODA
	dxf.test. Return false for a NULL string.

	* src/out_dxf.c (dxf_needs_cquote): return false for a NULL str.

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	out_dxf: cquote: actually convert MIF \M+nXXXX to \U+XXXX
	cquote was meant to turn old Asian MIF codes \M+nXXXX into \U+XXXX
	(commit 0ad71990) but never did: it tested s[3] (the first hex digit)
	for the codepage index n instead of s[2], so only codes starting with
	1-5 could match -- and the 932/949/950/1361/936 double-byte codes start
	with 8-F. sscanf("M+%d") also read n together with the leading hex
	digits (\M+38141 -> 38141), taking the "Invalid MIF index" branch.

	Read n as one digit (s[2]), require four hex digits, and convert via
	dwg_codepage_uwc. Keep the MIF code unchanged when the codepage has no
	such character, instead of emitting \U+0000.

	* src/out_dxf.c (cquote): test s[2] for n and s[3..6] for the hex code;
	  sscanf("%4X") the code; keep the MIF code as-is when not in the
	  codepage.

	Fixes GH #1495.
	Reported-by: hjkim-fieldro

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	out_dxf: escape U+0080+ and convert codepage strings on the cquote path
	Two related dwg2dxf string bugs in the caret-quoting path (strings that
	contain a line break, a C0 control byte, or a \M+ escape):

	1. r2000-r2004 TV strings stored in the source codepage were passed to
	   dxf_fixup_string unconverted; the quoting path ran bit_utf8_to_TU on
	   the raw codepage bytes, which parsed them as UTF-8 and dropped the
	   non-ASCII characters (GH #1496). Set dat->codepage from the header
	   for pre-R2007 input, and take the codepage->UTF-8 conversion whenever
	   the string needs cquote, not only for r2007+ targets.

	2. bit_embed_TU writes every code point < 0x100 as one raw byte. For
	   U+0080-U+00FF that is an invalid UTF-8 byte in an r2007+ DXF and a
	   lead byte in an r2000-r2004 Asian-codepage DXF (GH #1497). Add
	   dxf_embed_TU, which escapes U+0080 and up as \U+XXXX, and use it in
	   the quoting path (bit_embed_TU itself is left unchanged).

	* src/out_dxf.c (dxf_embed_TU, new): like bit_embed_TU but escapes
	  U+0080-U+00FF as \U+XXXX instead of a single raw byte.
	* src/out_dxf.c (dxf_fixup_string): use dxf_embed_TU in the quoting path.
	* src/out_dxf.c (VALUE_TV, VALUE_TV0): convert to UTF-8 when the string
	  needs cquote, not only for r2007+; forward-declare dxf_needs_cquote.
	* src/out_dxf.c (dwg_write_dxf): set dat->codepage from the header for
	  pre-R2007 input so the cquote path can convert codepage TV strings.

	Fixes GH #1496.
	Fixes GH #1497.
	Reported-by: hjkim-fieldro

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	out_dxf: dxf_fixup_zero_handle: avoid handing out an in-use handle
	dwg_next_handle returns the last non-zero object handle + 1, which is not
	the highest handle when the objects are not sorted by handle. A handle-0
	object (the decode leaves a number of them at 0) then landed on an
	existing handle -- the GROUP took handle 2, the *Model_Space
	BLOCK_RECORD, and the DXF became unloadable (GH #1356).

	Compute the real highest handle over objects and object refs and start
	the fresh-handle sequence there.

	* src/out_dxf.c (dxf_fixup_zero_handle): start from the highest handle in
	  objects and object refs, not dwg_next_handle's last non-zero + 1.

	Fixes GH #1356.

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	decode: read Inventor ACIDBLOCKREFERENCE entities as INSERT
	Inventor drawings (R2007-R2018) place their sheet content with
	ACIDBLOCKREFERENCE entities (class AcIdBlockReference). LibreDWG read
	them as UNKNOWN_ENT and out_dxf skipped them, so dwg2dxf dropped the
	whole sheet (paper space kept only its VIEWPORTs, and the *I<n> blocks
	were left unreferenced).

	Their entity data is exactly an AcDbBlockReference (insertion point,
	scale, rotation, extrusion, has_attribs, block header handle), so
	decode it as an INSERT. Check the class name before is_entity so it
	works even when the class flags are unusable (is_zombie).

	* src/decode.c: read ACIDBLOCKREFERENCE as DWG_TYPE_INSERT via
	  dwg_decode_INSERT, before the UNKNOWN_ENT/UNKNOWN_OBJ fallback.

	Fixes GH #1490.
	Reported-by: hjkim-fieldro

2026-11-04  Reini Urban  <reini.urban@gmail.com>

	decode: accept valid EED of exactly 256 bytes (BS code 10)
	dwg_decode_eed rejected extended data whose size was exactly 256 bytes:
	a BS value of 256 is the 2-bit code 10 with no payload, so reading it
	moves the bit position by only 2 bits and dat->byte can stay equal to
	sav_byte (the byte where the EED started). The "no progress" check
	dat->byte == sav_byte then treated the valid data as a stall, and the
	rest of the entity decoded from the wrong position (LINE vertices came
	out like 1e236).

	Limit that byte check to the pre-R13 RS size, which always reads two
	bytes; the BS path (R13+) can legitimately not advance the byte.

	* src/decode.c (dwg_decode_eed): only apply the dat->byte == sav_byte
	  check for from_version < R_13b1.

	Fixes GH #1492.
	Reported-by: hjkim-fieldro

2026-11-03  Reini Urban  <reini.urban@gmail.com>

	out_dxf: emit an empty chunk for a NULL binary payload
	VALUE_BINARY wrote `size` 00 bytes whenever the payload pointer was NULL
	but the declared length was nonzero. A crafted OLEFRAME with data ==
	NULL and a multi-gigabyte data_size made dwg2dxf spin a core emitting
	zeros. The decode-side guard (GHSA-37mv) only covers the binary-DWG read
	path; an API/JSON/DXF-built dwg still reaches this sink on DXF export.

	Emit an empty chunk for a NULL payload instead of that many zeros. The
	DXFB and JSON writers already guard on the pointer, so this closes the
	DXF path of the binary-size validation class.

	Harden GHSA-fxmw-mp89-7g88 (output-writer side).

	* src/out_dxf.c (VALUE_BINARY): emit an empty chunk for a NULL payload
	  with a nonzero declared length, instead of writing `size` zeros.

2026-11-03  Reini Urban  <reini.urban@gmail.com>

	in_json: cast blen*8 to BITCODE_BL for MSVC
	vs2019 (MSVC, /WX) rejected the build: the data_numbits handler sets
	  BITCODE_BL bits = blen * 8;
	where blen is size_t, so C4267 'conversion from size_t to BITCODE_BL'
	became error C2220. blen is the byte count of a hex binary field, so
	the 32-bit value is exact; cast it explicitly.

	make check: dxf.test and json.test pass.

2026-11-03  Reini Urban  <reini.urban@gmail.com>

	in_json: fix -Werror format, sign-compare and const-parameter warnings
	CI (GCC, -Werror) failed the build on three warnings rcc did not flag:

	- data_numbits LOG_TRACE: the format "%s.%s = " FORMAT_BL had two %s but
	  only sf->name was a string, so bits was consumed by the second %s and
	  FORMAT_BL lost its argument. Use one %s.
	- json_AcDs: seglen is an array length (t->size, non-negative) but was
	  declared int; comparing it against the BITCODE_RL num_segidx tripped
	  -Wsign-compare. Declare it BITCODE_RL.
	- json_set_numfield: the size parameter is const but is lowered in place
	  (size = old); assignment to a read-only parameter is an error. Drop the
	  const.

	make check: dxf.test and json.test pass; GCC -Werror -Wformat=2
	-Wsign-compare is clean on the changed sources.

2026-11-03  Reini Urban  <reini.urban@gmail.com>

	POINTCLOUD: set clippings num_vertices to 2 only when decoding
	dwg2.spec POINTCLOUD had the same shape for its clippings as IMAGE and
	WIPEOUT for their clip boundary: num_vertices = 2 for every clipping
	but a polygon (type 3), in every action. But only the DWG has no count
	for a box or a rectangle. The JSON importer allocates vertices at the
	length of the JSON array, and takes num_vertices from it, as it does
	for every num_ field. So a JSON clipping

	  { "type": 2, "vertices": [[-0.5, -0.5]] }

	makes the r2013+ encoder read vertices[1] past the 1-element array:

	  $ dwgwrite -y --as r2018 pc.json
	  ERROR: AddressSanitizer: heap-buffer-overflow ... READ of size 8
	      #0 in dwg_encode_POINTCLOUD_private src/dwg2.spec
	  allocated by: xcalloc <- _set_struct_field src/in_json.c

	This does for POINTCLOUD what IMAGE and WIPEOUT do: only the DECODER
	sets the count to 2. The decoder reads exactly 2 verts for a box or a
	rectangle, so the ENCODER, the DXF writer and the JSON writer write a
	non-polygon clipping with any other count as a polygon, with its
	count, and warn. The written file then reads back as imported.

	The rectangles and boxes of a DWG still decode to 2 verts, so the
	DXF, DXFB and JSON output of DWG files, and their re-encoding, do not
	change.

	While testing it, dwgread -O JSON and then dwgwrite failed on every
	DWG with POINTCLOUD clippings: out_json has no SUB_FIELD_2RD_VECTOR or
	SUB_FIELD_3BD_VECTOR, so the default from spec.h writes each point
	under its own "vertices[vcount]" key ("pts[vcount]" for POINTCLOUDEX
	croppings). in_json does not know that key and loses its place, and
	dwgwrite stops with "Unexpected JSON key" without writing a DWG. This
	writes them as arrays, as FIELD_2RD_VECTOR and FIELD_3DPOINT_VECTOR
	do, and frees them in free.c, which had neither macro.

	The new test test_pointcloud_clippings reads the PoC POINTCLOUD, a
	rect clipping with a single vertex, and checks that num_vertices and
	the vertices follow the array.

	See GH #1487.

	Reported-by: Mar <mardgez13@gmail.com>

2026-11-03  Reini Urban  <reini.urban@gmail.com>

	IMAGE, WIPEOUT: set num_clip_verts to 2 only when decoding a rect
	IMAGE and WIPEOUT set num_clip_verts = 2 for a rectangular clip
	boundary (clip_boundary_type == 1) in every action. Only the DWG has
	no count for a rectangle. The DXF importer counts the 91 value or the
	14/24 pairs, and the JSON importer takes the length of the
	clip_verts array, as it does for every num_ field. So a rectangle
	with a single vertex, for example this DXF IMAGE

	  71
	 1
	 91
	 1
	 14
	-0.5
	 24
	-0.5

	makes dwg_write_dxf, dwg_write_dxfb, dwg_write_json and dwg_encode
	read clip_verts[1], 16 bytes past the 1-element array, into their
	output. On an ASan build, with the DXF of the new test:

	  $ dxf2dwg -y -o rect.dwg rect.dxf
	  ERROR: AddressSanitizer: heap-buffer-overflow ... READ of size 8
	      #0 in dwg_encode_IMAGE_private src/dwg.spec
	      #1 in dwg_encode_IMAGE src/dwg.spec
	      #2 in dwg_encode_variable_type src/classes.inc
	  allocated by: xcalloc <- new_object src/in_dxf.c <- dxf_entities_read

	(dxfwrite stops the same way in dwg_dxf_IMAGE_private.)

	Only the DECODER now sets the count to 2. The decoder reads exactly
	2 verts for a rectangle, so the ENCODER and the DXF writer write a
	rect with any other count as a polygon, with its count, and warn.
	The written file then reads back as imported.

	The IMAGE default of 2 clip_verts (ad3442c9) is dropped from
	in_dxf.c. Since 0eea6c01 the 14 pairs are counted as they are for
	WIPEOUT. The default left num_clip_verts at 0 with 2 verts
	allocated, which only worked because of the forced 2. out_dxf
	writes no 91 for a rectangle, so re-importing our own DXF output
	depends on the pairs being counted.

	The rectangles of a DWG still decode to 2 verts, so the DXF, DXFB
	and JSON output of DWG files, and their re-encoding, do not change.

	The new test test_clip_verts_rect reads the PoC IMAGE, a rect with a
	91 1, and the same rect without the 91, whose count comes from the
	14/24 pairs. On master the second entity ends at num_clip_verts 0
	with 2 verts allocated, which encode and dwg_free walk.

	See GH #1487.

	Reported-by: Mar <mardgez13@gmail.com>

2026-11-03  Reini Urban  <reini.urban@gmail.com>

	in_dxf: set LEADEROBJECTCONTEXTDATA.num_points only with its points
	dxf_set_leader_context, new in ed97a2df, set num_points from every 70
	of the context body, but allocated the points only for the first one.
	test/test-data/2004/Leader.dxf with a 70 200 added after the
	context's third point:

	  $ dxf2dwg -y -o /tmp/out.dwg leader.dxf
	  ERROR: AddressSanitizer: heap-buffer-overflow ... READ of size 8
	      #0 in dwg_encode_LEADEROBJECTCONTEXTDATA_private src/dwg2.spec
	      #1 in dwg_encode_LEADEROBJECTCONTEXTDATA src/dwg2.spec
	  0x... is located 0 bytes after 72-byte region
	  allocated by: xcalloc <- dxf_set_leader_context src/in_dxf.c

	dxfwrite stops the same way in
	dwg_dxf_LEADEROBJECTCONTEXTDATA_private.

	As for LTYPE and MLINE, a 70 is now ignored, with an error, once the
	points are allocated, and a count the points cannot be allocated for
	is reset to 0.

	The new test test_dxf_count_resets extends to a
	LEADEROBJECTCONTEXTDATA with 3 points and a second 70 200 after them.
	On master the import ends at num_points 200 over the 3-point array,
	which encode and dwg_free walk.

	See GH #1487.

	Reported-by: Mar <mardgez13@gmail.com>

2026-11-03  Reini Urban  <reini.urban@gmail.com>

	in_dxf: set the ASSOCACTION and ASSOCNETWORK counts with their lists
	add_ASSOCACTION set num_deps, num_owned_params and num_values, and
	add_ASSOCNETWORK num_actions and num_owned_actions, before reading the
	list each one counts, but set the list itself only once it was
	complete. new_object calls them again on every 100 AcDbAssocAction
	or 100 AcDbAssocNetwork, so a repeated marker whose list ends early
	left the earlier, shorter list under the new count. test/test-data/
	2013/Constraints.dxf with its ACDBASSOCNETWORK given one dep, then a
	second AcDbAssocAction announcing 100 deps and none following:

	  $ dxf2dwg -y -o /tmp/out.dwg assoc.dxf
	  ERROR: AddressSanitizer: heap-buffer-overflow ... READ of size 1
	      #0 in dwg_encode_ASSOCNETWORK_private src/dwg2.spec
	      #1 in dwg_encode_ASSOCNETWORK src/dwg2.spec
	  allocated by: xcalloc <- add_ASSOCACTION src/in_dxf.c

	out_dxf, out_json and dwg_free walk the same counts.

	Both functions now read each count into a local and set it together
	with its list once the list is read, to the number of elements
	actually read (also when the list ends early or cannot be allocated),
	freeing the list it replaces, and the values with their names and
	strings. On an unexpected code they return that pair to new_object,
	as the other add_* helpers do, instead of dropping it.

	Reading these lists showed two misreads in add_ASSOCACTION with
	class_version 2 (r2013+): it did not skip the 90 0 that
	AcDbAssocAction_fields writes before num_owned_params (as it already
	did before num_values), and it wanted the owned params as pairs of
	type HANDLE, which a 360 is not, so no owned param was ever imported
	and the rest of the subclass was read one pair off.
	test/test-data/example_2013.dxf's ACDBASSOCACTION 391 now imports as
	the file has it: class_version 2, actionbody 392, deps 396 and 397,
	owned param 393 (before: class_version 0, actionbody 393, no owned
	params). add_VALUEPARAMs also frees the pairs it read and did not
	keep.

	The new test test_dxf_count_resets extends to an ACDBASSOCNETWORK
	with one dep, then a second AcDbAssocAction announcing 100 deps and
	none following. On master dwg_free segfaults, walking the deps to
	num_deps.

	See GH #1487.

	Reported-by: Mar <mardgez13@gmail.com>

2026-11-03  Reini Urban  <reini.urban@gmail.com>

	in_dxf: keep counts equal to the arrays they count
	The DXF importer let a later group code set three counts again after
	the array they count was allocated. The count then no longer matched
	the array, and everything that walks the array to the count (encode,
	out_dxf, out_json, dwg_free, and for MLINE the importer itself) went
	past it.

	LTYPE.numdashes (73): add_LTYPE_dashes allocates dashes for the
	current numdashes at the first 49. A 73 after the dashes went to the
	generic field setter, whose "already set" check covers only num_*
	fields, and changed numdashes without touching dashes. If the 49
	came before any 73, the array was even 0 bytes. new_object now
	handles LTYPE 73 itself, and ignores it, with an error, once the
	dashes are allocated or numdashes is set.

	MLINE.num_lines (73): the 73 handler allocated the lines of each
	vertex once, and refused a second 73 only when num_lines was not 0.
	A 73 0 after the 72 allocated 0-element lines arrays, so a second
	73 2 got through, set num_lines to 2 and did not allocate, because
	verts[0].lines was already set. The 74 that followed wrote
	lines[0] into the 0-byte array. Now add_MLINE allocates no lines
	for a num_lines of 0, and refuses a 73 once the lines are
	allocated.

	An entity's preview_size (160): before r2010 the preview size is
	group 92, and add_ent_preview allocates the preview with it. A 160
	in such a file was taken as the plain common field preview_size:
	after a 92 1 and its 310, a 160 3000 made the size 3000 with a
	1-byte preview, and dxf2dwg copied 3000 bytes from it into the DWG.
	Now an entity's 160 goes to add_ent_preview in every version, is
	ignored, with an error, once the entity has a preview, as a
	duplicate 310 already is. add_ent_preview also resets a size it
	rejects, instead of keeping it with the old preview.

	New test test_dxf_count_resets: LTYPE with a second 73 after its
	dashes, MLINE with a 73 0 before its real 73, and a POINT preview
	160 in r2000 with a duplicate 160 and a rejected size. On master
	dwg_free aborts, freeing past the LTYPE dashes.

	See GH #1487.

	Reported-by: Mar <mardgez13@gmail.com>

2026-11-03  Reini Urban  <reini.urban@gmail.com>

	in_json: a dotted key into an unset array is an array of one element
	A dotted key into a subclass array that is not set (eg
	"ref.classname" or "rowstyles.text_height", as in example_2004.dwg and
	Multiline.dwg with the array removed) allocated one element, but left
	the count at 0, so the specs and dwg_free walked the array the fixed
	number of times past that element, and dwg_free freed the pointers
	found there.

	Now such a key does what an array of one element does: a new
	json_subclass_num_alloc gives both element counts, the array gets the
	elements the specs walk, zero-filled (6 for DIMASSOC ref, 3 for
	TABLESTYLE rowstyles, 6 for their borders, at least the length for
	the rest), and the count is set to 1, within the other array when
	shared, as in the LTYPE dashes.numdashes case. Nested dotted keys,
	inside an array element or an embedded struct, are left alone, as
	bbaec638 and #1485 skip those.

	New test in_json_dotted_array_test: dotted keys into DIMASSOC ref,
	TABLESTYLE rowstyles, MLINE verts.lines and LTYPE dashes with a
	numdashes given before. On master dwg_free aborts.

	See GH #1487.

	Reported-by: Mar <mardgez13@gmail.com>

2026-11-03  Reini Urban  <reini.urban@gmail.com>

	in_json: the SORTENTSTABLE and HATCH path counts are shared too
	find_numfield maps both sort_ents and ents to SORTENTSTABLE
	num_ents, and both segs and polyline_paths to HATCH
	paths[].num_segs_or_paths, but json_set_numfield kept only
	num_hdls and numelems within the other array. With these, every
	count the specs walk over two arrays is bounded by the shorter one.

	See GH #1487.

	Reported-by: Mar <mardgez13@gmail.com>

2026-11-03  Reini Urban  <reini.urban@gmail.com>

	in_json: every MLINE vertex gets num_lines lines
	The MLINE spec sets every vertex's num_lines to MLINE.num_lines and
	walks that many lines on each vertex. in_json set MLINE.num_lines from
	each vertex's lines in turn, so it ended at the last vertex's count,
	while each vertex's lines were allocated at its own count. With an
	earlier vertex of fewer lines, encode, out_dxf, out_json and
	dwg_free read past its lines, and dwg_free freed the segparms and
	areafillparms pointers found there.

	Now MLINE.num_lines is the most lines of any vertex (at most 255, it
	is an RC) and every vertex's lines are allocated at it. A new
	json_mline_num_lines grows the vertices read so far, zero-filled,
	when a later vertex has more.

	New test in_json_mline_lines_test: a 2-vertex MLINE with 2 and 3
	lines. On master MLINE.num_lines is the last vertex's count and
	verts[0] keeps its 2-element lines array.

	See GH #1487.

	Reported-by: Mar <mardgez13@gmail.com>

2026-11-03  Reini Urban  <reini.urban@gmail.com>

	in_json: subclass arrays get all the elements the spec walks
	The specs walk some subclass arrays a fixed number of times,
	independent of the array length: DIMASSOC.ref 6 (REPEAT_CN),
	TABLESTYLE.rowstyles 3 (and free_TABLESTYLE_r2010), and their
	borders 6. in_json allocated the arrays at the JSON length, so a
	shorter array left the walkers to read past the buffer, and
	dwg_free freed the pointers found there.

	A new json_subclass_fixed_elems gives _set_struct_field these
	counts; the array is allocated at least that many elements,
	zero-filled. An empty array stays NULL, which the specs skip.

	New test in_json_subclass_fixed_elems_test: a DIMASSOC with 4
	refs and all 6 associativity bits, and a TABLESTYLE with one
	rowstyle. On master dwg_free walks ref[4]/ref[5] and
	rowstyles[1]/rowstyles[2] past the buffers and aborts with
	free(): invalid pointer.

	See GH #1487.

	Reported-by: Mar <mardgez13@gmail.com>

2026-11-03  Reini Urban  <reini.urban@gmail.com>

	in_json: object counts never exceed their buffers
	The R2004+ object readers took count and size keys as given, also
	when they came after the buffer or array they count, so encode,
	out_json and free walked past the short buffers. The buffer sets
	the count: a count key given after the buffer is ignored, and an
	array never raises the shared count above its own length.

	* src/in_dxf.c (find_numfield): map texts and itemhandles to
	  numitems, shorts to num_hdls, exprs and lut to numelems.
	* src/in_json.c (find_field, json_count_key_buffered): New
	  helpers; a count/size key is ignored once the buffer it counts
	  is set (preview, proxy_data, bindata, sweepdata, pathdata,
	  shsw_text, shsw_text2, data, data_date, dashes, texts,
	  itemhandles, hdls, shorts, exprs, lut).
	* src/in_json.c (json_set_numfield): an array lowers the count it
	  shares with a buffer or a second array, never raises it.
	* src/in_json.c (_set_struct_field): the OLE data_size bound from
	  86cc68d2 applies to a data_size key given before the data; the
	  binary branch now reads value.data_date of a TABLE or FIELD and
	  sets data_numbits in bits for the PROXY data.
	* src/in_json.c (json_fixed_vector_size): fixed vectors (SPATIAL
	  FILTER transform 12, all transmatrix/transform/trans 16,
	  BLOCK*PARAMETER prop_states 4) are allocated zero-filled at
	  least their spec size.
	* src/in_json.c (json_blocklookupaction_check): a BLOCKLOOKUP
	  ACTION numrows * numcols above exprs or lut is reset to 0.
	* test/unit-testing/encode_test.c: New in_json_object_counts_test.

	Fixes the in_json object side of GH #1487.

	Reported-by: Mar <mardgez13@gmail.com>

2026-11-03  Reini Urban  <reini.urban@gmail.com>

	in_json: section counts never exceed their buffers
	The R2004+ section readers took the count keys as given, also when
	they came after the buffer they count, and the writers in encode.c,
	out_json.c and free.c then read past the buffers. Apply the same
	rule as 0443a3df: the buffer sets the count, the count key is
	ignored.

	* src/in_json.c (FIELD_NUM): New macro that skips a count key.
	* src/in_json.c (json_AppInfo, json_AppInfoHistory): size counts
	  unknown_bits; the buffer sets it.
	* src/in_json.c (json_Security): encr_size counts encr_buffer.
	* src/in_json.c (json_RevHistory): num_histories counts histories.
	* src/in_json.c (json_AcDs): num_segidx counts both segidx and
	  segments; keep it at most the length of segments.
	* test/unit-testing/encode_test.c: New in_json_section_counts_test,
	  which walks the oversized AcDs counts through dwg_free_acds.

	Fixes the in_json section side of GH #1487.

	Reported-by: Mar <mardgez13@gmail.com>

2026-11-03  Reini Urban  <reini.urban@gmail.com>

	programs, configure: free the dwg under ASan when the compiler lacks its macro
	rcc enables -fsanitize=address without defining __SANITIZE_ADDRESS__ or
	__has_feature(address_sanitizer), so the force_free block that makes the
	writers call dwg_free was compiled out. A normal dwg (num_objects >= 1)
	then kept the whole Dwg_Data alive: ASan reported the CLASSES array and
	the header strings as direct leaks, with the objects reachable from them.

	- configure.ac: define HAVE_ASAN only when -fsanitize=address or
	  -fsanitize=leak is in CC or CFLAGS, as the AM_CONDITIONAL already did.
	  The AC_DEFINE was unconditional, so HAVE_ASAN was set in every build.
	- dwg2SVG, dwg2dxf, dwgbmp, dwglayers, dwgread, dwgwrite, dxf2dwg,
	  dxfwrite: the ASan gate now also recognizes HAVE_ASAN.

	make check: dxf.test, dxfb.test, json.test and alive.test pass again
	under rcc with -fsanitize=address,undefined.

	configure: Regenerate.

2026-11-03  Reini Urban  <reini.urban@gmail.com>

	classes: dispatch an object only by a class of its own type
	The writers and dwg_free read a variable-type object (type >= 500) by the
	struct of its class, dwg_class[type - 500], chosen in classes.inc by the
	class's dxfname. Only the decoder allocates the object from that class.
	in_json allocates it by its JSON object name and took the type number as
	given; json_CLASSES also skips an entry missing a mandatory field, which
	moves every later class down one index and leaves the skipped entry's
	fields to the next one. in_dxf types an object by the class of its
	dxfname, but keeps the object's own enum type when no class has that
	name, which then indexes whichever class sits there. Nothing checked that
	the class names the object's type, so dwg_write_json read the object's
	struct as another one, e.g. a SCALE as a MATERIAL: reads past the smaller
	struct and through its fields as pointers. A dxfname key after the type
	did the same to dwg_encode and dwg_free, which find the class by
	obj->dxfname. The DXF writers' type functions already refuse an object of
	another fixedtype; dwg_print gets the same check.

	- classes.inc: every dispatch to a type's function first requires
	  obj->fixedtype to be that type. Otherwise the class is handled as an
	  unknown one (dwg_free frees by fixedtype, as for a class whose dxfname
	  differs). The decoder sets the type from the class just before, so it is
	  unaffected.
	- out_json, print, encode: the UNKNOWN_OBJ/UNKNOWN_ENT fallback goes by the
	  object's supertype, the layout of its struct, not by the class's
	  item_class_id. print also read one class past the array and took class 0
	  for no class.
	- out_geojson indexed the classes by fixedtype - 500 instead of type - 500;
	  its LWPOLYLINE and GEOPOSITIONMARKER cases now need that object type, and
	  an unknown class is no printed feature.
	- in_json: after all sections are read (CLASSES may follow OBJECTS), each
	  object stored with a class is typed by the class of its name, as
	  dwg_encode_get_class does for in_dxf, and that class gets the object's
	  supertype. A skipped CLASSES entry is cleared and the classes are
	  numbered by their index. A dxfname key after the type no longer replaces
	  the dxfname of the object's name (UNKNOWN_* keep theirs). A fixed type
	  number other than the object's own is replaced by the object's type, as
	  one up to LAYOUT, PROXY_ENTITY or PROXY_OBJECT already was (f23fcbb9):
	  dwg_free_object and the writers switch on it.

	add_test: JSON import with skipped classes, CLASSES after OBJECTS and a
	foreign dxfname types each object by its class; a SCALE whose only class
	is a MATERIAL is written as UNKNOWN_OBJ, and one of type 499 is typed as
	a SCALE.

	Fixes GH #1485

	Reported-by: Mar <mardgez13@gmail.com>

2026-11-03  Reini Urban  <reini.urban@gmail.com>

	api: regenerate dynapi for ASSOCASMBODYACTIONPARAM field order
	The ASSOCASMBODYACTIONPARAM fields sorted by their new offsets, and
	dynapi_test.c with test_3dsolid_fields.

	Fixes GH #1485

	Reported-by: Mar <mardgez13@gmail.com>

2026-11-03  Reini Urban  <reini.urban@gmail.com>

	dwg.h: fix ASSOCASMBODYACTIONPARAM 3DSOLID field offsets (invalid free)
	ACTION_3DSOLID calls decode_3dsolid, encode_3dsolid, free_3dsolid,
	dxf_3dsolid_revisionguid, json_3dsolid, dxf_3dsolid and dxfb_3dsolid
	with _obj cast to Dwg_Entity_3DSOLID, and in_dxf does the same for every
	dwg_obj_is_3dsolid() object. ASSOCASMBODYACTIONPARAM was the only one of
	these types with its own fields before the _3DSOLID_FIELDS, so the
	helpers used name, asdap_class_version, dep and class_version as
	block_size, encr_sat_data, sab_size and acis_data: decoding overwrote
	the dep handle, and free_3dsolid freed values read from the DWG.

	Move them right after parent, as in the other types, and add a
	dynapi_test check that every type with the _3DSOLID_FIELDS has them at
	the Dwg_Entity_3DSOLID offsets.

	Fixes GH #1485

	Reported-by: Mar <mardgez13@gmail.com>

2026-11-03  Reini Urban  <reini.urban@gmail.com>

	in_json: skip a dotted key through a pointer field with all its value
	_set_struct_field took a dotted key "a.b" in an element of a subclass
	array as field b of a struct embedded at field a, and wrote b at a's
	offset plus b's. When a is a pointer field (MLINE_vertex.lines,
	LEADER_Node.lines, HATCH_Path.segs, the subclass parents such as
	MLINE_line.parent, ...), that struct is not there: b went over the
	fields after the pointer, past the array for its last element
	(lines.segparms in the last MLINE vertex wrote num_segparms and the
	segparms pointer after the end of verts). bbaec638 skips such a key in
	an embedded struct; skip it in an array element too.

	In the embedded struct, bbaec638 skips only the first token of the
	value, so an array or object value left its elements to be read as the
	next keys and the import failed (ctx.leaders.lastleaderlinepoint [1, 2,
	3] in a MULTILEADER: dwg_read_json returned 0x800 and the object was
	gone). Both places now skip the whole value. A top-level dotted key
	already follows the pointer.

	add_test: dotted keys through pointer fields are ignored, in an
	embedded struct and in an array element, and the import goes on.

	Fixes GH #1485

	Reported-by: Mar <mardgez13@gmail.com>

2026-11-03  Reini Urban  <reini.urban@gmail.com>

	in_dxf, in_json: set union members only as their selector picks them
	The importers chose which member of a union to write from the DXF group
	code or the JSON key in the input, while the spec, the writers and
	dwg_free choose it from the struct's own selector field. A member
	written under another selector is later read, written through or freed
	as the other member: a double the file chose ends up used as a pointer.

	- MULTILEADER.ctx.content, txt or blk, by has_content_txt or
	  has_content_blk: in_dxf refused 290 once blk was selected, but not
	  296 once txt was. Neither flag may now select its member while the
	  other one does, nor be cleared once set (296 0 after text content
	  stays valid).
	- EvalExpr.value, by value_code: add_AcDbEvalExpr set num40, pt2d, pt3d,
	  text1, short70 or handle91 for whichever code came; now only the
	  member value_code selects (the empty 1 before 70 is skipped).
	- EvalVariant.u, by code: add_EVALVARIANT switched on the value pair's
	  own value, dwg_resbuf_value_type (pair->value.i), instead of on code.
	  It now switches on code, and the value pair must carry that code.
	- in_json wrote all of these through the dynapi keys unchecked. The new
	  json_union_key_ok() in _set_struct_field, which every key passes
	  through, accepts a member key only when its selector picks it, and a
	  selector key only while it picks no member yet.
	- in_json: an array given for an embedded struct field (ctx, evalexpr,
	  ...) was read as an array of structs, and the field's size was copied
	  from the 8-byte array pointer over the struct. As bbaec638 does for an
	  object given for a pointer field, the field's own kind now decides.
	- in_json: the DICTIONARY "items" branch matched DICTIONARYVAR by its
	  name prefix and wrote the DICTIONARY fields into its smaller struct,
	  itemhandles past its end. in_dxf already excludes DICTIONARYVAR there.

	add_test: a conflicting DXF code and conflicting JSON keys are ignored.

	Fixes GH #1485

	Reported-by: Mar <mardgez13@gmail.com>

2026-11-03  Carmelo  <27890290+Carmel0@users.noreply.github.com>

	encode: zero new Dwg_Section entries after realloc
	dwg_encode() can grow header.section and immediately call
	section_info_rebuild(), which reads sec->type from the newly allocated,
	uninitialised tail.

	Track the old section count and clear the new entries after both
	reallocations. This follows the existing realloc-then-memset pattern
	used for header.section elsewhere in this file.

	No conventional regression test is added because the read has no
	observable effect without Valgrind or MemorySanitizer.

	* src/encode.c (dwg_encode): Zero newly allocated Dwg_Section entries
	before rebuilding section pointers.

2026-11-03  Carmelo  <27890290+Carmel0@users.noreply.github.com>

	dwg_api: set *error on layer/ltype fallback
	dwg_ent_get_layer_name() and dwg_ent_get_ltype_name() document the
	error output as 0 on success, but leave it unchanged when returning a
	default name for an entity without the corresponding handle.

	Set *error to 0 before the optional table lookup. The lookup still
	changes it to 1 on failure.

	* src/dwg_api.c (dwg_ent_get_layer_name,
	dwg_ent_get_ltype_name): Set *error on the fallback path.

2026-11-03  Reini Urban  <reini.urban@gmail.com>

	lint: re-format in_dxf.c

2026-11-03  Reini Urban  <reini.urban@gmail.com>

	indxf: keep group-9 LTYPE dash text in strings_area from DXF
	add_LTYPE_dashes stores the group-9 text dash into strings_area, but the
	LTYPE table-entry processing then re-allocated strings_area unconditionally
	(256 bytes for a <=r2004 source, 512 for >=r2007) after the read, discarding
	the text and leaking the old buffer. The LTYPE was then encoded with an
	empty strings_area, so a text dash lost its label on every DXF->DWG read.

	Guard both re-allocations with !_obj->strings_area so the buffer filled by
	add_LTYPE_dashes survives; LTYPEs without a text dash still get their
	allocation.

	Found while investigating GH #1486. Verified on an rcc build: an R2000 DXF
	LTYPE "GAS" with a text dash (pattern A,.5,-.2,["GAS",STANDARD,...],-.25)
	previously roundtripped with an empty group 9; it now keeps "GAS" (TV 256
	for r2000, upconverted to TU 512 for r2013 by the #1486 upconvert).

	* src/in_dxf.c (LTYPE table-entry): Only allocate strings_area when it is
	  not already set by add_LTYPE_dashes.

2026-11-03  Reini Urban  <reini.urban@gmail.com>

	encode: upconvert LTYPE strings_area for DXF input to r2007+ targets
	add_LTYPE_dashes sizes strings_area by the source version during the DXF
	read (256/TV for a <=r2004 source). dxf2dwg restores header.version to
	the -a target (e.g. r2013) only after the read, so the r2007+ encoder
	then writes 512/TU bytes into the 256-byte buffer and overflows in
	bit_write_TF (via dwg_encode_LTYPE_private).

	The blanket INDXF early-return in dwg_convert_LTYPE_strings_area skipped
	the 256->512 upconvert for DXF input. The upconvert reads old[0..255] and
	writes new[i*2], safe on a 256-byte buffer, so allow it. Keep skipping
	the r2007->r2004 downconvert, which reads old[i*2] up to index 510 and
	would overread a 256-byte DXF buffer.

	Verified on a clang ASan build: dxf2dwg -y -a r2013 on an R2000 DXF with a
	text dash (group 74 bit 2 + group 9) previously crashed with
	heap-buffer-overflow in bit_write_TF (0 bytes after a 256-byte region
	from add_LTYPE_dashes); it now converts cleanly and the LTYPE roundtrips.

	* src/encode.c (dwg_convert_LTYPE_strings_area): Run the r2004->r2007
	  upconvert for DXF input; only the downconvert stays skipped.

	Fixes GH #1486

2026-11-03  garcialeal  <garcialeal2@gmail.com>

	geom: fix V4 transform elevations, fixedtype and block ownership
	- switch on obj->fixedtype, not obj->type (R2000+ variable classes)
	- map shared elevations once via the anchor (0,0,e): SOLID, TRACE, TEXT,
	  LWPOLYLINE; TEXT alignment_pt mapped when dataflags & 2
	- skip subentities and block-definition members (v4_is_block_member)

	Known gap, pre-existing: ATTRIB/ATTDEF are subentities and are skipped, so
	a TEXT/INSERT moves while its attributes keep their old coordinates. Left
	for a follow-up.

2026-11-03  Reini Urban  <reini.urban@gmail.com>

	decode: reject overlarge OLEFRAME/OLE2FRAME data_size on import
	GHSA-37mv-q3xr-pjjc: DoS via a crafted DWG carrying an OLEFRAME/OLE2FRAME
	whose data_size is ~3.85 GB (3851730860) while data is NULL. dwg2dxf then
	emits gigabytes of zeros in its VALUE_BINARY loop. Catch the bogus length
	at import/decode time so it never reaches the writer.

	The OLE payload (the 310 data field) is stored inline in the object, so
	data_size can never exceed the object/document size. The R2013+ object
	section is decompressed in-place into the object stream (no separate OLE
	binary string stream), so bounding data_size against dat->size is safe for
	all versions and cannot false-positive. The check runs before the binary
	read so a bogus length cannot drive the bit_read_TF allocation, and before
	the xcalloc in in_dxf.c.

	src/dwg.spec: add a DECODER guard to OLEFRAME and OLE2FRAME that logs and
	  zeroes data_size when it exceeds dat->size, placed before FIELD_BINARY.
	src/in_dxf.c: in the OLE2FRAME 90 handler, reject (goto invalid_dxf) when
	  the pair value exceeds dat->size, before the xcalloc of the data buffer.
	  Cast pair->value.l to size_t/BITCODE_BL to keep -Werror=sign-compare and
	  -Werror=format clean on 32-bit and strict builds.
	src/in_json.c: in _set_struct_field, zero data_size when it exceeds
	  dat->size for OLE2FRAME/OLEFRAME.

	Verified: no false positive on test/test-data/2018/ole2frame.dwg
	(data_size 7296 <= size, dwg2dxf exits 0 in ~0.03s). All changed files
	compile clean under -Werror (GCC, 64- and 32-bit). Full make check passes
	32/32. The in_dxf.c guard is proven firing on a crafted overlarge 90; the
	DWG decode guard is verified by bound check and code inspection.

	clang-format 21 cannot load the repo .clang-format (SkipMacroDefinitionBody
	needs >=22), so formatting was applied manually.

	Credits: @BOTecko

2026-11-03  Saddam  <saddamr3e@gmail.com>

	out_json: fix thumbnail overread in json_thumbnail_write
	json_thumbnail_write skipped a 16-byte sentinel whenever
	header.from_version >= R_2004 and then wrote thumbnail.size bytes.  Only
	the r2004+ DWG decoder keeps that sentinel in the buffer (thumbnail.byte
	= 16).  The DXF and JSON importers store the bare image with byte 0, so
	writing an r2004+ DXF or JSON as JSON read 16 bytes past the heap buffer
	into the output, e.g. the DXF of the in-tree example_2018.dwg.  Skip
	thumbnail.byte instead, as encode_r13_thumbnail and dxf_thumbnail_write
	already do.

	* src/out_json.c (json_thumbnail_write): offset the chain by
	  thumbnail.byte, not by from_version.

2026-11-01  Reini Urban  <rurban@cpan.org>

	out_dxf: do not split UTF-8 sequences in chunked strings
	dxf_write_chunked cut long (>250 byte) strings at a fixed byte offset,
	so a cut inside a multi-byte UTF-8 character left the following group
	5/3 chunk starting with a continuation byte and the first chunk ending
	in a truncated sequence. Strict DXF readers reject such files.

	For r2007+ (UTF-8 output), back off up to 3 bytes to the previous
	character boundary before the existing \U+XXXX backslash scan. Pre-r2007
	codepage output is unchanged.

	Verified with a 275 byte Cyrillic MTEXT (byte 250 is a continuation
	byte): master writes 2 invalid UTF-8 chunks, patched 0, and the
	concatenated chunks equal the original text.

	* src/out_dxf.c (dxf_write_chunked): Back off to a UTF-8 boundary.

	Fixes GH #1483
	Reported-by: Igor Ivanter <39959578+IgorIvanter@users.noreply.github.com>

2026-11-01  Reini Urban  <rurban@cpan.org>

	R11/R12: trailing entity bytes, block ATTRIB SEQEND, anonymous blocks
	Three fixes for pre-R13 (R11/R12) DWG files read via dwg2dxf.

	1. The entity size check rejected any entity whose declared size was
	   larger than what was parsed (e.g. DIMENSION, TEXT or ATTRIB with
	   trailing bytes), cut the size and read the next entity from the
	   wrong position, ending in a CRC error cascade. Tolerate up to 64
	   trailing bytes so the existing branch keeps them in unknown_rest.
	2. In the BLOCKS section only POLYLINEs got their trailing children
	   written, so an INSERT with ATTRIBs inside a block lost its SEQEND
	   and strict readers (ezdxf) rejected the file. Scan INSERT and
	   MINSERT too, and accept ATTRIB children.
	3. The R11/R12 block table stores anonymous blocks with a bare name
	   (*D, *U, *X), so many BLOCK definitions shared one name and every
	   DIMENSION resolved to the same one. Give them unique names, taking
	   the numbered name stored in the BLOCK entity when there is one, else
	   numbering after the highest used number, and keep BLOCK_HEADER and
	   BLOCK names in sync.

	Verified: a dxf2dwg --as r12 file with INSERT+ATTRIB in a block emits
	INSERT ATTRIB SEQEND on the patched build and no SEQEND on master;
	ACEL10/ACEB10 headers now carry the stored *X16/*X17/*D<n> names, bare
	*D in entities-2d/3d becomes *D1. The r10-r12 samples read unchanged.
	No available sample has trailing entity bytes, so part 1 is untested
	beyond the sample regressions.

	* src/decode.c (dwg_decode_add_object): Allow 64 trailing bytes.
	* src/out_dxf.c (dxf_block_write): Also scan after INSERT/MINSERT, accept
	ATTRIB children.
	* src/decode_r11.c (number_anonymous_blocks): New, called at the end of
	decode_preR13.

	Fixes GH #1481
	Reported-by: 499226306 <117785614+499226306@users.noreply.github.com>

2026-11-01  Reini Urban  <rurban@cpan.org>

	Merge branch 'smoke/versions'
	* dwgrewrite: keep the version for all files <= r2004 (b79748a05)

2026-11-01  Reini Urban  <rurban@cpan.org>

	dwgrewrite: keep the version for all files <= r2004
	The encoder can write r2004, so only downgrade 2007+ files, and to
	r2004 instead of r2000 (less lossy, keeps the 2004 section layout).

	This exposes two pre-existing r2004 write bugs in dwg_encode:

	* realloc-grown section_info entries were not zeroed, so the new
	  info->sections pointer held stale (poisoned) memory; freeing it
	  in the stream loop crashed with SEGV (example_2004, example_2010).
	  Zero the new entry after the realloc.

	* the read-time info->sections arrays were overwritten by the
	  pre-calculated ones without being freed: 193 byte leak in 13
	  objects for example_2004 (calloc in read_R2004_section_info).
	  Free them before the calloc, like the drop loop already does
	  for entries that are not written.

	* programs/dwgrewrite.c: downgrade only > r2004 to r2004
	* src/encode.c: zero realloc-grown section_info entry and free the
	  read-time info->sections before replacing it; mark the
	  _SET_DATAFLAGS macro clang-format off (non-idempotent comment
	  reflow); file re-formatted with build-aux/clang-format.sh

2026-10-31  Reini Urban  <rurban@cpan.org>

	Merge branch 'smoke/table-leaks'
	Fixes on top of the TABLE/TABLECONTENT leak work:

	* free: fix two memory leaks in TABLE/TABLECONTENT (be34cf9f6)
	* test: fix revision_bytes array checks and per-file loglevel
	  (de7d6a797)
	* dynapi: size the TABLE.cells count local like its dynapi field
	  (fb148f770)
	* encode: restore TABLE_value data_type after kGeneral pre-clear
	  (d06c2233c)

2026-10-31  Reini Urban  <rurban@cpan.org>

	encode: restore TABLE_value data_type after kGeneral pre-clear
	The kGeneral (0x200) pre-clear in TABLE_value_fields rewrites the
	stored data_type when encoding to a pre-R2007 version (kGeneral is
	not representable there, it is written as kUnknown).  The rewrite
	persisted in the object, so the subsequent free dispatch switched on
	the corrupted value (0 = kUnknown) and never freed value.data_date,
	a 2 byte leak for every kGeneral value.  Reproducible with
	dwgrewrite example_2004.dwg (as r2000) under ASan: Direct leak of
	2 byte(s) in dwg_decode_TABLECONTENT_private.

	Save the data_type in encoder mode and restore it at the end of the
	macro, so the stored object keeps the decoded value as the source
	of truth for free/JSON/DXF.

	* src/dwg_spec_shared.h: wrap TABLE_value_fields in a scope with
	  save/restore of value.data_type around the kGeneral pre-clear.

2026-10-31  Reini Urban  <rurban@cpan.org>

	dynapi: size the TABLE.cells count local like its dynapi field
	gen-dynapi.pl emitted a BITCODE_BL count local for every pointer
	field's count check, but TABLE.num_cells is an unsigned long
	(computed as num_rows * num_cols). dwg_dynapi_entity_value then
	wrote 8 bytes into the 4-byte local, corrupting the adjacent stack
	slot and aborting dynapi_test at the first TABLE object:
	"stack smashing detected" on the clang CI and abort trap on macOS,
	both before the first TAP line.

	Look up the count field's type in the dynapi table and size the
	local accordingly; only TABLE.num_cells is wider than BL today.

	 src/gen-dynapi.pl
	   Size the count-pair local from the count field's dynapi type.
	   (Also perltidy-normalized one adjacent line, as the hook
	   requires.)
	 test/unit-testing/dynapi_test.c
	   Regenerate: TABLE.cells count local is unsigned long.
	   The in-tree `make regen-dynapi` could not run here (the
	   installed Convert::Binary::C rejects bool return types in
	   dwg.h), so the single affected block was updated to exactly
	   what the fixed generator emits.

2026-10-31  Reini Urban  <rurban@cpan.org>

	test: fix revision_bytes array checks and per-file loglevel
	Four entity tests compared the inline revision_bytes[9] array field
	with the pointer-compare CHK_ENTITY_TYPE macro, whose
	`field == ent->field` test can never match an array; use the
	established CHK_ENTITY_ARRAY (memcmp) pattern instead, as
	3dsolid.c already does. This made the region test fail on
	example_2018.dwg (and would fail body and friends with coverage).

	The test harness also lost its loglevel after the first file:
	dwg_read_file syncs the global loglevel from dwg->opts, which the
	tests never set, silencing all logging from the second file on and
	hiding failures from the CI logs. Seed g_dwg.opts before each read.

	 test/unit-testing/acsh_brep_class.c
	   Use CHK_ENTITY_ARRAY for ACSH_BREP_CLASS.revision_bytes.
	 test/unit-testing/assocasmbodyactionparam.c
	   Use CHK_ENTITY_ARRAY for ASSOCASMBODYACTIONPARAM.revision_bytes.
	 test/unit-testing/body.c
	   Use CHK_ENTITY_ARRAY for BODY.revision_bytes.
	 test/unit-testing/region.c
	   Use CHK_ENTITY_ARRAY for REGION.revision_bytes.
	 test/unit-testing/tests_common.c
	   Keep the test loglevel across the dwg_read_file opts sync.

2026-10-31  Reini Urban  <rurban@cpan.org>

	free: fix two memory leaks in TABLE/TABLECONTENT
	Both leaks reproduce with test/test-data/example_2000.dwg
	(AC1015 carrying a R2010 class table):
	    $ ./dwgread -v2 -o out.json test/test-data/example_2000.dwg
	    LeakSanitizer: 97922 byte(s) leaked in 2 allocation(s)

	src/dwg2.spec: the TABLE cells array (REPEAT_C num_cells, 180 x 544
	bytes in the reproducer) was never freed since 6cb65e748, which
	disabled the free because "it's 0x21, not a pointer. Someone is
	overwriting it, because it's shared with TABLECONTENT" - the TABLE
	and TABLECONTENT objects alias the same struct memory. Re-enable the
	free, guarded: glibc aligns every allocation to 16 bytes, so only
	plausible heap pointers are freed and unaligned sentinel values such
	as 0x21 are left alone. The underlying aliasing remains a separate,
	open refactor ("use a subclass instead").

	src/dwg_spec_shared.h: TABLE_value_fields pre-clears bit 0x200
	(kGeneral) from value.data_type for pre-R2007 output. The statement
	ran in all modes, including free/JSON/DXF, where it rewrote the
	stored kGeneral (512) to kUnknown (0) before the switch on
	data_type. The kGeneral payload value.data_date was then neither
	emitted (corrupting the JSON/DXF output) nor freed (the 2-byte leak
	in the reproducer, TABLECONTENT object 467). Restrict the pre-clear
	to decoder/encoder modes, where it is a no-op at decode time (the
	field is still zero) and only affects pre-R2007 encode output.

	Verified: dwgread on the reproducer reports no leak anymore, and the
	JSON now carries value.data_type 512 / data_size / data_date instead
	of a corrupted kUnknown. make check (asan build): leak summaries
	91 -> 44 (all 42 occurrences of these two leaks gone, 0 SEGVs), and
	dwgfilter.test and svg.test now pass (6 -> 4 failing tests, same
	set otherwise).

	* src/dwg2.spec (DWG_ENTITY (TABLE) free): guarded cells free
	  replacing the 6cb65e748 workaround.
	* src/dwg_spec_shared.h (TABLE_value_fields): restrict the 0x200
	  pre-clear to decode/encode modes.

2026-10-31  Reini Urban  <reini.urban@gmail.com>
	    omp + qwen3.8-27b-fp8-s2  <noreply@qwen.ai>

	attrib: fix R2010+ ATTRIB and R2018 multi-line ATTRIB/ATTDEF reading
	R2010+ ATTRIB objects do not carry the R2018 multi-line (mtext)
	subclass, so reading the keep_duplicate_records RC field as if present
	desyncs the decoder and leaves the ATTRIB misread. R2018 multi-line
	ATTRIB/ATTDEF (mtext_type > 1) additionally embed an AcDbMTextObject
	subclass - its own common data, the full MTEXT field set and a separate
	handle stream - that the decoder never consumed, so the main style
	handle was read from an embedded-MTEXT slot.

	This reworks the ATTRIB/ATTDEF decode to match the actual stream:

	* src/dwg.spec
	  - Drop the keep_duplicate_records RC field from ATTRIB (kept for
	    ATTDEF, DXF and JSON): the R2010+ ATTRIB stream does not carry it.
	  - Move the main style handle ahead of the R2018 mtext subclass in
	    both ATTRIB and ATTDEF so it is read at its true position in the
	    handle stream rather than grabbing an embedded-MTEXT handle.
	  - Encoder fallback: when writing below R2018 from an R2018+ file,
	    substitute text_value (ATTRIB) / default_value (ATTDEF) from the
	    embedded mtext.text so the downconverted text is not lost.

	* src/dwg_spec_shared.h
	  - Rework AcDbMTextObjectEmbedded_fields to read the embedded MTEXT
	    common data, the full MTEXT field set (MTEXT field/handle order,
	    R2018 bg mask) and, when is_not_annotative, the R2018
	    AnnotScaleObject. Handles not stored in the struct (owner, ltype,
	    material, shadow, plotstyle) are read and discarded.

	* src/dwg.c, include/dwg.h
	  - Add dwg_strip_mtext(): reduce an MTEXT string ({}, \P, ~, \U+xxxx,
	    \char, \f/\c/\H/... format codes) to plain text for the encoder
	    fallback above.

	Verified against the PR POC samples AC1014/15/18/21/24/27/32: no
	keep_duplicate / Invalid ATTRIB/ATTDEF errors, and the multi-line
	ATTDEF 476 / ATTRIB 483 now decode cleanly (mtext layer -> LAYER 0,
	style -> Standard, CRC match). Unit tests pass 6/6. A 391-file
	dwg2dxf corpus diff against master shows only added, correctly
	resolved ATTRIB/ATTDEF text styles (group code 7) - no regressions.
	dwg_strip_mtext passes an 11-case throwaway test and dwgrewrite -a
	r2010 downconvert of an R2018 multi-line file runs clean.

	Note: ODAFileConverter hangs in this environment (0 CPU), so no ODA
	audit was run. clang-format 21 cannot load the repo .clang-format
	(SkipMacroDefinitionBody needs >= 22); the new code follows the
	surrounding style by hand. The encode/spec hunks sit near PR #1444's
	"to R2000" hunk; a trivial rebase resolves it whichever lands second.

	Reported by monyuonyu, https://github.com/monyuonyu (PR #1443)

2026-10-30  Reini Urban  <reini.urban@gmail.com>
	    omp + qwen3.8-27b-fp8-s2  <noreply@qwen.ai>

	decode: R13-R2018 read fixes: classes, colors, MTEXT, ACIS, aux, LAYER, EED
	Twelve decoder defects, found by comparing LibreDWG against ACadSharp
	on the same drawings and decoding the bits by hand against the ODA
	spec (v5.4.1) and AutoCAD's own saves of the same drawing in other
	versions (sample_AC1014..AC1032). Reimplemented and verified
	independently.

	* src/decode.c: classes R2004+: dwg_version/maint_version are BL, not
	  BS (above 255 the upper 16 bits were lost and every following
	  class, and every entity of a class numbered 509+, became
	  UNKNOWN_OBJ; sample_AC1018 MLEADERSTYLE 508). Also read the second
	  unknown BL into unknown_2 instead of unknown_1 again. R2007+: stop
	  reading the color book handle a second time (deferred in
	  dwg_decode_common_entity_handle_data), which consumed the layer
	  handle (sample_AC1021..AC1032 CIRCLE 99F had no layer).
	  EED 1003: read the layer handle big-endian, as the handle of 1005.
	* src/encode.c: EED 1003: write the layer handle big-endian.
	* src/common_entity_data.spec: color: the true color RGB (0x80)
	  comes before the transparency (0x20); move the color book handle
	  (0x40) block with it, per ODA 2.11 (sample_AC1032 LINE 9D4 had
	  rgb 0x01000000 + transparency 0xc2803dc2, now #803dc2 + ByBlock).
	  R13/R14: an own linetype is ltype_flags 3; the :3 arm was dead
	  under if (isbylayerlt), so such entities were written as ByLayer
	  to R2000. Note: open PR #1378 fixes the same dead ternary;
	  whichever lands first, the other needs a trivial rebase.
	* src/dwg.spec: MTEXT R2018: the background fields also exist with
	  only the 0x10 text frame bit set (mask 17, not 1); otherwise the
	  rest of such an MTEXT is misread.
	  LAYER R13/R14: off is the bit or a negative color; OR with the
	  decoded bit instead of overwriting it (sample_AC1014 LAYER_OFF
	  was read as on).
	* src/dwg2.spec: RENDERSETTINGS R2013: read the class version
	  unconditionally; the +1 shift lost the value and shifted every
	  RAPIDRTRENDERSETTINGS by 10 bits (gh44-error, gh109_1, redwg1).
	* src/auxheader.spec: R2000: zero_7 and zero_8 are present too
	  (AutoCAD's R2000 AuxHeader is 123 bytes; dwgrewrite's 115 byte
	  ones were not).
	  R2018: two 129 byte layouts exist: AutoCAD writes maint_version
	  as RL and two extra RS fields in the version area, while
	  ODAFileConverter writes the R2013 123 byte layout plus three
	  trailing RS. Detect the layout via the constant -1 marker field
	  and normalize the AutoCAD one in place to the ODA layout, so the
	  struct keeps the documented ODA form.
	* src/dwg_spec_shared.h: 3DSOLID/REGION/BODY/*SURFACE: no leading
	  ACIS empty bit since R2013, the SAB data is in the has_ds_data
	  AcDs blob; reading the non-existent bit shifted every R2013+
	  ACIS entity by 1 bit (sample_AC1032 3DSOLID D6A had
	  1274288069 isolines, now 4).
	* test/unit-testing/{tests_common,3dsolid}.c: compare the ACIS
	  revision guid arrays with memcmp, not by pointer equality.

	Verification: all twelve fixes verified against the PR's POC
	drawings (sample_AC1014..AC1032). The R2018 test corpus (76 files)
	contains 17 ODA-layout and 59 AutoCAD-layout auxheaders, all
	decode correctly (sample_AC1032: minus_1 -1, TDCREATE
	2022-02-21 08:58:18, TDUPDATE 2025-12-02 08:10:09, matching its
	R2013 twin save). 6/6 unit tests pass (add, dxf, bits, common,
	dynapi, hash). Pair-diff of the full test corpus against a master
	baseline (391 DXF files): 7 files differ, all explained by the
	fixes: 2004/HatchG (true color 420, matches the reference DXF),
	2013/JW (520 ACIS GUIDs, all matching the reference DXF),
	2013/flipped, 2018/TS1, example_2013, example_2018 (ACIS
	GUIDs/fields; the TS1 reference DXF predates the current
	TS1.dwg), and r14/missing_xref (EED 1003 layer handles).
	No ODAFileConverter audit: it hangs at 0% CPU in this environment.
	clang-format was not run: the installed clang-format 21 cannot load
	the repo .clang-format (SkipMacroDefinitionBody needs 22+).

	Reported by monyuonyu, https://github.com/monyuonyu (PR #1442)

2026-10-30  Reini Urban  <reini.urban@gmail.com>
	    omp + qwen3.8-27b-fp8-s2  <noreply@qwen.ai>

	DIMASSOC: make the class stable and fix its DXF ref layout
	The DIMASSOC object (dimension association point references) was
	marked unstable: dwg2dxf dropped it from DXF output and in_dxf.c
	guessed its field layout.  The DXF layout (up to 6 AcDbOsnapPointRef
	entries in file order, each optionally followed by its lastpt
	companion ref, 75=1) and the DWG bit layout (one bit ref per set bit
	of the 90 associativity field, count in 74 for intersections) are now
	read, written and emitted properly, so the class can be stable.

	The 330 after "100 AcDbDimAssoc" is the dimension object handle
	(dimensionobj), not the owner; it is now read into that field
	instead of overwriting the owner handle.

	A correct, bit-aligned DWG decode also keeps the object/handle stream
	in sync on files where the old decode consumed the wrong number of
	ref bits: the new build's DIMASSOC object set and handles are
	byte-identical to ODA's own DXF for example_2010, while master
	wrote different (corrupted) handles for objects in those files.

	Verification:
	- dwg2dxf of ODA-produced input reproduces every DIMASSOC object
	  tag-identical: 2000/TS1 (2), example_2004 roundtrip (8, incl. a
	  4-ref object with associativity 15 and a double 331 ref),
	  2004/Publish (2); example_2010 DXF matches ODA's own DXF output
	  byte-identical for all 10 DIMASSOC objects.
	- DWG-native write/reread probe: associativity, dimensionobj and
	  ref contents identical for r2000 and r13 files.
	- Unit tests: 6/6 pass.
	- 391-file corpus dwg2dxf diff against master: only the 21 files
	  containing DIMASSOC objects change; they gain the previously
	  dropped DIMASSOC objects, all other objects byte-identical.
	- ODA FileConverter audit skipped: it hangs on every input, incl.
	  unmodified master corpus files, in this environment.
	- clang-format check skipped: installed clang-format 21 cannot load
	  the repository .clang-format (requires SkipMacroDefinitionBody,
	  only supported by clang-format >= 22).

	include/dwg.h
	    Update the DIMASSOC docs: stable class, sequential ref storage.
	src/classes.inc
	    DIMASSOC: UNSTABLE_CLASS -> STABLE_CLASS.
	src/dwg2.spec
	    DIMASSOC: move dimensionobj (330) right after the subclass;
	    fill the ref vector sequentially in decode (one slot per set bit
	    of associativity, each possibly followed by its lastpt
	    companion) instead of skipping bit-indexed slots; num_intsectobj
	    is a DWG-only count (DXF code 0), 74 is intersec_subent_type.
	src/in_dxf.c
	    DIMASSOC: read the 330 after "100 AcDbDimAssoc" into
	    dimensionobj; rewrite add_DIMASSOC to fill the ref slots in file
	    order (1 AcDbOsnapPointRef, 72/73/91/40/10/20/30, 75 companion,
	    331/332 intersection refs, 74 type, 92 gsmarker, 301/302 xref
	    paths) instead of the old guess-based layout.
	src/objects.in
	    DIMASSOC: UNSTABLE -> STABLE.
	src/objects.c
	    Regenerate via gperf from objects.in (one DIMASSOC line).

	Reported by tuxiasumari, https://github.com/tuxiasumari (PR #1434)

2026-10-30  Reini Urban  <reini.urban@gmail.com>
	    omp + qwen3.8-27b-fp8-s2  <noreply@qwen.ai>

	decode: size each EED item's data to the item, not the rest of the EED
	dwg_decode_eed allocated every EED item with calloc (size + 8, 1),
	where size was what is left of the whole EED block, not the size of
	the item. Since the decoder keeps splitting the remainder into new
	items, an object whose EED holds many small items took memory
	quadratic in the number of items: a 20,000-item XDATA line needed
	556 MB of peak RSS in dwg2dxf, and large P&ID drawings with proxy
	EED ran out of memory.

	After an item is decoded, realloc its data down to the bytes it
	consumed plus 8 (the string header/terminator slack the decoder
	stores beyond the read bytes), never below sizeof (Dwg_Eed_Data)
	for the fixed union members.

	Measured peak RSS of dwg2dxf on the 20,000-item XDATA line:
	556 MB -> 51 MB. DXF output is byte-identical for blank_Acad2004,
	2000/2, example_2007, example_2013 and example_2018.

	Reported by tuxiasumari, https://github.com/tuxiasumari (PR #1426)

2026-10-30  Reini Urban  <reini.urban@gmail.com>

	out_dxf: export dxf_block_is_layout so the SWIG module links
	dxf_block_is_layout is declared in dwg.h, so the SWIG Python wrapper
	generates a reference to it, but it was neither marked EXPORT nor defined
	in an always-compiled TU: on Windows EXPORT is __declspec(dllexport), so an
	unmarked symbol is absent from the DLL export table and the link of the
	SWIG module fails with "undefined reference to dxf_block_is_layout".

	Mark it EXPORT (like the sibling dxf_cvt_lweight) and move its definition
	from out_dxf.c (only built when !DISABLE_DXF) next to dxf_cvt_lweight in
	dwg.c, which is always compiled. The body is unchanged.

	* include/dwg.h: mark dxf_block_is_layout() EXPORT.
	* src/dwg.c: define dxf_block_is_layout() after dxf_revcvt_lweight().
	* src/out_dxf.c: drop the definition.

2026-10-30  Reini Urban  <reini.urban@gmail.com>
	    omp + qwen3.8-27b-fp8-s2  <noreply@qwen.ai>

	out_dxf: number layout viewports per block for DXF groups 68/69
	DXF groups 68 (stacking order) and 69 (viewport id) are not stored
	in the DWG; the writer derives them, and derived them from entmode
	alone. entmode 0 does not mean "the overall paperspace viewport", it
	means the entity carries an explicit owner handle -- which is how
	every layout stores its entities except the one current when the
	file was saved (entmode 1). So in a drawing with more than one
	layout, the viewports of every other layout were written off
	(68 = 0, 69 = 0), and a consumer that honors the status draws an
	empty sheet.

	Derive the owning block the same way as group 330 in
	common_entity_handle_data.spec (the explicit owner handle, else the
	paperspace/modelspace block record the entmode implies) and number
	the viewport 1..N within that block, restarting when the block
	changes. 68 gets the same number as 69, as it is the stacking order
	("1 is the active viewport, 2 the next"), not a boolean. Viewports
	owned by an ordinary block (A$C... paste blocks, $AUDIT_BAD_BLOCK_*
	after a repair) stay off (0, 0): they are no view of a sheet. An
	unresolvable owner is still numbered.

	 include/dwg.h: add last_viewport_block to Dwg_Data, tracking the
	   block the 68/69 counter belongs to.
	 src/out_dxf.c: new dxf_block_is_layout(), true for the
	   model/paperspace blocks, '*'-named blocks (R13/R14 paper space
	   without LAYOUT objects) and blocks referenced by a LAYOUT
	   object; used by all translation units compiling dwg.spec.
	 src/dwg.spec: rewrite the VIEWPORT 68/69 DXF block accordingly.

	Verified on a 19-layout drawing with 49 viewports: every layout
	block now carries (1,1) (2,2) ... restarting per block, the two
	top-level viewports come out (1,1) (2,2), and the diff against
	master touches only the 68/69 value lines. example_r14 keeps both
	viewpoints on. No new failures in the unit tests.

	Reported by tuxiasumari, https://github.com/tuxiasumari (PR #1406)

2026-10-30  Reini Urban  <reini.urban@gmail.com>

	in_dxf: fix double-free in codepage conversion realloc-fail path
	When bit_utf8_to_TV keeps failing and a growth realloc then fails, the
	loop did free(tv); break;, leaving tv dangling. The subsequent else
	free(tv) then double-freed it (caught as -Werror=use-after-free by the
	mips GCC). Null out tv after the free so the final else free(tv) is a
	no-op free(NULL).

	* src/in_dxf.c (dxf_read_pair, DWG_VT_STR case): set tv = NULL after
	  freeing it in the realloc-failure branch.

2026-10-30  Reini Urban  <reini.urban@gmail.com>

	in_dxf: pad pre-r2007 string pairs to 32 bytes for r12 and earlier
	dxf_pair_string did a plain strdup for all pre-r2007 targets, dropping the
	32-byte TF name padding that dwg_add_u8_input applies for version <= R_12.
	bit_write_TF would heap-overflow on a shorter name, so restore the padding
	in the new helper to keep the two paths equivalent.

	This fixes the mingw dwgadd_test failure (readjson error 0x1000) caused by
	unpadded r1.4 (AC1.40) names breaking the dwgread JSON step.

	* src/in_dxf.c (dxf_pair_string): pad to 32 bytes for version <= R_12,
	  matching dwg_add_u8_input.

2026-10-30  Reini Urban  <reini.urban@gmail.com>
	    omp + qwen3.8-27b-fp8-s2  <noreply@qwen.ai>

	in_dxf: convert r2007+ UTF-8 strings to the pre-r2007 target codepage
	dxf2dwg --as r2000 of any r2007+ (AC1021+) DXF double-encoded every
	non-ASCII string: the UTF-8 bytes were stored raw in the codepage TV
	fields and re-decoded as cp125x on the way out ("CAÑERÍA Ø150" came
	back as "CAÃ‘ERÃ\x8dA Ã˜150"). The generic dynapi field path never
	converted from UTF-8 for TV targets.

	Convert in dxf_read_pair, only for the broken combination (source
	>= r2007, target < r2007, using the header codepage), with
	bit_utf8_to_TV; unrepresentable chars degrade to \U+XXXX as AutoCAD
	does. Converting at the reader gives the value the same encoding as
	one read from a pre-r2007 DXF, so every downstream consumer
	(generic dynapi fields, EED) behaves identically to the already
	working pre-r2007 path.

	The in_dxf call sites that pass pair values to dwg_add_u8_input now
	use dxf_pair_string(): for a pre-r2007 target the pair value is
	already in the target encoding (plain copy; feeding it through
	dwg_add_u8_input again would treat the codepage bytes as UTF-8 and
	mangle them), for a r2007+ target the UTF-8 value is converted as
	before.

	in_dxf.c:
		* dxf_read_pair: UTF-8 to TV conversion for a pre-r2007 target
		* dxf_pair_string: new, target-encoding aware copy for pair values

	Reported by tuxiasumari, https://github.com/tuxiasumari (PR #1375)

2026-10-30  Reini Urban  <reini.urban@gmail.com>

	dec_macros: fix heap overflow in TRACE field-name logging
	FIELD_G_TRACE and the other FIELD_*_TRACE macros built the log field name
	with strrplc, which allocates a buffer sized only for the (possibly
	shortened) name, then strcat'ed a longer format suffix (": " FORMAT "
	[TYPE %d]") into it. For a repeated sub-field (a name containing
	"[rcount1]"/"[rcount2]", e.g. MLINESTYLE lines) with TRACE logging (-v3)
	this wrote past the buffer's end.

	Grow the buffer with realloc to fit the suffix before strcat'ing, and skip
	the log line if the realloc fails. Log-only path, gated on
	DWG_LOGLEVEL >= TRACE.

	Fixes a reproducible "malloc(): corrupted top size" crash in dwg2dxf on
	files with an MLINESTYLE when run with -v3, and an AddressSanitizer
	heap-buffer-overflow in dwg_decode_MLINESTYLE_private.

	* src/dec_macros.h (FIELD_G_TRACE, FIELD_G_TRACE_ANGLE, FIELD_TRACE,
	  FIELD_VEC_TRACE_N, FIELD_2PT_TRACE, FIELD_3PT_TRACE): realloc the
	  strrplc buffer to fit the appended suffix before strcat.

2026-10-30  Reini Urban  <reini.urban@gmail.com>

	in_dxf: decode TABLE row_heights/col_widths BD* vectors (141/142)
	The DXF importer was silently dropping the TABLE entity's row_heights
	(141) and col_widths (142) BD* dynapi vectors, logging 20+9
	"Ignore ... VECTOR" warnings on r2007 files. The is_malloc vector block
	in new_object only handled clip_verts and 2RD/3RD point vectors; BD*
	vectors fell into the Ignore-VECTOR drop. find_numfield also lacked the
	row_heights->num_rows / col_widths->num_cols mapping, so the vector
	size (num_rows/num_cols) could not be resolved.

	src/in_dxf.c
	  * find_numfield: map row_heights->num_rows, col_widths->num_cols.
	  * new_object: add a BD* vector branch (mirroring the point-vector
	    j-index convention) that stores each value via
	    dwg_dynapi_entity_set_value, resetting j=0 after the last element.
	    Add the terminal goto next_pair; the point-vector branch was also
	    missing it, a latent fall-through to invalid_dxf.

	Verified with .build-debug/programs/dxf2dwg -v3 on example_2007.dxf:
	20 row_heights (11.0 + 9.0x19), 9 col_widths (63.5x9), 180 cells
	preserved, 0 TABLE Ignore VECTOR / unhandled / skipping. All 10
	example_*.dxf green. Per-file -Werror clean.

2026-10-30  Reini Urban  <reini.urban@gmail.com>
	    omp + qwen3.8-27b-fp8-s2  <noreply@qwen.ai>

	in_dxf: read ACAD_TABLE cells and TABLECONTENT from DXF
	Reimplement, independently from the PR description, the DXF reading of
	the TABLE entity cells and the TABLECONTENT object for PR #1446. The
	DWG reading of TABLE/TABLECONTENT/TABLESTYLE in normal builds was
	already done; this commit completes the DXF side so that dxf2dwg no
	longer aborts on files (example_*.dxf) that carry an ACAD_TABLE entity
	and a TABLECONTENT object.

	ACAD_TABLE is an entity that derives from INSERT; AutoCAD writes it to
	every DXF version in the pre-R2010 form. in_dxf now reads the repeated
	cell groups (171..178, 91, 145, 92, the 301 CELL_VALUE..304
	ACVALUE_END value block, and the per-cell border/grid data 302..309)
	via a dedicated add_AcDbTableCells handler, dispatched on the 171 code
	of an AcDbTable entity. The cell run is bounded only by the next
	subclass (100) or entity (0); the table-level override flags
	(table_flag_override 93, border_*_overrides 94/95/96) are read by the
	generic field loop before the cells, and 93/94/95/90 also occur inside
	each cell's value block and border data, so they must not terminate the
	cell run.

	TABLECONTENT is not imported from DXF (it is written as a placeholder,
	matching the PR). Its nested ldata/tdata/fdata fields are sub-fields of
	embedded structs, not top-level fields, so the generic field loop cannot
	match them. An unmatched code for an importable class is fatal, which
	made one unmodelled TABLECONTENT abort the whole file; the fallback now
	warns and skips past those codes instead.

	Also fix the TABLE title/header/data text style DXF code (AutoCAD
	writes 343, not 7), enable the TABLE and TABLECONTENT classes in normal
	builds, size strrplc dynamically, and add downconvert_TABLE for
	R2010+ -> R2000 writing.

	 src/classes.inc, src/objects.c, src/objects.in
	  Enable TABLE and TABLECONTENT in normal (non-DEBUG_CLASSES) builds.
	 src/dwg2.spec
	  Remove the #if defined (DEBUG_CLASSES) || defined (IS_FREE) guard
	  around the TABLE/TABLECONTENT/TABLESTYLE definitions. Read the 20.4.99
	  cell value unconditionally (kGeneral is a BL byte count + UTF-16LE
	  bytes, also present before R2007 in AutoCAD 2008 round-trip data).
	  Use unchecked REPEAT_C/REPEAT2_C for the cell vectors (cell text lives
	  in the string stream). Fix the text style DXF code 7 -> 343.
	 src/dwg_spec_shared.h
	  TABLE_value_fields: read kGeneral (512) for all versions as a BL byte
	  count plus UTF-16LE byte array, not only since R2007.
	 src/dynapi.c
	  Regenerate: TABLE title/header/data_text_style DXF code 7 -> 343.
	  (perl src/gen-dynapi.pl; no other changes.)
	 src/encode.c, src/encode.h
	  downconvert_TABLE: build the pre-R2010 table layout for R2010+ ->
	  R2000/R2004; declare it in encode.h.
	 src/common.c
	  strrplc: size the destination buffer from the actual replacement
	  length instead of a fixed 160 bytes (the -v3 nested table field-name
	  trace aborted on the old assert).
	 src/in_dxf.c
	  add_AcDbTableCells: read the ACAD_TABLE cell run. Dispatch on 171 for
	  an AcDbTable entity. Make the unmatched-code fallback non-fatal for
	  TABLECONTENT (warn and skip) so an unmodelled TABLECONTENT does not
	  abort the file.
	 programs/dxf.test.in, programs/dxfb.test.in
	  Exclude TABLE from the r13/r14 roundtrip expect count: TABLE is
	  unstable, so dwg2dxf logs "Add entity TABLE" but does not write it to
	  the DXF, making the roundtrip one entity short.

	Verified in a TCC build: make check passes (programs: alive, dwgfilter,
	dxf, dxfb, json, svg; examples; top level; unit-testing). dxf2dwg of
	example_2000..2018.dxf reads the ACAD_TABLE entity (num_rows/num_cols/
	cells) and the TABLECONTENT object with no "Invalid DXF code" and no
	READ ERROR. dwgread of the POC and sample_AC1014..AC1032 DWG files
	shows the ACAD_TABLE/TABLECONTENT/TABLESTYLE classes present with no
	fatal TABLE errors (sample_AC1021 emits a non-fatal "Invalid data type
	in TABLE_value_fields" for one round-trip kGeneral cell value; the file
	still reads). dwg2dxf of example_*.dwg is byte-identical to the master
	baseline (diff = 0), so DXF writing is unchanged.

	Note: build-aux/clang-format.sh could not be run here; the installed
	clang-format 21 cannot load the repository .clang-format
	(SkipMacroDefinitionBody requires clang-format >= 22). New code follows
	the surrounding 2-space style by hand.

	Reported by monyuonyu, https://github.com/monyuonyu (PR #1446)

2026-10-30  Reini Urban  <reini.urban@gmail.com>
	    omp + qwen3.8-27b-fp8-s2  <noreply@qwen.ai>

	in_dxf: import annotation scale context data objects
	The R2010+ AcDb*ObjectContextData debug class objects (annotation
	scale context data for MTEXT, TEXT, MTEXTATTRIBUTE, LEADER and the
	*DIM* dimension classes) were dropped at DXF import: object_alias()
	only recognized ACDB_ names prefixed with ACAD_, so every context
	object hit "Unhandled 0 ACDB_..._CLASS (objects)". Their bodies were
	also unparseable: the generic dynapi field search neither sees the
	embedded Dwg_OCD_Dimension struct nor the context bodies' own 70/46/
	10-33 groups, which collide with the common class_version 70.

	* src/classes.c
	  - object_alias: match the ACDB_ prefix instead of ACAD_ for the
	    *OBJECTCONTEXTDATA_CLASS alias (the dxfnames start with ACDB_).
	* src/in_dxf.c
	  - dxf_set_ocd_dimension: fill the Dwg_OCD_Dimension body of the
	    *DIM*OBJECTCONTEXTDATA classes: 2 (the *D block by name, with a
	    hex handle fallback for the writer's hex output), 10/20 def_pt,
	    140 text_rotation, 280 override_code, 291-298 flags, 70 dimatfit
	    (the body 70 is not the class_version) and 71 dimtmove.
	  - dxf_set_context_70: the body 70 after the context subclass
	    (MTEXT attachment, TEXT/MTEXTATTRIBUTE horizontal_mode) is not
	    the class_version of AcDbObjectContextData.
	  - dxf_set_leader_context: the LEADER body has no subclass marker of
	    its own: 70 num_points, num_points x (10,20,30) points, 11-31
	    x_direction, 290 b290, 12-32 inspt_offset, 13-33 endptproj.
	  - new_object: consume the MTEXT column_heights 46 vector (counted
	    by 72) before the generic loop would ignore it.

	Verified with a hand-written R2010 DXF (a SCALE plus MTEXT and
	ALDIM context objects): it now imports cleanly and roundtrips
	through dxf2dwg --as r2000 and dwg2dxf field by field; ODA
	FileConverter reads the resulting R2000 DWG without audit errors.
	master drops both context objects with "Unhandled 0 ACDB_...".
	Corpus DXFs without context objects roundtrip byte-identical to
	master (2000/PolyLine2D, 2010/Donut); 2004/Leader, whose import
	fails on master (rc=1), now imports its LEADER context object
	(rc=0) and roundtrips it.

	Reported by tuxiasumari, https://github.com/tuxiasumari (PR #1432)

2026-10-30  Reini Urban  <reini.urban@gmail.com>
	    omp + qwen3.8-27b-fp8-s2  <noreply@qwen.ai>

	r11: give pre-R13 drawings their paper space BLOCK_HEADER
	Reading r11/r12 (pre-R13) drawings without a *PAPER_SPACE block
	record routed all entities to the model space header and the DXF
	writer emitted no paper space block, so paper space entities (67
	flag) had no proper owner and no block record in the output.

	* src/dwg_api.c (dwg_add_Document): create the *PAPER_SPACE
	  BLOCK_HEADER on R_11 on (not just R_13b1 on), with the same
	  BLOCK/ENDBLK-as-UNUSED_r11 fixup model space already gets, so the
	  header is encoded but the block entities are not.

	* src/decode.c (decode_preR13_entities): route entities with entmode
	  1 to the paper space header, model space otherwise.

	* src/out_dxf.c (dxf_cvt_blockname): key the $- versus *-spelling on
	  the version being written, not the source version, and accept the
	  upper-case *MODEL_SPACE / *PAPER_SPACE forms the pre-R13 path
	  produces. This also fixes r11 to r12 DXF conversion, which
	  previously wrote no block name at all.

	ACEB10.dwg: the DXF BLOCKS section is now [$MODEL_SPACE,
	$PAPER_SPACE] with the paper space entities owned by the paper
	space header; the r11 DWG rewrite grows by one object (+10 bytes),
	entity counts unchanged (1275 = 1269 model + 6 paper). The r13+
	corpus is unchanged except upper-case *MODEL_SPACE / *PAPER_SPACE
	block names are now written with the canonical r13+ case; r10/r9/
	r2.6 corpus is 0-diff. One edge file (r0000087v-1.dwg) now also
	emits 99 block entities master had dropped entirely, a pre-existing
	writer gap the new header un-gates.

	Verification: 6 unit tests (add, dxf, bits, common, dynapi, hash)
	pass; r11 roundtrips re-read with the paper space header present
	and all entities intact; 263-file r13+ and r10/r9/r2.6 corpora
	compared as above. ODA FileConverter audit skipped: the installed
	ODAFileConverter hangs (0 CPU, no output) on every input,
	including unmodified master corpus files, in this environment.

	Reported by tuxiasumari, https://github.com/tuxiasumari (PR #1368)

2026-10-30  Reini Urban  <reini.urban@gmail.com>
	    omp + qwen3.8-27b-fp8-s2  <noreply@qwen.ai>

	timebll: compute the julian day fraction from milliseconds
	A TIMEBLL/TIMERLL is a julian day number plus the milliseconds elapsed
	in that day, so the fraction of a day is ms / 86400000. The tree
	computed it three mutually incompatible ways: days + ms * 1e-8 in
	bits.c, header_variables.spec, header_variables_r11.spec and
	dwg_api.c (off by a factor of 0.864, up to 3.3 hours), 0.864 * ms /
	1000 in cvt_TIMEBLL, and days + 86400 * ms in json_TIMEBLL (off by
	twelve orders of magnitude one way and 1000x the other).

	dwg_add_Document fills the field itself with 1000 * (now % 86400) --
	milliseconds -- and on real drawings the ms value only makes sense as
	milliseconds of the day, settling the intended reading.

	* src/bits.c
	  - bit_read_TIMEBLL, bit_read_TIMERLL: value = days + ms / 86400000.0
	* src/common.c
	  - cvt_TIMEBLL: the seconds of the day are ms / 1000, not
	    0.864 * ms / 1000 (a $TDUCREATE of [2454831, 77383890] is now
	    21:29:43 instead of 18:34:19)
	* src/header_variables.spec
	  - the TDCREATE/TDUPDATE timezone-adjusted values use ms / 86400000.0
	* src/header_variables_r11.spec
	  - the TDUCREATE value uses ms / 86400000.0; the TDUUPDATE value now
	    uses its own days/ms instead of TDUPDATE's (copy-paste slip)
	* src/dwg_api.c
	  - dwg_add_Document: TDUCREATE.value uses ms / 86400000.0
	* src/in_json.c
	  - json_TIMEBLL: the [days, ms] form and the scalar form both use
	    86400000.0 as the number of milliseconds of a day

	The value field is display-only: bit_write_TIMEBLL/TIMERLL ignore it
	and write days/ms, so no DWG bytes change. Verified against ODA
	FileConverter, which agrees to every printed digit ($TDCREATE
	2451380.847099063, $TDUCREATE 2451380.805432396 for a test drawing);
	corpus DWGs now differ from the previous output only in the six $TD
	display lines, and the JSON [days, ms] and scalar roundtrips import
	unchanged.

	Reported by tuxiasumari, https://github.com/tuxiasumari (PR #1369)

2026-10-30  Reini Urban  <reini.urban@gmail.com>
	    omp + qwen3.8-27b-fp8-s2  <noreply@qwen.ai>

	in_dxf: keep xref flags and path from DXF BLOCK when importing
	The r13+ DXF BLOCK entity carries the xref/overlay/resolved bits in
	code 70 and the xref path in code 1; the BLOCK_RECORD table entry has
	neither (its 70 is not emitted by writers). in_dxf ignored both, so an
	imported xref block came back as a regular block: 70 = 0 and an empty
	path.

	- src/in_dxf.c
	  * new_object: read BLOCK 70 (r13+) into the owning BLOCK_HEADER:
	    blkisxref (bit 4), xrefoverlaid (bit 8), xref_loaded (bit 32) and
	    flag |= bits 4/8, matching the DWG encode/decode layout.
	  * dxf_blocks_read: borrow the BLOCK entity's xref_pname (1) into the
	    BLOCK_HEADER when the block is actually an xref/overlay. Ordinary
	    blocks may carry their name in 1 (ODA convention), so the transfer
	    is limited to blkisxref/xrefoverlaid blocks; the pointer moves, the
	    BLOCK side is nulled so the header free owns it.

	Verified with a hand-made r2000 host DXF with an xref BLOCK (70 = 4,
	1 = ./FormatoA4.dxf): master roundtrips it as 70 = 0 and an empty
	path; with this patch the roundtrip keeps 70 = 4 and the path,
	likewise 70 = 12 (xref + overlay). Non-xref files (r11, r14, r2000,
	r2013 corpus DXFs) roundtrip byte-identical to master; add_test,
	dxf_test, bits_test, common_test, dynapi_test, hash_test pass.

	Reported by jmao44, https://github.com/jmao44 (PR #1431)

2026-10-29  Reini Urban  <reini.urban@gmail.com>

	acds: don't leak schdat.uprops on a second schdat segment
	The schema-data case calloc's schdat.uprops unconditionally, so a
	second schdat segment (e.g. 2018/Surface.dwg) overwrote the first
	allocation, which LSan reported as an 8-byte leak in acds_private.

	* src/acds.spec (case 4): free a previous urops allocation before the
	  REPEAT2 re-calloc's.

2026-10-29  Reini Urban  <reini.urban@gmail.com>
	    omp + K2.8 Preview  <kimi@moonshot.cn>

	free: fix leaks in section_info fixups, BLOCKSCALEACTION, unknown_bits
	LeakSanitizer reports from a full test-data sweep:

	* blank_Acad2004.dwg: the Teigha Template fixup in decode.c heap-allocated
	  a Dwg_Section for section_info[i].sections[0]. The generic entries only
	  point into dwg->header.section[], so dwg_free released the pointer array
	  but never the heap-allocated entry. Allocate the fixup entry with
	  add_section() instead, so it lives and dies with header.section. (A
	  range-based ownership check in dwg_free breaks when encode realloc's
	  header.section first, leaving the old entries dangling.)
	* Dynblocks.dwg, blocks_and_tables, sun_and_sky_demo: BLOCKSCALEACTION
	  filled conn_pts[0..2] after AcDbBlockActionWithBasePt_fields had already
	  filled conn_pts[0..1], overwriting the two bit_read_TV allocations.
	  The struct has conn_pts[5]; the scale-action points belong in [2..4]
	  (codes 94-96, 303-305), as BLOCKROTATEACTION already does with [2].
	* r2.6/fit_curve_pline.dwg: JUMP (and any other object setting it outside
	  HANDLE_UNKNOWN_BITS) stores leftover bits in obj->unknown_bits, which no
	  free path released. Free it in the DWG_ENTITY_END/DWG_OBJECT_END macros;
	  the HANDLE_UNKNOWN_BITS free is FREE_IF-based, so the double free is
	  safe.

2026-10-29  Reini Urban  <reini.urban@gmail.com>
	    omp + K2.8 Preview  <kimi@moonshot.cn>

	spec: fix PROXY_ENTITY/PROXY_OBJECT DWG layout per ODA 20.4.90
	The refactored PROXY specs read a proxy_id (BL) first, but ODA 20.4.90
	has no proxy_id field in the DWG stream at all: R2000+ stores the Class
	ID (BL, dxf 91) right after the common data, then the version fields,
	then the Original Data Format bit. dxf 90 is the object's own DWG type
	code. Reading the nonexistent proxy_id ate the class_id and desynced
	the rest of the object: 2018/acad_proxy_entity.dwg decoded proxy_id as
	500 (the class id) with garbage version fields, and the proxy_entity
	unit test failed on its proxy_id != 498 assertion.

	* src/dwg.spec (PROXY_ENTITY, PROXY_OBJECT): derive proxy_id from
	  obj->type in DECODER and emit it as dxf 90; read class_id (BL 91)
	  from the DWG stream for R2000+ (all versions, not only pre-2018).

	Verified: the proxy_entity unit test passes under ASan, dwg2dxf emits
	90: 498 / 91: 500, and the DXF round-trips back to class_id 500.

2026-10-29  Reini Urban  <reini.urban@gmail.com>

	in_dxf: fix use-after-free in add_FIELD without child values
	add_FIELD freed the 93 num_childval pair but kept the pointer. With
	num_childval == 0, the later pair->code != 301 check read the freed pair.

	* src/in_dxf.c (add_FIELD): Clear pair after freeing it, and check it
	  for NULL before the 301 test.

	Fixes GH #1451

	Reported by waroad, https://github.com/waroad

2026-10-29  Reini Urban  <reini.urban@gmail.com>

	api: allow '#' in dwg_is_valid_tag
	AutoCAD writes and reads attribute tags such as "#", which
	dwg_is_valid_tag() rejected, so in_dxf and in_json had to work around it
	(GH #1410). Allow '#' in both the wctype and the ascii branches.

	* src/dwg_api.c (dwg_is_valid_tag): Accept '#'.

2026-10-29  Reini Urban  <reini.urban@gmail.com>

	in_dxf: unbreak valid DXF: keep unusual ATTDEF tags, skip embedded-MTEXT codes
	Two DXF imports stricter than AutoCAD, seen on a 52,000-object ezdxf
	export where dxf2dwg produced 163 errors and no output:

	* dwg_is_valid_tag() rejects tags AutoCAD writes and reads, such as
	  "#" or "Detail_#", and the branch dropped the tag -- the attribute's
	  name. Keep the tag, warn only.
	* A multiline ATTDEF/ATTRIB (r2018) embeds an MTEXT whose fields ride
	  along on the attribute record (42-49, 101, 421, 431, 441). They are
	  not modelled, and the unknown code destroyed the entity and failed
	  the whole file. Skip them with a warning.
	  TODO: honour the 101 "Embedded Object" marker and skip to the next
	  0 record instead.

	The third cause from the report, the HATCH group code 21 guard that
	rejected Y == 0.0, is already gone from add_HATCH.

	* src/in_dxf.c (new_object): Warn and keep unusual ATTDEF/ATTRIB tags;
	  skip the embedded-MTEXT codes for ATTDEF/ATTRIB.

	Fixes GH #1410

	Reported by kentruong174, https://github.com/kentruong174

2026-10-29  Reini Urban  <reini.urban@gmail.com>

	bits: keep the CMC index the file supplied; fix RGB layer color DXF
	bit_read_CMC read the colour index and then discarded it for every
	R2004+ CMC, re-deriving it from the rgb via dwg_find_color_index.
	Several ACI entries share one rgb (255 collides with palette 5,
	0x0000FF), so a stored colour 255 was emitted as 5. This is the same
	defect 9263d72d fixed in bit_downconvert_CMC, arriving through the
	read path. Keep the file's index when it is usable, and only fall back
	to the palette lookup when it is not.

	Also the LAYER DXF writer recovered a 256 index as rgb & 0xFF
	unconditionally. For true RGB colours (method 0xc2) the low byte is
	just the blue channel: a layer with rgb 0xC200A600 was exported as
	group 62 = 0, an illegal ByBlock layer colour. Gate the recovery on
	method 0xc3 (ACI), where the index really is packed in the low byte.

	* src/bits.c (bit_read_CMC): Guard the palette fixup like 9263d72d.
	* src/dwg.spec (LAYER): Only recover the index from the rgb for
	  method 0xc3.

	Fixes GH #1415

	Reported by hallelk, https://github.com/hallelk

2026-10-29  Reini Urban  <reini.urban@gmail.com>

	decode: set subtype name of preR13 DIMENSION
	decode_preR13_DIMENSION sets up a DIMENSION_ANG2LN and then only fixes
	obj->fixedtype, leaving obj->name and obj->dxfname at DIMENSION_ANG2LN.
	dwg_dynapi_entity_value refuses every field of such an object when asked
	for its real subtype name.

	* src/decode.c (decode_preR13_DIMENSION): Set obj->name and obj->dxfname
	  together with obj->fixedtype, as for R13+ dimensions.

	Fixes GH #1466

	Reported by birdnamoo, https://github.com/birdnamoo

2026-10-29  Reini Urban  <reini.urban@gmail.com>

	encode: avoid misaligned RS load in dwg_encode_eed_data
	The R2007+ eed_0_r2007.string member is at offset 5 of the packed
	Dwg_Eed_Data, so reading it through a BITCODE_RS pointer is a misaligned
	access (UBSan), undefined behaviour on strict-alignment targets.

	* src/encode.c (dwg_encode_eed_data): Read the TU string units with
	  memcpy.

	Fixes GH #1452

	Reported by waroad, https://github.com/waroad

2026-10-29  Reini Urban  <reini.urban@gmail.com>

	decode_r2007: don't leave hdl_dat dangling after header read
	read_2007_section_header shallow-copies sec_dat into the caller's
	hdl_dat, then frees sec_dat.chain, leaving hdl_dat->chain dangling and
	passed on to read_2007_section_handles and dwg_decode_add_object. The
	stale pointer is currently not dereferenced, but is a latent
	use-after-free. Detach the alias after the header variables are decoded.

	* src/decode_r2007.c (read_2007_section_header): Reset hdl_dat->chain
	  and size before freeing sec_dat.

	Fixes GH #1470

2026-10-29  Reini Urban  <reini.urban@gmail.com>

	test: index uses INDEX, not LAYER_INDEX
	* test/unit-testing/index.c: Fix copy-paste of the object name.

	test: fix lightlist class_version and num_lights types
	* test/unit-testing/lightlist.c: Use BITCODE_BL, not BS. Fixes an ASAN
	  stack-buffer-overflow in dwg_dynapi_entity_value.

	dwg.spec: PROXY_ENTITY decode objids
	* src/dwg.spec (PROXY_ENTITY): The decoder only counted num_objids but never
	  read the objids handle vector, leaving it NULL.

2026-10-29  Joël Marth  <joel.marth@mytum.de>

	dxfb: don't let block bodies advance the BLOCK_HEADER scan (#1409)
	dxfb_blocks_write() walks dwg->object[] for BLOCK_HEADERs and passed its
	own loop index to dxfb_block_write(). Writing an INSERT with attributes or
	a POLYLINE inside that block advances the index by num_owned + 1, which is
	right for the ENTITIES walk but here skips the BLOCK_HEADERs that follow:
	their bodies are never written to the binary DXF, dwg2dxf -b still exits 0.
	Pass a copy.

	The ASCII writer dxf_blocks_write() has the same loop and was fixed in
	11d9a9bd9, this is the same fix for the binary DXF writer.

	* src/out_dxfb.c (dxfb_blocks_write): Pass a copy of the loop index to
	  dxfb_block_write().

	Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

2026-10-28  Reini Urban  <reini.urban@gmail.com>

	.gitignore: add .opencode

2026-10-28  Saddam  <saddamr3e@gmail.com>

	in_dxf: convert the LTYPE dash text to TU for the r2007+ strings_area
	add_LTYPE_dashes lays out the r2007+ strings_area as UTF-16, but measured
	and copied the text with bit_wcs2len/bit_wcs2cpy on dashes[j].text, which
	dwg_add_u8_input returns as an 8-bit TV for DXF input.  The wide scan ran
	past the end of the string, an ASan heap-buffer-overflow READ in
	bit_wcs2len, e.g. dwgwrite -I DXF on the DXF of the in-tree
	test/test-data/2013/gh44-error.dwg.  Convert the UTF-8 value with
	bit_utf8_to_TU instead, as the EED string import already does.

	* src/in_dxf.c (add_LTYPE_dashes): measure and copy a TU copy of the
	  dash text into the r2007+ strings_area.

2026-10-28  garcialeal  <garcialeal2@gmail.com>

	geom: integration of V4 spatial and SVG 2D transformation pipeline
	V4 refers to the Klein four-group (V4 ≅ Z2 x Z2), not a DWG version or a 4D
	vector/quaternion.

	In this context, V4 provides the 4x4 integer butterfly matrix (H_V4) over the coprime
	residue lattice S12 = {1, 5, 7, 11} (mod 12). This enables a zero-multiplication pipeline
	(using integer additions, subtractions, and bit-shifts) for fast 2D/3D spline
	quantization and spatial transformation.

	Closes GH #1405, see also GH #1400

2026-10-28  Reini Urban  <reini.urban@gmail.com>

	test: add 2018 DXFs for the objects without coverage, convert via ODA
	We created minimal r2018 DXFs with unique field values for each object
	type that has no DWG coverage, and convert them to a DWG with the
	ODAFileConverter (or TeighaFileConverter). The DXFs are in git, the DWGs
	are generated.

	ODA limitation: ODAFileConverter 27.1 and 27.9 only write a real object
	for 12 of the types: FCFOBJECTCONTEXTDATA, GRADIENT_BACKGROUND,
	IMAGE_BACKGROUND, INDEX, LAYER_FILTER, LAYER_INDEX, LIGHTLIST,
	LONG_TRANSACTION, OLEFRAME, RENDERSETTINGS, VBA_PROJECT, DWFDEFINITION.
	For all others it keeps the DXF object as an ACAD_PROXY_OBJECT /
	ACAD_PROXY_ENTITY (from_dxf=1), regardless of the output version, although
	the DbConstraints, ISM, SCENEOE and DynBlocks modules are installed:
	the ASSOC*ACTIONBODY, ASSOC*PARAM, ASSOCARRAY*PARAMETERS,
	BLOCK*CONSTRAINTPARAMETER, BLOCKUSERPARAMETER, POINTCLOUD*, IBL_BACKGROUND
	(RAPIDRTRENDERENVIRONMENT) and the underlays. Its own DXF roundtrip still
	prints the original object name, so only a decoder shows the proxy. These
	DXFs therefore give no coverage with ODA, they are kept as input for a real
	AutoCAD, or an ODA with those classes. CAMERA and DUMMY cannot be created
	by ODA at all.

	* test/test-data/2018/*.dxf: The new objects, lowercase typename.
	* test/Makefile.am (EXTRA_DIST): Add them.
	* test/unit-testing/tests_common.c (test_2018_dxf): If
	  test-data/2018/<typename>.dwg does not exist, but the .dxf, convert it
	  with ODAFileConverter or TeighaFileConverter (under xvfb-run without a
	  DISPLAY) into test-data/2018/ and test that. Skipped if there is no
	  converter.

2026-10-28  Reini Urban  <reini.urban@gmail.com>

	spec: rename LAYERFILTER to LAYER_FILTER
	ODA, and AutoCAD, write the class and the DXF object as LAYER_FILTER (cpp
	AcDbLayerFilter), the entry of the ACAD_LAYERFILTERS dictionary. We used
	LAYERFILTER, so a real LAYER_FILTER object was decoded as UNKNOWN_OBJ.

	The DXF name of IBL_BACKGROUND (AcDbIBLBackground) is
	RAPIDRTRENDERENVIRONMENT, as written by ODA. Drop the separate unhandled
	RAPIDRTRENDERENVIRONMENT class, it is the same object.

	* src/dwg2.spec (LAYER_FILTER): Rename.
	* src/classes.inc: Rename LAYERFILTER. Add the dxfname
	  RAPIDRTRENDERENVIRONMENT to IBL_BACKGROUND, remove the unhandled
	  RAPIDRTRENDERENVIRONMENT.
	* src/classes.c, src/objects.in, src/objects.c, src/objects.inc: Rename the
	  type, class and dxfname.
	* src/in_dxf.c: Use DWG_TYPE_LAYER_FILTER and Dwg_Object_LAYER_FILTER.
	* include/dwg.h, include/dwg_api.h, src/dwg_api.c, src/dynapi.c,
	  bindings/dwg.i, doc/dynapi.texi: Regenerate.
	* test/unit-testing/layerfilter.c: Rename to layer_filter.c.
	* test/unit-testing/Makefile.am, add_test.c, dynapi_test.c,
	  tests_common.c: Adjust.

2026-10-28  Reini Urban  <reini.urban@gmail.com>
	    omp + Claude Sonnet 5.5  <noreply@anthropic.com>

	spec: TABLE, TABLECONTENT: decode r2010+ tables, name cell geometry flags
	* src/dwg2.spec (TABLECONTENTs_fields): Read the column custom data
	  items, cellstyle_id and width, the cell and fdata cell styles, and
	  all cell geometry entries. Row height is a BD.
	  (TABLE): Decode the r2010+ table after the block reference part,
	  since R2013 and later share the layout. Read num_owned only with
	  has_attribs.
	* src/dwg_spec_shared.h (TABLE_value_fields): r2007+ kString and
	  kGeneral values are an inline UTF-16 byte blob with a size.
	* include/dwg.h (Dwg_CellContentGeometry): Name unknown as flags.
	  (Dwg_TableCell): Add cellstyle.
	  (Dwg_TableDataColumn): Add custom data items, width is a BD.
	* src/common.c (strrplc): Enlarge the result buffer.
	* src/in_dxf.c, test/unit-testing/tablegeometry.c: Follow the rename.

2026-10-28  Reini Urban  <reini.urban@gmail.com>
	    omp + Claude Sonnet 5.5  <noreply@anthropic.com>

	spec: DIMASSOC main subent needs xrefs, document ASSOCEDGEACTIONPARAM types
	DIMASSOC: AutoCAD writes an _End last-point reference without any xrefs.
	Such a reference has a nonzero osnap_type but no main subent block, only
	the osnap distance, point and continuation bit follow. Read the main subent
	type, gsmarker and xref paths only if num_xrefs is not 0.

	The DIMASSOC samples (example_*.dwg, 2013/gh44-error.dwg) have no such
	reference, their decoding is unchanged.

	ASSOCEDGEACTIONPARAM: document the action_type values 11, 17, 19, 23, 27 and
	42 of the switch. The curve payload is still not decoded.

	* src/dwg2.spec (DIMASSOC, ASSOCEDGEACTIONPARAM): Likewise.

2026-10-28  Reini Urban  <reini.urban@gmail.com>
	    omp + Claude Sonnet 5.5  <noreply@anthropic.com>

	spec: child parameter block only for the assoc pointref action params
	The child parameter block (BS status, BL id, H parameter and, if the id is
	not 0, H, BL marker, H) of AcDbAssocCompoundActionParam exists only for the
	AcDbAssocPointRefActionParam and AcDbAssocOsnapPointRefActionParam
	subclasses. It was guarded by a never set has_child_param field, so it was
	never read, which shifted the fields of ASSOCOSNAPPOINTREFACTIONPARAM
	(osnap_mode and param decoded as garbage). Pass the flag per class, as a
	macro argument, to AcDbAssocCompoundActionParam_fields. Remove the unused
	has_child_param field and the unused AcDbAssocPathActionParam_fields macro.

	Verified with example_{2000,2004,2007,2010,2013,2018}.dwg
	(ASSOCOSNAPPOINTREFACTIONPARAM): osnap_mode 1 and param -1.0, the object
	consumes exactly its bits. ASSOCPATHACTIONPARAM (2004/Surface.dwg) is
	unchanged. No sample has ASSOCCOMPOUNDACTIONPARAM or
	ASSOCPOINTREFACTIONPARAM.

	* src/dwg2.spec (AcDbAssocCompoundActionParam_fields): Add the has_child
	  argument. Pass 0 for ASSOCCOMPOUNDACTIONPARAM and ASSOCPATHACTIONPARAM, 1
	  for ASSOCOSNAPPOINTREFACTIONPARAM and ASSOCPOINTREFACTIONPARAM.
	  (AcDbAssocPathActionParam_fields): Remove.
	* include/dwg.h (ASSOCCOMPOUNDACTIONPARAM_fields): Remove has_child_param.
	* test/unit-testing/assoccompoundactionparam.c,
	  assocosnappointrefactionparam.c, assocpathactionparam.c,
	  assocpointrefactionparam.c: Adjust.

2026-10-28  Reini Urban  <reini.urban@gmail.com>
	    omp + Claude Sonnet 5.5  <noreply@anthropic.com>

	spec: decode the r2010 AcDbAssocAnnotationActionBody layout
	Until r2010 (AC1024 included) the annotation action bodies start with the
	AcDbAssocActionBody and AcDbAssocParamBasedActionBody blocks. The spec
	guarded them with "if (actionbody)", a handle which is never set while
	decoding, so they were skipped and the following fields were read from the
	wrong bits. Only since r2013 a BS version and a dependency handle replace
	them.

	The r2010 sample proves that r2010 still uses the old layout: the BL
	class_version 1 read at the start of the object was the aab_version, and
	the 8 old fields end exactly at the class_version 0 and the two handles.

	Verified with example_{2000,2004,2007,2010}.dwg and example_r14.dwg
	(ASSOCALIGNEDDIMACTIONBODY): the object now consumes exactly its bits.
	example_2013.dwg (the r2013 layout) is unchanged and still leaves 2 bits.

	Also rename the dimension nodes r_node and d_node of the ALIGNED, ORDINATE,
	ROTATED and 3POINTANGULAR dim action bodies to read_node and dimension_node.

	* src/dwg2.spec (AcDbAssocAnnotationActionBody_fields): Remove the actionbody
	  guard.
	  (ASSOCALIGNEDDIMACTIONBODY, ASSOC3POINTANGULARDIMACTIONBODY)
	  (ASSOCORDINATEDIMACTIONBODY, ASSOCROTATEDDIMACTIONBODY): Rename r_node,
	  d_node.
	* include/dwg.h: Likewise.
	* test/unit-testing/assoc*dimactionbody.c: Adjust.
	* examples/log_unknown_dxf.pl: Likewise.

2026-10-28  Reini Urban  <reini.urban@gmail.com>
	    omp + Claude Sonnet 5.5  <noreply@anthropic.com>

	spec: ASSOC2DCONSTRAINTGROUP num_nodes is next_node_id
	The BL after the actions list is an id seed, not an array length. Deleted
	nodes leave it larger than the number of nodes. Reading it as a REPEAT count
	failed on every sample ("Invalid nodes[rcount1].connections size").

	Since r2013 the node list is a registry: root id, root connections, root
	status, a table of class names, and a list of {flag, class index, node id}
	entries, followed by the node bodies in registry order. Decode the registry
	header. The node bodies are not decoded yet, they stay in the unknown bits.
	Before r2013 (inline nodes with a class name each) is not decoded either.

	Verified with 2013/Constraints.dwg: next_node_id 9, 6 class names
	(AcConstrainedCircle, AcCenterPointConstraint, ...) and 9 registry entries
	with the node ids 1-9. {2004,2007,2010}/Constraints.dwg no longer error in
	this object.

	* include/dwg.h (Dwg_CONSTRAINTGROUP_ClassType)
	  (Dwg_CONSTRAINTGROUP_Registered): New.
	  (Dwg_Object_ASSOC2DCONSTRAINTGROUP): Replace num_nodes and nodes with
	  next_node_id, root_id, num_root_connections, root_connections, root_status,
	  num_class_types, class_types, num_registered and registered.
	* src/dwg2.spec (ASSOC2DCONSTRAINTGROUP): Likewise.
	* test/unit-testing/assoc2dconstraintgroup.c: Adjust.

2026-10-28  Reini Urban  <reini.urban@gmail.com>
	    omp + Claude Sonnet 5.5  <noreply@anthropic.com>

	spec: fix ASSOCGEOMDEPENDENCY, ASSOCVALUEDEPENDENCY and ASSOCVARIABLE
	ASSOCGEOMDEPENDENCY: since r2013 the persistent subent id has no classname
	text. It is a leading flag, a class code BL (1 AcDbAssocSingleEdgePersSubentId
	with no values, 3 AcDbAssocEdgePersSubentId with 3 BL values, 5
	AcDbAssocAsmBasedEntityPersSubentId) and then the compound flag. The old
	layout lost 12 bits per object. DXF keeps writing the classname, derived
	from the class code if needed.

	ASSOCVALUEDEPENDENCY: add the AcDbAssocValueDependency tail, BL
	class_version, T name and the EvalVariant value.

	ASSOCVARIABLE: the BL after the value is not the length of a text, the
	cached value text is only present with has_cached_value. A trailing list of
	{H dependency, BL flags} follows the last flag.  Rename t58 to expression,
	has_t78 to has_cached_value, t78 to cached_value and b290 to flag.

	Verified with 2018/Dynblocks.dwg (22 ASSOCVARIABLE, 18 ASSOCVALUEDEPENDENCY,
	28 ASSOCGEOMDEPENDENCY) and {2004,2007,2010,2013}/Constraints.dwg: each
	object now consumes exactly its bits, the decode errors of these classes are
	gone.

	* include/dwg.h (ASSOCPERSSUBENTID_fields): Add has_classname, class_code,
	  num_values and values.
	  (Dwg_Object_ASSOCVALUEDEPENDENCY): Add class_version, name and value.
	  (Dwg_ASSOCVARIABLE_Dep): New.
	  (Dwg_Object_ASSOCVARIABLE): Rename t58, has_t78, t78, b290. Add num_var_deps
	  and var_deps.
	* src/dwg2.spec (AcDbAssocPersSubentId_fields): Add the r2013+ layout.
	  (ASSOCVALUEDEPENDENCY, ASSOCVARIABLE): Add and fix the fields.
	* test/unit-testing/assocgeomdependency.c, assocvaluedependency.c,
	  assocvariable.c: Adjust.

2026-10-28  Reini Urban  <reini.urban@gmail.com>
	    omp + Claude Sonnet 5.5  <noreply@anthropic.com>

	spec: DATATABLE, DATALINK, RTEXT, TVDEVICEPROPERTIES: fix fields
	The DATATABLE column type selects the cell payload: 1 integer (BL, 93),
	2 double (BD, 40), 3 text (T, 3), 4 point (3BD, 10), 5 object id
	(handle, 331). gh209_1.dwg (text and integer columns) now decodes
	without the former out-of-sync bit read error.

	The DATALINK fields 92 and 93 are flags and status_flags.

	RTEXT writes its text height as DXF 40 and uses the RText subclass
	marker. The last TVDEVICEPROPERTIES double is reserved.

	* src/dwg2.spec (DATATABLE): Switch on the column type.
	  (DATALINK): Rename bl92 to flags and bl93 to status_flags.
	  (RTEXT): Use DXF 40 for height and the RText subclass.
	  (TVDEVICEPROPERTIES): Rename bd2 to reserved_double.
	* include/dwg.h (Dwg_Object_DATALINK, Dwg_Object_TVDEVICEPROPERTIES):
	  Likewise.
	* test/unit-testing/datalink.c, tvdeviceproperties.c: Adjust.

2026-10-28  Reini Urban  <reini.urban@gmail.com>
	    omp + Claude Sonnet 5.5  <noreply@anthropic.com>

	spec: MATERIAL, POINTCLOUD: DXF specs and documentation
	The advanced material properties (DXF 460-465, 270-273, 290, 293) are
	not stored in the DWG MATERIAL object but in an ADVMATERIAL XRECORD of
	its extension dictionary, so the disabled "missing fields" block is
	replaced by a note.

	POINTCLOUD writes show_intensity as DXF 290. POINTCLOUDEX uses the
	AcDbPointCloudEx subclass and DXF 340 for the definition handle. No
	sample contains a POINTCLOUD*, so the DWG layouts are not changed.

	* src/dwg2.spec (MATERIAL): Replace the #if 0 block with a comment.
	  (POINTCLOUD): Add DXF 290 to show_intensity.
	  (POINTCLOUDEX): Use the AcDbPointCloudEx subclass and DXF 340 for
	  pointclouddefex.

2026-10-28  Reini Urban  <reini.urban@gmail.com>
	    omp + Claude Sonnet 5  <noreply@anthropic.com>

	spec: RENDERENTRY times, RENDERSETTINGS versioning
	RENDERENTRY stores a start hour and the complete end date and time
	after the start time. The decoded sample ATMOS-DC22S.dwg now yields
	matching start/end times and a render_time equal to their difference.

	RAPIDRTRENDERSETTINGS always stores has_predefined after its own
	fields, MENTALRAYRENDERSETTINGS never stores it, and RENDERSETTINGS
	stores it since r2013 (also r2018), not only in the exact r2013
	version. gh109_1.dwg RAPIDRT objects now decode to sane values.

	* src/dwg2.spec (AcDbRenderSettings_fields): Check class_version
	  adjustment with SINCE (R_2013) and remove has_predefined from the
	  shared fields.
	  (RENDERSETTINGS): Read has_predefined SINCE (R_2013).
	  (RAPIDRTRENDERSETTINGS): Read has_predefined unconditionally last.
	  (MENTALRAYRENDERSETTINGS): Rename sampling1/2 to sampling_min/max.
	  (RENDERENTRY): Add start_hour and end_year ... end_msec.
	* include/dwg.h (Dwg_Object_RENDERENTRY): Likewise.
	  (Dwg_Object_MENTALRAYRENDERSETTINGS): Rename sampling1/2.
	  (RENDERSETTINGS_fields): Document has_predefined.
	* src/in_dxf.c (add_RENDERENTRY): Add the new fields.
	  (add_RENDERSETTINGS): Use SINCE (R_2013).
	* test/unit-testing/renderentry.c, mentalrayrendersettings.c: Adjust.
	* src/dynapi.c, test/unit-testing/dynapi_test.c, doc/dynapi.texi,
	  include/dwg_api.h, src/dwg_api.c, bindings/dwg.i: Regenerate

2026-10-28  Reini Urban  <reini.urban@gmail.com>
	    omp + Claude Sonnet 5.5  <noreply@anthropic.com>

	spec: dynblocks, name EVALUATION_GRAPH edges, fix block action doubles
	* include/dwg.h (Dwg_EVAL_Edge): Rename e1, e2, e3 to incoming_edge,
	  source_node and destination_node.
	  (BLOCKACTION_doubles_fields): Rename action_offset_x to
	  distance_multiplier (DXF 140), action_offset_y to angle_offset (DXF
	  141) and replace the third BD angle_offset by the RC action_xy_type
	  (DXF 280).
	* src/dwg2.spec (EVALUATION_GRAPH): Use the new edge names and do not
	  stop the node loop when edge_flags != 32.
	  (AcDbBlockAction_doubles_fields): Decode BD, BD, RC. The old third BD
	  read garbage and desynced the handle stream of BLOCKMOVEACTION and
	  BLOCKSTRETCHACTION; the DXF 280 value is now the decoded RC instead of
	  a constant 1.
	* src/in_dxf.c (add_AcDbBlockMoveAction, add_AcDbBlockStretchAction):
	  Read 140, 141 and 280 into the renamed fields.
	  (EVALUATION_GRAPH edges): Use the new field names.
	* src/dwg_api.c (dwg_add_EVALUATION_GRAPH): Likewise.
	* test/unit-testing/evaluation_graph.c, blockmoveaction.c,
	  blockstretchaction.c: Check the renamed fields.
	* examples/alldxf_BLOCKSTRETCHACTION.inc: Rename the logged fields.

2026-10-28  Reini Urban  <reini.urban@gmail.com>

	regen: promoted all *OBJECTCONTEXTDATA classes to STABLE
	634f0c6b1f5b5c4a03d4fccc91593db04d3e063c did that without regen.

	ALDIMOBJECTCONTEXTDATA, MTEXTOBJECTCONTEXTDATA,
	BLKREFOBJECTCONTEXTDATA, LEADEROBJECTCONTEXTDATA,
	TEXTOBJECTCONTEXTDATA

2026-10-28  Reini Urban  <reini.urban@gmail.com>

	dec_macros: do the _VECTOR_CHKCOUNT products in 64 bit
	_VECTOR_CHKCOUNT and _VECTOR_CHKCOUNT_STATIC multiplied the count by the
	element size, and 8 * siz, in 32 bit before the cast to int64_t, so counts
	that wrap 32 bit passed the check. Cast the count first, as
	VECTOR_CHKCOUNT already does.

	* src/dec_macros.h (_VECTOR_CHKCOUNT, _VECTOR_CHKCOUNT_STATIC): Cast size
	  to int64_t before the multiply.

	Fixes the _VECTOR_CHKCOUNT part of GHSA-fv59-9w8h-6p5x. The section address
	truncation of it is fixed by 92c06b6cb.

2026-10-28  Reini Urban  <reini.urban@gmail.com>

	decode: do the R2004 section page bounds checks in 64 bit
	read_2004_compressed_section added the page address, a copy size and
	max_decomp_size as uint32_t, so crafted values wrapped the sums and passed
	the checks. With address == the allocation size and a wrapped size of
	about 4GB the memcpy then started at the end of dec.chain and ran 4GB far.
	info->size - address wrapped the same way when address > info->size.

	* src/decode.c (read_2004_compressed_section): Add address and size or
	  max_decomp_size in uint64_t. The copy size is page_size when the page
	  address is beyond info->size, instead of a wrapped difference.

	Fixes GHSA-rhh7-9m95-rh87.

2026-10-28  Reini Urban  <reini.urban@gmail.com>

	decode: keep the R2004 section address 64bit
	read_2004_compressed_section stored the section map address (a 64bit
	Dwg_Section.address) in a uint32_t, truncating it, and then checked it
	against the input size. Keep it as uint64_t, and compare without any
	addition that could wrap: address > size || size - address < 32.

	* src/decode.c (read_2004_compressed_section): Use uint64_t for address,
	  mask with the low 32 bits only for the section header decryption, print
	  it with PRIu64.

	Follow-up to GHSA-6xx6-g44h-929j.

2026-10-28  Reini Urban  <reini.urban@gmail.com>

	configure: keep logs_all for config.status re-runs
	AC_CONFIG_FILES([logs-all.sh:$logs_all]) expands logs_all when
	config.status runs, where it is unset unless configure just ran. Any
	later "make check" that re-ran config.status then generated an empty
	logs-all.sh, which failed the shellcheck test with SC2148.

	* configure.ac: Pass logs_all via INIT-CMDS.

	configure: Regenerate.

2026-10-28  Reini Urban  <reini.urban@gmail.com>

	in_json: clang-format
	* src/in_json.c (json_eed): Apply clang-format.

	in_dxf: clang-format
	* src/in_dxf.c (CHECK_DICTIONARY_HDR): Protect the macro from
	clang-format, which mangles its comment.
	* src/in_dxf.c: Apply clang-format to previously unformatted lines.

2026-10-27  Reini Urban  <reini.urban@gmail.com>

	decode: do R2004 section copy bounds sums in 64 bits
	es.fields.address + size summed in uint32_t, so address 0x2effd400 and
	page_size 0xd100a000 wrapped to a small value, passed the checks and
	memcpy'd past the decompression buffer. The section address was also
	truncated from 64 to 32 bits. _VECTOR_CHKCOUNT multiplied size by the
	element size in 32 bits.

	* src/decode.c (read_2004_compressed_section): Reject addresses that
	do not fit 32 bits. Sum address and sizes in uint64_t/size_t.
	* src/dec_macros.h (_VECTOR_CHKCOUNT, _VECTOR_CHKCOUNT_STATIC): Multiply
	in int64_t.

	Fixes GHSA-rhh7-9m95-rh87 and GHSA-fv59-9w8h-6p5x.

2026-10-27  Reini Urban  <reini.urban@gmail.com>

	in_json: reset proxy types 498/499 to the fixedtype
	The type key handler only corrected a parsed type <= DWG_TYPE_LAYOUT.
	An MTEXT with type 498 or 499 kept it, so dwg_free_object freed the
	MTEXT buffer with the PROXY_ENTITY/PROXY_OBJECT free body, using
	doubles as pointers.

	* src/in_json.c (json_OBJECTS): Also normalize types 498 and 499 when
	they do not match the fixedtype.

	Fixes GHSA-v9c2-69pf-gwr5.

2026-10-27  Reini Urban  <reini.urban@gmail.com>

	in_dxf: migrate INSERT to a fresh MINSERT on upgrade
	UPGRADE_ENTITY only reallocates when the target is larger, but MINSERT
	is smaller than INSERT, so the INSERT buffer was reinterpreted with the
	MINSERT layout. Doubles written to INSERT fields were then freed as
	handle pointers by dwg_free_MINSERT.

	* src/in_dxf.c (new_object): Allocate a Dwg_Entity_MINSERT, move the
	fields over and free the old INSERT.

	Fixes GHSA-hh9f-2fpf-p5w6.

2026-10-27  Reini Urban  <reini.urban@gmail.com>

	free: don't double-free TABLESTYLE ovr border colors
	downconvert_TABLESTYLE shallow-copies ovr.cellstyle.borders[].color into
	rowstyles[0] and [2]; free_TABLESTYLE_r2010 then freed them twice.

	* src/free.c (free_TABLESTYLE_r2010): Drop the aliased color strings
	from rowstyles before freeing, leaving ovr as the single owner.

	Fixes GHSA-j899-7qhm-8244.

2026-10-27  Reini Urban  <reini.urban@gmail.com>

	dwg_ref_object: validate cached ref->obj against the object array
	After dwg->object is realloced, refs not listed in object_ref[] keep a
	stale ref->obj, which dwg_ref_object then dereferenced.

	* src/dwg.c (ref_obj_valid): New. Check the pointer lies in the current
	object array without dereferencing it.
	(dwg_ref_object, dwg_ref_object_relative, dwg_ref_object_silent): Use it.

	Defensive fix for GHSA-8gv8-3gxc-4vhv.

2026-10-27  Reini Urban  <reini.urban@gmail.com>

	dwg_get_entities: size the output by counting entities
	dwg->num_entities is only maintained by the binary decoders, so after
	DXF, DXF-B or JSON import or API construction it stays 0 while entities
	exist, and dwg_get_entities wrote past a zero-size allocation.

	* src/dwg.c (dwg_get_entities): Count supertype ENTITY objects for the
	allocation size. Return NULL on allocation failure.

	Fixes GHSA-r4jf-pvp2-c2mj.

2026-10-27  Reini Urban  <reini.urban@gmail.com>

	decode: do the R2004 section header bounds check in size_t
	read_2004_compressed_section compared address + 32 > dat->size with
	address a uint32_t, so a section address of 0xFFFFFFE0 wrapped the sum to
	0 and passed the check. The memcpy of the 32 byte section header then read
	far outside the input.

	* src/decode.c (read_2004_compressed_section): Add in size_t.

	Fixes GHSA-6xx6-g44h-929j.

2026-10-27  Reini Urban  <reini.urban@gmail.com>

	in_json: don't treat a pointer field as an inline struct
	_set_struct_field recursed into a JSON object value for any Dwg_ typed
	field with &_obj[f->offset] as the base of an embedded struct. For a
	pointer field that address is the pointer slot in the parent, so the
	sub-fields were written past the parent allocation, e.g.
	{"object":"ASSOC2DCONSTRAINTGROUP","nodes":{"nodeid":1}} wrote 4 bytes
	after the 208 byte object.

	Reject a JSON object for a pointer typed field, and for a pointer typed
	subclass field reached by a dotted key, and skip the value.

	* src/in_json.c (_set_struct_field): Check for a trailing '*' in f->type
	  before recursing into an embedded struct.

	Fixes GHSA-28p5-qcx5-2jqm.

2026-10-27  Reini Urban  <reini.urban@gmail.com>

	in_dxf: don't return a freed pair on a failed xcalloc
	add_AcDbBlockVisibilityParameter and add_BlockParam_PropInfo freed the
	pair that carried a count, and when the xcalloc for that count failed
	(count * element size too large) returned the freed pair. new_object then
	read its code and next_pair freed it a second time.

	Return the next pair read from the input instead, as every other
	non-NULL return of these functions hands out a live pair.

	* src/in_dxf.c (add_AcDbBlockVisibilityParameter, add_BlockParam_PropInfo):
	  Return dxf_read_pair on a failed allocation of states[].blocks,
	  states[].params and prop->connections.

	Fixes GHSA-73h2-mv37-jrq8.

2026-10-27  Reini Urban  <reini.urban@gmail.com>

	dwg.spec: cap SPLINE num_knots when decoding
	num_knots was a raw BL, so FIELD_VECTOR (knots, BD, ...) could allocate
	32 times the remaining input (2 bit BDs, 8 byte elements) for a crafted
	count. Reject more than 10000 knots, the limit the HATCH SPLINE edge
	already uses.

	* src/dwg.spec (SPLINE): Check num_knots in the decoder.

	Follow-up to GHSA-3v4w-cmp5-3x66.

2026-10-27  Reini Urban  <reini.urban@gmail.com>

	in_dxf: check the realloc of MULTILEADER line breaks
	A failed realloc of lline->breaks in add_MULTILEADER_lines was stored
	unchecked, losing the old block and then dereferenced by the memset and
	the breaks[k] stores. Realloc to a temporary, and on failure keep the old
	array and num_breaks, free the pair and return NULL.

	* src/in_dxf.c (add_MULTILEADER_lines): Check the realloc for group 11.

	Follow-up to GHSA-4958-4543-8grm.

2026-10-27  Saddam  <saddamr3e@gmail.com>

	in_dxf: NUL-terminate buf on an overlong line in dxf_read_string
	An ASCII DXF value line of 4096 or more bytes fills the static buf[4096]
	and dxf_read_string returns without a terminator.  Callers passing
	string == NULL then read buf as a C string: dxf_read_pair sscanf's it
	for every handle group code, and the DIMSTYLE DIMBLK handler passes it
	to dwg_find_tablehandle_silent and array_push.  A 4096-char handle value
	gives an ASan global-buffer-overflow READ past buf in dxf_read_pair.

	* src/in_dxf.c (dxf_read_string): terminate buf on the early return.

2026-10-27  Saddam  <saddamr3e@gmail.com>

	out_dxf: fix double-free on a zero SAB string len in dwg_convert_SAB_to_SAT1
	Every SAB ident record (tag 13) aliases encr_sat_data[0] to the growing
	dest.chain.  A following tag 7/13/14 record with a zero length byte took
	a bare return 0, unlike the sibling invalid-length paths which free dest
	and clear encr_sat_data[0].  When dest.chain had been realloc'd since the
	alias was taken, encr_sat_data[0] was left dangling and freed again by
	free_3dsolid, or read and freed by dxf_3dsolid when num_blocks > 0.
	Reachable from dwgread -O DXF / dwg2dxf on a crafted r2007+ 3DSOLID.

	* src/out_dxf.c (dwg_convert_SAB_to_SAT1): treat a zero len as an
	  invalid SAB in the existing error path.

2026-10-27  venkatchalla06  <111296179+venkatchalla06@users.noreply.github.com>

	out_dxf, out_dxfb: propagate opts so imported DXF T strings stay TV
	IS_FROM_TU (dat) picks wide (TU) vs single-byte (TV) for a T string from
	dat->from_version and !(dat->opts & DWG_OPTS_IN).  dwg_write_dxf and
	dwg_write_dxfb set dat->from_version but not dat->opts, so for an r2007+
	DXF or JSON import -- whose T strings are stored as single-byte TV --
	IS_FROM_TU (dat) became true and bit_convert_TU scanned the TV buffer as
	UTF-16 past its end, a heap-buffer-overflow read (e.g. the summaryinfo
	strings in dxf_header_write).  dwg_encode already copies opts (encode.c);
	do the same, masked to the input-format bits, in the DXF writers.

	Reproduced with -fsanitize=address on the in-tree sample:
	dxfwrite test/test-data/example_2007.dxf out.dxf.

	* src/out_dxf.c (dwg_write_dxf): set dat->opts |= dwg->opts & DWG_OPTS_IN.
	* src/out_dxfb.c (dwg_write_dxfb): likewise.

2026-10-27  Saddam  <saddamr3e@gmail.com>

	bit_write_TU32: convert a TV source to UCS-2 for r2007+ targets
	bit_write_TU32 chose the UCS-2 branch by the target version alone and
	then measured the string with bit_wcs2len. The string is only UCS-2
	when it came from an r2007+ DWG (IS_FROM_TU); from JSON, DXF or a
	pre-r2007 DWG it is still an 8-bit TV, so bit_wcs2len read 16-bit
	units past the end of the heap string: ASan heap-buffer-overflow in
	bit_wcs2len via dwg_encode (filedeplist.spec:22) when writing any JSON
	with a non-empty FileDepList.features as r2007+.

	The same branch also indexed the string byte-wise, so even an r2018 to
	r2018 rewrite wrote the UCS-2 features as single bytes and "Acad:Text"
	read back as "A".

	Convert a non-UCS-2 source with bit_utf8_to_TU first, as bit_write_T16
	already does, and write the 16-bit units through a BITCODE_TU pointer.

	* src/bits.c (bit_write_TU32): Convert a TV source for r2007+ targets,
	  index the UCS-2 units.

2026-10-27  Saddam  <saddamr3e@gmail.com>

	encode: skip LTYPE strings_area convert for DXF input
	dwg_convert_LTYPE_strings_area translates an LTYPE strings_area between
	the r2000 256-byte and r2007+ 512-byte layouts and assumes the buffer is
	in from_version layout, so the downconvert reads old[i*2] up to index
	510. DXF input instead rebuilds strings_area directly in the target
	header.version layout (256 bytes for a <=r2000 target), so converting an
	r2007+ DXF to a <=r2000 DWG reads 512 bytes from a 256-byte buffer.
	Return early for DXF-sourced data, which is already in the target layout.

	* src/encode.c (dwg_convert_LTYPE_strings_area): bail out when
	  dwg->opts has DWG_OPTS_INDXF.

2026-10-22  venkatchalla06  <venkatchalla06@users.noreply.github.com>

	encode: fix invalid free of uninitialized eed raw in downconvert_MLEADERSTYLE
	In the realloc branch (object already carries >=1 EED entry, idx!=0) the
	new ACAD_MLEADERVER entry set .handle/.size/.data but left eed[idx].raw
	uninitialized (realloc garbage), so dwg_free_eed later freed a bogus
	pointer -> heap corruption when down-converting an untrusted R2010+ DWG
	with an MLEADERSTYLE to a pre-R2010 version. Initialize raw = NULL,
	mirroring downconvert_DIMSTYLE (fixed in 31b9e40a).

	* src/encode.c (downconvert_MLEADERSTYLE): set eed[idx].raw = NULL.

2026-10-22  Damien  <114640315+Umbo-Damien@users.noreply.github.com>

	dxf: write LAYOUT 331 from viewports[0] when active_viewport is NULL
	The handle of the overall paperspace viewport (DXF group 331 of the
	LAYOUT object, the VIEWPORT with id 1) is the only reliable way for a
	DXF reader to tell the sheet's own view from the viewports onto the
	model. AutoCAD and the ODA converter always write it, taking the first
	entry of LAYOUT.viewports when active_viewport is NULL. We only wrote
	active_viewport, so for layouts saved with a NULL active_viewport (11
	of 41 layouts in a set of 36 AutoCAD 2013/2018 drawings) the DXF had
	no 331, and readers mistook the sheet view, at scale 1:1, for a
	viewport onto the model. The value itself was decoded correctly: the
	JSON output shows it as the first element of viewports.

	* src/dwg.spec (LAYOUT): In the DXF writer, when active_viewport is
	  NULL or has a zero handle and viewports is non-empty, emit
	  viewports[0] as group 331.

	Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

2026-10-22  shota  <monyuonyu@gmail.com>

	bit_utf8_to_TV: the lead byte of Asian double-byte characters
	The lead byte of a two-byte character of an Asian codepage was written as
	wc1 >> 4 instead of wc1 >> 8: 0xB8F4 (GBK for U+9694) became 8F F4, and
	every Chinese, Japanese or Korean string converted from UTF-8 to such a
	codepage (dwg_add_u8_input, JSON import) was garbled.  In the 3-byte
	UTF-8 branch the single-byte characters of the codepage (CP932 half-width
	katakana) also got a 0x00 lead byte, which cut the string.

	bits_test expected the result of the >> 4 bug for 시험 in CP949
	(DC C3 7E E8); CP949 is BD C3 C7 E8, as Python and Windows convert it.
	Add ANSI_932 (windows-31j) tests with a two-byte and a single-byte
	character.

	* src/bits.c (bit_utf8_to_TV): >> 8, single bytes without a lead byte.
	* test/unit-testing/bits_test.c (bit_utf8_to_TV_tests): CP949, ANSI_932.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-10-22  Artem Arbatski  <busch.artem@gmail.com>

	decode: accept compressed sections larger than num_sections * max_decomp_size
	read_2004_compressed_section() rejected sections whose total size is
	larger than num_sections * max_decomp_size. Large AcDsPrototype_1b
	(ACIS datastorage) sections in r2013+ files can have this layout, so
	the whole section was dropped and all 3DSOLID/REGION/BODY ACIS data was
	lost ('AcDsPrototype_1b section not found').

	Example: AC1032 drawing, 865 pages, max_decomp_size 0x7400,
	info->size 31536256 > 865 * 29696. With the real size allocated, the
	section decodes and contains 2292 valid SAB blobs.

	Sizes < 0 or > 790Mb are still rejected, and the per-page bounds checks
	are unchanged.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-10-22  Saddam  <saddamr3e@gmail.com>

	encode: bound ovr.cellstyle.borders copy in downconvert_TABLESTYLE
	The header rowstyle loop copied six borders from ovr.cellstyle without checking ovr.cellstyle.num_borders, unlike the two sibling rowstyle loops, overreading the decoder-allocated borders array when a TABLESTYLE has fewer than six and is downconverted to <= r2007.

	out_dxf: bound the SAB header string reads in dwg_convert_SAB_to_SAT1

2026-10-22  Saddam  <saddamr3e@gmail.com>

	acds: bound the ACIS BinaryFile scan index to dat->size
	The AcDs datastorage decoder scans the decompressed section buffer for
	the "ACIS BinaryFile" marker.  When a marker has no following
	End-of-ASM marker and sits in the last 20 bytes of the buffer, the
	next-offset advance (j + 20) runs past dat->size.  The loop condition
	then evaluates "dat->size - i", a size_t that underflows to a huge
	value, and memmem reads far past the decompressed buffer.

	* src/acds.spec: Stop the scan once i reaches dat->size.

2026-10-22  Marco Sumari Tellez  <ing.sumari@gmail.com>

	in_dxf: a HATCH boundary line may end at Y = 0
	add_HATCH took the edge path's code 21 (the end point's Y of a LINE
	edge, the end point of an elliptical arc, a spline fit point's Y) only
	when it was not 0.0; code 11 and every other coordinate never had that
	condition. A boundary line ending on the X axis fell through to
	"ERROR: Unknown DXF code 21 for HATCH".

	The point was zero-initialised, so the geometry came out right and only
	the log was wrong, but every such hatch reported an error: a program
	that checks dxf2dwg's log for errors, as IngeCAD does after saving as
	DWG, took a sound conversion for a damaged one.

	Reproducer: an R2000 DXF with a solid HATCH whose edge path is
	(0,0)-(10,0)-(10,10)-(0,0). dxf2dwg -v3 logged the error twice before,
	none now; dwg2dxf reads back the same three edges either way.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-10-22  Marco Sumari Tellez  <ing.sumari@gmail.com>

	in_dxf: read DETAILVIEWSTYLE/SECTIONVIEWSTYLE colors from any DXF version
	FIELD_CMC2004 read the colors of these two styles only from an R2004+
	DXF. A DXF writer that keeps an object it does not know passes its 62s
	on whatever version it writes -- ezdxf does, saving a drawing from
	AutoCAD 2013+ (which always carries these styles) as R2000. From an
	R2000 DXF the reader stopped at the first 62, lost its place
	("Unexpected DXF code 62, expected 40", "Unexpected DXF code 340,
	expected 90" three times), and the style reached the DWG with its
	heights, offsets, text styles and label text zeroed or empty.

	Read the color whenever it is there: dxf_read_CMC backs up when the
	next pair is not the color, so a DXF without them reads as before.

	Reproducer: an R2000 DXF with the Metric50 ACDBDETAILVIEWSTYLE of an
	AutoCAD 2018 drawing, through dxf2dwg and back through dwg2dxf. Before:
	the four errors, 40 = 15.0, 0.0, 0.0, 0.0, 0.0, text style handles wrong
	or 0, and an empty label. Now: no error, and the style reads back as
	written (40 = 5.0, 5.0, 7.5, 5.0, 15.0; text styles and label kept).

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-10-22  Marco Sumari Tellez  <ing.sumari@gmail.com>

	encode: keep the TEXT alignment point of a justified text
	dwg_set_dataflags omitted alignment_pt (dataflags 0x02) whenever it
	equalled ins_pt. DXF writers that do not compute the left baseline point
	(ezdxf among them) write a centred or right-justified TEXT with both
	points alike, so the point the text is placed by was left out of the DWG
	and read back as 0,0, in LibreDWG and in ODA: the text jumped to the
	origin. Keep it whenever horiz_alignment or vert_alignment is set, as
	the same macro already keeps those. Applies to TEXT, ATTDEF and ATTRIB.

2026-10-22  Artem Arbatski  <busch.artem@gmail.com>

	dwg2dxf: don't skip BLOCK_HEADERs after writing a block
	dxf_blocks_write() passed its loop index to dxf_block_write(), which
	advances it to the index of the last written entity. If a block's
	entities are stored later in the object stream than following
	BLOCK_HEADERs (typical for dynamic blocks in r2013+ files), those
	BLOCK_HEADERs were skipped and their BLOCK/ENDBLK and entities were
	missing in the DXF. INSERTs referencing them then pointed to empty or
	undefined blocks.

	Observed with an AC1032 drawing: 16 of 449 blocks (e.g. dynamic blocks
	'Transformator', 'Gebäude', 'E-Spule') were not written. With this fix
	all blocks are written with their entities.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-10-13  Reini Urban  <reini.urban@gmail.com>

	ci: oda: install libopengl0 and libxcb-cursor0 for the Qt6 build
	ODAFileConverter 27.9 failed with: error while loading shared
	libraries: libOpenGL.so.0.

	* .github/workflows/oda.yml: Install libopengl0, libxcb-cursor0.

2026-10-13  Reini Urban  <reini.urban@gmail.com>

	ci: oda: the download page now also lists a {version} template deb
	The deb name regex matched two lines, so the download broke. Take the
	first real name.

	* .github/workflows/oda.yml: Skip names with {version}.

2026-10-12  Reini Urban  <reini.urban@gmail.com>

	common_entity_data: r2007+ has material flags before plotstyle flags
	For R2007+ the second BB after ltype_flags is the material flags and
	the third the plotstyle flags. The material handle was decoded as
	plotstyle.

	* src/common_entity_data.spec: Swap the order for SINCE (R_2007a).

	Fixes GH #1436.

2026-10-12  Reini Urban  <reini.urban@gmail.com>

	dec_macros: NULL the vector after VECTOR_CHKCOUNT frees it
	The CHKCOUNT macros freed _obj->nam and returned an error, leaving a
	dangling pointer which dwg_free_object freed again.

	* src/dec_macros.h (VECTOR_CHKCOUNT, SUB_VECTOR_CHKCOUNT,
	  VECTOR_CHKCOUNT_LV): Set the pointer to NULL after free.

	Probable cause of GHSA-6v3v-3gmq-63v4 (no PoC available, unverified).

2026-10-12  Reini Urban  <reini.urban@gmail.com>

	Avoid strftime with a relative TIMEBLL calendar date
	cvt_TIMEBLL zeroes tm for days < 1000, so tm_mday is 0, which makes
	the Windows UCRT strftime fail-fast.

	* src/header_variables.spec (TDCREATE, TDUPDATE): Format a date only
	  when days >= 1000, else the time.
	* src/dec_macros.h (FIELD_TIMEBLL): Likewise.

	Fixes GHSA-r6gj-f9g5-xqf7.

2026-10-12  Reini Urban  <reini.urban@gmail.com>

	in_json: fix unknown_bits/rest counts and EED parser crashes
	* src/in_json.c (json_OBJECTS): Never let num_unknown_bits/rest exceed
	  the hex buffer.
	* src/in_json.c (json_eed): Check for NULL strings and handles, and
	  extend the data for code 5 handles.
	* src/in_json.c (json_xdata): Check for a NULL string.

	json_acis_data already rejects the undersized acis_data (GHSA-55wc).

	Fixes GHSA-v9f9-mwpf-rqfm and GHSA-m865-h78j-r4v2.

2026-10-12  Reini Urban  <reini.urban@gmail.com>

	dec_macros: do the VECTOR_CHKCOUNT size multiply in 64 bit
	(size) * TYPE_MAXELEMSIZE was computed in 32 bit and wrapped.

	* src/dec_macros.h (VECTOR_CHKCOUNT, SUB_VECTOR_CHKCOUNT,
	  VECTOR_CHKCOUNT_LV): Cast size to int64_t before the multiply.

	Fixes the wrap of GHSA-3v4w-cmp5-3x66.

2026-10-12  Reini Urban  <reini.urban@gmail.com>

	examples/load_dwg: fix new_filename heap overflow
	"_new.dwg" needs 9 bytes with the NUL, not 4.

	* examples/load_dwg.c (load_dwg): Allocate strlen + 9.

	Fixes GHSA-xvf3-p5w9-rjr2.

2026-10-12  Reini Urban  <reini.urban@gmail.com>

	in_dxf: fix bit_convert_TU overread on a 1-char DWGCODEPAGE
	Only r2007+ header strings are TU. A 1-char ASCII name in an older DXF
	is a 2 byte buffer that the unbounded TU scan overreads.

	* src/in_dxf.c (dxf_set_DWGCODEPAGE): Check for hdr->version >= R_2007.

	Fixes GHSA-whv4-wvrc-6qj3 and GHSA-qcmm-37h7-fqg5.

2026-10-12  Reini Urban  <reini.urban@gmail.com>

	in_dxf: fix FIELD and MULTILEADER heap overflows
	* src/in_dxf.c (add_FIELD): Do not jump back into the child loop with
	  i == num_childval.
	* src/in_dxf.c (add_MULTILEADER_lines): Clear the new lline->breaks[k],
	  not ctx->leaders[k].

	Fixes GHSA-xmr4-x33r-gmh9 and GHSA-4958-4543-8grm.

2026-10-12  Reini Urban  <reini.urban@gmail.com>

	dwg_api: fix use-after-free of vp in dwg_add_LAYOUT
	* src/dwg_api.c (dwg_add_LAYOUT): Re-fetch vp by index after the object
	  pool might have been realloced.

	Fixes GHSA-73h8-qxxr-5ggq.

2026-10-12  Reini Urban  <reini.urban@gmail.com>

	dwg2.spec: stop unbounded MATERIAL.gentextures recursion
	The recursive call operates on the same _obj, so a crafted bitstream
	recursed until the stack or heap was exhausted.

	* src/dwg2.spec (MAT_TEXTURE): Reject nested gentextures when decoding.

	Fixes GHSA-h844-9fxw-8fq6.

2026-10-12  Reini Urban  <reini.urban@gmail.com>

	free: never free the aliased TABLESTYLE rowstyles[0] handles
	downconvert_TABLESTYLE shallow-copies sty.cellstyle (or ovr.cellstyle)
	into rowstyles[0], which are freed by the spec free. The guard only
	covered ovr.type == 1.

	* src/free.c (free_TABLESTYLE_r2010): Skip rowstyles[0] always.

	Fixes GHSA-9j7j-3x85-hfwf.

2026-10-12  Reini Urban  <reini.urban@gmail.com>

	decode: fix R2004 section_info alloc wrap and unbounded first literal
	* src/decode.c (read_R2004_section_info): Compute the allocation and
	  the 8*comp_data_size ratio in 64 bit.
	* src/decode.c (decompress_R2004_section): Bound the first literal copy
	  by the output buffer, as the in-loop literal is.

	Fixes GHSA-mjmg-5vfx-8hgf, GHSA-92mf-vvmr-xgx5, GHSA-88vm-95h9-8wj2.

2026-10-12  Reini Urban  <reini.urban@gmail.com>

	in_json: fix json_eed heap overflow when extending eed data
	eed_need_size reallocated relative to the logical eed[].size, which
	is shrunk on cross-version reads, instead of the real allocation.

	* src/in_json.c (eed_need_size, json_eed): Track the real allocation.

	Fixes GHSA-6w6j-23m9-86jc.

2026-10-12  Reini Urban  <reini.urban@gmail.com>

	in_dxf: bound LTYPE strings_area by the transcoded text length
	dwg_add_u8_input may expand the text (\U+XXXX escapes), so the
	check used the shorter input length.

	* src/in_dxf.c (add_LTYPE_dashes): Use the length of the copied string.

	Fixes GHSA-j73w-vqjg-vf8x.

2026-10-12  Reini Urban  <reini.urban@gmail.com>

	in_dxf: fix SPLINE ctrl_pts[-1] write with num_ctrl_pts 0
	Check the lower bound of the index in add_SPLINE's group 41 branch.

	* src/in_dxf.c (add_SPLINE): Reject j < 0.

	Fixes GHSA-r7h7-457h-9fxx and GHSA-jg7m-p248-hmw6.

2026-10-12  Jamie Jahn  <jamiejahnio@gmail.com>

	MESH: DXF 91 is the subdivision level, not a vertex count
	dwg2.spec read 91 as the size of a subdiv_vertex array and consumed
	level * 3BD before num_vertex. Every MESH with a smoothness level
	above 0 was misaligned from there on, so vertex, faces, edges and
	crease decoded as garbage. Only the level 0 mesh is stored.

	in_dxf no longer allocates subdiv_vertex from group 91. The field
	keeps its name, so the API does not change; it now holds the level.

2026-10-12  Aleksei Korolev  <lllshamanlll@gmail.com>

	programs: initialise optind once, not on every getopt call
	The bundled getopt, compiled where the system has no <getopt.h> — in
	practice MSVC — assigned opterr and optind at the top of getopt() itself.
	optind is the scan position, so every call reset it to 1 and

	    while ((c = getopt (argc, argv, "...")) != -1)

	never terminated: the first option was parsed and optind advanced, then
	the next call rewound and parsed the same option again, forever. Any
	option at all made the programs spin on one core; "dxf2dwg -a r2000" with
	no input file is enough to reproduce it. An invocation with no options
	works, which is what made this look intermittent: argv[1] then does not
	begin with '-', so the first call returns -1 through the one branch that
	never reaches the option handling.

	The original BSD getopt initialises these at file scope. That was lost
	when the declarations moved into my_getopt.h, where one GETOPT_EXTERN
	macro cannot carry the initialisers — written that way they would define
	the variables in every translation unit that includes the header. So the
	macro gives way to two explicit branches: definitions with their initial
	values under GETOPT_C, plain extern declarations elsewhere.

	Initialising in getopt.c next to the existing tentative definitions is a
	smaller diff, but it leaves the header still unable to express an initial
	value, which is the trap that produced this bug, and relies on tentative
	definitions that C++ does not have.

	Checked with MSVC 19.44 on Windows: before, "dxf2dwg -o out.dwg in.dxf"
	consumed a full core until killed; after, it writes a DWG byte-identical
	to the one a GNU/Linux build produces from the same drawing.

	Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

2026-10-12  Marco Sumari Tellez  <ing.sumari@gmail.com>

	out_dxf: emit the annotation-scale context data of TEXT, MTEXT, ALDIM, BLKREF and LEADER
	dwg2dxf decoded these context-data objects (the per-scale representations
	of annotative objects) but never wrote them: UNSTABLE_CLASS_DXF keeps an
	unstable class out of DXF, so every ACDB_ANNOTATIONSCALES dictionary came
	out full of handles pointing at nothing, and a reader had no way to show
	an annotative object at any scale but its default one.

	Promote the five classes the decoder already reads correctly, after
	fixing their DXF layout to match ODA's, object by object:

	* MTEXT: DXF has the direction in 10 and the insertion point in 11, the
	  same order as the DWG stream (the "ODA bug" comment's order);
	* TEXT, BLKREF, LEADER: no subclass marker of their own after
	  AcDbAnnotScaleObjectContextData;
	* BLKREF: the scale factors are 41/42/43, not 42/43/44;
	* ALDIM: the text location is 2D, no 30.

	dynapi.c carries the MTEXT and BLKREF group codes for in_dxf. FCF stays
	unstable: no drawing at hand has one to check it against.

	Measured with ODA File Converter's DXF of the same DWG as reference, tag
	by tag: 5275 TEXT, 755 MTEXT, 184 ALDIM, 402 BLKREF and 7 LEADER context
	objects in eight drawings (among them test/test-data/2013/gh44-error.dwg
	and 2018/Leader.dwg) now identical. dwg2dxf on 104 drawings containing
	these classes: same result category and same entity count for every
	file before and after. make check passes.

	Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

2026-10-12  Saddam  <saddamr3e@gmail.com>

	fix OOB read on a dangling DBCS lead byte in htmlescape

2026-10-12  Marco Sumari Tellez  <ing.sumari@gmail.com>

	in_dxf: pre-r2004 viewports keep their on/off state
	Before r2004 a DWG keeps a VIEWPORT on or off in the VX_TABLE_RECORD that
	in_dxf creates for it, not in the entity. Its is_on was never set (the
	line was commented out), so every viewport of a DXF converted to r2000
	or earlier was off: ODA File Converter reads them back with status 0 and
	AutoCAD shows the layout's viewports empty.

	is_on now follows the DXF 68 status once the viewport has been read: 0
	off, anything else (including -1, on but off screen) on. Checked with
	ODA: a layout with two viewports reads back with status 1 and 2, and a
	viewport whose 68 is 0 stays off.

2026-10-12  Marco Sumari Tellez  <ing.sumari@gmail.com>

	DIMENSION_ANG2LN: read and write the stream points in their order
	In the DWG stream of a 2-line angular dimension the arc point (DXF 16)
	comes first, as a 2RD, then the points 13, 14 and 15, and last the second
	line's end (DXF 10) as a 3BD (ODA spec). The spec read the 2RD into def_pt
	and the last 3BD into xline2end_pt, so 10 and 16 were swapped on every
	read and every write -- dwg2dxf's own round trip agreed with itself, but
	ODA and AutoCAD saw the arc point where the line's end should be. The
	pre-R13 branch above already treats xline2end_pt as the arc point (16).

	The DXF and JSON outputs keep their order. Checked with ODA File Converter:
	123 of 123 such dimensions in 40 real drawings now have ODA's points (none
	before), and a DWG written by dxf2dwg reads back in ODA with its points
	(swapped before).

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-10-12  Marco Sumari Tellez  <ing.sumari@gmail.com>

	LWPOLYLINE: keep per-vertex widths through DXF import and export
	Three bugs lost the start/end widths of an LWPOLYLINE:

	- in_dxf flagged per-vertex widths with flag bit 4, which in the DWG is
	  "has const_width"; "has widths" is 32. The DWG writer then wrote a
	  const_width of 0 and no widths at all, so a polyline drawn with widths
	  came back with none. The 41 test checked the same wrong bit.
	- in_dxf allocated the widths only on the 40 of vertex 0. The DXF writer
	  omits 40/41 for a vertex with no width, so a polyline whose first
	  segment has no width made CHK_array abort the import. The first 40 now
	  allocates, as the first 42 does for bulges.
	- The DXF writer emitted the widths only when num_bulges == num_points,
	  a condition copied from the bulges test: a polyline with widths and no
	  bulges was written without widths.

	Checked with ODA File Converter: a DWG written by dxf2dwg with these
	polylines reads back with every width, and on real drawings the widths
	dwg2dxf now writes are the ones ODA reads (none before). Over 197 real
	drawings dwg2dxf gives the same entity counts, and 962 polylines in 44
	drawings get their widths back.

	Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

2026-10-03  Saddam  <saddamr3e@gmail.com>

	fix OOB read on the ASCII cellstyle names in upconvert_TABLESTYLE

2026-10-02  Saddam  <saddamr3e@gmail.com>

	in_json: bail on invalid SAB acis_data before writing at offset 15

2026-10-01  Marco Sumari Tellez  <ing.sumari@gmail.com>

	in_dxf: keep each application's EED apart when an object has several
	An object whose DXF carries XDATA from two or more applications came
	out of dxf2dwg with every group after the first fused into the first:
	ODA, AutoCAD and dwg2dxf all read one application holding everybody's
	values. Two faults in add_eed, both needed for the fix:

	* A 1001 fills slot i with its APPID handle and gives the slot back
	  (num_eed--) so that the group's first value reuses it. On reuse the
	  slot is realloc'd and memset to 0 whenever i > 0, which wipes the
	  handle the 1001 just stored. Only the first group (i == 0) escaped.
	  The memset is meant for a freshly grown slot; skip it for the one
	  the 1001 reserved.

	* "search for previous size index" walks down from i without stopping,
	  so it always settles on the lowest slot with a handle -- the first
	  group -- and adds every later value's size to it. Stop at the
	  nearest one, which is what the comment describes.

	Reproducer (a LINE with two applications):

	  0 ... LINE ... 1001 APPA 1000 first 1001 APPB 1000 second 1070 1
	  dxf2dwg -y --as r2000 -o two.dwg two.dxf
	  dwg2dxf -y -o back.dxf two.dwg   # APPA: first, second, 1  (APPB gone)

	Measured on 42 real drawings (DXF -> dxf2dwg r2000 -> dwg2dxf): of the
	851 objects with two or more EED groups, 0 came back intact before and
	851 after; the 19658 single-group objects are unchanged. ODA reads the
	written DWG the same as it reads the source DXF. make check passes.

	Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

2026-10-01  Marco Sumari Tellez  <ing.sumari@gmail.com>

	in_dxf: resolve the ACAD EED application through the APPID table
	add_eed hard-codes 5.1.12 as the handle of the ACAD application. That
	is where AutoCAD puts it, but not every DXF does: ezdxf, for one,
	creates it at 2A. The written EED then points at whatever object sits
	at 0x12, ODA and AutoCAD cannot resolve the application, audit it into
	a "$TD_AUDIT_GENERATED_(12)" group, and the data it carries is lost --
	for a DIMENSION that is its DSTYLE overrides.

	Look ACAD up in the APPID table like every other application, and keep
	5.1.12 only as the fallback when the table has no ACAD entry.

	Reproducer: a linear dimension with a dimlfac override written by
	ezdxf (APPID ACAD at 2A), dxf2dwg --as r2000, then read with ODA:
	before, the dimension has no dimlfac override; after, dimlfac = 0.05.
	make check passes.

	Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

2026-09-10  Reini Urban  <reini.urban@gmail.com>

	tests: fix ODA hangs
	redirect stdin from /dev/null for ODAFileConverter calls

	timeout(1) puts the monitored command into a new process group but
	never makes it the controlling terminal's foreground group. Under
	make check (running attached to a real tty/pty), xvfb-run's own
	`stty size` probe (used to size its diagnostic messages) then reads
	the controlling terminal from that background-relative group, and
	the kernel delivers a job-control stop (SIGTTIN) to the whole group.
	Nothing ever resumes it, so `timeout N xvfb-run ODAFileConverter ...`
	hangs forever instead of being bounded by the timeout.

	Fix by redirecting stdin from /dev/null on every
	`timeout ... $ODAFileConverter ...` invocation, so no component in
	that subtree can touch the controlling terminal in the first place.

	* dxf-check: add </dev/null to both ODA roundtrip calls.
	* dxfb-check: add </dev/null to both ODA roundtrip calls.
	* json-check: add </dev/null to the ODA roundtrip call.
	* oda: add </dev/null to the ODA roundtrip call.
	* programs/dxf.test.in: add </dev/null to both ODA calls
	  (check_subentity, check_roundtrip).
	* programs/dxfb.test.in: add </dev/null to the ODA call.
	* examples/dwgadd_test.sh.in: add </dev/null to the checkODA call.

	Reproduced and verified fixed under a real pty (make check and
	standalone runs); confirmed hanging without the fix and completing
	in <1s with it, with no orphaned Xvfb/ODAFileConverter processes
	left behind.

2026-09-10  Hallel  <hallel.kula@gmail.com>

	dxf: emit the group for a value that quotes away to nothing
	dxf_write_chunked() is a bare while (len > 0), and dxf_fixup_string()
	emits the empty-value form only from its outer else branch.  A non-empty
	input whose quoted form came out empty therefore emits no group code at
	all, and every following tag in the file shifts by one.

	This is hardening, not a second live defect, and I would rather say so
	than overstate it: I could not construct an input that reaches it on
	master.  cquote()'s invalid-MIF path needs s + 6 < send to enter and
	consumes only 4 bytes, so it always leaves trailing bytes for the else
	branch to write, and bit_embed_TU() does not return an empty string for
	a non-empty input.  What it closes is the same "the length is whatever
	strlen says" assumption as the previous commit.

	Output is unchanged on all 184 drawings tested there, as expected for a
	guard on an unreachable state.

	PR #1412

		* src/out_dxf.c (dxf_write_chunked): Write an empty value for a
		zero-length string rather than nothing at all.

2026-09-10  Hallel  <hallel.kula@gmail.com>

	dxf: terminate cquote's output at the last byte written
	cquote() stores its NUL at d[len - 1], the last byte of the destination
	buffer, and never at the position where it stopped writing.
	dxf_fixup_string() then calls strlen() on that buffer, so every byte
	between the end of the quoted string and the end of the allocation is
	read back as string content.  The buffer is malloc'd with
	(2 * emblen) + 1 bytes, so any string that grows by less than 2x under
	quoting leaves such a gap.

	Reproduces with the shipped test data, no allocator tricks needed:

	  programs/dwg2dxf --as r2018 -y -o out.dxf test/test-data/example_2018.dwg
	  grep -a Fgdt out.dxf

	  expected   {\Fgdt;r}%%v1%%v2%%v%%v%%v^J10
	  actual     {\Fgdt;r}%%v1%%v2%%v%%v%%v^J10v

	The trailing byte is whatever the allocation happened to hold: the value
	quotes to 30 bytes in a 59-byte buffer, and strlen() runs past the end of
	what was written.  Same on example_2004, _2007, _2010 and _2013.  Under
	MALLOC_PERTURB_ the residue grows to a long run rather than a single
	byte, which is how it was first spotted.

	This is the defect valgrind reported against MTEXT in 3c5ab3bb.  That
	commit moved the buffer to a zeroed static, which changed the residue
	from arbitrary heap to the previous call's tail rather than fixing the
	termination; the buffer is malloc'd again today.

	PR #1412

		* src/out_dxf.c (cquote): Terminate after the last byte written,
		clamped to the end of the buffer.

2026-09-03  Saddam  <saddamr3e@gmail.com>

	shrink codepage_bounds_tests below the 15-line threshold
	Compress the regression test to a single check covering both fixed
	paths (codepage_helper via dwg_codepage_uc/dwg_codepage_wc, and
	dwg_codepage_isalnum) so the test addition stays under 15 lines and
	no copyright assignment is needed.

	bound the codepage index in codepage_helper and dwg_codepage_isalnum
	header.codepage is read straight from the file (header.spec, 2ndheader.spec) and used as the index into the 46-entry cp_fntbl / cp_alnumtbl / cp_alnum16tbl tables, valid range 0..CP_ANSI_1258. Neither codepage_helper nor the default branch of dwg_codepage_isalnum bounds it before indexing and dereferencing, so an out-of-range codepage reads past the array and derefs a wild pointer. Reject the out-of-range value in both callees.

2026-09-01  encku  <frkncku@gmail.com>

	api: regenerate dynapi for MTEXT background scale
	* src/dynapi.c: Regenerate.
	* doc/dynapi.texi: Likewise.
	* test/unit-testing/dynapi_test.c: Likewise.

2026-09-01  encku  <frkncku@gmail.com>

	decode: read MTEXT background scale as BD
	The background fill scale has a fractional default and is encoded as a bit-double. Reading it as BL leaves the R2018 MTEXT data stream misaligned, so the following color and annotative geometry are decoded from the wrong bits.

	* src/dwg.spec (MTEXT): Read bg_fill_scale as BD.
	* src/dwg_spec_shared.h (AcDbMTextObjectEmbedded_fields): Likewise.
	* include/dwg.h (Dwg_Entity_MTEXT, Dwg_AcDbMTextObjectEmbedded): Change the field type to BITCODE_BD.
	* doc/ODA-5.4.2-libredwg.patch: Correct the documented bitcode.
	* test/unit-testing/mtext.c (api_process): Check the BD field type.

2026-08-26  Marco Sumari Tellez  <ing.sumari@gmail.com>

	in_dxf: MTEXT spacing fields default when their group is omitted
	DXF omits the optional groups 72 (flow direction), 73 (line spacing
	style) and 44 (line spacing factor) when they hold their default --
	ezdxf and AutoCAD both do -- and the importer stored the missing group
	as 0. An MTEXT with the ordinary single line spacing therefore came
	back with linespace_factor 0.0, and every line of the paragraph draws
	on top of the first one; dwg2dxf then writes the explicit 0 back out,
	so the corruption round-trips.

	0 is not a valid value for any of the three fields (the factor's
	documented range is 0.25-4.0), so the defaults can never override a
	real value. Set them when the object completes, next to the existing
	_3DFACE default -- the same shape as the MINSERT column/row default
	of PR #1385.

	Reproducer (one entity):
	  python3 -c "import ezdxf; d = ezdxf.new('R2000'); \
	    d.modelspace().add_mtext('LINE ONE\\\\PLINE TWO', \
	    dxfattribs={'char_height': 1.0}); d.saveas('two-lines.dxf')"
	  dxf2dwg two-lines.dxf -y -o two-lines.dwg
	  dwg2dxf two-lines.dwg -y -o back.dxf
	  grep -A1 ' 44' back.dxf   # 0.0 before, 1.0 with this patch

2026-08-26  Reini Urban  <reini.urban@gmail.com>

	bits, encode: fix bit_copy_chain undersized realloc, use bit_chain_init_dat
	bit_copy_chain: bit_chain_alloc() only grows the chain by the fixed
	CHAIN_BLOCK (4096 bytes), not by the actually needed size. When the
	tmp_dat content being appended exceeds that, the following bounds
	check silently aborts the copy, dropping data. Use
	bit_chain_alloc_size(dat, size) to grow by exactly what is needed.

	dwg_encode_eed: use the existing bit_chain_init_dat() helper instead
	of manually calling bit_chain_init() and copying from_version/version/
	opts by hand; same semantics, less duplication.

2026-08-25  Reini Urban  <reini.urban@gmail.com>

	regen-gperf for objects.in

2026-08-23  Marco Sumari Tellez  <ing.sumari@gmail.com>

	in_dxf: do not double the ACAD_ prefix in CHECK_DICTIONARY_HDR's fallback
	The macro uses its single argument both as the Dwg_Header_Variables
	field suffix and as the dictionary name, and its fallback prepends
	ACAD_ because most names are stored without the prefix.  Two of the
	eight call sites pass a name that already begins with ACAD_
	(ACAD_GROUP, ACAD_MLINESTYLE), so their fallback searched for a
	doubled ACAD_ACAD_ prefix that can never exist and logged a
	misleading 'DICTIONARY with ACAD_ACAD_MLINESTYLE not found' line.
	Skip the fallback for pre-prefixed names.

	Cosmetic only: the produced DWG is byte-identical; the bogus lookup
	could never succeed.

	Fixes #1390

2026-08-17  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix ASSOCPERSSUBENTMANAGER from DXF

	Fix ASSOCPERSSUBENTMANAGER object

2026-08-17  Marco Sumari Tellez  <ing.sumari@gmail.com>

	out_dxf: EED groups 1070 and 1071 are signed — do not zero-extend them
	`Dwg_Eed_Data` stores the 1070 short in a `BITCODE_RS` and the 1071 long
	in a `BITCODE_RL`, both unsigned, and the DXF writer handed those fields
	straight to `VALUE_RS`/`VALUE_RL`. The value was therefore zero-extended
	before formatting and every negative came back as its unsigned
	complement: `1070 -6700` re-exported as `1070 58836`, `1070 -1` as
	`65535`, `1071 -70000` as `4294897296`.

	`dxf_format()` already documents the right signedness for both codes, so
	the fix is to hand it a signed value; the signed macros `VALUE_RSd` /
	`VALUE_RLd` are what the neighbouring resbuf path already uses for the
	same group codes.

	While here, `dxf_format(1071)` returned `"%9li"`, which reads 64 bits of
	vararg. Every caller passes a 32-bit value (this EED field and resbuf's
	`i32`), so it is now `"%9i"` — the mismatch was undefined behaviour on
	every LP64 target and is why casting the field alone was not enough.

	The DWG side was never wrong: a DWG written here is byte-identical to
	one ODA File Converter writes from the same DXF, and reading ODA's own
	DWG reproduced the same corrupt DXF, so this is purely the export path.

	Verified against ODA File Converter 25.6 on a drawing carrying
	1070/1071 values at both ends of the range (-32768, -1, 32767, -70000):
	after the fix the emitted DXF matches ODA's value for value. Regression
	on 200 real drawings, stock against patched: 2595 values change and
	every one of them is exactly the two's-complement reinterpretation
	(1014 in 1070, 1581 in 1071); no other line of any file differs, and
	`make check` stays at 254/254.

2026-08-17  Saddam  <saddamr3e@gmail.com>

	cap sscanf field width in dwg_add_PDFUNDERLAY

2026-08-12  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	dwgadd: accept CRLF line endings for bare commands

	Add repeat and endrep commands to dwgadd

	Add test for REPEAT and ENDREP entities

	Add API for legacy REPEAT and ENDREP entities

	Regen via `make regen-dynapi`

2026-08-10  Marco Sumari Tellez  <ing.sumari@gmail.com>

	decode: widen the pre-R13 sentinel search to the +-1000 it documents
	A r11 drawing here was rejected outright:

	    ERROR: DWG_SENTINEL_R11_LAYER_BEGIN not found at 67586
	    ERROR: Failed to decode file ... 0x101
	    READ ERROR 0x101

	The file is fine. Every 16-byte table sentinel in it sits earlier than where the
	header's table address puts it:

	    BLOCK_BEGIN   expected 67286, actually 67254   (-32)
	    LAYER_BEGIN   expected 67586, actually 67286   (-300)
	    STYLE_BEGIN   expected 67741, actually 67586   (-155)
	    VIEW_BEGIN    expected 67971, actually 67363   (-608)

	decode_preR13_sentinel already recovers from exactly this: when the sentinel is
	not where expected it searches around, repositions, and continues with a
	WRONGCRC warning. But the window was

	    pos = MAX (dat->byte, 200) - 200;
	    len = MIN (dat->size - dat->byte, 400);
	    // search +- 1000 bytes around

	+-200, while its own comment promised +-1000. LAYER_BEGIN at -300 fell outside
	by 116 bytes, so the recovery never fired and the file was lost. Widened to the
	documented window, and computing len from pos so it really covers both
	directions.

	Two r11 drawings that produced no output at all now decode to exactly what ODA
	File Converter reads from them:

	    primer-piso.dwg    nothing -> 1246 modelspace entities  (ODA: 1246)
	    segundo-piso.dwg   nothing -> 1459                      (ODA: 1459)

	make check: 270 PASS / 0 FAIL, unchanged. All 146 DWGs in test/test-data and
	programs/ re-converted before and after: 146 identical, 0 worse — upstream's own
	r11 files have their sentinels where the header says, so nothing there changes.
	A 190-drawing corpus sweep: NO_OUTPUT 3 -> 1, OK 167 -> 169, zero regressions.

2026-08-10  Marco Sumari Tellez  <ing.sumari@gmail.com>

	dwg_read_dxf: a DXF without a trailing newline lost its last group pair
	    // properly end the buffer for strtol()/... readers
	    if (dat.chain[size - 1] != '\n')
	      {
	        dat.chain[size] = '\n';
	        dat.size++;
	      }
	    dat.chain[size] = '\0';

	The newline is appended at chain[size] and then overwritten by the NUL at
	the same index. dat.size was incremented, so the buffer ends "...\n0\0"
	with size pointing past a NUL that stands where the newline should be.

	dxf_read_string then refuses to read the value:

	    if (dat->byte >= dat->size
	        || !memchr (&dat->chain[dat->byte], '\n', dat->size - dat->byte))
	      return;

	It leaves *string NULL, the caller reports that as "Out of memory" -- on
	an 18 KB file -- and the whole import fails with DWG_ERR_IOERROR. The
	chain is calloc'd with two spare bytes for exactly this case, so the fix
	is to put the NUL after the newline.

	The same DXF, differing only in whether the last byte is a newline:

	    with a trailing newline      5139-byte DWG
	    without                      failed, no output

	and with this patch both produce the same 5139 bytes, byte for byte.

	That is the whole class: any DXF whose last byte is not a newline is
	rejected, whatever it contains, because the loss falls on the final
	0/EOF. The file attached to #474 (from Maker.js, ending "0\nEOF") is one,
	and it now converts to a 12696-byte AC1015 DWG instead of failing.

	#474 is not closed by this. The DWG it now produces is still rejected by
	ODA File Converter with "Null object Id: <object> (0)", which is the
	diagnosis rurban gave in that thread in 2022: a minimal DXF carries no
	handles, and handles are used internally to find table entries, so they
	have to be assigned. That is a separate fix. This one only stops the
	import failing outright, and fixes every other DXF that happens to end
	without a newline.

	Verification:

	- make check: 270 PASS / 0 FAIL / 0 SKIP, unchanged.
	- Eight real DXFs (26 KB to 47 MB) through dxf2dwg before and after:
	  every DWG byte-identical. Two of them produce no output on either side
	  (unrelated), the other six match exactly.
	- Built and tested on a clean e405fcff (= tag 0.14.8556) with this patch
	  alone. Ubuntu 26.04, gcc 15.2.0.

2026-08-10  Marco Sumari Tellez  <ing.sumari@gmail.com>

	encode: in_postprocess_SEQEND rewrapped a relative handle value as absolute
	The first/last_attrib (and first/last_vertex) refs collected by
	dxf_postprocess_SEQEND are created with an owner, so dwg_add_handle may
	store their handleref.value as a relative offset. Rewrapping that value
	with dwg_add_handleref (dwg, 4, owned[0]->handleref.value, NULL) then
	produces a dangling absolute handle: an INSERT with one ATTRIB (0x53,
	owner 0x51) got first_attrib = 2, pointing at the LTYPE control object.

	ODA-based readers reject the whole drawing over it:
	  Object improperly read: <AcDbBlockReference>
	  Previous error: Object of class AcDbLinetypeTable can't be cast to AcDbEntity
	i.e. every DWG written by dxf2dwg from a DXF with block attributes was
	unreadable in AutoCAD. Use absolute_ref, as dwg_dup_handleref does.

2026-08-10  Marco Sumari Tellez  <ing.sumari@gmail.com>

	in_dxf: a SPLINE with only fit points is scenario 2, not an empty scenario 1
	The scenario was decided solely from flag bit 32, which is LibreDWG's
	own marker, not a DXF one: standard group 70 has no fit-vs-control bit.
	A SPLINE carrying only fit points (72=0, 73=0, 74=n — what ezdxf's
	add_spline writes) stayed scenario 1 and encoded zero knots and zero
	control points: an empty spline, silently gone after dxf2dwg. The
	correct assignment was already there at the 74 handler, commented out;
	guard it so splines that do carry knots/control points keep scenario 1.

	bits: keep the palette index when downconverting a CMC whose rgb round-trips
	bit_downconvert_CMC rederived the index from the rgb even when a valid
	palette index was already there. Several ACI entries share one rgb
	(1/10 are both FF0000, 5/170 both 0000FF, ...) and dwg_find_color_index
	returns the first match, so writing r2000 from an r2004+ source silently
	recolored entities: color 170 became 5, color 10 became 1.

	in_dxf: group 420 lost its method and rgb-present flag — true color dropped
	The common-entity 420 handler set color.method = value >> 24, which is 0
	for any plain RGB, an invalid CMC method the encoder then discards. And
	the r2004+ entity color encoding writes the rgb only under the 0x80
	rgb-present flag, which nothing set (the 440 handler right below does
	set its 0x20). Every true color imported from DXF was dropped when
	writing r2004. Sibling code in dxf_read_CMC already does both correctly.

2026-08-10  Marco Sumari Tellez  <ing.sumari@gmail.com>

	in_dxf: MTEXT group 50 is valid — do not reject the whole DXF over it
	Group 50 on MTEXT is the rotation angle, a documented alternative to
	the group 11 direction vector; AutoCAD writes it, and so does ezdxf's
	dimension renderer for every measurement text. The importer knew no
	50 for MTEXT and the unknown-group fallthrough treats any unknown code
	on an importable class as fatal:

	  ERROR: Invalid DXF code 50 for MTEXT
	  ERROR: Failed to decode DXF file

	i.e. one dimension in the drawing and dxf2dwg imported nothing at all.
	Convert the angle to x_axis_dir, as the DXF reference defines it.

2026-08-10  Marco Sumari Tellez  <ing.sumari@gmail.com>

	dwg_version_as: accept "r12", which every tool's usage lists as valid
	dxf2dwg --help advertises "Valid versions: r12, r14, r2000 (default),
	r2004", but dwg_version_as only knows the table string "r11" for the
	AC1009 format, so --as r12 has never worked. The table is indexed by
	the version enum and R_12 == R_11, so it cannot carry an alias row;
	special-case the alias instead.

	Also print optarg, not argv[1], in the five tools' error message: the
	old message blamed whatever the first flag was, e.g.
	"Invalid version '-y'".

2026-08-10  Marco Sumari Tellez  <ing.sumari@gmail.com>

	encode: a pre-R13 source must still write handle streams for R13+ targets
	VALUE_HANDLE and FIELD_HANDLE_N chose between two branches with two
	different variables: PRE (R_13b1) keys the r11-index style on the
	TARGET, but the real-handle branch was IF_ENCODE_SINCE_R13, keyed on
	the SOURCE. Encoding an R12 DXF to r2000 satisfied neither: not a
	single handle was written — no owners, no block chains, no control
	entries — and the objects' declared sizes no longer matched their
	content, so readers drowned in "bit_read_RC buffer overflow". Key the
	second branch on the target, complementing the PRE above it.

	in_dxf: R12 layout blocks are named $MODEL_SPACE, not *Model_Space
	An R12 DXF (AutoCAD's own, and every library following the convention,
	e.g. ezdxf) names the layout blocks $MODEL_SPACE/$PAPER_SPACE. Every
	matcher in the importer knows only the r13+ * spellings, so the model
	space block was treated as a user-defined block, BLOCK_CONTROL's
	model_space stayed unset, and every entity of the drawing became
	unreachable after conversion. Normalize the name at the pair reader,
	so all downstream matchers see the canonical spelling.

2026-08-08  Marco Sumari Tellez  <ing.sumari@gmail.com>

	dxf: do not write R11 JUMP records into the ENTITIES section
	JUMP is not an entity. It is the "resume reading at this offset" marker of
	the R11/R12 entity sections (jump_address, jump_entity_section), and it
	carries no drawing data. DXF has no such record.

	The pre-R13 branch of dxf_entities_write iterates all objects in file order
	and skips the structural markers BLOCK and ENDBLK, but not JUMP. JUMP has no
	ownerhandle, so it lands in the "!ohdl -> assume ms" branch and is emitted as
	"0 JUMP" into ENTITIES. When it falls inside a polyline sequence the file
	stops being loadable: ezdxf 1.4.4 aborts with

	    DXFStructureError: Expected DXF entity JUMP or SEQEND

	decode.c already excludes DWG_TYPE_JUMP when populating the block header
	entity list, for the same reason. The BLOCKS writer is unaffected because it
	requires a matching ownerhandle and drops ownerless objects. Binary DXB is
	unaffected: it walks the owned-entity list, which never contains JUMP.

	Reproduce with the shipped test files:

	    programs/dwg2dxf -o x.dxf test/test-data/r10/entities.dwg
	    grep -c '^JUMP$' x.dxf     # 2 before, 0 after

	Affects programs/entities_r10.dwg and test/test-data/r{9,10}/entities.dwg —
	all three are unreadable by a conformant DXF reader before this change and
	load with 20 entities after it.

	Checked for regressions over all 146 DWGs in test/test-data and programs/,
	converted with stock 0.14.8556 and with this patch, then loaded with ezdxf:
	143 byte-identical, 3 fixed, 0 worse (+60 entities recovered in total).

2026-08-08  Marco Sumari Tellez  <ing.sumari@gmail.com>

	INSERT: normalize has_attribs for pre-R13 (DXF 66 was written as 128)
	The R11 decoder assigns the masked flag bits straight into has_attribs:

	    DECODER { FIELD_VALUE (has_attribs) = R11FLAG (FLAG_R11_HAS_ATTRIBS); }

	FLAG_R11_HAS_ATTRIBS is 128 and has_attribs is a BITCODE_B documented as
	DXF 66, so every pre-R13 INSERT that has attributes is written out as
	"66 128". DXF group 66 admits only 0 or 1.

	The three sibling POLYLINE sites already normalize with "? 1 : 0"
	(dwg.spec:1345, 1431, 2225); the INSERT one at 749 is the only one that
	does not.

	Reproduce with the shipped test files:

	    programs/dwg2dxf -o x.dxf programs/entities_r10.dwg
	    grep -A1 '^ 66$' x.dxf        # 128 before, 1 after

	Affects programs/entities_r{2.6,2.10,10}.dwg and
	test/test-data/r{2.6,2.10,9,10}/entities.dwg. The dwg2dxf output diff is
	exactly "128" -> "1" on each file; nothing else changes.

2026-08-08  Marco Sumari Tellez  <ing.sumari@gmail.com>

	add_test: const-correct the version-string scanners
	test_api_version() scans the const strings returned by
	dwg_api_version_string() and dwg_api_so_version(), but keeps the strchr()
	results in plain `char *`. gcc 15 diagnoses the discarded qualifier and,
	since the unit tests build with -Werror, `make check` fails to compile
	before a single test runs:

	  add_test.c: In function 'test_api_version':
	  add_test.c:1296:6: error: assignment discards 'const' qualifier from
	      pointer target type [-Werror=discarded-qualifiers]
	   1296 |   d0 = strchr (version, '.');
	  add_test.c:1330:6: error: assignment discards 'const' qualifier from
	      pointer target type [-Werror=discarded-qualifiers]

	d0/d1/d2 are only read from (assert, &d0[1], atoi), so const is enough --
	no cast, no copy.

	With this, `make check` on 0.14.8556 is 270 PASS / 0 FAIL
	(Ubuntu, gcc 15.2.0).

2026-08-07  Marco Sumari Tellez  <ing.sumari@gmail.com>

	decode_r2007: Reed-Solomon decode uncompressed data pages too
	read_data_section() treats "not compressed" as "not encoded", and copies
	such a page straight out of the file buffer:

	    // only if compressed. TODO: Isn't there a compressed flag as with 2004+?
	    if (section_page->comp_size != section_page->uncomp_size)
	      read_data_page (...)
	    else
	      memcpy (&decomp[section_page->offset], &dat->chain[dat->byte],
	              section_page->uncomp_size);

	But Reed-Solomon coding is independent of compression, and
	read_data_page() already treats the two separately: it undoes the RS
	coding first, then decompresses only `if (size_comp < size_uncomp)`.
	An uncompressed page can therefore still be RS coded, and the memcpy
	hands the caller the RS codewords -- payload interleaved with parity.

	The section page record has no compression flag (the TODO asks about
	exactly that), so page->size is the only evidence: an RS coded page is
	ceil(comp_size/0xFB) * 0xFF rounded up to 32, while a verbatim page is
	only rounded up to 32 and comes out smaller. Take the RS path whenever
	page->size matches the coded size exactly; anything else keeps today's
	verbatim copy.

	In an 11 MB r2007 file here, AcDb:AcDbObjects has 181 pages of which
	136 are stored uncompressed. Every one of them was garbage:

	    pages           objects   fail
	    compressed        10586      0   0.0%
	    uncompressed       2259   2183  96.6%

	The 2183 objects are 2232 LWPOLYLINEs plus a few CIRCLE/MTEXT/TEXT/LINE
	whose handles then appear in *Model_Space's entity list and resolve to
	nothing. Measured entropy of the affected byte ranges is 7.87 bits
	against 6.39 in the intact ones, which is what parity interleaved with
	data looks like.

	Result on that file, against ODA File Converter 25.6:

	    modelspace entities   8588  ->  10847   (ODA: 10847)
	    LWPOLYLINE vertices 231138  -> 1026048  (ODA: 1026048)
	    vertices near DBL_MAX 33188 ->       0  (ODA: 0)

	That also closes #1361, which I filed for the LWPOLYLINE point arrays
	"desynchronising mid-list": they were not desynchronising, they were
	being read out of RS codewords. Same for the 45316 coordinates above
	1e12 reported there -- now 0, where ODA has 40.

	Verification:

	- make check: 270 PASS / 0 FAIL / 0 SKIP, unchanged. Includes the two
	  unit tests covering this area, `decompress_r2007` and
	  `read_data_section: rejects out-of-bounds page->offset`.
	- All 146 DWGs in test/test-data and programs/ converted before and
	  after: 146 byte-identical, 0 worse. None of them stores a data page
	  uncompressed, so none takes the new path.
	- A 190-drawing corpus: three r2007 files go LOAD_FAIL -> OK
	  (+11550, +10847, +5725 entities), 187 unchanged, 0 regressions,
	  0 drawings losing an entity.

	Built on Ubuntu 26.04, gcc 15.2.0, at e405fcff (= tag 0.14.8556).

2026-08-07  Marco Sumari Tellez  <ing.sumari@gmail.com>

	bits: never encode a UTF-16 surrogate into the UTF-8 output
	The UTF-16 to UTF-8 loops encode any code unit >= 0x800 as a three-byte
	sequence, on the strength of this comment:

	    else /* if (c < 0x10000) */
	      {  /* windows ucs-2 has no D800-DC00 surrogate pairs. go straight up */

	U+D800..U+DFFF are surrogate halves. They stand for a code point only in
	pairs, and RFC 3629 forbids encoding them in UTF-8 at all. The decoder in
	this same file already knows that:

	    // reject overlong encodings and UTF-16 surrogates
	    if (cp >= 0x800 && (cp < 0xD800 || cp > 0xDFFF))

	So a string that does contain a surrogate goes out as bytes no UTF-8
	decoder will accept, and a DXF for R2007 or later is UTF-8.

	The file attached to #1021 shows what that costs. One APPID whose name in
	the DWG is damaged:

	    AT_JNT_\xed\xb4\xb8\xe0\xae\xb5\xed\xb4\xb8...

	\xed\xb4\xb8 is U+DD38, a lone low surrogate. iconv -f UTF-8 and Python
	both reject the whole file, and the reporter's AutoCAD refuses the
	drawing with "Error in APPID Table / Invalid or incomplete DXF input --
	drawing canceled". 106000 sound lines lost to one name. ODA File
	Converter reads the same DWG and writes that record as
	$TD_AUDIT_GENERATED_(10E7), so it agrees the name is unusable -- it just
	does not emit anything invalid over it.

	U+FFFD is the standard substitute and occupies the same three bytes, so
	none of these loops changes shape and no buffer arithmetic moves. Four of
	the five drawings in that attachment go from invalid UTF-8 to valid, and
	the DXFs differ by exactly six bytes each -- the two surrogates. The
	fifth had none and is byte-identical.

	Combining a genuine surrogate pair into the supplementary code point it
	denotes would recover more than U+FFFD does, and would emit four bytes
	where six are already reserved. I left it out to keep this to one
	uniform, provable change; happy to follow up with it.

	Verification:

	- make check: 270 PASS / 0 FAIL / 0 SKIP, unchanged. bit_convert_TU has a
	  unit test; its data is BMP-only, so it is unaffected.
	- All 146 DWGs in test/test-data and programs/ converted before and
	  after: 146 byte-identical. None of them carries a surrogate.
	- Three of those 146 do emit invalid UTF-8, and this patch deliberately
	  leaves them alone: example_2000, example_r13 and 2000/TS1 write the
	  degree sign as the single byte 0xB0. They are $ACADVER AC1015 with
	  $DWGCODEPAGE ANSI_1252, and a pre-R2007 DXF is in the drawing's code
	  page, not UTF-8, so 0xB0 is correct there. The rule this patch enforces
	  is only about the UTF-16 conversions.
	- Built and tested on a clean e405fcff (= tag 0.14.8556) with this patch
	  alone. Ubuntu 26.04, gcc 15.2.0.

2026-08-04  Saddam  <saddamr3e@gmail.com>

	terminate the book_name copy in dxf_CMC and dxfb_CMC

2026-08-04  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix API for ARC in pre-R13

2026-08-03  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix dwg_add_POINT api for pre-R13 DWGs

2026-07-30  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix 3DFACE HAS_ELEVATION flag in DWGs < R_10

	Fix line API in AC1009
	In AC1009 the line entity has HAS_ELEVATION flag set if use 2d
	coordinates only.

2026-07-28  Reini Urban  <reini.rurban@gmail.com>
	    omp + DeepSeek V4 Pro /high  <deepseek@deepseek.com>

	fix 3DLINE stableness, GH #1328
	API_ADD_ENTITY allocates the entity; re-type to _3DLINE by
	changing obj->type and obj->fixedtype directly instead of
	calling dwg_add_3DLINE which would allocate a second entity
	and leak the first. Fixes the entity leak in 3c3d694.

	gen-dynapi: emit _3DLINE as additional objects.in key, as for all ^3D objects

	in_dxf: fix 3DLINE DXF round-trip by ensuring model space ref and early handle

	Two fixes for DXF import of entities at R_9 (pre-R13) where
	BLOCK_RECORD_MSPACE is not set in header vars:

	* dxf_entities_read: if dwg_model_space_ref() returns NULL,
	  construct a fallback ref from the model space object so that
	  add_to_BLOCK_HEADER has a valid ownerhandle target.
	* dxf_entities_read: assign the entity's handle BEFORE calling
	  add_to_BLOCK_HEADER, so the PUSH_HV link in the block's entities
	  array carries the correct handle value (not the still-unset 0).

2026-07-28  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Rewrite dwg_add_LINE to use of dwg_add_3DLINE
	This is present in >= R_2_4 && < R_10 AutoCAD releases

	Add tests for dwg_add_3DLINE()

	Add 3dline command to dwgadd

	Add dwg_add_3DLINE api

2026-07-26  nameloCmaS  <namelocmas@gmail.com>

	in_dxf: free GEODATA mesh arrays before reallocating
	This is part of the DXF importer allocation-ownership cleanup found while reviewing Fuzzing Action LeakSanitizer reports.

	Free existing geomesh point and face arrays before rebuilding them from DXF counts, avoiding leaks when the importer sees replacement mesh data.

	For commits considered too large, a request for a GNU copyright assignment covering PAST AND FUTURE CHANGES has been sent already.

	This does not overlap the parsing or semantics scope of PR #1312-#1322.

	* src/in_dxf.c (free_GEODATA_geomesh_pts): New helper.

	* src/in_dxf.c (free_GEODATA_geomesh_faces): New helper.

	* src/in_dxf.c (add_GEODATA): Free existing mesh arrays before replacement.

2026-07-26  nameloCmaS  <namelocmas@gmail.com>

	in_dxf: free MESH arrays before rebuilding vectors
	This is part of the DXF importer allocation-ownership cleanup found while reviewing Fuzzing Action LeakSanitizer reports.

	Free existing MESH subdivision, vertex, face, edge, and crease arrays before rebuilding each vector from DXF input.

	This does not overlap the parsing or semantics scope of PR #1312-#1322.

	* src/in_dxf.c (add_MESH): Free old vector arrays before allocating replacements.

2026-07-26  nameloCmaS  <namelocmas@gmail.com>

	in_dxf: free SECTIONVIEWSTYLE hatch angles before rebuilding
	This is part of the DXF importer allocation-ownership cleanup found while reviewing Fuzzing Action LeakSanitizer reports.

	Free the existing SECTIONVIEWSTYLE hatch_angles vector before reading a replacement vector from DXF input.

	This does not overlap the parsing or semantics scope of PR #1312-#1322.

	* src/in_dxf.c (add_AcDbSectionViewStyle): Free hatch_angles before replacement allocation.

2026-07-26  nameloCmaS  <namelocmas@gmail.com>

	in_dxf: free PERSUBENTMGR arrays before reallocating
	This is part of the DXF importer allocation-ownership cleanup found while reviewing Fuzzing Action LeakSanitizer reports.

	Free the existing PERSUBENTMGR steps and subents arrays before rebuilding them from DXF counts.

	This does not overlap the parsing or semantics scope of PR #1312-#1322.

	* src/in_dxf.c (add_PERSUBENTMGR): Free steps and subents before replacement allocation.

2026-07-26  nameloCmaS  <namelocmas@gmail.com>

	in_dxf: free MATERIAL map strings before replacing them
	This is part of the DXF importer allocation-ownership cleanup found while reviewing Fuzzing Action LeakSanitizer reports.

	Free existing imported MATERIAL map filename strings before assigning replacement duplicates from DXF input.

	This does not overlap the parsing or semantics scope of PR #1312-#1322.

	* src/in_dxf.c (add_MATERIAL): Free MAT_T string fields before strdup replacement.

2026-07-26  nameloCmaS  <namelocmas@gmail.com>

	in_dxf: free MLINESTYLE lines before reallocating
	This is part of the DXF importer allocation-ownership cleanup found while reviewing Fuzzing Action LeakSanitizer reports.

	Free the existing MLINESTYLE line array before rebuilding it from the DXF line count so repeated or restarted parsing does not leak the old allocation.

	This does not overlap the parsing or semantics scope of PR #1312-#1322.

	* src/in_dxf.c (add_MLINESTYLE_lines): Free the old lines array before allocating the replacement.

2026-07-26  nameloCmaS  <namelocmas@gmail.com>

	encode: free imported class dxfname before replacing it
	This is part of the DXF importer allocation-ownership cleanup found while reviewing Fuzzing Action LeakSanitizer reports.

	Imported DXF objects own their duplicated dxfname. Free that string before replacing it with a class alias or class dxfname during encode-time class lookup.

	This does not overlap the parsing or semantics scope of PR #1312-#1322.

	* src/encode.c (dwg_encode_get_class): Free IN-mode object dxfname before assigning a new duplicate.

2026-07-26  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix encoding in AC1006
	There were bad size in APPID.

2026-07-26  Reini Urban  <reini.rurban@gmail.com>
	    omp + DeepSeek V4 Pro /high  <deepseek@deepseek.com>

	gen-dynapi: keep first DXF group code per field to fix MTEXT rect size
	When a field is re-used in an Embedded Object or annotative context
	under a different group code, the generator was overwriting the
	canonical DXF mapping. For MTEXT this mapped rect_width to 40
	(instead of 41) and rect_height to 41 (instead of 46), silently
	clobbering text_height. The fix scopes first-wins protection to
	the Embedded Object marker, keeping the canonical mapping.

	Reported by @tuxiasumari, GH #1321.

2026-07-26  Reini Urban  <reini.rurban@gmail.com>
	    omp + DeepSeek V4 Pro /high  <deepseek@deepseek.com>

	bits: fix r2000 TV length and bit_write_DD mode selection
	Two encoder bugs that corrupted round-trip output for r2000 DWG:

	* bit_write_TV: the trailing NUL is only counted in the TV string length
	  for >= R_2004; pre-r2004 lengths must equal strlen. Writing the NUL
	  into r2000 shifted every object body by one byte per string.
	* bit_write_DD: the raw-byte alias cast took the address of a local
	  pointer variable instead of the double value's own storage, and the
	  comparison used LOW words instead of the HIGH words that bit_read_DD
	  keeps from the default. This made partial-mode DD writes use random
	  mode decisions, corrupting e.g. INSERT yscale values on round-trip.

	Reported by @tuxiasumari, GH #1319.

2026-07-26  Reini Urban  <reini.rurban@gmail.com>
	    omp + DeepSeek V4 Pro /high  <deepseek@deepseek.com>

	dxf: emit valid control characters and fix string quoting order
	out_dxf fixes:

	* cquote: encode all C0 controls (0x00-0x1F except tab) using the
	  caret rule (c + 0x40), not just LF/CR. Raw control bytes from
	  decoder over-reads desynchronize tag/value streams.
	* dxf_fixup_string: run quoting AFTER the UTF-8 to TU round-trip,
	  since bit_embed_TU can re-emit raw controls from misdecoded bytes.
	* Chunk continuation: never split mid-\U+XXXX escape by breaking
	  before a trailing backslash instead of after it.
	* Continuation group codes: use dxf+2 (e.g. 301->303) for 3xx string
	  fields, matching AutoCAD's own GEODATA output.
	* Add dxf_fputs_escaped as escaping output for all chunked strings.
	* Add dxf_write_chunked() helper.

	Reported by @tuxiasumari, GH #1314.

2026-07-26  Reini Urban  <reini.rurban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	in_dxf: fix crashes importing AutoCAD dynamic-block DXFs
	Four independent fixes for importing real AutoCAD 2018 DXF files
	containing dynamic blocks (EVALUATION_GRAPH, FIELD, BLOCKSTRETCHACTION).

	* add_EVAL_Node: reset the per-node 92-counter (j) when a new node
	  starts (group 91), so the second node's group-92 values are not
	  misread as edge-list entries. Map group 95 to nextid per dwg.spec
	  rather than overwriting edge_flags with a misleading '!= 32' warning.
	* add_EVAL_Edge: use (i+1), not num_edges, as the realloc count --
	  num_edges is 0 on the first edge, giving a 0-byte allocation and
	  a heap overflow on the edges[0] store.
	* add_AcDbBlockStretchAction: allocate hdls[i].indexes and
	  codes[i].indexes before writing to them (xcalloc of the parent
	  array left those pointers NULL, producing a SEGV). Fix the codes
	  loop bound which was copy-pasted from hdls[i].num_indexes.
	* add_FIELD: tolerate group 93 as the childval data-type code
	  (AutoCAD uses 93 here; the previous code aborted with 'Invalid DXF
	  code 93 for FIELD'), and accept both 90/93 for wider compatibility.

	Reported by @tuxiasumari, GH #1312.

2026-07-26  Reini Urban  <reini.rurban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	in_dxf/dwg: handle & ownership fixes
	Five ownership/handle-semantics fixes so that conformant readers
	(AutoCAD/BricsCAD/ODA) accept our r2000 output without recovery
	errors or warnings:

	1. SORTENTSTABLE sort handles: pass NULL instead of the owning object
	   pointer to dwg_add_handleref, preventing duplicate handle
	   registration in object_map that caused 3000+ "Duplicate handle"
	   errors and downstream block-owner corruption.

	2. SORTENTSTABLE.block_owner: for empty tables with no explicit
	   code-330 owner, derive block_owner by walking the ownership chain
	   (ownerhandle -> DICTIONARY -> BLOCK_HEADER) instead of leaving it
	   unset, which misled conformant readers.

	3. Regular (non-space) block member entities: use entmode 0 (explicit
	   owner) instead of entmode 3, matching AutoCAD/ODA convention.
	   entmode 3 caused conformant readers to resolve the owner as
	   *Model_Space and warn "BlockBegin owner Id is invalid" on every
	   block member.

	4. BLOCK_RECORD flag 70 xref bit: clear blkisxref when there is no
	   genuine xref path (xref_pname is empty), preventing bound/local
	   blocks such as A$C... anonymous blocks from being rendered as
	   unresolved Xref placeholders.

	5. dwg_set_next_objhandle: check object_map for whether the candidate
	   next_hdl value is already in use, and only reuse it if free;
	   otherwise fall through to computing a fresh handle via the normal
	   handseed path, avoiding ambiguous handle collisions when table
	   records are added after the main DXF import pass.

	Reported by @tuxiasumari, GH #1320.

2026-07-26  Reini Urban  <reini.rurban@gmail.com>
	    omp + DeepSeek V4 Pro /high  <deepseek@deepseek.com>

	in_dxf: fix five field misread bugs
	Five independent in_dxf bugs found importing AutoCAD/ezdxf DXFs:

	1. DIMENSION group 16/26/36 (arc definition point) aborted import for
	   subtypes without xline2end_pt (DIMENSION_ANG3PT).  Skip gracefully.

	2. BLOCKROTATEACTION third connection point uses group 96/305, not 94/303.
	   The writer emits codes starting at 2, so index 2 maps to 96/305.

	3. SEQEND owner (group 330) may point at the owning BLOCK_RECORD (both
	   ezdxf and AutoCAD do this), not the INSERT/POLYLINE parent.  Validate
	   the owner type; fall back to backwards-search when invalid.

	4. 2D point VECTOR handler lost the first point's Y value: the j>0
	   branch excluded j==0 which still needed .y/.z for the first point.
	   Change to j>=0, increment j for 2D points, and properly reset j.

	5. Setting only a point's .x leaked stale .y/.z from a previous field
	   write.  Read the existing field value before overwriting .x only.

	Reported by @tuxiasumari, GH #1317.

2026-07-26  Reini Urban  <reini.rurban@gmail.com>
	    omp + DeepSeek V4 Pro /high  <deepseek@deepseek.com>

	dwg_add_u8_input: enable UTF-8 to codepage conversion for r2000
	The codepage-conversion branch in dwg_add_u8_input existed but was
	disabled with #if 0. Enable it so that importing a UTF-8 DXF into a
	pre-r2007 (single-byte codepage) target converts accented characters
	through the existing bit_utf8_to_TV helper instead of storing raw
	UTF-8 bytes in TV fields (producing mojibake in readers).

	Reported by @tuxiasumari, GH #1322.

2026-07-26  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix parsing of 3DLINE in AC1006

2026-07-25  Reini Urban  <reini.urban@gmail.com>
	    Claude Sonnet 5  <noreply@anthropic.com>

	encode: fix inverted pre-allocation guard in dwg_encode_add_object
	dat->byte + obj->size < dat->size meant "grow only when already
	big enough" - backwards. The undersized case relied entirely on
	downstream bit_write_* calls to grow just-in-time, which don't all
	leave enough headroom for the later overlarge-size patchup memmoves.

	Root cause behind the same ossfuzz 538648852 heap-buffer-overflow
	fixed in 10232aa48; that commit guarded the read but left this
	inverted condition in place.

	Verified: all 20 target versions of the reported testcase now
	encode cleanly under ASAN+UBSAN, no regressions in the other three
	previously-fixed ossfuzz issues re-tested, and the full unit-testing
	suite (254 tests) passes.

2026-07-25  Reini Urban  <reini.urban@gmail.com>
	    Claude Sonnet 5  <noreply@anthropic.com>

	encode: fix heap-buffer-overflow with fuzzed input
	Fixes ossfuzz 538648852

2026-07-25  Reini Urban  <reini.urban@gmail.com>

	NEWS: add 0.14.1 entry with CVE numbers and Reported-by credits
	Document the 9 security fixes from the current release cycle
	(GHSA-qg2f-8389-w95j, -qcxp-m6vj-h5h8, -c8cq-gr5h-7c6j, -2m5x-9p64-6m3f,
	-pcp5-hv9w-8f78, -6v3v-3gmq-63v4, -46mp-4x39-p444, -6q9w-j39m-jg37,
	-9g8v-9575-xgrf, -q4c2-xfww-pp93) plus a curated summary of the other
	notable non-security fixes since 0.14.  CVE numbers and reporters were
	looked up via 'gh api .../security-advisories' rather than guessed.

	Also correct the 0.14 entry:
	* Fill in CVE-2026-62254 (GHSA-gp83-hcvh-g255) and credit Bin-infinite
	  for CVE-2026-54610 (GHSA-5p98-8245-6hxq) — both fixes landed before
	  the 0.14 tag, only the CVE numbers were still 'xxxxx' placeholders.
	* Remove the premature GHSA-7625-26gc-xqvp/CVE-2026-62250 attribution
	  from the 0.14 entities_end fix: that mitigation (Jun 23) was
	  incomplete and only ossfuzz-timeout motivated; the advisory's actual
	  fix (decode_preR13_entities: fix unbounded OOM from corrupt
	  entities_end, commit 4e14952c4) landed 2026-07-04, after the 0.14
	  tag (2026-06-25/27) -- 0.14 shipped still vulnerable.  Moved the
	  correct CVE/GHSA/Reported-by credit to the 0.14.1 entry documenting
	  the real fix.

2026-07-25  Reini Urban  <reini.urban@gmail.com>
	    Claude Fable 5  <noreply@anthropic.com>

	encode: add unit-test coverage for remove_NOD_item NULL deref (GHSA-6q9w-j39m-jg37)
	The fix itself (362c146d6) already landed on this branch's ancestry:
	remove_NOD_item()'s first bounds check now guards _obj->itemhandles !=
	NULL before dereferencing _obj->itemhandles[i], matching the second check
	a few lines below that GH #357's earlier (incomplete) fix already added.
	A DICTIONARY with numitems > 0 but a NULL itemhandles array crashed with
	a NULL-pointer dereference during encode.

	Add regression coverage so it stays fixed:
	remove_NOD_item_null_itemhandles_test() in encode_test.c (which already
	#includes encode.c directly, so the static function needs no exposure)
	constructs exactly that state -- numitems=1, itemhandles=NULL -- and
	calls remove_NOD_item() directly. Verified the test segfaults (SIGSEGV,
	exit 139) when the itemhandles != NULL guard is removed from the first
	check, and passes clean under valgrind with the fix in place.

	* test/unit-testing/encode_test.c
	  (remove_NOD_item_null_itemhandles_test): new test, wired into main().

2026-07-25  Reini Urban  <reini.urban@gmail.com>
	    Claude Fable 5  <noreply@anthropic.com>

	add_test: add hang regression coverage for MLINESTYLE angles (GHSA-46mp-4x39-p444)
	The fix itself (c9ba20de0) already landed on this branch's ancestry:
	the MLINESTYLE DXF writer in dwg.spec now guards non-finite
	start_angle/end_angle with isfinite() and normalizes with a single fmod()
	call, replacing the unbounded 'while (angle > 91.0) angle -= 90.0;' loops
	that never terminate for +-Infinity (subtracting a finite number from an
	infinity leaves it unchanged, so the loop condition never flips) and hung
	dwg2dxf converting a crafted DWG.

	Add regression coverage so it stays fixed: test_mlinestyle_nonfinite_angle()
	builds a real MLINESTYLE via dwg_add_MLINESTYLE(), forces
	start_angle=INFINITY and end_angle=NAN, then calls dwg_write_dxf() (the
	actual vulnerable code path) under a SIGALRM(5)+siglongjmp escape hatch:
	if the writer hangs, the alarm fires, the test jumps back out and reports
	a failure instead of hanging the whole suite forever. Skipped on Windows
	(no SIGALRM) and DISABLE_DXF builds. Verified the test takes ~5.5s and
	fails when the guard is reverted to the buggy unbounded while loops, and
	completes in <1s and passes with the fix in place.

	* test/unit-testing/add_test.c (test_mlinestyle_nonfinite_angle): new
	  test, wired into main() (POSIX + DXF builds only).

2026-07-25  Reini Urban  <reini.urban@gmail.com>
	    Claude Fable 5  <noreply@anthropic.com>

	decode: add unit-test coverage for 3DSOLID block_size overflow (GHSA-6v3v-3gmq-63v4)
	The fix itself (2cd63f5db) already landed on this branch's ancestry:
	decode_3dsolid()'s bound check now casts to int64_t before multiplying
	block_size[i] by 8, and additionally caps block_size[i] < MAX_SIZE_TF
	(0xFFF0), closing the 32-bit unsigned overflow that let block_size values
	above 0x1FFFFFFF wrap 'AVAIL_BITS(dat) > 8 * block_size' to a
	trivially-true comparison and drive a multi-hundred-MB out-of-bounds read
	via FIELD_TFv(), reported to manifest as heap corruption / a double-free
	during dwg_free cleanup on a crafted DWG.

	Add regression coverage so it stays fixed: decode_3dsolid_tests() in
	decode_test.c (decode_3dsolid is compiled into decode.c via dwg.spec ->
	dwg_spec_shared.h, which decode_test.c already #includes, so no exposure
	changes needed) hand-encodes a minimal ACIS v1 3DSOLID prefix
	(acis_empty=0, unknown=0, version=1, block_size[0]=0x20000000) into a
	16-byte Bit_Chain -- 8 * 0x20000000 wraps to 0 in 32-bit, matching the
	advisory's overflow -- and confirms block_size[0] is safely zeroed
	instead of driving the oversized read. Verified the test fails when the
	guard is reverted to the buggy '8 * block_size[i]' form, and passes clean
	under valgrind with the fix in place.

	* test/unit-testing/decode_test.c (decode_3dsolid_tests): new test,
	  wired into main().

2026-07-25  Reini Urban  <reini.urban@gmail.com>
	    Claude Fable 5  <noreply@anthropic.com>

	decode: add unit-test coverage for R2004 section-info overflow (GHSA-2m5x-9p64-6m3f)
	The fix itself (050ce0030) already landed on this branch's ancestry:
	read_2004_compressed_section() now computes
	  max_decomp_size64 = (uint64_t)info->num_sections * (uint64_t)info->max_decomp_size
	and rejects it against the 790Mb cap before truncating to the uint32_t
	allocation size, closing the 32-bit-wrap under-allocation that let
	sec_dat->size get stamped from an unbounded info->size and a later
	sentinel/bit_read_* scan run gigabytes past the small allocation.

	Add regression coverage so it stays fixed: read_2004_compressed_section_tests()
	in decode_test.c (which already #includes decode.c directly, so the
	static function needs no exposure) reproduces the advisory's exact
	numbers -- num_sections=3235, max_decomp_size=0x144400 (true product
	4,296,494,080, 32-bit wrap 1,526,784) -- with an all-NULL info->sections
	array sized to num_sections (so if the overflow guard fails to fire, the
	function safely walks the 'empty section' skip path instead of touching
	unallocated memory in this synthetic harness, but still returns a
	different error code than the expected DWG_ERR_VALUEOUTOFBOUNDS,
	catching the regression). Verified the test fails when the guard is
	reverted to the buggy 32-bit multiply, and passes clean under valgrind
	with the fix in place.

	* test/unit-testing/decode_test.c (read_2004_compressed_section_tests):
	  new test, wired into main().

2026-07-25  Reini Urban  <reini.urban@gmail.com>
	    Claude Fable 5  <noreply@anthropic.com>

	decode_r2007: add unit-test coverage for page->offset bound (GHSA-pcp5-hv9w-8f78)
	The fix itself (4594de3c7) already landed on this branch's ancestry:
	read_data_section() now rejects page->offset >= dat->size before assigning
	dat->byte, closing the size_t underflow in the uncompressed-page guard
	that let the memcpy at the end of the function read past the file buffer.

	Add regression coverage so it stays fixed: expose read_data_section() and
	its r2007_page/r2007_section/r2007_section_page types via decode.h
	(same pattern already used for decompress_r2007 in commit 9cdc8c537), and
	add read_data_section_tests() to decode_test.c building a minimal
	one-page, one-section, uncompressed setup with page->offset past
	dat->size. Verified the test fails (DWG_ERR_VALUEOUTOFBOUNDS not
	returned) when the bounds check is removed, and passes clean under
	valgrind with it in place.

	* src/decode_r2007.c: un-static read_data_section, drop its now-redundant
	  forward declaration, move the three r2007_* typedefs to decode.h.
	* src/decode.h: add the moved typedefs and the read_data_section
	  prototype under the existing '/* from decode_r2007.c */' block.
	* test/unit-testing/decode_test.c (read_data_section_tests): new test,
	  wired into main().

2026-07-25  Reini Urban  <reini.urban@gmail.com>
	    Claude Fable 5  <noreply@anthropic.com>

	in_dxf: fix stale obj pointer UAF importing VIEWPORT before R2004 (GHSA-qcxp-m6vj-h5h8)
	new_object()'s VIEWPORT -> VX_TABLE_RECORD special case (pre-R2004 DXF,
	group code 5) kept its local Dwg_Object *obj across the dwg_add_VX() call
	used to create the entity's VX_TABLE_RECORD. dwg_add_VX() expands
	API_ADD_TABLE, which can add object(s) and realloc dwg->object[] once the
	object count hits an allocation boundary, invalidating every existing
	pointer into the pool. obj was then read (VIEWPORT tio access,
	SORTENTSTABLE check further down) and written through
	(obj->handle.value = ...; dwg_add_handle()) while stale: a
	heap-use-after-free reachable from untrusted DXF input, with the object
	count controllable via preceding entities and the VIEWPORT handle
	supplied directly by the attacker.

	Save the object's index before the call that may grow the pool, and
	re-fetch obj = &dwg->object[idx] afterwards, matching the pattern already
	used by NEW_OBJECT()/dwg_decode_add_object().

	Add test_viewport_vx_realloc() to test/unit-testing/add_test.c,
	reproducing the advisory's exact boundary (1022 preceding POINT entities
	filling the 1024-slot initial object pool) via dwg_read_dxf() on an
	in-memory buffer, so ASan/valgrind catch any regression. Run before the
	other add_test cases so the object pool's backing allocation is fresh
	enough for the realloc to actually relocate memory.

	Reported-by: rigelyoung (GHSA-qcxp-m6vj-h5h8)

2026-07-25  Reini Urban  <reini.urban@gmail.com>
	    Claude Fable 5  <noreply@anthropic.com>

	dwg_api: fix stale obj pointer UAF in dwg_add_MLINESTYLE (GHSA-q4c2-xfww-pp93)
	dwg_add_MLINESTYLE() kept the Dwg_Object *obj pointer returned by
	API_ADD_OBJECT(MLINESTYLE) across a call to dwg_add_DICTIONARY(), used to
	create the ACAD_MLINESTYLE dictionary when it is missing.
	dwg_add_DICTIONARY() expands API_ADD_OBJECT(DICTIONARY), so it can call
	dwg_add_object(), which reallocs dwg->object[] once the object count hits
	an allocation boundary, invalidating every existing pointer into the
	pool. obj was then dereferenced (ownerhandle assignment, num_reactors
	check) and passed to dwg_add_handleref() while stale: a heap-use-after-
	free.

	Save the object's index before the call that may grow the pool, and
	re-fetch obj = &dwg->object[idx] afterwards, matching the pattern already
	used by NEW_OBJECT()/dwg_decode_add_object().

	Add test_mlinestyle_obj_realloc() to test/unit-testing/add_test.c,
	reproducing the advisory's boundary condition (1023 pre-existing objects,
	1024-slot pool, dictionary-less Dwg_Data) so ASan/valgrind catch any
	regression. Run first in main() so the object pool's backing allocation
	is still fresh enough for the realloc to actually relocate memory.

	Reported-by: rigelyoung (GHSA-q4c2-xfww-pp93)

2026-07-25  Reini Urban  <reini.urban@gmail.com>

	decode: fix OOB read in decode_R2004_header section page map (GHSA-c8cq-gr5h-7c6j)
	src/decode.c (decode_R2004_header): validate that the section-page-map
	address + 0x100 does not exceed dat->size before reading the map.

	In the backward-search path (triggered when section_map_address >
	dat->size), the loop scans backward in 0x20 steps for the magic
	0x41630e3b and leaves `start` the last-tested offset.  The code then
	unconditionally reads 0x100 bytes from &dat->chain[start] without
	checking that start + 0x100 <= dat->size.  For a small or truncated
	R2004 file the read lands past the end of the dat->chain buffer,
	producing a heap-buffer-overflow READ (CWE-125).

	The guard also covers the normal (non-search) path where
	section_map_address <= dat->size: a file whose section map header
	crosses the file boundary is now rejected with DWG_ERR_VALUEOUTOFBOUNDS
	instead of reading past the allocation.

	Fixes GHSA-c8cq-gr5h-7c6j. No CVE yet.
	Reported-by: yPin9 <ypp0x7@gmail.com>

	* src/decode.c (decode_R2004_header): add bounds check before map read

2026-07-25  Marco Sumari Tellez  <ing.sumari@gmail.com>
	    Reini Urban  <reini.urban@gmail.com>
	    Claude Fable 5  <noreply@anthropic.com>

	dwg: a duplicate handleref must not disable the ordered-ref index
	ordered_ref_add treats a duplicate (code, absref) pair as "should never
	happen" and reacts by freeing the whole bsearch index, demoting every
	subsequent ordered_ref_find to a linear scan over all refs. But
	duplicates are reachable through a normal path: dwg_add_handleref only
	dedupes via ordered_ref_find on some branches (e.g. obj == NULL), yet
	unconditionally calls ordered_ref_add at the end. One duplicate early in
	a big DXF import turns the whole run quadratic — together with the
	in_dxf strlen fix this took a real 19 MB DXF from >5 minutes (killed) to
	1.8 s, with byte-identical DWG output.

	Refs sharing a key are interchangeable by design (the dedupe branch
	returns whichever is indexed), so simply skip inserting the duplicate
	and keep the index alive.

	Found by IngeCAD's round-trip fidelity harness over a corpus of 1385
	real-world DWGs (same hunt as #1311-#1315).

2026-07-25  Marco Sumari Tellez  <ing.sumari@gmail.com>
	    Claude Fable 5  <noreply@anthropic.com>

	in_dxf: don't strlen() the whole remaining buffer per character
	dxf_read_string's per-character loop probes each byte for a "\M+n" MIF
	escape with memBEGINc, whose implementation calls strlen(s1). Here s
	points into the raw file buffer, so every character of every string
	value scanned the entire remaining file: DXF import cost O(file_size^2).
	A 19 MB DXF (a real pavement-details plan exported by ezdxf) needed
	minutes of pure strlen before this and converts in seconds after.

	Compare the three escape bytes directly with an explicit bounds check
	against dat->size — faster and safer than relying on a terminating NUL
	in a memory-mapped buffer.

	Found by IngeCAD's round-trip fidelity harness over a corpus of 1385
	real-world DWGs (same hunt as #1311-#1315).

2026-07-25  Reini Urban  <reini.urban@gmail.com>

	ci: pinact run -u

2026-07-21  Marco Sumari Tellez  <ing.sumari@gmail.com>
	    Claude Fable 5  <noreply@anthropic.com>

	dxf: sanitize partially decoded values — zero handles, MTEXT columns
	Two more corpus findings (1385 real-world DWGs), both "garbage in,
	fatal DXF out":

	* src/out_dxf.c (dxf_fixup_zero_handle): objects can arrive from
	  partial decodes with handle 0 (LAYOUTs seen in the wild), which
	  readers reject outright ("Invalid handle 0"), killing the whole
	  file. Assign a fresh unique handle at write time; also give the
	  synthetic ENDBLK of dxf_ENDBLK_empty a real handle instead of the 0
	  that calloc leaves.
	* src/dwg.spec (MTEXT): partial decodes leave garbage in column_type
	  (256, 35141...); a 71 group > 2 in the embedded object crashes DXF
	  readers (ezdxf ColumnType enum). Treat out-of-range values as "no
	  columns".

	All 254 unit tests pass. Sibling PRs from the same corpus hunt:
	#1311 #1312 #1313 #1314.

2026-07-21  Marco Sumari Tellez  <ing.sumari@gmail.com>
	    Claude Fable 5  <noreply@anthropic.com>

	in_dxf: rational HATCH spline read knots as weights (index overrun)
	A rational spline boundary edge stores num_knots knot values (DXF code 40)
	BEFORE the per-control-point weights (also code 40). The importer decided
	knot-vs-weight purely on `l >= 0 && is_rational`, so every knot after the
	first was routed to the weight branch: it overwrote control_points[0].weight,
	never advanced the knot index, and left `l` stuck at 0 so the knot-complete
	reset never fired. The control points then indexed from the wrong base and
	ran past num_control_points ("wrong l N control_points index"), aborting the
	whole DXF import (READ ERROR 0x800) -- e.g. Planos Constructivos, a spline
	with num_knots=18 / num_control_points=14.

	Track a knots_left counter (set at code 95, decremented per knot) and only
	treat code 40 as a weight once the knots are consumed. Planos now imports
	and round-trips clean through ODA; 254 unit tests green.

2026-07-21  Marco Sumari Tellez  <ing.sumari@gmail.com>
	    Claude Fable 5  <noreply@anthropic.com>

	in_dxf: HATCH.has_derived must OR every path flag, not just the last
	has_derived controls whether pixel_size is written/read. in_dxf set it with
	`o->has_derived = flag & 4` per path, so it ended up holding only the LAST
	path's derived bit. The decoder computes has_derived as the OR of every
	path flag's 0x4 bit. When an earlier path was derived but the last was not
	(e.g. flags [7, 24]), the encoder skipped pixel_size while the reader
	expected it -> the 64-bit gap corrupted num_seeds and the HATCH became
	unreadable. Accumulate with |=.

	HATCH: spline-edge fit points/tangents only when num_fitpts > 0
	For a spline boundary edge (R2010+), the decoder read num_fitpts and then
	ALWAYS read the two 2RD tangents. AutoCAD writes the fit points and the
	start/end tangents only when the spline was defined by fit points
	(num_fitpts > 0). Reading them unconditionally overran the object and made
	the decoder lose bit-sync right after the first spline edge -- it silently
	dropped every remaining edge and path of that hatch. dwg2dxf then emitted a
	DXF whose 91/93 counts disagreed with the data present, and dxf2dwg baked
	that inconsistency into an r2000 file that AutoCAD/BricsCAD/ODA reject
	("Object improperly read: <AcDbHatch>"). Guard the fit-point/tangent block
	with `if (num_fitpts)`. On Detalles Plaza Yanque a spline-bounded hatch now
	decodes all 3 paths / 6 edges instead of 2 / 3. 254 unit tests green.

2026-07-21  Marco Sumari Tellez  <ing.sumari@gmail.com>
	    Claude Fable 5  <noreply@anthropic.com>

	dxf: hex-encode binary TF chunks (group codes 310-319)
	* src/out_dxf.c: FIELD_TF with a binary chunk group code (310-319),
	  as used by PROXY_ENTITY.proxy_data, went through the string path
	  (VALUE_TV): the raw bytes were emitted verbatim — with the r2007+
	  codepage conversion applied to them — producing invalid DXF that
	  readers reject ("invalid binary data"). Route those groups through
	  VALUE_BINARY instead.
	* src/dwg.spec: the previously discarded len argument now compiles,
	  exposing -Werror=pointer-sign in OLE2FRAME's strlen; cast it.

	Found converting a 27 MB r2013 cadastre drawing with partially
	decoded ACAD_PROXY_ENTITYs: after the af67061c fix stopped the SEGV,
	dwg2dxf output was still rejected by ezdxf/recover due to the raw
	proxy_data bytes. With both fixes the drawing converts and loads
	fully (92k entities).

2026-07-21  nameloCmaS  <namelocmas@gmail.com>

	Fix function dwg_page_x_min to use the correct header variable.

2026-07-20  Marco Sumari Tellez  <ing.sumari@gmail.com>
	    Claude Fable 5  <noreply@anthropic.com>

	in_dxf: reset hdl_idx per HATCH path — associative hatches lost their pattern
	* src/in_dxf.c (add_HATCH): each boundary path carries its own 97
	  handle-count and 330 handle list, but hdl_idx was never reset when a
	  new 97 arrived. The 330s of every path after the first failed the
	  (hdl_idx + 1) < num_boundary_handles guard and were rejected
	  ("Unknown DXF code 330 for HATCH"), leaving num_boundary_handles set
	  with a NULL boundary_handles array. The encoder then emitted a short
	  handle stream ("Invalid boundary_handles size 1. Need min. 8 bits,
	  have 3"), corrupting the rest of the entity: on decode the hatch came
	  back with pattern_scale 0 and no definition lines.

	Minimized reproducer: an associative two-path hatch (ring of two arc
	edges, each path with one source boundary handle). Before: pattern
	ANSI31 scale 2.5 -> scale 0.0, 0 pattern lines. After: identical
	roundtrip. On the originating real-world plan, all 57 hatches now
	roundtrip with zero differences.

2026-07-16  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	spec: implement TABLESTYLE upconvert to r2010+
	* src/out_dxf.c (dwg_dxf_object): Drop the < R_2010 version gate for
	  TABLESTYLE DXF export.  TABLESTYLE objects in r2010+ source DWGs
	  were previously skipped with "Unhandled Object" warnings.
	* src/encode.c (upconvert_TABLESTYLE): New function, reverse of
	  downconvert_TABLESTYLE.  Populates the sty.cellstyle (and ovr) from
	  the r2007 rowstyles when encoding to r2010+.  Moves text/fill
	  colors, borders, and content format fields.
	* src/dwg2.spec (TABLESTYLE LATER_VERSIONS): Enable upconvert call
	  when from_version <= R_2007.  Clarify style overrides comment,
	  remove TODO warning.
	* test/unit-testing/tablestyle.c: Remove DEBUG_CLASSES guard and
	  r2010+ skip, enabling full r2010+ testing.

2026-07-16  Reini Urban  <reini.urban@gmail.com>

	dxf.test: add missing 2004 to convert_year_dxf
	* programs/dxf.test.in (convert_year_dxf): Add 2004 case so the ODA
	  roundtrip check runs for r2004 DWGs instead of printing "empty 2004".

2026-07-14  Reini Urban  <reini.urban@gmail.com>

	HATCH: don't warn on a legitimately-exhausted handle stream
	The DECODER guard for the trailing COMMON_ENTITY_HANDLE_DATA logged
	'Skip HATCH common handles due to short handle stream' whenever <8 bits
	remained. But the common entity handles are read earlier by
	dwg_decode_common_entity_handle_data, and the trailing
	COMMON_ENTITY_HANDLE_DATA is only START_HANDLE_STREAM (a stream
	reposition, not a handle read). For a ByLayer/default HATCH the
	conditional handles (ltype/plotstyle/material, present only when their
	*_flags == 3) are absent, so the handle stream correctly ends right
	after layer + boundary_handles.

	So the condition is normal, not an error: verified the affected HATCH
	still decodes layer=Tavolo 3 (matching ODA) with the handles fully
	preserved. Downgrade the misleading LOG_WARN to LOG_HANDLE; behavior
	is unchanged (same skip), ASAN clean.

	Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

2026-07-14  Reini Urban  <reini.urban@gmail.com>

	in_dxf: unquote ^J/^M back to LF/CR in DXF strings
	out_dxf's cquote() writes embedded control chars in text values as caret
	codes (LF -> ^J, CR -> ^M), and dxf_read_string already reverses cquote's
	\\M+nxxxx -> \\U+xxxx mapping, but not the caret codes. So a
	dwg->dxf->dwg roundtrip turned an embedded newline into the literal two
	bytes ^J: e.g. a TOLERANCE feature-control-frame text_value

	  {\\Fgdt;r}%%v1%%v2%%v%%v%%v\n10   (original)
	  {\\Fgdt;r}%%v1%%v2%%v%%v%%v^J10    (after roundtrip)

	Add the inverse ^J -> LF, ^M -> CR in dxf_read_string, next to the
	existing \\M+ handling, so text with embedded newlines round-trips.
	Verified on example_2007 TOLERANCE (text_value now identical after
	roundtrip); no over-conversion of other strings, ASAN clean.

	Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

2026-07-14  Reini Urban  <reini.urban@gmail.com>

	in_dxf: read TABLESTYLE rowstyle true-color (RGB) values
	add_TABLESTYLE read the rowstyle color *indices* (DXF 62 text_color,
	63 fill_color, 64..69 borders[].color) but dropped their true-color
	(RGB) counterparts. DXF encodes a true color at the index code + 358,
	so 420/421/422..427 pair with 62/63/64..69. Those codes fell through
	to 'Unknown DXF code NNN for TABLESTYLE' and the RGB was lost on import.

	Add cases 420..427 mirroring the index cases, setting .rgb and .method
	(top byte) like the MLINESTYLE reader. Clears the 32 unknown-code
	TABLESTYLE warnings across the example/sample set; the parsed values now
	match the originals exactly (e.g. text_color C2000005, fill_color
	C28000C1, borders C2000100/C2FFFD01).

	Import-side fidelity only; a full dwg->dxf->dwg to r2010+ still converts
	rowstyles to the CellStyle layout (the separate 'TODO TABLESTYLE r2010+
	missing fields' encode gap).

	Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

2026-07-13  Reini Urban  <reini.urban@gmail.com>

	in_dxf: use correct handle code for SEQEND-owned vertex/attribs
	dxf_postprocess_SEQEND rebuilt the owner's owned-child list
	(POLYLINE.vertex[] or INSERT.attribs[]) with handle relation code 3 for
	every child, but the encoder writes most of these as soft pointers
	(code 4):
	  - INSERT/MINSERT.attribs[]                HANDLE_VECTOR(..., 4)
	  - POLYLINE_PFACE/MESH.vertex[]            HANDLE_VECTOR(..., 4)
	  - POLYLINE_2D/3D.vertex[]                 HANDLE_VECTOR(..., 3)
	So on re-encode each PFACE/MESH vertex and each attrib warned
	'Expected a CODE 4 handle, got a 3'.

	Pick the code from the owner type: 3 only for POLYLINE_2D/3D, else 4.
	This drops the dwg->dxf->dwg handle-code warnings from 103 to 48 across
	the example/sample set. No ownership change (absolute refs and counts
	unchanged); ODA reads the re-encoded R2004 output cleanly.

	Remaining 48 are 'expected 4, got 5' on scattered single-handle fields
	(base_ucs, visualstyle, layer, ...) for a later pass.

	Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

2026-07-13  Reini Urban  <reini.urban@gmail.com>

	in_dxf: use code 4 for BLOCK_HEADER.entities[] owned handles
	When rebuilding a block's owned-entity list during DXF import, each
	entity was pushed onto BLOCK_HEADER.entities[] with handle relation
	code 3 (hard owner), but the encoder writes that vector as a soft
	pointer: HANDLE_VECTOR(entities, num_owned, 4, 0). On re-encode every
	owned entity therefore triggered

	  Warning: Expected a CODE 4 handle, got a 3

	which accounted for the large majority of dwg->dxf->dwg handle-code
	warnings (813 -> 103 across the example/sample set, i.e. ~710 removed).

	Push these refs with code 4 to match the encoder and real DWGs.
	dwg_add_entity_link already uses code 4 for first/last_entity, so this
	aligns the R2004+ entities[] path with it. No functional change to
	ownership: the absolute refs are unchanged, ODA reads the re-encoded
	R2004 output cleanly, and owned-entity counts are unchanged (an
	unrelated pre-existing 68->67 Model_Space delta is present with code 3
	too).

	The remaining ~103 warnings are a scattered long tail (base_ucs,
	visualstyle, POLYLINE vertex[], layer, ...) for a later pass.

	Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

2026-07-13  Reini Urban  <reini.urban@gmail.com>

	decode_r2007: bound page->offset (heap OOB read via size_t underflow)
	read_data_section set the source cursor from an unbounded page offset:
	  dat->byte = page->offset;
	page->offset accumulates unchecked page sizes in read_pages_map; only
	section_page->offset (the destination into decomp) was validated. In
	the uncompressed branch (comp_size == uncomp_size) the guard
	  section_page->uncomp_size > dat->size - dat->byte
	underflows when dat->byte (= page->offset) > dat->size, since both are
	size_t, so it wraps to ~2^64 and passes. The following memcpy then
	reads uncomp_size bytes from dat->chain + page->offset, past the file
	buffer -> heap out-of-bounds read (DoS, limited disclosure) on a
	crafted R2007 DWG.

	Reject page->offset >= dat->size before assigning dat->byte, which also
	makes the dat->size - dat->byte subtraction below well-defined and
	guards the compressed read_data_page path from the same bad cursor.

	GHSA-pcp5-hv9w-8f78. No behavior change for valid files (120 r2004/
	r2007 test DWGs still decode ASAN-clean).

	Reported-by: zx (Jace) @manus-use
	Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

2026-07-13  Reini Urban  <reini.urban@gmail.com>

	decode: fix R2004 section-info integer overflow (heap OOB read)
	read_2004_section_info computed
	  max_decomp_size = info->num_sections * info->max_decomp_size;
	with both factors BITCODE_RL (uint32) into a uint32_t, so the product
	wraps mod 2^32. The 0x2f000000 guard then checked the wrapped (small)
	value and passed, while the second guard at :2059 uses a non-wrapping
	int64 product and admits info->size up to ~4.29e9. The buffer was
	allocated with the small wrapped size but sec_dat->size was stamped
	from info->size, so bit_search_sentinel later scanned gigabytes past a
	~1.5MB allocation -> heap out-of-bounds read (DoS, limited disclosure)
	on a crafted R2004 DWG.

	Compute the product in uint64_t and reject before truncating to the
	uint32_t. info->size is then bounded by max_decomp_size via the :2059
	check, so the sentinel scan stays inside the allocation.

	GHSA-2m5x-9p64-6m3f. No behavior change for valid files (120 r2004/
	r2007 test DWGs still decode ASAN-clean).

	Reported-by: zx (Jace) @manus-use
	Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

2026-07-13  Reini Urban  <reini.urban@gmail.com>

	in_dxf: read MATERIAL color and mapper subfields
	MATERIAL had no dedicated DXF reader, so it went through new_object's
	generic field-by-dxf-code path. That cannot resolve its nested color
	and mapper subclasses: the 16-element transmatrix vectors reuse one
	code, and the codes are position-dependent (270 is bumpmap.projection
	in the map section but luminance_mode in the tail). So on dxf2dwg /
	json2dwg every material map field hit 'Unknown DXF code NNN for
	MATERIAL' and was dropped -- ~525 warnings on example_2007 alone, and
	all the ambient/diffuse/specular colors, the six maps (blend factor,
	projection/tiling/autotransform, 16x transmatrix, source, filename)
	and the trailing scalars were lost.

	Add add_MATERIAL(), a sequential reader keyed on the fixed field order
	dwg2.spec emits, dispatched from new_object like add_MESH. Handles the
	three colors, all six maps incl. image-file filenames (source==1), and
	the r2007+ scalar tail. Returns unconsumed pairs via start_loop so
	trailing xdata is still handled. Procedural-texture variants (source==2,
	277/300/...) are not emitted by out_dxf and stay unhandled.

	Fixes all MATERIAL warnings and makes materials round-trip: every
	color/map/scalar field is now identical after dwg->dxf->dwg across
	r2000..r2018 (verified on example_* and Drawing_2013, which uses
	image-file maps).

	Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

2026-07-13  Reini Urban  <reini.urban@gmail.com>

	dynapi: keep imported strings as UTF-8, don't convert to TU
	dynapi_set_helper converted every string field to UTF-16 (TU) whenever
	the (target) version was >= R_2007, ignoring import mode. But DXF/JSON
	imports (DWG_OPTS_IN) keep strings as UTF-8 in memory, as the readers
	assume via IS_FROM_TU_DWG (from_version >= R_2007 && !DWG_OPTS_IN).

	The result of this set/get asymmetry: importing an R2007+ DXF/JSON
	stored table names (layer, style, dimstyle, ltype, appid ...) as
	UTF-16, which the UTF-8 readers then truncated to the first character.
	So 'Tavolo 2' became 'T' in the written DWG, and every by-name lookup
	(dwg_find_tablehandle) failed -> a flood of 'Unknown HEADER.CLAYER',
	'Unknown LAYER.ltype', 'Unknown <entity>.layer', 'Unknown ...style',
	'eed[].handle for APPID...' and 'TODO resolve common handle name'
	warnings on dxf2dwg / json2dwg of R2007+ files.

	Pass an is_import flag (dwg->opts & DWG_OPTS_IN) to dynapi_set_helper
	and route imported strings through the UTF-8 (ascii) branch regardless
	of version. Non-import paths (binary decode, dwg_add API) are
	unchanged. Fixes the truncated names and all the resolve warnings;
	dwg->dxf->dwg and dwg->json->dwg round-trips preserve every table name
	across r2000..r2018.

	Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

2026-07-13  Reini Urban  <reini.urban@gmail.com>

	MATERIAL: don't emit spurious diffusemap texture in DXF
	The diffusemap was the only map channel with an extra
	  DXF { SINCE (R_2007a) CALL_SUBCLASS (_obj, MATERIAL, Texture_diffusemap); }
	block emitting its procedural texture (277/278/460/279/461 ...)
	unconditionally, in addition to MAT_MAP already emitting it inline when
	map.source == 2 (like all five other maps).

	For the common source != 2 case (no procedural texture) this wrote a
	bogus texture block with no backing data, which ODA rejects with
	'Syntax error or premature end of file' on the MATERIAL; for source == 2
	it double-emitted. Rely on MAT_MAP alone, consistent with the specular,
	reflection, opacity, bump and refraction maps.

	Fixes the ODA MATERIAL(269) syntax error in test-data/example_2007.dwg;
	dwg->dxf->dwg round-trip via in_dxf still decodes the materials.

	Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

2026-07-13  Reini Urban  <reini.urban@gmail.com>

	3DSOLID/REGION: fix off-by-one dropping last SAT block in DXF
	dwg_convert_SAB_to_SAT1() splits the converted SAT v1 stream into
	<=4096-byte blocks. The final 'smaller rest' block is written at index
	i, but i is not incremented afterwards, so num_blocks = i is one too
	small and the last block is always dropped.

	For multi-block geometry (e.g. large 3DSOLID) this only loses the
	trailing End-of-ACIS-data terminator, which ODA tolerates. For a small
	single-block REGION the whole SAT fits in one <4096-byte block, so
	num_blocks becomes 0 and no ACIS/SAT data is emitted at all: the DXF
	gets the AcDbModelerGeometry subclass markers but an empty body, and
	ODA reports 'General modeling failure' on the AcDbRegion.

	Set num_blocks = i + 1 so the last block is kept (block_size[num_blocks]
	== 0 stays as the terminator). Fixes the two empty AcDbRegion(176) and
	AcDbRegion(37D) in test-data/example_2007.dwg.

	Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

2026-07-12  Reini Urban  <reini.urban@gmail.com>

	spec: rename ACSH_*_CLASS.bl92 field to method in ACSH shapes
	Renamed the DXF group code 92 BL field from the placeholder bl92
	to method in the ACSH_CHAMFER_CLASS, ACSH_FILLET_CLASS,
	ACSH_SWEEP_CLASS and ACSH_EXTRUSION_CLASS objects.

	* include/dwg.h: Renamed BITCODE_BL field.
	* src/dwg2.spec: Renamed FIELD_BL.
	* src/dynapi.c, src/dwg_api.c, include/dwg_api.h, doc/dynapi.texi:
	  Regenerated for the renamed field.
	* test/unit-testing/acsh_chamfer_class.c, acsh_fillet_class.c,
	  acsh_sweep_class.c, acsh_extrusion_class.c: Updated tests.
	* test/unit-testing/dynapi_test.c: Regenerated.

	Co-Authored-by: Kimi-k2.7 <kimi@moonshot.cn>

2026-07-12  Reini Urban  <reini.urban@gmail.com>

	spec: rename ACSH_CHAMFER_CLASS.bl95 field to base_face
	the face adjacent to the edge(s)

2026-07-12  Reini Urban  <reini.urban@gmail.com>

	3DSOLID: read/write ACIS wire color as BS, not BL
	The ACIS wireframe wires[].color field was read as a plain BL for
	R2004+. The common value 256 (BYLAYER) is encoded with the 2-bit code
	11, which bit_read_BL flags as 'unexpected 2-bit code' (it returns 256
	but the read/write is asymmetric: bit_write_BL(256) emits 32 bits, so
	a re-encoded object no longer matches the original).

	Read/write it as BS for all versions (as the pre-R2004 branch already
	did): bit_read_BS/bit_write_BS treat code 11 = 256 as a valid value,
	symmetrically (2 bits each way). Fixes 12 false errors on
	test-data/2004/Surface.dwg and the round-trip asymmetry, for the whole
	3DSOLID family (3DSOLID/REGION/BODY/surfaces). No regression.

2026-07-12  Reini Urban  <reini.urban@gmail.com>

	MLEADERSTYLE: promote to STABLE; in_dxf: handle plotstyle enum 380
	Promote MLEADERSTYLE from UNSTABLE to STABLE. The dwg2.spec was
	already complete, it was only skipped on DXF I/O. Regenerated
	dwg_api.c, dwg_api.h, dwg.h, dwg.i, objects.in/.c and classes.inc.

	Verified byte-identical MLEADERSTYLE round-trip (DWG->DXF->DWG->DXF)
	across all test-data DWGs/DXFs referenced in examples/alldwg.inc.

	in_dxf: handle common entity DXF code 380 (PlotStyleNameType enum:
	0 ByLayer, 1 ByBlock, 2 DictDefault, 3 ById). AutoCAD writes 380
	whenever the plot style is not a 390 handle; we only handled 390, so
	any entity with a ByLayer/ByBlock plot style failed the whole DXF
	decode with 'Invalid DXF code 380 for LINE'. The enum maps 1:1 to the
	DWG plotstyle_flags BB.

2026-07-12  Reini Urban  <reini.urban@gmail.com>

	ARC_DIMENSION: promote to STABLE, fix DXF I/O
	Promote ARC_DIMENSION from UNSTABLE to STABLE so it is no longer
	skipped on DXF import/export (classes.inc, classes.c, objects.in/.c).

	DXF export:
	- dwg2.spec: block handle DXF code 2 -> 0. The 2 emitted a duplicate
	  group-2 line; the block name is already written by
	  COMMON_ENTITY_DIMENSION.
	- dwg_spec_shared.h: add ARC_DIMENSION to the dimension flag calc
	  (flag |= 5), so code 70 exports as 37 matching ODA (was 32).

	DXF import (in_dxf.c): the AcDbArcDimension subclass reuses DXF codes
	70, 41, 71 that also appear in the earlier AcDbDimension subclass
	(flag, lspace_factor, attachment). The generic dynapi loop matches the
	first field by struct order, so those landed in the wrong fields. Add
	subclass-guarded handlers: 70 -> is_partial, 41 -> arc_end_param,
	71 -> has_leader. Guard the pre-R12 DIMENSION_ANG2LN upgrade switch so
	it does not fire for ARC_DIMENSION.

	DWG->DXF->DWG->DXF now round-trips byte-identical for the full entity
	incl. preview blob, across r2000-r2018.

2026-07-12  Reini Urban  <rurban@cpan.org>

	pi: regen pi with TV/TU changes

	pi: update for is_entity ENC or CMC

	pi: skip some overlarge ACAD_TABLE objects

	pi: update pi and log with hdlsize

	pi: add timed-out logs

	pi: add generated .pi and .pi.log files

2026-07-12  Reini Urban  <reini.urban@gmail.com>

	remove duplicate dead ACTION_3DSOLID code in dwg.spec
	it is in dwg_spec_shared.h

2026-07-12  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	decode: fix integer overflow in 3DSOLID block_size bounds check (GHSA-6v3v-3gmq-63v4)
	The check 'AVAIL_BITS(dat) > 8 * FIELD_VALUE(block_size[i])' has an
	unsigned 32-bit overflow: for block_size > 0x1FFFFFFF the multiplication
	wraps around and bypasses the bounds check, allowing a crafted DWG to
	drive heap corruption during decode that manifests as a double-free
	during dwg_free cleanup.

	Fix:
	- Cast to int64_t before multiplication
	- Add MAX_SIZE_TF (0xFFF0) upper bound, matching the encoder guard

	* src/dwg.spec (decode_3dsolid): fix overflow and add size cap
	* src/dwg_spec_shared.h (decode_3dsolid): same

	CWE-122, CWE-415
	Severity: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
	Reported-by: lcany

2026-07-11  Reini Urban  <reini.urban@gmail.com>

	spec: fix R11 HANDSEED to RLL_BE (GH #1304)
	AuxHeader.HANDSEED field is always 8 bytes. The old code
	always read/wrote 4 bytes plus a not-existing plot_stamp field,
	which together formed the full HANDSEED value.

	Reported-by: Michal Josef Špaček <michal.josef.spacek@gmail.com>

2026-07-11  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	Fix HANDSEED value in 2ndheader handles (GH #1303)
	The Dwg_SecondHeader_Handles struct lacked a value field,
	so the decoded handle bytes from the handle stream were never
	converted back to their BV handle value. The LOG_TRACE only
	dumped raw hex bytes, showing 10005 instead of 100000005.

	* include/dwg.h: Add BITCODE_HV value field to Dwg_SecondHeader_Handles.
	* src/decode.c (secondheader_private): Compute handle values from
	  raw big-endian bytes after the spec decode, and log the value.

	Reported-by: Michal Josef Špaček <michal.josef.spacek@gmail.com>

2026-07-06  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	fix stack-buffer-overflow READ in json_section_2ndheader
	GHSA-9g8v-9575-xgrf — num_hdl is signed char; a raw 0xFF
	byte decodes to -1, bypassing the >8 bounds check, then
	(unsigned)(-1) = 0xFFFFFFFF drives an unbounded read loop
	in dwg_write_json, leaking process memory into the output.

	* include/dwg.h (Dwg_SecondHeader_Handles.num_hdl): change type
	  from BITCODE_RCd (signed char) to BITCODE_RC (unsigned char).
	* src/2ndheader.spec: match the type change (SUB_FIELD_RCd -> RC).

2026-07-06  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	fix infinite loop in MLINESTYLE DXF writer with non-finite angles
	GHSA-46mp-4x39-p444 — converting a crafted DWG with non-finite
	start_angle/end_angle hangs dwg2dxf in an unbounded while loop.

	* src/dwg.spec (MLINESTYLE, IS_DXF): guard non-finite start_angle
	  and end_angle with isfinite, replace unbounded while loops with
	  fmod-based normalization.
	* src/dwg_api.c (dwg_geom_angle_normalize): add isfinite guard.

2026-07-06  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	encode: fix NULL-pointer dereference in remove_NOD_item
	GHSA-6q9w-j39m-jg37 — incomplete fix for GH #357 from 2022.

	* src/encode.c (remove_NOD_item): add missing itemhandles != NULL
	  guard to the first bounds check, matching the second check that
	  was added by the earlier incomplete fix in commit 065a3119.

2026-07-06  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	decode_preR13_entities: fix unbounded OOM from corrupt entities_end
	Fix GHSA-7625-26gc-xqvp — a crafted pre-R13 DWG with a corrupt
	entities_end larger than the file size drives an unbounded alloc
	loop in decode_preR13_entities.

	* src/decode.c (decode_preR13_entities): Always recalculate size
	  from clamped end, not only when size > end - start.
	  (decode_preR13_entities): Track per-iteration position with
	  iter_start instead of comparing against pre-loop oldpos, so the
	  no-advance guard works beyond the first entity.

2026-07-04  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	Reject files too small for DWG header (< 6 bytes) before decode
	* src/dwg.c (dwg_read_file): Check bit_chain.size >= 6 before
	  calling dwg_decode.  A 0-byte file slipped through and entered
	  decode_R13_R2000, potentially causing undefined behavior.

2026-07-04  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	Skip classes section when too small (< 30 bytes)
	* src/decode.c (decode_R13_R2000): Add minimum size check for
	  classes section.  A 1-byte section with a corrupt size field
	  matching unsigned underflow slipped through the existing check
	  and entered an unbounded class decode loop.

	Fixes oss-fuzz 530086146

2026-07-04  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	Add OOM/loop guards for corrupt DWG input
	* src/bits.c (CHK_OVERFLOW): In DWG_ABORT mode, detect consecutive
	  overflow errors at the same position and abort after 100 repeats
	  to prevent infinite buffer growth via bit_chain_alloc.
	* src/decode.c (decode_R13_R2000): Cap class count at 65535 to
	  prevent OOM with corrupt class section size.

	Fixes oss-fuzz 530086146 and GH #1301

2026-07-03  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	Fix null-deref in encode_preR13_section when entries is NULL
	* src/encode.c (encode_preR13_section): Add _bctrl->entries NULL
	  check before accessing _bctrl->entries[i].
	  Fixes oss-fuzz 530086151 / clusterfuzz 6442428077506560

	Add angle_normalize, replace unbounded angle while loops
	* src/geom.c (angle_normalize): New function normalizing angle to
	  [0, 2*PI) with inf/nan/denormal safety via fmod.
	  (arc_split): Use angle_normalize instead of unbounded while loops.
	* src/geom.h: Declare angle_normalize.
	* src/out_geojson.c (ARC handler, ELLIPSE handler): Replace
	  unbounded while (angle < 1e-6) loops with angle_normalize.
	  Fixes potential infinite loops with inf/large values.
	  Fixes oss-fuzz 530576161 (hang)

	dxf: Fix null-deref in dwg_dxfb_PROXY_ENTITY
	* src/dwg.spec: Guard DXF objids loop with _obj->objids NULL check.
	  PROXY_ENTITY can have num_objids > 0 but objids == NULL,
	  causing a SEGV at _obj->objids[rcount1].
	  Fixes oss-fuzz 530762732 / testcase 6079304832974848

2026-07-02  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	Fix two ASAN fuzzer crashes in dxf --as
	* src/decode.c (dwg_fixup_BLOCKS_entities): guard ARGS_REF(hdl) against
	  NULL _obj->entities[j] entries.  Move all declarations to block top
	  (C90), then check if (!hdl) continue before any dereference.
	  Fixes SEGV for r1.4 through r2000 with input-16.dwg.
	* src/out_dxf.c (dxf_cvt_blockname): add strlen(name) >= 12 guard
	  before memcmp(name, "$PAPER_SPACE", 12) and the *Paper_Space
	  variant.  Fixes heap-buffer-overflow reading 12 bytes from a
	  10--11 byte block name allocated by bit_convert_TU, seen with
	  r2004+.

	Expand header_variables FREE block with all TV fields
	* src/free.c (dwg_free): Call both dwg_free_preR13_header_vars and
	  dwg_free_header_vars unconditionally instead of routing by version.
	  Programs change dwg->header.version before dwg_free, so version-based
	  routing calls the wrong free function.  (dwg_free_header_vars): Add
	  explicit FREE_IF calls for HYPERLINKBASE, STYLESHEET,
	  FINGERPRINTGUID, VERSIONGUID, PROJECTNAME, DIMPOST, DIMAPOST,
	  DIMBLK_T, DIMBLK1_T, DIMBLK2_T that are allocated by
	  IF_ENCODE_FROM_EARLIER strdup during encode.
	* src/header_variables.spec: Expand FREE block with all TV fields.
	  Add HYPERLINKBASE, STYLESHEET, FINGERPRINTGUID, VERSIONGUID,
	  PROJECTNAME, DIMPOST, DIMAPOST, DIMBLK_T, DIMBLK1_T, DIMBLK2_T, MENU
	  to the FREE block.
	  Fixes ASAN leaks in dwg_encode_header_variables when IF_ENCODE
	  strdup's empty strings for NULL TV fields.
	* src/header_variables_r11.spec: Add FREE block for unit1-4_name;
	  expand DECODER block to free unit2-4_name.

	Fix dwg_free routing: use from_version not version
	* src/free.c (dwg_free): Use dwg->header.from_version (the original
	  file version) to decide whether to call dwg_free_preR13_header_vars
	  or dwg_free_header_vars.  Programs like dwg2dxf and dwgrewrite
	  change dwg->header.version to the output version before dwg_free,
	  causing the wrong free function to run and leaking header TV fields.
	  Fixes ASAN leak in bit_read_TV from dwg_decode_header_variables.

	Fix memory leak in header_variables FREE: add missing unit2-4_name frees
	* src/header_variables.spec, src/header_variables_r11.spec: FREE block
	  only freed unit1_name but unit2_name, unit3_name, unit4_name are
	  also allocated via FIELD_TV during decode. Add the three missing FIELD_TV frees.
	  Found via ASAN on clusterfuzz-testcase-minimized-llvmfuzz-4534090775461888.dwg

2026-07-02  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	encode: fix heap-buffer-overflow in preR13 section header encoding
	Two dwg version conversion bugs caused uninitialized section table
	entries, leading to a heap-buffer-overflow in LOG_TRACE when printing
	tbl->name via %s.

	1. dwg_sections_init used realloc to grow the section array but
	   never zeroed the new entries.  Switch to free+calloc so every
	   entry starts zeroed.

	2. encode_check_num_sections extended the array with realloc then
	   memset only zeroed the hole between STYLE and LTYPE (index 4),
	   missing the newly added entries at indices 5+.

	   The memset count was id+1-num_sections when it should cover all
	   new entries: id+2-(num_sections-1).

	* src/dwg.c (dwg_sections_init): Replace realloc with free+calloc.
	* src/encode.c (encode_check_num_sections): Fix memset length.

2026-07-02  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	encode: fix heap-buffer-overflow in eed/xdata TU conversion
	The fuzzer found a heap-buffer-overflow at src/encode.c:6861 in
	dwg_encode_eed_data and at line 7612 in dwg_encode_xdata.

	bit_utf8_to_TU allocates its result buffer with calloc(strlen(str)+1, 2),
	but the callers iterated dest[j] up to a separately-stored length field
	(data->u.eed_0.length / rbuf->value.str.size).  When a fuzzer-supplied
	input contains an embedded NUL byte, strlen() returns less than that
	stored length, the TU buffer is undersized, and the loop reads past the
	heap allocation.

	Fix by clamping the loop bound to the actual strlen at both sites.
	For valid data the clamp is a no-op; for corrupted inputs it prevents
	the OOB access.

	* src/encode.c (dwg_encode_eed_data): Guard length against strlen.
	  (dwg_encode_xdata): Likewise.

2026-07-02  Reini Urban  <reini.urban@gmail.com>

	llvmfuzz: extend
	allow versions for all outputs. print proper usage

2026-07-01  Reini Urban  <reini.urban@gmail.com>

	decode: fix heap-buffer-overflow WRITE in decompress_R2004_section (GHSA-qg2f-8389-w95j)
	`read_2004_compressed_section` allocates `dec.chain` as
	`calloc(max_decomp_size, 1)` with `dec.size = max_decomp_size`.
	Inside the per-section loop it overwrote `dec.size` with the smaller
	value `dec.byte + info->max_decomp_size`.  `bit_chain_alloc_size`
	assumes `dat->size == capacity(dat->chain)` and reallocs to
	`dat->size + CHAIN_BLOCK`; because `dec.size` was reset to a much
	smaller number the realloc physically shrinks the live buffer while
	`dec.byte` and `dec.size` keep tracking the larger logical stream.
	The existing bounds guard in `decompress_R2004_section`
	(`end > dec->size`) passes because `dec->size` itself is the shrunken
	(but still larger than the real allocation) value, so the copy lands
	past the shrunk allocation — a heap-buffer-overflow WRITE of up to
	several kilobytes.

	The CVE-2026-9501 guard (commit e501cb99) was structurally unable to
	detect this: it validated against the same `dec->size` that drove the
	shrink.

	Fix: remove the per-section `dec.size` assignment.  `dec.size` stays
	pinned to `max_decomp_size` (the true allocation) for the entire
	decompression lifetime.  The pre-loop guard already asserts
	`es.fields.address + info->max_decomp_size <= max_decomp_size`, so
	the bounds check in `decompress_R2004_section` (`end > dec->size`)
	remains correct and sufficient.  `bit_chain_alloc` can now only grow
	the buffer, never shrink it.

	Fixes GHSA-qg2f-8389-w95j. Related: #1180 #1239 #1243 #1251 #1254.
	Vuln: CWE-122
	CVE requested.
	Severity: 6.7/10 Moderate
	CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

	* src/decode.c (read_2004_compressed_section): remove dec.size override
	  inside the per-section loop.

	Reported-by: yPin9 <ypp0x7@gmail.com> Taipeh
	Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

2026-07-01  Reini Urban  <reini.urban@gmail.com>

	bits: fix UBSan negation overflow in bit_read_MC
	BITCODE_UMC is uint64_t, so the 5-byte modular-char accumulator can
	hold 35 bits.  The old guard `result == 0x80000000` only caught the
	exact case where the lower 32 bits were 0x80000000 with no upper bits
	set.  Values such as 0x180000000 pass the guard, truncate to INT32_MIN
	on the `(BITCODE_MC)result` cast, and then negating INT32_MIN is
	undefined behaviour (UBSan: "negation of -2147483648 cannot be
	represented in type 'int'").

	Fix: replace the point check with `result > INT32_MAX`.  Any magnitude
	exceeding INT32_MAX cannot be safely round-tripped through int32_t
	negation, so go to the existing err_mc error path instead.
	Fixes ossfuzz 444908414 (and GH #1153 again)

	* src/bits.c (bit_read_MC): use result > INT32_MAX guard.

	Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

2026-07-01  Reini Urban  <reini.urban@gmail.com>

	in_dxf: fix double-free of dxfname in dxf_blocks_read
	After calling new_object(), the caller's dxfname may already have been
	freed by UPGRADE_ENTITY inside new_object (which frees obj->dxfname,
	which aliases the caller's dxfname, and sets only the local variable to
	NULL). Without NULLing the caller's dxfname, the subsequent
	`free (dxfname)` in the error path double-frees the pointer.

	The other two new_object call sites in dxf_entities_read (line ~13934)
	and dxf_blocks_read (line ~14026) already had this guard; the blocks
	loop at ~13605 was missing it.

	Reported by oss-fuzz (testcase 5692626108743680, heap-double-free in
	dxf_blocks_read).

	* src/in_dxf.c (dxf_blocks_read): set dxfname = NULL after new_object.

	Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

2026-07-01  Reini Urban  <reini.urban@gmail.com>

	out_json: fix heap-buffer-overflow reading unknown_rest/unknown_bits
	The bits-to-bytes rounding used the wrong mask (& 8 instead of & 7),
	over-counting num_bytes by one whenever num_unknown_bits/rest was a
	multiple of 8 with bit 3 set (8, 24, 40, ...). VALUE_BINARY then read
	one byte past the calloc'd buffer.

	Triggered by a preR13 LOAD entity whose decode_preR13_entities size
	mismatch allocated a 1-byte unknown_rest (num_unknown_rest = 8 bits):
	the JSON writer computed 2 bytes and over-read. Reported by oss-fuzz
	(GH testcase 4506072807964672, heap-buffer-overflow READ 1 in
	dwg_json_LOAD_private).

	* src/spec.h (UNKNOWN_BITS_REST, HANDLE_UNKNOWN_BITS): & 8 -> & 7.
	* src/out_json.c (dwg_json_variable_type): same fix in the >500
	  variable-type fallback.

	Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

2026-06-30  Reini Urban  <reini.urban@gmail.com>

	geojson: fix empty basename when ext is set by file resolution
	When a bare name like example_2000 was resolved to example_2000.dwg
	via the test-data lookup, ext was set but b (the basename) was never
	computed — the old code only set b inside the if [ -z "$ext" ] block,
	which was skipped.  Output would land in .geojson instead of
	example_2000.geojson.

	* geojson.in: always compute b and ext from the resolved filename,
	  replacing the dead if [ -z "$ext" ] block.

2026-06-30  Reini Urban  <reini.urban@gmail.com>

	out_geojson: fix SPLINE null deref crash from fuzzer
	The fuzzer produced a malformed DWG where fit_pts or ctrl_pts
	was NULL despite a positive count, causing SEGV at offset 0x10
	(= Dwg_SPLINE_control_point.y from NULL base).

	* src/out_geojson.c (SPLINE handler): null-check fit_pts and
	  ctrl_pts pointers before dereference. Use use_fit_pts flag
	  to avoid re-checking the count.

	CIFuzz crash: https://github.com/LibreDWG/libredwg/actions/runs/28442910269

2026-06-30  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	out_geojson: add arc/circle/ellipse/spline entity support
	Fix ARC and CIRCLE segment count (was inverted), add ELLIPSE polygon
	approximation and SPLINE fit-point LineString output.

	* src/out_geojson.c:
	  - Add calc_curve_segments helper using LIMMAX-LIMMIN zoom factor,
	    similar to circle.js approach: steps ~ sqrt(radius/extent).
	  - Fix ARC: inverted num_pts formula (viewres/rad2deg -> dynamic).
	    Full circles previously got only 2 points; now 16-256.
	  - Fix CIRCLE: replace hardcoded 120 with dynamic segment count.
	  - Add DWG_TYPE_ELLIPSE handler: parametric polygon approximation.
	  - Add DWG_TYPE_SPLINE handler: LineString from fit_pts or ctrl_pts.
	  - Pass Dwg_Data pointer through dwg_geojson_object for header access.

	Implements GH #1206

2026-06-30  Reini Urban  <reini.urban@gmail.com>

	fix heap-buffer-overflow in TRACE_DD (oss-fuzz #42531271)
	The TRACE_DD macro in dec_macros.h had a bounds check that only
	logged an error but continued to read from dat->chain at the
	overflowed position, causing a heap-buffer-overflow READ 1 in
	dwg_decode_INSERT_private when processing a truncated DWG input.

	Fix: wrap the chain read in an else block so it is skipped when
	the bounds check fires.  Also initialize result=0 to avoid using
	uninitialized stack in the error path.

	Fixes oss-fuzz issue 42531271 / testcase 4549377972371456.
	GH #1203

	* src/dec_macros.h (TRACE_DD): Guard chain read with else, init result.

2026-06-29  Reini Urban  <reini.urban@gmail.com>

	escape: Improved htmlwescape/htmlescape
	grow only only on demand. Can only fail on OOM now.
	See PR #1302

2026-06-29  Reini Urban  <reini.urban@gmail.com>

	escape: bounds-check htmlwescape/htmlescape
	Manully improved bad automated security fix generated by OrbisAI Security

	Each HTML entity substitution now checks that the write fits within the
	allocated buffer before calling memcpy, jumping to a done label if not.
	Uses the existing end pointer in htmlescape; adds an equivalent end
	pointer to htmlwescape and keeps it updated across realloc calls.

	Also replaces sprintf with snprintf for the &#xNN; fallback path.

	See PR #1302
	Co-Authored-By: orbisai0security <mediratta01.pally@gmail.com>
	Bad AI code, manually improved.
	Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

2026-06-29  Reini Urban  <reini.urban@gmail.com>

	Update NEWS for not yet assigned CVE's

2026-06-29  Reini Urban  <reini.urban@gmail.com>

	Fix memory leak in DXF import error path
	Fixes oss-fuzz issue 5463457726791686.  When new_object() failed
	(invalid_dxf or other early return), the partially-constructed
	object remained in dwg->object[] with dynamically-allocated
	string fields set by dynapi_set_helper(), leaking memory.

	Clean up by calling dwg_free_object() and decrementing
	dwg->num_objects.  Initialize obj=NULL to guard the error path
	against early failures before object creation.

	* src/in_dxf.c (new_object): Initialize obj to NULL.
	  (invalid_dxf): Add fail: label for cleanup without pair-free.
	  Free partially-constructed object via dwg_free_object() and
	  decrement dwg->num_objects.
	  Replace bare return NULL with goto invalid_dxf or goto fail.

2026-06-29  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	Fix OOM/heap-overflow in pre-R13 section address loop
	Fixes oss-fuzz issue 527085540, testcase 6588975733866496.

	A corrupt DWG header with numheader_vars=65535 inflated
	dwg->header.num_sections far beyond SECTION_VX (11),
	causing the section address patching loop to iterate up
	to 65535 iterations.  Each iteration called
	bit_write_RL with a garbage address, triggering unbounded
	bit_chain_alloc (OOM) or LOG_TRACE reading past the
	allocated section array (heap overflow).

	* src/encode.c (dwg_encode): Cap the pre-R13 section address loop
	  upper bound to SECTION_VX.

2026-06-29  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	automake: fix mingw build for iconv.m4
	The automake bump to 18 broke the mingw autotools link by putting the
	full library path @LIBICONV@ (e.g. /mingw64/lib/libiconv.dll.a)
	in libredwg_la_LDFLAGS.  libtool mistook the .dll.a import
	library for a static archive and could not link it, producing
	undefined references to libiconv_open, libiconv_close, etc.

	Move -lm and @LIBICONV@ from LDFLAGS to LIBADD where library
	dependencies belong in libtool convention.

	Fixes GH #1203

	* src/Makefile.am (libredwg_la_LDFLAGS): Drop -lm and @LIBICONV@.
	  (libredwg_la_LIBADD): New variable with -lm and @LIBICONV@.

2026-06-29  Reini Urban  <reini.urban@gmail.com>

	automake: bump to latest 18
	as with `sh autogen.sh`

2026-06-28  Reini Urban  <reini.urban@gmail.com>

	fix perl bindings for out-of-tree builds
	- dwg.i: change #include "../src/config.h" to "config.h"
	  The build passes -I via OPTIMIZE, so the pathless include works
	  in both in-tree and out-of-tree builds.

	- Makefile.am: add -lredwg to OTHERLDFLAGS
	  OTHERLDFLAGS comes after the object file in the link command,
	  avoiding the --as-needed discard that happened when -lredwg
	  was in LDDLFLAGS (before the object).

	- Makefile.PL.in: use LIBS for -lredwg instead of LDDLFLAGS
	  LIBS generates LDLOADLIBS which comes after the object,
	  fixing the link-order issue for in-tree builds.  Also drop
	  the stale #LIBS comment.

2026-06-28  Reini Urban  <reini.urban@gmail.com>

	llvmfuzz: cap input size at 10MB to prevent OOM/timeout
	Add a hard size limit on fuzzer inputs to prevent out-of-memory
	and timeout conditions when oss-fuzz feeds very large inputs.
	10MB is generous for DWG/DXF/JSON testcases.

	Addresses ossfuzz issues 527085540 (OOM) and 528659158 (Timeout).

	        * examples/llvmfuzz.c (LLVMFuzzerTestOneInput): Return 0 for
	        inputs larger than 10 MB.

2026-06-28  Reini Urban  <reini.urban@gmail.com>

	in_json: fix NULL-deref and operator precedence in in_hex2bin unknown_bits
	json_string may return NULL when the JSON token has no string value.
	Check hex for NULL before passing to in_hex2bin, which requires a
	non-null src argument (declared __nonnull).  Also check buf for
	allocation failure.  Fix operator precedence: (= vs !=) so read
	carries the actual decoded length, not a boolean.

	Fixes ossfuzz issue 42531515 (Null-dereference READ in in_hex2bin).

	        * src/in_json.c (json_OBJECTS): Add NULL guard for hex and
	        buf before in_hex2bin call.  Fix operator precedence.

2026-06-28  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	UPGRADE_ENTITY: fix double-free when macro frees dxfname
	UPGRADE_ENTITY calls free(obj->dxfname) which aliases the dxfname
	parameter of new_object (via ADD_ENTITY setting obj->dxfname = dxfname).
	After the free, the dxfname parameter still points to freed memory,
	causing a double-free in subsequent error-path free(dxfname) calls.
	Set dxfname = NULL after the free so those later free()s become safe
	no-ops.

	Fixes ossfuzz issue 528859714 (double-free in dxf_entities_read via
	UPGRADE_ENTITY DIMENSION_ANG2LN -> DIMENSION_LINEAR upgrade).

	        * src/in_dxf.h (UPGRADE_ENTITY): Set dxfname = NULL after
	        free(obj->dxfname)

2026-06-28  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Flash  <deepseek@deepseek.com>

	encode_preR13_section: guard null entries in PREP_CTRL macro
	Corrupted STYLE_CONTROL objects can have entries pointer NULL while
	num_entries is non-zero.  Accessing _ctrl->entries[0] without the
	guard causes a NULL dereference.

	Guard with check for _ctrl->entries before dereferencing.

		* src/encode.c (PREP_CTRL macro): Check _ctrl->entries
		before dwg_ref_object call.

2026-06-28  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Flash  <deepseek@deepseek.com>

	dxf_entities_read: fix double-free when new_object frees dxfname
	UPGRADE_ENTITY macro calls free(obj->dxfname) which frees the
	dxfname pointer passed to new_object.  If new_object then returns
	NULL, the caller tries to free(dxfname) again -> double-free.

	Fix both call sites: dxf_entities_read and dxf_objects_read (also
	a nested function).  Set dxfname = NULL after new_object returns
	so the error-path free(dxfname) becomes a safe no-op.

	Add clang-format off/on guards around the nested functions to
	prevent clang-format from breaking the nested function syntax.

	Fixes ossfuzz issue in indxf/5483090964185088.dxf.

		* src/in_dxf.c (dxf_entities_read): Set dxfname = NULL
		after new_object call.
		(dxf_objects_read): Same fix.
		Add clang-format guards around nested functions.

2026-06-28  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Flash  <deepseek@deepseek.com>

	json_OBJECTS: guard negative tag size from corrupt token positions
	Corrupted JSON input can produce jsmn tokens with end < start,
	making int sz = t->end - t->start negative.  This caused
	malloc(sz+1) to allocate a tiny buffer and tag[sz] to access
	before it, triggering UBSan's negate-overflow trap.

	Move the sz <= 0 check before malloc/tag[sz] to prevent the UB.

	Also guard tokens->index-- on the harderr/typeerr error paths
	with if (tokens->index) to prevent unsigned wrap.

	Fixes oss-fuzz issue 42531515, testcase 5785304774541312
	(Null-dereference READ in in_hex2bin).

	        * src/in_json.c (json_OBJECTS): Guard negative tag size.
	        Guard tokens->index-- underflow on error paths.

2026-06-28  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Flash  <deepseek@deepseek.com>

	json_OBJECTS: guard tokens->index underflow on malformed JSON
	Malformed JSON input can cause jsmn tokenizer to produce tokens
	that leave tokens->index at 0 when the error path decrements it.
	Decrementing unsigned 0 wraps to UINT_MAX, triggering UBSan's
	negate-overflow check.

	Guard both harderr and typeerr paths with if (tokens->index) before
	decrementing.

	Fixes oss-fuzz issue 42531515, testcase 5785304774541312
	(Null-dereference READ in in_hex2bin, actually a UBSan trap in
	json_OBJECTS).

		* src/in_json.c (json_OBJECTS): Guard tokens->index-- in
		harderr and typeerr error labels.

2026-06-27  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Flash  <deepseek@deepseek.com>

	Fix OOM/timeout from unbounded bit_chain_alloc loops in write functions
	Extend the while-to-if + early-return hardening from bit_write_RC
	to all other write functions that can loop unboundedly on a
	corrupted write position (set by dwg_encode seeking to a garbage
	section address):

	bit_write_B, bit_write_BB, bit_write_TF, bit_write_TFv,
	bit_copy_chain.

	All follow the same pattern: if the initial alloc (of 4KB via
	bit_chain_alloc or of the exact needed size via
	bit_chain_alloc_size) does not bring the buffer size past the write
	position, return early instead of looping forever or allocating
	terabytes.

	Fixes ossfuzz 527085540, clusterfuzz-testcase-minimized-llvmfuzz-6588975733866496

		* src/bits.c (bit_write_B): Add overflow guard.
		(bit_write_BB): Add overflow guard.
		(bit_write_TF): Add overflow guard.
		(bit_write_TFv): Add overflow guard.
		(bit_copy_chain): Change while to if, add overflow guard.

2026-06-27  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Flash  <deepseek@deepseek.com>

	Fix UBSan SIGILL in Ref_cmp function pointer cast and infinite alloc loop in bit_write_RC
	The OSS-Fuzz issues 528659158 and 527085540, testcases
	clusterfuzz-testcase-minimized-llvmfuzz-{4679250872172544,6588975733866496}.dwg
	crashed with two different issues:

	1. SIGILL in bsearch: Ref_cmp had a non-standard signature
	   (const Dwg_Object_Ref *, const Dwg_Object_Ref **) but was cast to
	   (int (*)(const void *, const void *)) when passed to bsearch and
	   bsearch_ex.  UBSan's __ubsan_handle_function_type_mismatch traps
	   this incompatible function pointer cast with ud1.  Fix by changing
	   Ref_cmp to the standard bsearch-compatible signature and doing the
	   casts internally.  Remove the now-unnecessary casts at the callers.

	2. Timeout in dwg_encode: the corrupted R_10 file has a garbage
	   tbl->address in a section header.  dwg_encode seeks dat->byte to
	   this huge position and then calls bit_write_RL, which hits the
	   while (dat->byte >= dat->size) loop in bit_write_RC.  The loop
	   keeps allocating 4KB pages (MAX_MEM_ALLOC is 1TB, so up to ~268M
	   iterations).  With ASAN's slow realloc this hangs for 60+ seconds.
	   Fix by changing while to if in bit_write_RC and adding a post-alloc
	   guard that returns early when the buffer is still too small.

		* src/dwg.c (Ref_cmp): Change signature to
		int (const void *, const void *), with internal casts.
		(ordered_ref_add): Remove function-pointer cast at bsearch_ex call.
		(ordered_ref_find): Remove function-pointer cast at bsearch call.
		* src/bits.c (bit_write_RC): Change while to if, add overflow
		guard with early return.

2026-06-27  Reini Urban  <reini.urban@gmail.com>

	Optimize ordered_ref_find
	only bsearch for > 4 refs
	See ossfuzz 528659158

2026-06-27  Reini Urban  <reini.urban@gmail.com>

	Release 0.14
	Updated manpage dates, ChangeLog and NEWS.
	Added dwgfuzz --help and --version for dwgfuzz.1
	Fix build-aux/release.sh

2026-06-27  Reini Urban  <reini.urban@gmail.com>

	fix: MB_LEN_MAX cross-compilation error for aarch64
	GCC internal limits.h defines MB_LEN_MAX=1, but glibc's bits/wchar2.h
	requires MB_LEN_MAX=16. Add the same guard already present in bits.h to
	codepages.h, before including <wchar.h>.

	* src/codepages.h: guard MB_LEN_MAX before <wchar.h> include

2026-06-26  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	spec: un-union MLINESTYLE_line.lt
	The lt field was a union of index (BSd, pre-2018) and ltype (H, post-2018).
	When add_MLINESTYLE_lines set lt.index from a DXF code 6 value,
	lt.ltype would contain garbage (0x3), causing dwg_free_MLINESTYLE_private
	to dereference it as a pointer → SEGV. Too fragile.

	Change lt.index→lt_index and lt.ltype→lt_ltype as separate fields.
	Affects dwg.spec, in_dxf.c, dwg.c, dwg_api.c, gen-dynapi.pl, dynapi.c,
	dwg.h, and dynapi.texi.

	Fixes ossfuzz 42533974

2026-06-26  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	indxf: Fix ossfuzz 42536446 and 42535236
	- Fix SEGV in add_HATCH: CHK_fitpts macro now checks for NULL fitpts
	  pointer and frees it on error (#42536446). Also add NULL check after
	  xcalloc for fitpts in code 97 handler.

	- Fix double-free in dxf_entities_read: new_object type-change code
	  now does not free caller's dxfname. The caller handles cleanup
	  on failure (#42535236).

2026-06-26  Reini Urban  <reini.urban@gmail.com>

	encode: Fix global-buffer-overflow in section_move_before
	Fixes oss-fuzz issue 528059079.  The attacker-controlled
	dwg->header.num_sections could exceed SECTION_R13_SIZE (7), causing
	memmove in section_move_before to read past the section_order[]
	array.  Cap *pnum at entry to all section_order helper functions.

	* src/encode.c (section_move_top, section_find, section_remove,
	  section_move_before): Clamp *pnum to SECTION_R13_SIZE to prevent
	  OOB reads/writes on the section_order array.

2026-06-26  Reini Urban  <reini.urban@gmail.com>

	Fix assertion and leaks in --as=r2004 encoding path
	Fix assertion dat->byte <= 0x140 that fails when encoding R2018→R2004.
	The VERSIONS(R_13b1,R_2004) block writes legacy section data to the
	main dat chain before old_dat is saved, advancing dat->byte far past
	320 bytes.  Replace hardcoded version-specific bounds with the real
	invariant: dat->byte < dat->size.
	GH #1091

	* src/encode.c (dwg_encode): Replace PRE/LATER_VERSIONS assert bounds
	  0x100/0x140 with dat->byte < dat->size.
	  Free orphaned section_info[i].sections before reducing num_desc
	  during encode to prevent leak on re-read.

	* src/decode.c (read_R2004_section_info): Free info->sections before
	  calloc to prevent leak on re-decode.

2026-06-26  Reini Urban  <rurban@cpan.org>

	free: fix double-free in free_TABLESTYLE_r2010 on downconvert
	downconvert_TABLESTYLE shallow-copies the r2010+ cellstyle text_style
	handle and the content_color/bg_color name strings into rowstyles[0].
	free_TABLESTYLE_r2010 then freed those aliases while the spec free
	(dwg_free_TABLESTYLE) frees the same originals, double-freeing them when
	an r2010+ TABLESTYLE is re-encoded down to <= r2007.

	PR GH #1298, but rewritten.
	Reported-by: Saddam <saddamr3e@gmail.com>

2026-06-25  Reini Urban  <reini.urban@gmail.com>

	dxf: unify TU xref name checks on native 2-byte wchar_t platforms
	Remove the remaining HAVE_NATIVE_WCHAR2 special cases in
	out_dxf.c (dxf_is_xrefdep_name and dxf_has_xrefdep_vertbar).  Both
	helpers now always convert the TU string to UTF-8 via bit_convert_TU
	and search for the ASCII "$0$" / "|" markers there.

	The previous native wcsstr()/wcschr() paths happened to work because
	the search targets are ASCII, but they kept a divergent platform-only
	code path next to the portable UTF-8 fallback.  JSON output already
	received a similar cleanup for GH #655; apply the same philosophy to
	DXF.
	See GH #655

	Co-Authored-By: Kimi-k2.7 <kimi@moonshot.cn>

2026-06-25  Reini Urban  <reini.urban@gmail.com>

	json: fix blank/garbled r2007+ unicode text on Windows (GH #655)
	On native 2-byte wchar_t platforms (HAVE_NATIVE_WCHAR2, e.g. Windows)
	the JSON UTF-16 output path went through wcquote() + fprintf("%ls").
	"%ls" converts the wide string to the C locale's narrow multibyte
	encoding via wcrtomb(), which under the default "C" locale truncates
	at the first non-ASCII character.  For r2007+ strings starting with a
	non-ASCII codepoint (Cyrillic, Korean, U+0192 ...) this emitted an
	empty "text_value", and for Western text it produced non-UTF-8 bytes.

	JSON must always be UTF-8 regardless of platform locale, so always use
	the manual UTF-16->UTF-8 emitter print_wcquote().  GH #655.

	* src/out_json.c (VALUE_TEXT_TU): always expand to print_wcquote.
	  (print_wcquote): compile unconditionally.
	  (wcquote): removed, no longer used.
	* NEWS: mention the fix.

	Reported-by: Gian Maria Gentilini <<gentilinigm@users.noreply.github.com>>
	Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

2026-06-25  Reini Urban  <reini.urban@gmail.com>

	bits: check unchecked realloc in bit_write_TV
	On DWG_OPTS_INJSON conversion the destination buffer was grown with an
	unchecked realloc.  On failure this leaked the old buffer and passed NULL
	back into bit_utf8_to_TV, causing a null-deref crash.

	* src/bits.c (bit_write_TV): Capture realloc result in a tmp, on OOM log
	  the error, free the old buffer, set length to 0 and break out cleanly.
	  The grown buffer is only adopted when non-NULL.  Also set loglevel
	  before the adjacent malloc-failure LOG_ERROR so it is not suppressed.

	Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

2026-06-25  Saddam  <saddamr3e@gmail.com>

	Fix UBSan pointer-overflow in bsearch_ex on empty array

2026-06-25  Reini Urban  <reini.urban@gmail.com>

	AGENTS: add gortex support

2026-06-25  Reini Urban  <reini.urban@gmail.com>

	indxf: make VIEWPORT.frozen_layers dxf group code version dependent
	The 341 -> 331 group code change matches the handle type change
	from hard pointer to soft pointer.
	So the dxf codes must be dependent on the version and handle type.

	Also fix the dynapi for injson, and the indxf case.
	test-case:
	../dxf-check ../to/2010/from_knowledge.autodesk.com/plot_screening_and_fill_patterns.dwg
	haven't fund any pre-2004 VIEWPORT.frozen_layers in the wild.

2026-06-25  Emptyset110  <21324784@qq.com>

	dxf: VIEWPORT frozen_layers use DXF group code 331, not 341
	AcDbViewport per-viewport frozen-layer handles are soft-pointer
	references; the DXF reference assigns them group code 331. dwg.spec
	emitted them as 341 (hard-pointer band, like the adjacent
	clip_boundary=340), so dwg2dxf output is read as having no
	per-viewport frozen layers by spec-conformant parsers (ezdxf,
	AutoCAD). DWG decode and -O JSON were unaffected (they key on the
	field name), which hid it from the symmetric round-trip. Verified:
	SW049 sheet 260 now reads its 9 frozen layers via ezdxf, matching
	dwgread -O JSON.

2026-06-24  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	decode: demote missing AppInfo section from ERROR to INFO
	* src/decode.c (read_2004_section_appinfo): treat missing AppInfo
	  section as non-critical, matching read_2004_section_appinfohistory
	  and the r2007 decoder.  AppInfo is optional; its absence should not
	  propagate DWG_ERR_SECTIONNOTFOUND into the cumulative error result.

2026-06-24  Reini Urban  <reini.urban@gmail.com>

	Fix global-buffer-overflow in section_move_top insert
	Fix ASAN global-buffer-overflow WRITE when section_move_top
	inserts with *pnum >= SECTION_R13_SIZE, causing memmove to write
	past psection_order[7].  The UBSan index-out-of-bounds fix
	(0ff2bb926) only guarded the switch; this guards the array write.

	* src/encode.c (section_move_top): Refuse insert and return -1
	  when *pnum >= SECTION_R13_SIZE instead of asserting.

2026-06-24  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	Fix null-dereference WRITE in bit_write_TV on OOM
	Fix ossfuzz 524392897: when malloc fails in
	bit_write_TV JSON-to-codepage conversion, dest is NULL and
	bit_utf8_to_TV writes to it.

	* src/bits.c (bit_write_TV): Check dest for NULL after malloc,
	  log error and set length=0 on failure.

2026-06-24  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	Fix null-dereference in dwg_encode_handleref_with_code
	Fix ossfuzz 524854787: null dereference of BITCODE_H
	(Dwg_Object_Ref *) when corrupt DWG has null handle fields
	(e.g. BLOCK_HEADER.block_entity or endblk_entity).
	Add null guard for ref and obj.

	* src/encode.c (dwg_encode_handleref_with_code): Return early
	  if ref or obj is NULL.

2026-06-24  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	Fix UBSan index-out-of-bounds in section_order switch
	Fix ossfuzz 524832524 again: UBSan catches section_order[id]
	with sentinel value SECTION_R13_SIZE (7) indexing into the switch
	jump table of 7 entries (enum values 0-6).  Wrap the switch in a
	bounds check so the sentinel hits the LOG_WARN path instead.

	* src/encode.c (dwg_encode): Guard section_order switch with
	  section_order[id] < SECTION_R13_SIZE check.

2026-06-24  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	Fix heap-buffer-overflow WRITE in dwg_encode_add_object overlarge MS
	Fix ossfuzz 526016910: OOB write when an object's size
	changes from <=0x7fff to >0x7fff during encode.  The memmove shifts
	obj->size+3 bytes right by 2, ending at dat->byte+obj->size+5,
	but the bit_chain_alloc_size guard only reserved +4 extra bytes.

	* src/encode.c (dwg_encode_add_object): Reserve +5 bytes instead
	  of +4 for the overlarge MS size memmove.

2026-06-24  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	Fix heap-buffer-overflow in cquote for truncated \M+ sequence
	Fix ossfuzz issue 525088817: OOB read when a header string
	ends with a truncated \M+ escape.  memBEGINc only checks 2 chars
	but s[3] and sscanf(&s[3]) need 7.

	* src/out_dxf.c (cquote): Add source-buffer check s + 6 < send
	  before accessing the \M+nXXXX sequence.

2026-06-24  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	Fix infinite loop in decode_preR13_entities corrupt R11 DWG
	Fix ossfuzz timeout (6039899330117632): corrupted R11 DWG with
	bogus entities_end caused an infinite entity-decode loop.

	* src/decode.c (decode_preR13_entities): Clamp size when end is
	  fixed to dat->size to prevent infinite while loop.  Prevent
	  dat->byte from moving backwards when corrupted entities decode
	  to zero length (LATER_VERSIONS position correction).
	* src/dwg.c (Ref_cmp): Fix sign: return -1 instead of 1 when
	  pKey->absolute_ref < (*ppR)->absolute_ref, breaking bsearch.

2026-06-24  Reini Urban  <reini.urban@gmail.com>

	Fix ossfuzz 525291340: SEGV in dwg_dxfb_BLOCK_HEADER preview write
	The fuzzed DWG data can set dwg->opts loglevel bits to enable TRACE
	logging, which causes LOG_TRACE in FIELD_BINARY to dereference
	_obj->preview as %s even when the pointer is corrupted.

	* src/out_dxfb.c (BLOCK_HEADER DXF): Guard FIELD_BINARY(preview, ...) with
	  _obj->preview and _obj->size null checks.
	* src/bits.c (bit_write_TF): Defensively reject chain pointers below
	  page size (4096) as corrupted, treating them like NULL (write zeros).

2026-06-24  Reini Urban  <reini.urban@gmail.com>

	Revert "Fix ossfuzz 525291340: null-deref in dwg_dxfb_BLOCK_HEADER"
	This reverts commit 8feb782ab9a156d5ab90979904f5ee294cd88de8.

2026-06-24  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	Fix ossfuzz 524832524: index-out-of-bounds in dwg_encode section_order
	* src/encode.c (dwg_encode): Clamp section iteration to SECTION_R13_SIZE
	  (7) to prevent reading past the static section_order array when
	  num_sections is inflated by fuzzed DWG header data.

	Fix ossfuzz 42534122: heap-buffer-overflow in dxf_entities_read clip_verts
	* src/in_dxf.c (new_object, clip_verts handling): Extend num_clip_verts
	  growth check to cover DXF code 14 (not just 11), add realloc for
	  code 14 when j > 0, and guard the y-write path (code < 30) against
	  unallocated clip_verts by allocating on first access.

	Fix ossfuzz 525088107: heap-buffer-overflow in dwg_geojson_object
	* src/out_geojson.c (dwg_geojson_object, ARC case): Reject num_pts <= 0
	  to prevent malloc(0) returning a 1-byte region that is then read as
	  a BITCODE_2BD (16 bytes) in the pts[0] access.

	Fix ossfuzz 525291340: null-deref in dwg_dxfb_BLOCK_HEADER
	* src/dwg.spec (BLOCK_HEADER DXF): Guard FIELD_BINARY(preview, ...) with
	  _obj->preview null check to prevent fwrite from reading a corrupted
	  pointer set during fuzzed DWG decode.

	Fix ossfuzz 42510991: memory leak in dxf_header_read
	* src/in_dxf.c (dxf_header_read): Free pair on early return when
	  ACADVER is invalid, and after the while-loop exits with an
	  unexpected group code on garbled DXF input.

	Fix ossfuzz 42533395: heap-buffer-overflow in dynapi_set_helper via JSON import
	* src/in_json.c (_set_struct_field): For pointer-typed subclass fields
	  (type ending in '*'), dereference the pointer and allocate the subclass
	  struct when NULL before recursing into _set_struct_field.  Previously
	  the code treated the pointer's address in the parent struct as the
	  subclass buffer, writing past the parent allocation.

2026-06-24  Reini Urban  <reini.urban@gmail.com>

	Revise AGENTS.md clean rules

2026-06-19  Reini Urban  <reini.urban@gmail.com>

	Fix ossfuzz 524394694: ASSERT section[0].address in encode_header_vars
	Replace the assertion with a validated check and reset bogus
	section[0].address to 0 when fuzzed DWG decode sets it past the
	current write position. The address/size for R2004+ is kept on
	section[0] to maintain consistency with the section map writer.

	* src/encode.c (encode_auxheader): skip empty AuxHeader.
	  (encode_header_vars): validate section[0].address and reset
	  when invalid, instead of asserting.
	* src/decode.c: set fixedtype DWG_TYPE_UNKNOWN_ENT for unknown
	  objects; skip tio.entity NULL objects in block header.
	* src/decode_r11.c: set tbl->size to 0 on overflow.

2026-06-19  Pascal Bourguignon  <pjb@informatimago.com>

	bits: fix misleading CWE-120 comment on in_hex2bin reference path
	The disabled (#if 0) reference implementation of in_hex2bin carried a
	"Safe alternative to sscanf ... (CWE-120)" comment, but the relevant concern
	for that hand-rolled loop is an out-of-bounds read, not a format-string
	overflow, and the active implementation is the #else lookup path. Reword the
	comment to describe it accurately (reference-only; relies on the caller's
	2*destlen contract) and drop the misleading security justification.

	Addresses review feedback on #1282.

	Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

2026-06-19  Pascal Bourguignon  <pjb@informatimago.com>

	encode: extract can_emit_raw_unknown() for UNKNOWN_ENT/OBJ gating
	The condition deciding whether an UNKNOWN_ENT/UNKNOWN_OBJ raw blob can be
	re-emitted verbatim (same version && raw bits still held) was duplicated in
	both switch cases. Extract it into a can_emit_raw_unknown() predicate so the
	two paths can't drift apart. No behavior change (verified: example_2018
	--as r2018 still round-trips with no object loss or wrong-size).

	Addresses review feedback on #1286.

	Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

2026-06-19  Pascal Bourguignon  <pjb@informatimago.com>

	out_dxf: only negate LAYER colour (DXF 62) when the layer is off
	The LAYER table writer negated the group-62 colour index unconditionally, so
	every ON layer was exported with a negative 62 (= "layer off") and its
	entities became invisible after dwg2dxf; a DWG->DXF->DWG round-trip flipped
	the layer off. libredwg's own decoder reports the layer as on, so this was an
	exporter-only inconsistency.

	Derive the sign from the decoded `off` flag: negate only when off, using
	abs() so an already-signed index cannot double-negate, with explicit braces.
	An ON layer now exports its true positive ACI (62=7 instead of -7) and an OFF
	layer exports negative; the DWG->DXF->DWG round-trip preserves on/off.

	This re-applies the fix from the earlier #1283 (which did not land on master)
	and incorporates the review feedback there (sign via -abs(), braces).

	Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

2026-06-17  Reini Urban  <reini.urban@gmail.com>

	encode: fix index-out-of-bounds in section_move_before
	When section_order is full (*pnum reaches SECTION_R13_SIZE) and
	section_move_before tries to insert a section not already in the
	array, the old assert() was the only guard.  In release builds
	(NDEBUG) this became a memmove past the end of the static array.

	Replace the assert with a runtime bounds check that returns early
	when the array is full, matching the existing 'before not found'
	early-return pattern.

	* src/encode.c (section_move_before): Replace assert with runtime
	  if (*pnum >= SECTION_R13_SIZE) return 0 guard.

	Fixes oss-fuzz Issue 524832524
	GH #831

2026-06-17  Reini Urban  <reini.urban@gmail.com>

	encode: fix null-deref in encode_preR13_section PREP_CTRL and PREP_TABLE
	When a fuzzed DWG has an object with a fixedtype matching that of a
	CONTROL table object but is actually an entity (tio.object == NULL),
	the PREP_CTRL macro would null-dereference ctrl->tio.object->tio.token.
	Similarly, PREP_TABLE accessed obj->tio.object->tio.token before
	checking obj->fixedtype, and without a NULL guard on tio.object.

	* src/encode.c (PREP_CTRL): Add !ctrl->tio.object guard before deref.
	  (PREP_TABLE): Move fixedtype check before tio.object access and add
	  !obj->tio.object guard.

	Fixes oss-fuzz Issue 524854787
	GH #832

2026-06-15  Pascal Bourguignon  <pjb@informatimago.com>

	decode: fix R2004+ decompression aborting on exact buffer-fill (data loss)
	decompress_R2004_section rejected a back-reference copy whose end landed
	*exactly* on the decompressed buffer size (`end >= dec->size`). A real R2018
	section legitimately ends with a copy that fills the buffer to the brim (the
	trailing run lands in the unused tail past the page's real data and is never
	read), so this false positive aborted the whole section mid-stream with
	"Invalid decompression bytes". The short section then left every later
	bit_read run off the end, dropping/garbling thousands of objects — a
	regression vs 0.13.3 introduced by the 2004-decompression refactor (the
	pre-refactor code used `dst + comp_bytes > dst_end`, i.e. strict `>`).

	Restore the strict comparison (`end > dec->size`): only error when the copy
	would actually overrun the buffer; allow the exact-fill case. The copy then
	writes at most dec->size bytes (buffer is over-allocated by 1024), so this is
	still safe against OOB.

	On a real R2018 file that previously hit 5+ "Invalid decompression bytes"
	and produced unusable JSON, the decode is now clean (0 errors) and recovers
	the same 121 objects as 0.13.3. r2004–r2018 corpus decode unaffected.

	Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

2026-06-15  Pascal Bourguignon  <pjb@informatimago.com>

	encode: fix R2018 decode→encode→decode object loss and thumbnail growth
	Two defects broke faithful same-version round-trips of R2004+ DWGs
	(R2018/AC1032 in particular); both are fixed in encode_r13_thumbnail and
	the dwg_encode_add_object dispatch.

	1. UNKNOWN_OBJ/UNKNOWN_ENT proxy objects (custom classes libredwg keeps as
	   raw blobs) were only re-emitted when the input was JSON
	   (DWG_OPTS_INJSON). A DWG→DWG re-encode at the same version wrote just the
	   common header and dropped the blob, producing "Wrong object size" errors
	   and losing objects (6 dropped, 474→473 on example_2018). Gate on
	   version == from_version && unknown_bits instead, so DWG and JSON inputs
	   are handled identically (the raw encoder already requires same-version).

	2. The AcDb:Preview thumbnail grew 16 bytes on every round-trip and tripped
	   "Preview overflow". The r2004+ decoder keeps the trailing THUMBNAIL_END
	   sentinel inside thumbnail.size (decode.c: size = sec_dat.size - 16,
	   byte = 16; the JSON writer likewise retains it), so encode_r13_thumbnail
	   must not append its own END sentinel for SINCE(R_2004a) — it is already
	   part of the content. r13-r2000 keep the END separate and still write it.
	   Also write content from chain + thumbnail.byte so the leading sentinel is
	   skipped.

	Result: dwgrewrite --as r2018 on example_2018/sample_2018 yields 474/474
	objects, a byte-identical thumbnail stable across repeated round-trips, and
	no new errors; r2010/r2013 and the r13/r14/r2000 paths are unaffected.

	Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

2026-06-15  Pascal Bourguignon  <pjb@informatimago.com>

	in_dxf: preserve leading spaces in string values; fix r2007+ DWGCODEPAGE read
	Two DXF-import string fidelity fixes:

	- dxf_read_string stripped leading whitespace from every value via
	  dxf_skip_ws, but dxf_read_rs already consumed the group-code line and its
	  newline, so we are at the value-line start where leading spaces are
	  significant. An MTEXT continuation chunk beginning with a space (e.g.
	  "...un des" + " maîtres...") lost that space, joining the words. Drop the
	  skip.

	- dxf_set_DWGCODEPAGE read header_vars.DWGCODEPAGE as a C string, but r2007+
	  stores header TV vars as TU (UTF-16), so "ANSI_1252" was seen as "A" and
	  the codepage came out UNDEFINED ("Invalid DWGCODEPAGE A"). Decode the TU
	  name first, detected by the embedded NUL (codepage names are pure ASCII).

	With these and the bit_write_T UTF-8 fix, a real R2018 multiline-MTEXT
	dwg2dxf | dxf2dwg --as r2018 round-trip reproduces the text byte-identically.

	Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

2026-06-15  Pascal Bourguignon  <pjb@informatimago.com>

	bits: decode UTF-8 DXF strings to UTF-16 when encoding to r2007+
	bit_write_T, when emitting a non-TU (DXF/JSON/API) string to an r2007+
	target, built the UTF-16 by copying each input byte and zero-extending it.
	For DXF input — whose in-memory strings are UTF-8 (in_dxf keeps them as
	read) — that double-encoded every non-ASCII character: "été" was written as
	"Ã©tÃ©". A decode→DXF→r2018 round-trip of a French multiline MTEXT thus
	mojibaked all accented text (non-ASCII char count doubled).

	Decode real UTF-8 multi-byte sequences (2/3-byte, and 4-byte to a surrogate
	pair) for DXF input, gated on DWG_OPTS_INDXF. JSON and the add API store
	codepage bytes (json_string runs bit_utf8_to_TV) with non-representable
	characters already escaped as \U+xxxx, and old-DWG up-converts likewise hold
	codepage bytes, so those keep the byte-wise path unchanged. The inline
	\U+xxxx escape is still honoured on both paths.

	Now dwg2dxf | dxf2dwg --as r2018 of accented text round-trips byte-identical;
	JSON and DWG->DWG paths are unaffected.

	Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
	Co-Authored-By: Reini Urban <reini.urban@gmail.com>

	Also replace the (dead, #if 0) sscanf "%2hhX" reference path in
	in_hex2bin() with a hand-rolled two-nibble hex decode, to clear a CWE-120
	scanf warning flagged on this PR (the format was already width/size-safe,
	but this drops the format string entirely).

	Rejects overlong encodings / surrogate-range / out-of-range code points.

2026-06-15  Pascal Bourguignon  <pjb@informatimago.com>

	in_dxf: concatenate MTEXT text split across group codes 3 and 1
	MTEXT text longer than 250 characters is emitted in DXF as one or more
	250-char chunks under group code 3 followed by a final (<250) chunk under
	group code 1. The importer overwrote o->text on each code 3 (and only
	reallocated when the new chunk was longer), and let the final code 1 fall
	through to the generic field setter, which overwrote again. The result was
	a single surviving fragment — a 1497-char paragraph imported as one byte.

	Handle codes 3 and 1 together for MTEXT and append each chunk (a short
	MTEXT still has only the code 1, handled as the first chunk). On
	dwg2dxf | dxf2dwg of a real R2018 multiline MTEXT the full text and all
	\P paragraph breaks now survive; short single-chunk MTEXT is unchanged.

	Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

2026-06-15  Pascal Bourguignon  <pjb@informatimago.com>

	build: don't redeclare memmem() on macOS
	macOS declares memmem() in <string.h>, so the non-Linux fallback
	declaration in common.h is redundant there and fails the build under
	-Werror=redundant-decls. Guard it with !defined(__APPLE__).

	Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

2026-06-15  Reini Urban  <reini.urban@gmail.com>
	    Pascal J. Bourguignon  <informatimago@gmail.com>

	spec: fix swapped extents_width/height in R2018 MTEXT embedding
	The redundant embedded object in R2018+ MTEXT uses DXF field order
	(extents_width 42, then extents_height 43) matching the DXF branch, but
	the binary DWG branch had them reversed (height first, width second).
	This swapped the decoded values compared to the non-redundant path.

	GH #1278
	A fellow lisp hacker.
	Verified by Opus 4.8 (Pascal) and Sonnet 4.6 (Reini)

2026-06-14  Reini Urban  <reini.urban@gmail.com>

	fix 3 ossfuzz crashes
	ossfuzz #523804647: Null-dereference in encode_r11_auxheader at encode.c:1796
	when dwg->header_vars.HANDSEED is NULL.  Add null guard.
	https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=523804647

	ossfuzz #523387982: Heap-buffer-overflow in encode_preR13_entities at encode.c:5454
	when a Dwg_Entity_POLYLINE_PFACE (56 bytes) is accessed through a
	Dwg_Entity_POLYLINE_2D pointer whose num_m_verts/num_n_verts fields
	lie 72 bytes past the PFACE allocation.  Split the unified case to use
	the correct struct pointer per fixedtype.
	Also fix VERTEX_PFACE_FACE which lacks a point field.
	https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=523387982

	ossfuzz #523782030: SEGV in dwg_dxfb_BLOCK_HEADER at out_dxfb.c:1067
	when LOG_TRACE unconditionally evaluates obj->tio.object->ownerhandle->
	absolute_ref before the log-level guard.  Add ternary null check.
	Also guard callers against uninitialized BLOCK_HEADER tio.
	https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=523782030

2026-06-14  Reini Urban  <reini.urban@gmail.com>

	indxf: fix EED code 1004 binary data overflows in add_eed
	- Emit LOG_WARN when blen > 0xff ("EED binary data too long... truncating")
	- size, allocation, eed_4.length, and both memcpy/in_hex2bin calls now
	  consistently use cblen instead of the untruncated blen

	This keeps the __counted_by(length) eed_4.data array consistent with
	the actual copied/allocated size (previously length silently wrapped
	mod 256 while blen bytes were copied into a buffer sized for the
	untruncated length — correct memory-wise but a latent correctness
	mismatch for binary EED data > 255 bytes).

	Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

2026-06-13  Reini Urban  <reini.urban@gmail.com>

	test: skip version/tag mismatch assertions on smoke/rel* branches
	smoke/rel* branches bump LIBREDWG_VERSION_M{AJOR,MINOR} ahead of the
	next release tag, so PACKAGE_VERSION (derived from git describe) still
	refers to the previous tag until the branch is tagged, tripping
	test_api_version's major/minor vs tag assertions.

	Detect smoke/rel* via CI branch env vars (GITHUB_REF_NAME,
	GITHUB_HEAD_REF, CI_COMMIT_REF_NAME, CI_COMMIT_BRANCH) or, as a
	fallback, `git rev-parse --abbrev-ref HEAD`, and report a todo()
	instead of asserting on a mismatch there.

2026-06-13  Reini Urban  <reini.urban@gmail.com>

	configure: auto-enable --check-less under OSS-Fuzz/CIFuzz
	The CIFuzz build (build.sh) runs make check-prep -C test/unit-testing/
	after building the fuzzer, compiling ~300 ASAN+debug unit-test
	binaries statically linked against libredwg.a. This regularly exhausts
	the GitHub Actions runner's disk ("No space left on device" linking
	ray/rastervariables/proxy_object), failing the whole fuzzer build even
	though the fuzzer itself built fine.

	Detect CIFUZZ or OSS_FUZZ_PROJECT_NAME in the environment and default
	check_less=yes in that case, so check_PROGRAMS shrinks to the minimal
	API test set, without affecting normal builds.

2026-06-13  Reini Urban  <reini.urban@gmail.com>

	Fix -Werror=format-overflow in xmlsuite common.c
	GCC's null-destination-pointer check flags sprintf into the result of
	malloc that isn't checked for NULL. Add the standard if (!result)
	return NULL; guard used elsewhere in the codebase to each of the five
	helper functions.

2026-06-12  Reini Urban  <reini.urban@gmail.com>

	encode: Fix heap-buffer-overflow in encode_auxheader
	for cross-boundary version conversion

	When a fuzzed AC1013 (R13c3) file has an unusual header.num_sections=3
	(decode doesn't normalize this since from_version==version) and is
	re-encoded as R2004, dwg_sections_init's recompute condition only
	handled downgrades (from_version > R_2000 && version <= R_2000),
	leaving num_sections=3 and header.section[] sized for 5 entries.

	The SINCE(R_2004a) encode path unconditionally calls encode_auxheader,
	which writes header.section[SECTION_AUXHEADER_R2000] (index 5) - one
	element past the end of the array.

	Replace the one-directional check with a symmetric XOR
	((from_version > R_2000) != (version > R_2000)) so both upgrades and
	downgrades across the R_2000 boundary trigger the recompute.

	Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

2026-06-12  Reini Urban  <reini.urban@gmail.com>

	Fix assertion failure in section_move_before for R13 encoding
	When decoding an AC1500 (R2000b) file with header.sections=6 and
	re-encoding as R13, two section_move_before calls occur during section
	reordering. The first legitimately grows *pnum 6->7 (THUMBNAIL). The
	second moves TEMPLATE, which is already within the counted range -
	a reorder, not an insert - but the old code still tried to grow *pnum
	7->8, tripping assert(*pnum + 1 <= SECTION_R13_SIZE).

	Detect when id is already within [0, *pnum) and reorder it in-place
	via memmove without touching *pnum, mirroring the analogous branch in
	section_move_top.

2026-06-12  Reini Urban  <reini.urban@gmail.com>

	Triage CodeQL alerts: dead code + use-after-free false positives
	decode.c: remove unreachable `if (!dat) return error` in
	dwg_decode_add_object - dat is unconditionally dereferenced at function
	entry (abs_dat = *dat), so it can never be NULL here (CodeQL #82).

	Add inline codeql[cpp/use-after-free] suppressions for the VALUE_HANDLE
	pre-R13 free()+reassign pattern in FIELD_HANDLE/CONTROL_HANDLE_STREAM/
	XDICOBJHANDLE/*_fields call sites across dwg.spec, dwg2.spec and
	common_*.spec. Same pattern already reviewed and dismissed as false
	positive in #181 (dwg2.spec:1006): ref is freed and immediately
	reassigned to a fresh allocation before any further dereference.

2026-06-12  Reini Urban  <reini.urban@gmail.com>

	fix dxfwrite buffer overflow with __counted_by on eed_4
	* src/in_json.c (json_eed): set data->u.eed_4.length before memcpy
	  into the flexible array data->u.eed_4.data.  The __counted_by(length)
	  attribute requires the length to be set first, otherwise FORTIFY_SOURCE
	  aborts on the memcpy because it sees length as zero.

2026-06-11  Reini Urban  <reini.urban@gmail.com>

	fix json-check example_r14 roundtrip regression
	Revert two changes from d868ddf1b that broke r14 DWG output.

	* src/bits.c (bit_write_TV): restore TV-ZERO null terminator for r14
	  by using >= R_14 instead of > R_14.  r14 TV fields need the trailing
	  \0 byte, otherwise ODA misidentifies class names on re-read.
	* src/encode.c (dwg_encode): do not unconditionally overwrite
	  maint_rel_version from the dwg_versions table.  When importing from
	  JSON the value from the input file (e.g. 0xa for example_r14) must
	  be preserved.

2026-06-11  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	Fix r11 DXF roundtrips: ODA validation and entity encoding
	Fixes ODA "Illegal entity type" and "Invalid DXF code" errors
	for r11 DXF roundtrip on files with block POLYLINE/VERTEX entities
	and DIMENSION entities without subtype flags.

	* src/out_dxf.c (dxf_block_write): When writing block-owned POLYLINE
	  entities to the BLOCKS section, also forward-scan for trailing
	  VERTEX/SEQEND children and write them to the same section.  Without
	  this, block VERTEX entities land in ENTITIES, and ODA sees
	  HAS_ATTRIBS on block polylines expecting VERTEX to follow, but
	  finds no vertices and reports "Illegal entity type".

	* src/in_dxf.c (new_object): Handle DXF code 50 (dim_rotation) also
	  for DWG_TYPE_DIMENSION_ANG2LN, upgrading to DIMENSION_LINEAR.
	  Some r11 DIMENSION entities lack the flag (code 70), leaving them
	  as the placeholder ANG2LN type.  Without this, code 50 triggers
	  "Invalid DXF code 50 for DIMENSION".

	* src/encode.c (encode_preR13_entities): Set OPTS_R11_POLYLINE_HAS_FLAG
	  on all POLYLINE entities so the subtype flag is always written.
	  Compute HAS_M_VERTS/HAS_N_VERTS for mesh polylines.  Sync
	  elevation_r11 from point.z for VERTEX entities.  Set HAS_FLAG (bit 8)
	  for VERTEX when the vertex flag is non-zero.  Clear HAS_ATTRIBS for
	  block POLYLINE entities after flag computation to prevent ODA from
	  expecting VERTEX children that are not present.  Add backward-scan
	  owner lookup for VERTEX/SEQEND section assignment.

	* src/decode.c (dwg_fixup_BLOCKS_entities): Add post-import fixup
	  loop that scans VERTEX/SEQEND entities backward for their
	  POLYLINE/INSERT owner and inherits its entmode, correcting entmode=2
	  (model space) to entmode=3 (block) for DXF roundtrip cases.

	Verified with AIRPLANE.DWG and TUTORIAL.DWG r11 DXF roundtrips.

	Also fixes regressions from commit 82ee35d5c (GH #1236).

	* BLOCKS_SECTION_INDEX: Remove dead 'dat->version < R_2_0b' code
	  (leftover from 82ee35d5c).  Fix ENDBLK handling: use 'else if
	  (!in_blocks)' so ENDBLK is properly encoded in BLOCKS section.

	* Type 0x80 flag: Fix spurious deleted flag (type 146 instead of
	  18) on entity types for DXF/JSON-imported entities.  obj->type
	  is the modern fixedtype whose bit 7 is coincidentally set; only
	  apply the deleted flag when obj->type != obj->fixedtype.

	Reduces dxf-check failures from 49 to 46 (fixes 3 files).

	- Verified entities-2d.dwg roundtrip now keeps POLYLINE_2D →
	  VERTEX_2D ×3 → SEQEND sequential in ENTITIES, with EXTRAS empty (size 0)
	- Verified pure DXF→DWG roundtrip shows the same correct structure
	- Ran dxf-check on all r9-r12 test DWGs (entities-2d, entities-3d,
	  PL1, ACEL10, Drawing_r11, r9/entities, etc.)
	— exit codes identical before/after, no regressions

	Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

2026-06-09  Reini Urban  <reini.urban@gmail.com>

	Fix spurious CMLSTYLE warning during DXF import
	When importing DXF, resolve_postponed_header_refs is called twice:
	once after the TABLES section and once after OBJECTS.  CMLSTYLE references
	a MLINESTYLE object in the OBJECTS section, so the first lookup fails.
	Downgrade the warning to LOG_TRACE since the handle is resolved correctly
	on the second pass.

2026-06-09  Reini Urban  <reini.urban@gmail.com>

	Fix r2007 DWG encoding by falling back to r2010
	r2007 encoding was not supported, returning DWG_ERR_NOTYETSUPPORTED
	and producing a truncated ~4KB file.  Now we fall back to r2010
	before writing the header, producing a valid DWG that LibreDWG can
	read.

	* src/encode.c (dwg_encode): Move the r2007 -> r2010 fallback
	  before the file header is written.

2026-06-08  Reini Urban  <reini.urban@gmail.com>

	Fix spurious "Object handle not found" warnings during decode
	Two issues in the object reference resolution paths caused spurious
	warnings for handle values like HANDSEED, which are not references to
	other objects.

	* src/decode.c (resolve_objectref_vector): Skip code-0 handle refs.
	  Code-0 handles represent handle values (e.g. HANDSEED), not object
	  references, so resolving them as object references always fails.

	* src/decode.c (dwg_resolve_objectrefs_silent): Use
	  dwg_resolve_handle_silent instead of dwg_resolve_handle.  The latter
	  overwrites the global loglevel with dwg->opts, defeating the purpose
	  of the "silent" function which sets loglevel=0 to suppress warnings.

2026-06-08  Reini Urban  <reini.urban@gmail.com>

	Fix "Object handle not found" warnings in dwg_add_Document for pre-R2000
	Two issues caused spurious warnings when creating documents for r11 and
	other pre-R2000 versions:

	* src/dwg_api.c (dwg_add_Document): Skip resolving code-0 handle refs
	  (e.g. HANDSEED) in the object_ref resolution loop.  Code-0 handles are
	  handle values, not references to other objects, so resolving them as
	  object references always fails with a warning.

	* src/dwg_api.c (dwg_add_Document): Only set the default LAYER plotstyle
	  to 0xF for R_2000 and later.  The PLOTSTYLE object at handle 0xF is only
	  created for R_2000+, so referencing it in earlier versions caused an
	  "Object handle not found" warning.  This aligns with dwg_add_LAYER,
	  which already guards plotstyle assignment behind version >= R_2000.

2026-06-08  Reini Urban  <reini.urban@gmail.com>

	Fix pre-R13b1 dwg_version and improve r11 DXF import/encode
	Fix the dwg_version RC field in the file header, which was 0x10
	for pre-R13b1 files produced from DXF import.
	Pre-R13b1 files need dwg_version=0 (set by dxf_fixup_header).
	Only R13+ uses the dwg_versions struct value.

	Improve r11 roundtrip quality:
	- Add VX_CONTROL object on DXF/JSON import, needed for VX section header
	- Compute correct DIMENSION opts_r11 for all dimension subtypes
	- Fix SHAPE entity: change style_id DXF code from 2 to 7
	- Fix DIMENSION_COMMON: avoid duplicate user_text code 1 for pre-R13
	- Initialize used=-1 on new objects in DXF import
	- Re-enable DIMENSION flag-based subtype detection for pre-R13 files

	* src/encode.c: Guard dwg_version assignment with version >= R_13b1.
	  Add VX_CONTROL creation on DXF/JSON import. Add opts_r11 computation
	  for DIMENSION subtypes.
	* src/in_dxf.c: Add used=-1 initialization on new objects. Re-enable
	  DIMENSION flag-based subtype upgrade for r11/pre-R13 files.
	* src/dwg.spec: Fix SHAPE style_id DXF code (2 -> 7).
	* src/dwg_spec_shared.h: Fix DIMENSION_COMMON user_text to not
	  duplicate code 1 for pre-R13.
	* doc/dynapi.texi: Regenerated for SHAPE.style_id code change.

	The roundtrip for r11/entities-2d still fails ODA validation due to
	remaining structural differences (lost deleted entities, table entry
	counts, entity property flags). Further work needed.

2026-06-08  Reini Urban  <reini.urban@gmail.com>

	validate entity links also in fixup_BLOCKS_entities
	GH #1226

	And add a couple of null-ptr and type protections for more robust
	cycle checks and fuzzed input.

2026-06-07  Reini Urban  <reini.urban@gmail.com>

	Fix GHSA-5p98-8245-6hxq: const-input write/crash in bit_TV_to_utf8 iconv error path
	bit_TV_to_utf8 could write to the caller-provided const src buffer
	via bit_u_expand on an iconv error path, causing SIGSEGV for string
	literals and silent input corruption for mutable buffers.

	* src/bits.c (bit_TV_to_utf8): Use bit_TV_to_utf8_codepage fallback
	  instead of in-place bit_u_expand on iconv error, consistent with
	  the other three error paths in the same function.
	* test/unit-testing/bits_test.c (bit_TV_to_utf8_tests): Add
	  regression test with const string literal, \U+XXXX marker, and
	  CP_UTF16 that triggers the exact iconv error path.
	* SECURITY.md: mention the new WebUI

	CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L
	Reported-by: Bin-infinite

2026-06-07  Reini Urban  <reini.urban@gmail.com>

	Fix pre-R13 entity section assignment: remove entmode filter in BLOCKS
	The BLOCKS section encoder was filtering entities by entmode!=3, but after
	JSON import, entmode might be 0 (not preserved for pre-R13). BLOCK/ENDBLK
	boundaries are already tracked via fixedtype and in_blocks state, so the
	entmode filter is redundant and harmful.

	Fixes GH #1236 - oda Illegal entity type in pre-R13 JSON roundtrips.

2026-06-07  Reini Urban  <reini.urban@gmail.com>

	Fix pre-R13 HANDSEED encode: mask absolute_ref to 32 bits
	bit_write_RLL_BE was writing the full 64-bit absolute_ref which carried
	garbage in the upper 32 bits from bogus dwg_add_handleref propagation.
	Make the encoder robust by masking to 32 bits at the write point —
	this is the direct fix for the RLL_BE write path.

	Fix pre-R13 HANDSEED filters for bogus 64-bit handles
	* dwg_add_handleref: guard against >32-bit absref poisoning HANDSEED
	  for pre-R12 files (root cause fix)
	* encode_preR13_header_variables: add safety-net filter for HANDSEED
	  >0xFFFFFFFF, recomputing from valid 32-bit refs
	* dwg_encode_header_variables: use _obj->HANDSEED as seed start,
	  add pre-R12 guard matching existing object_ref scan filter

	encode: improve MINSERT r11 opts calc

2026-06-07  Reini Urban  <reini.urban@gmail.com>

	Fix OOB write in encode.c subentity loop; add CodeQL suppression in dwg2.spec
	encode.c in_postprocess_SEQEND: realloc owned[] before writing owned[i],
	not after — second iteration wrote owned[1] one slot past the initial
	calloc(1,...) allocation before the realloc happened (GH #1273).

	dwg2.spec: extend lgtm suppression comment to also cover CodeQL
	(codeql[cpp/use-after-free]) for the CellStyle_fields false-positive.

2026-06-07  Reini Urban  <reini.urban@gmail.com>

	Suppress false positive CodeQL UAF: CellStyle_fields
	Also not detected as false by copilot, but by deepseek v4 pro.

	Add cycle checks in entity link chains (GH #1226)
	- Add dwg_add_entity_link(dwg, first, field, handle_val) for safe entity
	  link creation with cycle detection via next_entity chain traversal.
	  Used from importers where ->obj pointers are already valid.
	- Add dwg_validate_entity_links(dwg): post-decode bitset-based cycle
	  detector for r13-r2000 entity chains. Called after resolve_objectref_vector
	  in decode_R13_R2000. Clears cyclic next_entity links.
	- Add __iterator-based step counter in get_next_owned_entity and
	  get_next_owned_block_entity for r13-r2000 to prevent infinite loops.
	  get_first_owned_entity resets __iterator=0 for r13-r2000 path.
	- Add max_steps cycle guard in in_postprocess_SEQEND for vertex/attrib chains.
	- Use dwg_add_entity_link in in_dxf.c for first/last entity assignments.

2026-06-04  Reini Urban  <reini.urban@gmail.com>

	examples/dwgfuzz.c: fix double-free in RW and INDXF modes (GH #1270)
	Set out_dat.chain = NULL after each in-case free, so the unconditional
	free at the common exit path becomes free(NULL) (a no-op).

2026-06-03  Reini Urban  <reini.urban@gmail.com>

	spec: fix LAYER.material null-deref
	Fixes GH #1269

2026-06-03  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	spec: fix HATCH curve_type 0 crash (GH #1107)
	Demote LOG_ERROR to LOG_WARN for unknown HATCH.curve_type values
	and use return 0 instead of DWG_ERR_VALUEOUTOFBOUNDS so the
	partially-decoded HATCH survives the roundtrip without aborting.

	ezdxf writes some HATCH boundary segments with curve_type 0, which
	is unknown but harmless — the segment should be skipped, not aborted.

	* src/dwg.spec (HATCH curve_type default): s/LOG_ERROR/LOG_WARN/,
	  s/return DWG_ERR_VALUEOUTOFBOUNDS/return 0/ in both locations
	  (HATCH and MPOLYGON decode paths).

2026-06-03  Reini Urban  <reini.urban@gmail.com>
	    omp + DeepSeek V4 Pro  <deepseek@deepseek.com>

	decode: fix CVE-2026-xxxxx DoS in decode_R13_R2000 (GH #1261)
	CWE-400: Uncontrolled Resource Consumption in the R13-R2000 class
	decoding loop. A crafted DWG could force unbounded realloc via a
	malformed classes section, causing denial of service.

	Add a num_classes upper bound check before realloc, derived from the
	section data size, matching the existing pattern in
	read_2004_section_classes() for R2004+.

	* src/decode.c (decode_R13_R2000): Check i > 100 + size/sizeof(Dwg_Class)
	  before each realloc; fail with DWG_ERR_VALUEOUTOFBOUNDS and jump to
	  handles_section cleanup.

2026-06-03  Reini Urban  <reini.urban@gmail.com>

	Fix PROXY_OBJECT version corruption in json roundtrip
	The decoder for PROXY_OBJECT was overwriting the version field with
	just the low byte (dwg_version), discarding the maint_version high byte.
	This is a copy-paste error from PROXY_ENTITY, which correctly assigns
	to dwg_version instead of clobbering version.  The truncated version
	field (e.g. 15 instead of 527) caused ODA to throw "No ClassId" when
	reading the written DWG, breaking json-check roundtrips for any file
	containing a PROXY_OBJECT.

	* src/dwg.spec (PROXY_OBJECT): Assign dwg_version from version low
	  byte, matching PROXY_ENTITY behavior.

2026-06-02  Reini Urban  <reini.urban@gmail.com>

	in_dxf: fix MSVC C4267 warning: size_t to unsigned cast
	Cast needed (size_t) to unsigned in dash_i accumulation; the value is
	bounded by strings_size (max 512) so the cast is safe.  Fixes /WX build
	on Windows MSVC.

2026-06-02  Reini Urban  <reini.urban@gmail.com>
	    Copilot Autofix powered by AI  <175728472+Copilot@users.noreply.github.com>

	encode: force size recalculation for pre-R13 entities after JSON import
	In encode_preR13_entities, the size patchup was skipped when obj->size
	was already non-zero. JSON import sets obj->size from the source file's
	entity sizes, but the encoder may write different amounts of data
	depending on flag_r11/opts_r11 computation (e.g. 2RD vs 3RD points for
	LINE entities based on FLAG_R11_HAS_ELEVATION). This caused entity
	size mismatches, decoder offset errors, and "Critical: INVALIDDWG" on
	the JSON roundtrip of R11 files like ACEB10.dwg.

	Fixes json-check r11/ACEB10 roundtrip.

2026-06-01  Reini Urban  <reini.urban@gmail.com>

	Merge remote-tracking branch 'refs/remotes/origin/work/hatch-gh1209' into work/hatch-gh1209

2026-06-01  Reini Urban  <reini.urban@gmail.com>
	    codewhale + DeepSeek V4 Pro  <deepseek@deepseek.com>

	in_dxf: fix HATCH spline tangent DXF codes and LTYPE strings_area overflow
	* add_HATCH: handle DXF codes 12/22 (start_tangent) and 13/23 (end_tangent)
	  for spline boundary paths (curve_type 4).  After end_tangent, set k=-1
	  so the next code 97 is handled as num_boundary_handles.

	* add_HATCH: move CHK_segs in code 97 handler into the num_fitpts branch
	  only, fixing a false error when k=-1 from the end_tangent handler.

	* add_HATCH: skip xcalloc(0) for HATCH fitpts to avoid encoder error
	  When num_fitpts is 0, xcalloc(0, size) on glibc returns a non-NULL
	  pointer, triggering the encoder validation "Invalid ... fitpts 0, set
	  to 0" error.  Only allocate fitpts when num_fitpts > 0.

	* add_LTYPE_dashes: fix heap buffer overflow via group-code-9 strings
	  (CWE-122).  Remove static dash_i counter (Variant B: persisted across
	  LTYPE calls) and add bounds check before copying into the 256/512-byte
	  strings_area buffer (Variant A: up to 4096-byte strings).

	GH #1209

2026-06-01  Reini Urban  <reini.urban@gmail.com>

	bits: fix memory leak on realloc failure in iconv retry path
	On realloc failure, free(odest) was commented out, leaking the original
	iconv output buffer.  Uncomment it.

2026-06-01  Reini Urban  <reini.urban@gmail.com>

	bits: fix stale errno check and src advancement in iconv success path
	After the iconv flush call, the success check used errno==0, but errno
	is not reset by successful iconv calls. If a prior E2BIG retry left
	errno set, the success path was taken as failure, freeing the correctly
	converted buffer and falling back.

	Also, the fallback passed src (which iconv advanced past consumed input)
	instead of osrc (the original pointer saved before conversion).

	Fix: check nconv != (size_t)-1 instead of errno, and pass osrc to the
	fallback codepage conversion.

	Reported-by: code review

2026-06-01  Reini Urban  <reini.urban@gmail.com>
	    omp + opus 4.6  <noreply@anthropic.com>

	encode: Fix double-free in bit_chain_free in 3DSOLID/BODY/REGION
	In COMMON_ENTITY_HANDLE_DATA (enc_macros.h), path 1 copies hdl_dat to
	a local dat1, then redirects hdl_dat to dat2. When dat1 is freed, it
	NULLs dat1.chain but the original struct (wrapper's _hdl_dat) still
	holds the dangling pointer. The DWG_ENTITY wrapper then double-frees
	through the stale _hdl_dat.chain.

	Fix: NULL hdl_dat->chain right after copying to dat1, so dat1 owns
	the buffer exclusively and the original struct can't be double-freed.

	Same class as CVE-2021-36080 (fixed in 9b6e0ff9 for MTEXT), but this
	3DSOLID/BODY/REGION instance was missed.

	Reported-by: Adam Taguirov <adam@sigreturn.com>

	* src/enc_macros.h (COMMON_ENTITY_HANDLE_DATA): NULL hdl_dat->chain
	after copying to dat1, before redirecting hdl_dat to dat2.

2026-06-01  Reini Urban  <reini.urban@gmail.com>
	    omp + opus 4.6  <noreply@anthropic.com>
	    codewhale + DeepSeek V4 Pro  <deepseek@deepseek.com>
	    codewhale + DeepSeek V4 Pro  <deepseek@deepseek.com>

	bits: Fix heap OOB read in bit_TV_to_utf8 (iconv path)
	Uncomment the NUL termination (*dest = '\0') in the iconv success path
	of bit_TV_to_utf8(). When iconv fills the destination buffer exactly,
	dest points one past the allocation and no NUL remains within bounds.
	The following bit_u_expand()/strlen() then reads past the heap chunk
	(CWE-125 OOB read / CWE-200 heap disclosure).

	Also extend all calloc/realloc sizes by +1 to always leave room for
	the terminator, even on the exact-fill and retry paths.

	Reported-by: Adam Taguirov <adam@sigreturn.com>

	* src/bits.c (bit_TV_to_utf8): Uncomment *dest = '\0' at the iconv
	  success path. Extend calloc and realloc by +1 for the NUL terminator
	  on the CP_UTF8 path, the iconv initial alloc, and the iconv retry
	  realloc.
	  Also in the iconv E2BIG retry path, fix two bugs:
	  1. destlen tracks remaining space; when iconv fills the buffer,
	  destlen=0, so destlen*=2 stays 0, then dest_new[destlen-1] writes
	  at dest_new[SIZE_MAX] (heap OOB-write underflow). Double odestlen
	  instead and compute the new destlen from it.
	  2. After realloc, dest was reset to dest_new (base), losing its
	  position within the buffer. The next iconv call would overwrite
	  previously converted output instead of appending. Preserve the
	  offset: dest = dest_new + (dest_old - odest_old).

	  Also remove the now-unnecessary dest_new[destlen-1]='\0' hack since
	  the NUL terminator is written at the success path
	  and the extra +1 in the allocation always leaves room.
	* test/unit-testing/bits_test.c: iconv NUL-termination test for
	  bit_TV_to_utf8 (commit dc8e3509).
	* test/unit-testing/encode_test.c: double-free test for
	  COMMON_ENTITY_HANDLE_DATA (commit 6deac10e).

	GH #1209

2026-06-01  Reini Urban  <reini.urban@gmail.com>
	    codewhale + DeepSeek V4 Pro  <deepseek@deepseek.com>

	in_dxf: fix HATCH spline tangent DXF codes and LTYPE strings_area overflow
	* add_HATCH: handle DXF codes 12/22 (start_tangent) and 13/23 (end_tangent)
	  for spline boundary paths (curve_type 4).  After end_tangent, set k=-1
	  so the next code 97 is handled as num_boundary_handles.

	* add_HATCH: move CHK_segs in code 97 handler into the num_fitpts branch
	  only, fixing a false error when k=-1 from the end_tangent handler.

	* add_HATCH: skip xcalloc(0) for HATCH fitpts to avoid encoder error
	  When num_fitpts is 0, xcalloc(0, size) on glibc returns a non-NULL
	  pointer, triggering the encoder validation "Invalid ... fitpts 0, set
	  to 0" error.  Only allocate fitpts when num_fitpts > 0.

	* add_LTYPE_dashes: fix heap buffer overflow via group-code-9 strings
	  (CWE-122).  Remove static dash_i counter (Variant B: persisted across
	  LTYPE calls) and add bounds check before copying into the 256/512-byte
	  strings_area buffer (Variant A: up to 4096-byte strings).

	GH #1209

2026-06-01  Reini Urban  <reini.urban@gmail.com>
	    omp + opus 4.6  <noreply@anthropic.com>

	encode: Fix double-free in bit_chain_free in 3DSOLID/BODY/REGION
	In COMMON_ENTITY_HANDLE_DATA (enc_macros.h), path 1 copies hdl_dat to
	a local dat1, then redirects hdl_dat to dat2. When dat1 is freed, it
	NULLs dat1.chain but the original struct (wrapper's _hdl_dat) still
	holds the dangling pointer. The DWG_ENTITY wrapper then double-frees
	through the stale _hdl_dat.chain.

	Fix: NULL hdl_dat->chain right after copying to dat1, so dat1 owns
	the buffer exclusively and the original struct can't be double-freed.

	Same class as CVE-2021-36080 (fixed in 9b6e0ff9 for MTEXT), but this
	3DSOLID/BODY/REGION instance was missed.

	Reported-by: Adam Taguirov <adam@sigreturn.com>

	* src/enc_macros.h (COMMON_ENTITY_HANDLE_DATA): NULL hdl_dat->chain
	after copying to dat1, before redirecting hdl_dat to dat2.

2026-06-01  Reini Urban  <reini.urban@gmail.com>
	    omp + opus 4.6  <noreply@anthropic.com>
	    codewhale + DeepSeek V4 Pro  <deepseek@deepseek.com>
	    codewhale + DeepSeek V4 Pro  <deepseek@deepseek.com>

	bits: Fix heap OOB read in bit_TV_to_utf8 (iconv path)
	Uncomment the NUL termination (*dest = '\0') in the iconv success path
	of bit_TV_to_utf8(). When iconv fills the destination buffer exactly,
	dest points one past the allocation and no NUL remains within bounds.
	The following bit_u_expand()/strlen() then reads past the heap chunk
	(CWE-125 OOB read / CWE-200 heap disclosure).

	Also extend all calloc/realloc sizes by +1 to always leave room for
	the terminator, even on the exact-fill and retry paths.

	Reported-by: Adam Taguirov <adam@sigreturn.com>

	* src/bits.c (bit_TV_to_utf8): Uncomment *dest = '\0' at the iconv
	  success path. Extend calloc and realloc by +1 for the NUL terminator
	  on the CP_UTF8 path, the iconv initial alloc, and the iconv retry
	  realloc.
	  Also in the iconv E2BIG retry path, fix two bugs:
	  1. destlen tracks remaining space; when iconv fills the buffer,
	  destlen=0, so destlen*=2 stays 0, then dest_new[destlen-1] writes
	  at dest_new[SIZE_MAX] (heap OOB-write underflow). Double odestlen
	  instead and compute the new destlen from it.
	  2. After realloc, dest was reset to dest_new (base), losing its
	  position within the buffer. The next iconv call would overwrite
	  previously converted output instead of appending. Preserve the
	  offset: dest = dest_new + (dest_old - odest_old).

	  Also remove the now-unnecessary dest_new[destlen-1]='\0' hack since
	  the NUL terminator is written at the success path
	  and the extra +1 in the allocation always leaves room.
	* test/unit-testing/bits_test.c: iconv NUL-termination test for
	  bit_TV_to_utf8 (commit dc8e3509).
	* test/unit-testing/encode_test.c: double-free test for
	  COMMON_ENTITY_HANDLE_DATA (commit 6deac10e).

	GH #1209

2026-05-31  Reini Urban  <reini.urban@gmail.com>
	    codewhale + DeepSeek V4 Pro  <deepseek@deepseek.com>

	tests: add dwgfilter.test for programs/dwgfilter
	Test basic jq queries against DWG JSON output: header variables,
	object counts, entity type filtering, --help/--version, error
	handling, --debug flag, and -i write-back mode.

	* programs/dwgfilter.test.in: New file.
	* programs/Makefile.am (TESTS): Add dwgfilter.test (HAVE_JQ).
	  (DISTCLEANFILES): Add dwgfilter.test.
	* configure.ac (AC_CONFIG_FILES): Add dwgfilter.test.
	* CMakeLists.txt: Add dwgfilter.test (NOT DISABLE_JSON).

2026-05-31  Reini Urban  <reini.urban@gmail.com>

	tests: fix decompress_R2004_section test vectors (wrong dec.size)
	The two decompress_R2004_section test cases used dec.size equal to the
	expected output length (123 and 53 bytes).  The real decoder allocates
	dec at max_decomp_size (0x7400 = 29696) per section.  With the smaller
	buffers the decompressor hit the end-of-buffer guard added to cap the
	large LZ77 back-copy that fills the page:

	  auxh: >C 29564 at dec[116] -> end=29680; 29680 >= 123 -> VALUEOUTOFBOUNDS
	  ofs:  iteration 4 end=55 >= 53, and later >C 30137 -> end=30192

	Fix: allocate 29696 for auxh (exact real-decoder size) and 32768 for ofs
	(covers the >C 30137 copy landing at dec[30192] plus 13 literals = 30205).
	The meaningful bytes in dec.chain[0..N-1] are identical; only the
	memcmp range is kept at sizeof(expected).

	* test/unit-testing/decode_test.c (decompress_R2004_section_tests):
	  Change dec allocation from sizeof(expected) to 29696/32768.  Remove
	  the now-wrong dec.size == sizeof(expected) check from the auxh test.
	  Restore fail() from todo().

	Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

2026-05-31  Reini Urban  <reini.urban@gmail.com>

	tests: add decompress_r2007 OOB regression tests (CWE-125)
	Regression tests for the two heap-buffer-overflow read sites in
	decompress_r2007() that were fixed since commit 939a6f5:

	- Test B: read_literal_length() do/while(n==0xFFFF) loop with a
	  2008-byte 0xff-filled buffer (mirrors calloc(block_count=8,251)
	  in read_data_page()).  Unguarded, the loop walks past the end;
	  with the src_end bound check it returns DWG_ERR_INTERNALERROR.

	- Test A: read_instructions() case-0 two-byte read with src==src_end.
	  Minimal 12-byte stream ending at the instruction opcode; with the
	  CHECK_SRC(2) guard it returns DWG_ERR_INTERNALERROR.

	src_size=2008 mirrors the real allocation: size_comp is an
	attacker-controlled R2007 page-header field.

	* src/decode_r2007.c (decompress_r2007): Remove static; the forward
	  declaration becomes redundant with the decode.h prototype.
	* src/decode.h: Declare decompress_r2007 under the existing
	  '/* from decode_r2007.c */' block, parallel to obj_string_stream.
	* test/unit-testing/decode_test.c (decompress_r2007_tests): New
	  function with tests A and B.  Wire into main(); fix main() to
	  return numfailed()?1:0 instead of always 0.
	  (decompress_R2004_section_tests): Convert the two fail() calls to
	  todo(): the test vectors trigger DWG_ERR_VALUEOUTOFBOUNDS since
	  decompress_R2004_section became stricter about out-of-range copy ops
	  (see the GH comment in decode.c); they need regenerated vectors.

	Co-Authored-by: Michalis Vasileiadis
	Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

2026-05-31  Reini Urban  <reini.urban@gmail.com>

	F-1 CWE-494: Fix CI supply-chain: https+sha256 for build helpers, vendor svg11 schema
	install-relaxng-svg11: the original script fetched over plaintext HTTP
	with no integrity check, then ran `sudo unzip` on unverified content —
	allowing an on-path MITM to write arbitrary files as root in the runner.
	Fix: vendor the immutable 2006 svg11-relaxng-20060604.zip (41 KB) into
	build-aux/ and copy it locally; add a sha256 check before extraction.
	Falls back to HTTPS download + same sha256 check if the vendored copy
	is absent.

	install-libxslt, install-pslib: already used HTTPS but had no integrity
	check.  Add pinned sha256 verification after download.

	Reported-by: Michalis Vasileiadis
	Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

2026-05-31  Reini Urban  <reini.urban@gmail.com>
	    cubic-dev-ai[bot]  <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
	    Copilot Autofix powered by AI  <175728472+Copilot@users.noreply.github.com>

	F-2 CWE-377: Replace predictable temp file in dwgfilter with mktemp
	Replace /tmp/dwgfilter-$$.json (PID-only entropy, world-writable /tmp)
	with mktemp so the path is unpredictable.  Add a trap to clean up the
	temp file on EXIT/INT/TERM in normal mode; in --debug mode the trap is
	skipped and the path is printed so the file can be inspected.

	On BSD/macOS mktemp, the X placeholders must be at the end of the template.

	Reported-by: Michalis Vasileiadis
	Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

2026-05-31  Reini Urban  <reini.urban@gmail.com>
	    DeepSeek V4 Pro  <deepseek@deepseek.com>

	F-4 CWE-116: Fix JSON escaping in 3DSOLID acis_data and json_cquote 0x1f byte
	out_json.c json_cquote: change `c < 0x1f` to `c <= 0x1f` so byte 0x1f
	(unit separator) is escaped per RFC 8259 (U+0000..U+001F must be escaped).

	out_json.c json_3dsolid: restore the json_cquote() call that was commented
	out, replacing the raw fprintf that emitted attacker-controlled SAT text
	(including `"` and `\`) unescaped into JSON output.

	Reported-by: Michalis Vasileiadis
	Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
	Review fixes suggested by GH Copilot:

2026-05-31  Reini Urban  <reini.urban@gmail.com>
	    Copilot Autofix powered by AI  <175728472+Copilot@users.noreply.github.com>

	F-3 CWE-125: Fix OOB reads in decompress_r2007 (read_instructions, read_literal_length)
	Pass src_end to read_instructions() and read_literal_length() and bounds-check
	every *(*src)++ before it executes.  Both functions now return int (0 / DWG_ERR_*)
	so callers in decompress_r2007() can propagate the error.

	read_literal_length: the do-while loop accumulating 0xFFFF-continued lengths
	had no bound check at all, allowing src to walk arbitrarily past the buffer.

	read_instructions cases 0 and 1: each consumed 2 bytes past src without
	checking src < src_end; case 2 had up to 4 unchecked reads.

	Forward declarations updated to match.

	Reported-by: Michalis Vasileiadis
	Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

	fix: avoid undefined behavior in CHECK_SRC pointer arithmetic

	Replace `*src + (n) > src_end` with `src_end - *src < (n)` to avoid
	undefined behavior when pointer is already at buffer end.

2026-05-25  Reini Urban  <reini.urban@gmail.com>

	Fix NULL pointer dereferences in DXF output for corrupted DWG input
	* src/dwg.spec (APPID DXF block): check _obj->name for NULL before
	  strncmp, caused SEGV on malformed APPID table records.
	* src/out_dxf.c (FIELD_HANDLE_NAME): add NULL checks for o->dxfname
	  and o->tio.object->tio.BLOCK_HEADER->name to avoid SEGV and
	  bit_convert_TU crash when name pointers are NULL or corrupt.

2026-05-25  Reini Urban  <reini.urban@gmail.com>

	Fix stack buffer overflow in JSON scalar field size checks
	When a JSON primitive is provided for a VECTOR_INL field (e.g.
	LTYPE.dashes_r11 which is RD with size 96), _set_struct_field
	passed a pointer to a local variable to dwg_dynapi_field_set_value
	which then read the full field size from stack, causing ASAN
	stack-buffer-overflow.

	* src/in_json.c (_set_struct_field): check f->size before calling
	  dwg_dynapi_field_set_value with local scalars for BD/RD/BT,
	  RC/B/BB/RS/BS/RL/BL/4BITS variants, and RLL/BLL. Throw
	  DWG_ERR_INVALIDTYPE if the field is larger than expected.

2026-05-18  Reini Urban  <reini.urban@gmail.com>

	Fix r11 DXF roundtrips: rotation angle unit conversion
	* src/out_dxf.c (FIELD_RD): Convert radians to degrees for DXF group
	codes 50-54, matching VALUE_BD. Pre-R13 entities use FIELD_RD for
	angles in dwg.spec, but DXF expects degrees while r11 DWG stores
	radians.

	Fixes INSERT, ATTDEF, ATTRIB, TEXT rotation and ARC start/end angles
	in r11 DXF roundtrips.

	Co-Authored-by: Kimi-k2.6 <kimi@moonshot.cn>

2026-05-18  Reini Urban  <reini.urban@gmail.com>

	Fix r11 DXF roundtrips: POLYLINE vertices, SEQEND, BLOCK
	- src/out_dxf.c (decl_dxf_process_VERTEX): Add PRE (R_13b1) block to
	  output VERTEX and SEQEND sub-entities for pre-R13 POLYLINE DXF.
	- out_dxf.c: For pre-R13 DXF output, replace _hdr->entities[] iteration
	  with ownerhandle-based object-order iteration so SEQEND and VERTEX
	  sub-entities (not in entities list) are correctly output in sequence.
	  Use two-level owner resolution so SEQEND/VERTEX (owned by INSERT/POLYLINE)
	  are correctly included in model space output.
	- out_dxf.c: Fix SEQEND output for pre-R13 (was commented out as 'stale').
	  Remove stale warnings for ATTRIB/VERTEX in pre-R13 mode.
	- out_dxf.c: Add HEADER_HANDLE_NAME0 macro that skips output when name
	  resolves to empty, preventing ODA "Empty Record name" error from
	  $UCSNAME/$PUCSNAME with no active UCS.
	- src/encode.c: Set FLAG_R11_HAS_ATTRIBS on POLYLINE when has_vertex
	  is true, so the encoder writes the correct flag_r11.
	- src/in_dxf.c (dxf_fixup_header): Reset dwg_version to 0 for pre-R13.
	- src/dwg.spec (POLYLINE_2D): Output group 66 (has_vertex) for r11 DXF.
	- header_variables_dxf.spec: Use HEADER_HANDLE_NAME0 for UCSNAME, PUCSNAME.
	  Add SINCE(R_13b1) guard to $CMLSTYLE/$CMLJUST/$CMLSCALE (R13+ only).
	- in_dxf.c: Propagate entmode from parent INSERT/POLYLINE to SEQEND/VERTEX
	  so encoder places them in the entities section (not extras).
	- encode.c: Pre-encode SEQEND.begin_addr_r11 from owner address (already
	  present), add DWG_TYPE_BLOCK opts_r11 case (HAS_BLOCK_NAME for named blocks).

	Fixes missing POLYLINE vertices and SEQEND in r11 DXF roundtrips and
	empty r11 record names.

	Co-Authored-by: Kimi-k2.6 <kimi@moonshot.cn>

2026-05-18  Reini Urban  <reini.urban@gmail.com>

	Fix r11 DXF roundtrips for entities-2d
	out_dxf: Skip STYLE table entries with empty names (SHAPE xrefs) since
	ODA rejects empty record names in r11 DXF output.

	in_dxf: For r11 DXF import, create BLOCK_HEADER objects for user-defined
	and star-blocks (*D etc.) when reading the BLOCKS section, since r11 DXF
	has no TABLE BLOCK section. Use dwg_next_handle to avoid HANDSEED
	issues and set r11_idx on entries for correct postprocessing resolution.

	in_dxf: Set flag_r11 HAS_ELEVATION/HAS_THICKNESS bits when codes 38/39
	are read for pre-r13 entities in the common entity field loop.

	common_entity_data.spec: Fix JUMP check to use obj->fixedtype != DWG_TYPE_JUMP
	instead of obj->type != DWG_TYPE_JUMP_r11, since DWG_TYPE_CIRCLE (0x12=18)
	collides with DWG_TYPE_JUMP_r11 (18), causing DXF-imported CIRCLE entities
	to incorrectly skip layer and opts_r11 fields.

	dwg.spec (ARC): Use FIELD_BD for start/end_angle in IS_DXF output so
	radian values are converted to degrees. DXF angles are in degrees but
	r11 DWG stores them in radians.

	encode.c: Pre-compute opts_r11 for TEXT, INSERT, MINSERT, SHAPE, BLOCK entities
	before encoding pre-r13 DWG, since DXF format does not store r11-specific
	opts_r11 flags. Also sync TRACE/SOLID elevation to elevation_r11.

	Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

	Fix r11 dwgadd test: pre-R13 handle size mismatch for code 1

	In encode_preR13_entities, VALUE_HANDLE used handleref.size to decide
	whether to write an RC (1 byte) or RS (2 byte) handle.  For API-created
	objects dwg_add_handleref forces handleref.size to 2 for all pre-R13
	handles, but the decoder uses the handle_code argument (code==1 => RC,
	else RS) to decide the size.

	This caused a 1-byte misalignment for SHAPE entities, which use a
	code-1 style handle in r11 (and older).  The misaligned decoder then
	read garbage types and entered an infinite loop.

	Fix by using handle_code to pick the size, matching the decoder.

	src/enc_macros.h (VALUE_HANDLE): For pre-R13, ignore handleref.size
	and use handle_code == 1 ? 1 : 2.

	Co-Authored-by: Kimi-k2.6 <kimi@moonshot.cn>

2026-05-16  Reini Urban  <reini.urban@gmail.com>

	Fix heap-buffer-overflow in bit_convert_TU via dwggrep LTYPE search (GH #1246)
	A malformed DWG can cause LTYPE.strings_area (a 512-byte binary buffer)
	to lack a wide null terminator. When dwggrep searched it as a single
	TU string via bit_convert_TU, the scan read past the allocation.

	Fix by:
	* Adding bit_convert_TU_len() which limits the scan to max_wchars and
	  returns NULL if no null terminator is found within bounds.
	* Changing dwggrep match_LTYPE to search individual dashes[i].text
	  strings (which are properly bounded within strings_area) instead of
	  the raw binary buffer, using bit_convert_TU_len for R2007+.

	* src/bits.c (bit_convert_TU_len): New bounded TU-to-UTF8 converter.
	* src/bits.h: Declare bit_convert_TU_len.
	* programs/dwggrep.c (match_LTYPE): Search dashes text safely.

	Co-Authored-by: Kimi-k2.6 <kimi@moonshot.cn>

2026-05-16  Reini Urban  <reini.urban@gmail.com>

	Fix NULL pointer dereference in free_TABLESTYLE_r2010 (GH #1143)
	Guard the borders[] inner loop with a NULL check for rowstyles[i].borders.
	When a TABLESTYLE object is partially initialized (e.g. from fuzzed input),
	the borders array may be NULL but the unconditional loop tried to access
	borders[j], causing a SEGV at a small offset from zero.

	* src/free.c (free_TABLESTYLE_r2010): Add _obj->rowstyles[i].borders NULL check.

	Co-Authored-by: Kimi-k2.6 <kimi@moonshot.cn>

2026-05-16  Reini Urban  <reini.urban@gmail.com>

	Fix OOM in add_ent_preview on fuzzed DXF input (GH #1006, GH #1144)
	Cap entity preview_size at 16MB (0x1000000) to prevent ASAN abort on
	huge allocation requests from malformed DXF files. The existing
	MAX_SIZE_BUF check (1TB in ASAN builds) was too permissive.

	* src/in_dxf.c (add_ent_preview): Add preview_size > 0x1000000 guard.

	Co-Authored-by: Kimi-k2.6 <kimi@moonshot.cn>

2026-05-16  Reini Urban  <reini.urban@gmail.com>

	Fix use-after-free in dxf2dwg on error path (GH #474)
	When dxf_read_file fails with a critical error, dxf2dwg frees
	filename_out but does not clear the pointer.  On the next loop
	iteration strEQ(filename_in, filename_out) accesses freed memory.

	programs/dxf2dwg.c (main): Set filename_out to NULL after free.

	Co-Authored-by: Kimi-k2.6 <kimi@moonshot.cn>

2026-05-16  Reini Urban  <reini.urban@gmail.com>

	Populate VIEWPORT id after DWG read (GH #1213)
	For R13+ DWG files the VIEWPORT entity does not store the id (DXF 69)
	and on_off (DXF 68) fields in its binary format; they are only
	computed during DXF export.  This caused the API to report id=0 for
	all viewports after reading a DWG.

	Add a post-processing step in dwg_read_file that iterates over all
	objects and assigns auto-incremented viewport ids (starting at 1) to
	active viewports, and id=0/on_off=0 to the overall paperspace
	viewport (entmode 0).

	src/dwg.c (dwg_fixup_viewport_ids, dwg_read_file): New helper and call.

	Co-Authored-by: Kimi-k2.6 <kimi@moonshot.cn>

2026-05-16  Reini Urban  <reini.urban@gmail.com>

	Fix R2004 section address bounds check (GH #1239)
	read_2004_compressed_section read 32 bytes from dat->chain[address]
	without verifying that address + 32 fit within the input buffer size.

	src/decode.c (read_2004_compressed_section): Add check
	  address + 32 > dat->size before the memcpy.

	Co-Authored-by: Kimi-k2.6 <kimi@moonshot.cn>

2026-05-16  Reini Urban  <reini.urban@gmail.com>

	Fix UNKNOWN_ENT/UNKNOWN_OBJ name and fixedtype override (GH #1238)
	When an object decode falls back to UNKNOWN_ENT or UNKNOWN_OBJ, the
	setup macros did not override obj->name and obj->fixedtype if they had
	already been set by a previous classification (e.g. UNHANDLED_CLASS in
	classes.inc).  This caused dwg_dynapi_entity_value to look up fields for
	the wrong entity type and read past the small UNKNOWN_ENT allocation.

	src/dec_macros.h (DWG_ENTITY, DWG_OBJECT): Force obj->name, obj->dxfname,
	  and obj->fixedtype to UNKNOWN_ENT / UNKNOWN_OBJ.

	Co-Authored-by: Kimi-k2.6 <kimi@moonshot.cn>

2026-05-16  Reini Urban  <reini.urban@gmail.com>

	Fix R2004 decompression buffer overflows (GH #1254, #1255, #1251)
	Two related bugs caused heap-buffer-overflows during R2004 section
	decompression:

	2. read_2004_compressed_section set dec.size larger than the actual
	   calloc allocation when es.fields.address + info->max_decomp_size
	   exceeded max_decomp_size.  The decompressor then wrote past the
	   allocated buffer.

	3. dat->size was inflated by es.fields.data_size without capping to
	   the actual file size, causing the decompressor to read past the
	   input buffer.

	src/decode.c (read_2004_compressed_section): Add bounds checks for
	  es.fields.address + info->max_decomp_size and cap dat->size to
	  orig_size.

	Co-Authored-by: Kimi-k2.6 <kimi@moonshot.cn>

2026-05-16  Reini Urban  <reini.urban@gmail.com>

	Fix dwg_bmp thumbnail overflow checks (GH #1252, #1255)
	Several overflow checks in dwg_bmp were incorrect:

	* The check `osize > (dat.size - 4)` could underflow when dat.size < 4
	  because dat.size is size_t (unsigned).  Add `dat.size < 5` guard.

	* The loop guard `dat.byte > dat.size` used strict greater-than, allowing
	  reads when dat.byte == dat.size.  Use >= instead.

	* The BMP size check `*size > (dat.size - 4)` did not account for bytes
	  already consumed by header entries.  Check against `dat.size - dat.byte`.

	* The final overflow check `header_size + *size > dat.size` did not account
	  for the header entry bytes already consumed.  Check `dat.byte + *size`.

	src/dwg.c (dwg_bmp): Fix all four checks.

	Co-Authored-by: Kimi-k2.6 <kimi@moonshot.cn>

2026-05-16  Reini Urban  <reini.urban@gmail.com>

	fix dwg_next_entity NULL pointer dereference
	Fixes GH #1253

2026-05-16  Reini Urban  <reini.urban@gmail.com>
	    "opencode + DeepSeek V4 Pro /high"  <deepseek@deepseek.com>

	fix 2 long-standing eed off-by-one bugs
	fix UAF in eed_need_size case 3 and buffer overflows

	eed_need_size adds 1 internally for the code byte that sits at offset 0
	in the packed Dwg_Eed_Data struct.  This fixes buffer overflows in cases
	10-15 (3RD, 24 bytes), 40-42 (RD, 8 bytes), 70 (RS, 2 bytes), 71 (RL, 4
	bytes).
	Also fix the use-after-free in case 3 by refreshing the data
	pointer after eed_need_size reallocation, matching the pattern used by
	other cases.  Adjust need values in cases 0, 1, 3, 4 to match.

	Fixes GH #1257

2026-05-16  Reini Urban  <reini.urban@gmail.com>
	    "opencode + DeepSeek V4 Pro /high"  <deepseek@deepseek.com>

	demote UNKNOWN_OBJ/ENT warn to trace in dwg_free_variable_type
	The dxf_test exercises unstable (UNKNOWN_OBJ/UNKNOWN_ENT) objects
	which naturally have no matching class.  Demote the LOG_WARN to
	LOG_TRACE for these expected cases, keeping LOG_WARN for genuine
	surprises.

2026-05-16  Reini Urban  <reini.urban@gmail.com>
	    "opencode + DeepSeek V4 Pro /high"  <deepseek@deepseek.com>

	dynapi: fix double-offset in JSON embedded struct parser
	in_json.c _set_struct_field at the embedded struct handler computes the
	field address with both the parent offset and the field offset, then
	passes it to _set_struct_field which internally calls
	dwg_dynapi_field_set_value adding the field offset again.  This double-
	offset writes to the wrong memory location, corrupting adjacent fields.

	When data_long=0xDEADBEEF is then followed by a data_string= set via
	dot notation, the corrupted string pointer causes free(0xDEADBEEF) to
	crash.

	Fixes GH #1258


	The bug was found by Claude, and Claude only suggested a simple NULL
	guard in TABLE_value_fields. I asked DeepSeek 4 to check the proper fix,
	and it found the real root-cause then, the double-offset! Better than
	Claude already, for a tenth of the price.

2026-05-16  Reini Urban  <reini.urban@gmail.com>

	win32: fix appveyor-deploy to include libgcc_s_dw2-1.dll
	Fixes GH #1259

2026-05-06  Reini Urban  <reini.urban@gmail.com>

	ci: oda updated to ODAFileConverter_QT6_lnxX64_8.3dll_27.1.deb
	and does not need libpng12 anymore

2026-04-29  Reini Urban  <reini.urban@gmail.com>

	indxf: fix a null-deref
	fuzzing mostly, because there is always a VPORT name.

2026-04-28  mmgehlot  <gehlot.21@gmail.com>

	test/bits: add aliasing-return regression for bit_TV_to_utf8
	Lock in the contract that bit_TV_to_utf8 may return its input `src`
	pointer unchanged on the fast paths exercised by VALUE_TV in
	out_dxf.c. Without explicit pointer-equality assertions, a future
	contributor could "tighten" the function to never alias and re-add
	ATTRIBUTE_MALLOC, silently re-introducing the optimizer-induced
	free() of caller stack buffers that this PR fixes.

	Asserts pointer equality on three paths reachable from the public
	function:

	  1. CP_UTF8 + pure-ASCII input without \U+/\M+ markers — the path
	     actually triggered in dxf_CMC for the Panchvati R2018 DWG that
	     surfaced the bug. Aliases on every build.
	  2. CP_UTF8 + empty string — same line-3372 branch as (1); aliases
	     on every build regardless of HAVE_ICONV.
	  3. CP_UNDEFINED — typically aliases via the `!charset`
	     short-circuit. On builds without iconv this routes through
	     bit_TV_to_utf8_codepage and may return a fresh allocation; both
	     are accepted (the contract is "alias OR fresh malloc", what's
	     forbidden is an attribute-malloc claim that lets the optimizer
	     elide the alias guard).

	Addresses qodo-code-review's PR #1250 finding "No regression test
	for aliasing" (PR Compliance ID 5: add tests for bug fixes).

	Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

2026-04-28  mmgehlot  <gehlot.21@gmail.com>

	bits: drop ATTRIBUTE_MALLOC from bit_TV_to_utf8
	bit_TV_to_utf8 is documented to "return ... the unchanged src string,
	or a copy" and in fact returns the input pointer on at least four
	paths:

	  - bit_TV_to_utf8_codepage: codepage == 0 fallback
	  - bit_TV_to_utf8: CP_UTF8 with no \U+/\M+ markers
	  - bit_TV_to_utf8: HAVE_ICONV + iconv() EINVAL fallback (returns
	    bit_u_expand(osrc), and bit_u_expand returns its input pointer
	    unchanged in pointer value)
	  - bit_TV_to_utf8: empty srclen via charset short-circuit

	Despite that, the prototype/definition were annotated
	__attribute__((malloc)). That attribute promises every non-NULL
	return is fresh, non-aliasing memory — which is false here.

	Under -O2/-O3, GCC and Clang exploit the malloc attribute to prove
	the alias guard in the VALUE_TV macro is dead code:

	    char *u8 = bit_TV_to_utf8 ((char *)value, dat->codepage);
	    dxf_fixup_string (dat, u8 ? u8 : (char *)value, 1, dxf);
	    if (u8 && u8 != (char *)value)   <-- compiler proves "always true"
	      free (u8);                     <-- becomes unconditional

	The guard is elided and free() is called on the caller's input
	pointer. In dxf_CMC (out_dxf.c:1261) the input is `char name[256]`
	on the stack, producing:

	  free(): invalid pointer  (SIGABRT, exit 134)

	Reproduced on a real-world Panchvati DWG (R2018) at -O2. AddressSanitizer
	confirms:

	  ERROR: AddressSanitizer: attempting free on address which was not
	  malloc()-ed: 0x7ff7b8b20e20
	    #1 dxf_CMC out_dxf.c:1261
	  This frame has 1 object(s):
	      [32, 288) 'name' (line 1234) <== bad-free target
	  SUMMARY: bad-free out_dxf.c:1261 in dxf_CMC

	The bug only manifests at -O2/-O3 because -O0/-O1 do not exploit
	the attribute hint, which is why test suites and debug builds
	miss it.

	Fix: remove ATTRIBUTE_MALLOC from both the prototype (src/bits.h)
	and the definition (src/bits.c) of bit_TV_to_utf8. The function's
	existing semantics (input-aliased return value is legitimate, and
	the VALUE_TV alias guard is correct) are preserved; we just stop
	lying to the optimizer.

	A separate audit of bit_TV_to_utf8_codepage shows it has the same
	issue (also annotated ATTRIBUTE_MALLOC, also returns (char *)src on
	codepage==0). It is static and only reached via bit_TV_to_utf8
	fallbacks; the alias guard at every reachable call site is the same
	VALUE_TV macro, so it is covered by this fix in practice. A
	follow-up may want to drop the attribute there too for defensiveness.

	Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

2026-04-24  Reini Urban  <reini.urban@gmail.com>

	decode: generalize the decompressor oob checks
	Fixes GH #1239

	decode: fix a teigha empty TEMPLATE bug
	GH #1239, poc_r2004_memcpy.dwg

2026-04-23  Reini Urban  <reini.urban@gmail.com>

	decode: fix another decompression overflow
	some regular overflow.
	Fixes GH #1242, #1243, Thanks to HackC0der for some fuzzing

	decode: fix decompression overflow
	es.fields.address + size wrapping over, to < dec.size.
	Fixes GH #1245, #1248, Thanks to HackC0der for some fuzzing

2026-04-10  Reini Urban  <reini.urban@gmail.com>

	spec: harmonize VPORT/VIEW/VIEWPORT fields with HEADER
	r11 stores some VPORT fields in VPORT not the header.
	So we best use the HEADER name, which is fixed due to be being named
	in DXF.
	on indxf set the header vars from the *Active VPORT.

	rename circle_zoom_percent => circle_zoom, twist_angle => VIEWTWIST,
	lens_length => LENSLENGTH, front_clip_z => FRONTZ, back_clip_z => BACKZ.

2026-04-09  Reini Urban  <reini.urban@gmail.com>

	WIP r11 in_dxf: register more block and table handles

2026-04-08  Reini Urban  <reini.urban@gmail.com>

	in_dxf: Fix LTYPE entries for pre-R13 DXF roundtrip
	Wrong find_hv logic!

	For r11/r12 DXF, BYBLOCK and BYLAYER linetype entries have no handles
	(abs:0 placeholders). Patch their absolute_ref/handleref.value when the
	actual LTYPE object is encountered during dxf_tables_read, and also
	update LTYPE_BYLAYER/BYBLOCK header vars accordingly.

	Also fix the inverted find_hv logic: the old code had the push in the
	`else` branch (entry already present), so CONTINUOUS and other regular
	linetype entries were never added to LTYPE_CONTROL.entries. This caused
	all layer/entity ltype refs to resolve to -1 in the r11/entities-2d
	roundtrip.

	* src/in_dxf.c (dxf_tables_read): Detect bylayer/byblock with abs:0
	and set their refs by name match. Invert find_hv < 0 branch to add
	entry when not already present.

2026-04-08  Reini Urban  <reini.urban@gmail.com>

	r11: set the 3 special HEADER.LTYPE_* handles
	when looking them up.
	see dwg_find_tablehandle_index for the special index values.

	dxf: fix r11 dwg_handle_name
	i.e. table names, like $TEXTSTYLE, $CLAYER, ...

2026-04-07  Reini Urban  <reini.urban@gmail.com>

	indxf: set ref->r11_idx in PUSH_HV
	esp. for table controls.
	also preserve table index for pre-R13

	but the blocks and entities are still wrong.

2026-04-07  Reini Urban  <reini.urban@gmail.com>

	encode: fix r11 entities and blocks entmode and types from in_dxf
	Fix three related issues in the r11 encode/decode DXF roundtrip:

	1. in_dxf.c: set entmode=3 (not 0) for regular block entities in
	   dxf_blocks_read. Modelspace blocks still get entmode=2.

	2. dwg.spec BLOCK entity: add pre-R13 DXF output for block name (code 2),
	   using same BLOCK_HEADER lookup as R13+. Without the name, in_dxf
	   cannot distinguish *MODEL_SPACE from named blocks.

	3. encode.c encode_preR13_entities filtered loop:
	   - Fix ENTITIES_SECTION_INDEX: allow entmode==2 entities through even
	     after past_blocks is set (mspace entities come after block objects
	     in DXF-roundtrip object lists).
	   - Fix EXTRAS_SECTION_INDEX: skip entmode==2 entities (they belong in
	     ENTITIES section, not EXTRAS).
	   - Add fixedtype_to_r11_type() to convert modern entity fixedtype to
	     R11 type codes. Entities created via in_dxf have obj->type set to
	     modern enum values (e.g. DWG_TYPE_POINT=27), but R11 DWG format
	     needs the legacy type codes (e.g. DWG_TYPE_POINT_r11=2).

2026-04-06  Reini Urban  <reini.urban@gmail.com>

	test: log xvfb-run in dxf-check json-check
	as in dxf.test

	encode: fix missing r11 auxheader.plot_stamp
	fixes writing r11 DWG

	doc updates for 0.14

2026-04-06  Reini Urban  <reini.urban@gmail.com>

	encode: shift larger>127 objects on changed UMC handlestream_size
	add a small helper to measure actual UMC width, track the originally
	written handle-size width, and shift the BOT/payload when the
	rewritten UMC needs more or fewer bytes.

	Didn't fix the CRC DXF 2010 roundtrip errors yet, but getting closer.

2026-04-06  Reini Urban  <reini.urban@gmail.com>

	in_dxf: fix r2010 dxf roundtrip Out of range regression
	Copy $ACADMAINTVER from header_vars to hdr->maint_version in
	dxf_fixup_header. maint_version > 3 controls whether bitsize_hi is
	written in section headers, which ODA requires for R_2004+.
	The previous WIP commit correctly set header.version = from_version
	(R_2010) during DXF import, but lost the maint_version = 0x8 that
	was previously set in the R_2000 code path.

	WIP: investigate r2010 ODA CRC header layout failures
	set R2004_Header.unknown_long
	fix 2ndheader padding.
	set more dwg versions in in_dxf already.
	write empty sections AppInfoHistory and FileDepList, dont skip em.

2026-04-05  Reini Urban  <reini.urban@gmail.com>

	in_dxf: preserve underlay clip vertex counts
	* src/in_dxf.c (new_object): Reuse num_clip_verts while
	reading underlay DXF clip vertex pairs and grow the array as
	vertices are imported.

	encode: fix XRECORD off-by-one errors
	and change padding from 1-bits to 0-bits for the handles

	in_dxf: add missing MULTILEADER LEADER_LINE DXF codes
	Add cases for DXF codes 340 (ltype handle), 341 (arrow_handle),
	and 271 (attach_dir) in add_MULTILEADER_lines. These R2010+
	fields were missing, causing early error return and cascading
	failures for subsequent MULTILEADER fields during DXF import.
	Also fix the log message for code 93 (flags, not line_index).

	fix DIMSTYLE.DIMTFILLCLR wrong CMC method after INDXF roundtrip
	bit_write_CMC: default uninitialized CMC (method=0, rgb=0) to ByBlock
	(0xc1) instead of writing invalid method 0x00.
	dxf_CMC: with FIELD_CMC0 (opt=1), still write index for ByBlock
	(method 0xc1), since index=0 is a meaningful value, not a default to suppress.

	encode2: apply R2007+ split string stream to dwg2.spec objects
	encode2.c had its own DWG_ENTITY/DWG_OBJECT macro copies that were
	not updated with the split stream changes. This caused VISUALSTYLE,
	LIGHT, and other dwg2.spec objects to write strings inline instead of
	to the separate str_dat buffer.

	encode: set zero_one_or_three = 3 with r2004+

	enc_macros: FIELD_VECTOR_T use FIELD_T for R2007+ split streams
	FIELD_VECTOR_T had a shortcut for same-version encoding that wrote
	strings directly to dat with bit_write_TV, bypassing the split string
	stream. For R2007+, always use FIELD_T which writes to str_dat.

2026-04-05  Reini Urban  <reini.urban@gmail.com>

	encode: R2007+ object-level split string stream
	For R2007+ objects, allocate a separate str_dat buffer so FIELD_T
	writes strings to a separate stream. At START_HANDLE_STREAM, assemble
	the string footer (data_size RS + has_strings B) and copy the string
	data before computing bitsize.

	Fix dwg_encode_entity/object to not overwrite the separate str_dat
	chain with dat's chain pointer.

2026-04-05  Reini Urban  <reini.urban@gmail.com>

	WIP encode: R2007+ split-stream encoding for Header and Classes sections
	- encode_header_vars: use separate Bit_Chain buffers for main, handle,
	  and string streams. Assemble as [main][strings+footer][handles] with
	  proper bitsize/hsize fields.
	- encode_classes: split non-string fields (main stream) from class name
	  strings (string stream) with proper string footer (data_size + endbit).
	- enc_macros.h: fix SECTION_STRING_STREAM/END_STRING_STREAM to save/restore
	  dat as pointer instead of value copy, preventing str_dat corruption.
	- encode.c: add hsize(RL) and bitsize(RL) to classes section for R2010+.
	- encode.c: fix summaryinfo_address to add +32 for page header offset.
	- encode.c: keep max_decomp_size aligned (don't reduce to actual data size).
	- bits.c: fix bit_write_T16 R2007+ to not write null terminator (match reader).

	ODA error improved from "Out of range" to "CRC does not match".

2026-04-05  Reini Urban  <reini.urban@gmail.com>

	dxfwrite: accept DXB

	programs: can write all but r2007

	spec: rename HEADER/2NDHEADER.is_maint to maint_rel_version
	because that is how it is documented in the ODA specs

2026-04-04  Reini Urban  <reini.urban@gmail.com>

	in_json: fix empty XRECORD xdata roundtrip GH #1043
	When num_xdata is 0, skip the Resbuf allocation and return early
	with xdata = NULL and xdata_size = 0. Previously the unconditional
	calloc left a non-NULL xdata pointer, causing the encoder to write
	a spurious 2-byte empty resbuf entry.

	out_json: fix non-UTF8 output for codepoints 0x80-0xff GH #1039
	print_wcquote had c > 0xff which let Latin-1 range characters
	(like ä ü ø) pass through as raw bytes instead of converting
	to UTF-8.

	python: fix _LibreDWG.so missing on Windows GH #975
	Add -avoid-version to prevent libtool from producing _LibreDWG-0.dll,
	and detect Python's EXT_SUFFIX to pass -shrext .pyd on Windows.

	in_dxf: fix PERSUBENTMGR missing num_subents/subents parsing
	add_PERSUBENTMGR() returned after reading steps[] without reading
	num_subents and subents[]. The remaining DXF 90 codes were then
	re-interpreted as class_version etc., corrupting the object data
	and causing ODA to reject with "Object improperly read:
	<AcDbPersSubentManager>".

	out_dxf: fix off-by-one in dwg_convert_SAB_to_SAT1 GH #1184
	The boundary check `src.byte + len >= src.size` rejected valid SAB data
	when the record ended exactly at the buffer boundary. Changed to `>`
	since reading `len` bytes from `src.byte` only needs `src.byte + len`
	to be at most `src.size`.

2026-04-04  Reini Urban  <reini.urban@gmail.com>

	out_dxf: fix SORTENTSTABLE sort_ents output
	FIELD_HANDLE was skipping sort_ents (DXF code 5) when ->obj was NULL,
	but sort_ents are sort-order handles that don't necessarily point to
	real objects. This broke the 331/5 pairing in the DXF output, causing
	ODA to reject the file with "Object improperly read: <AcDbSortentsTable>".

	Fix: for DXF code 5 handles, only check absolute_ref (not ->obj) in
	both the skip condition and the output value. Also guard the DXF loop
	in the spec to skip both ent and sort_ent together when the ent is
	invalid.

	Fixes dxf-check 2004/HatchG roundtrips and SORTENTSTABLE ODA error.

2026-04-04  Reini Urban  <reini.urban@gmail.com>

	test: use xvfb-run with some ODAFileConverter's

	decode: fix MLINESTYLE loop GH #1230
	the display of lt.index = 32767 as BSd is correct.

	dwg_next_handseed: skip existing handles in object_map GH #1229
	dwg_next_handseed blindly incremented HANDSEED without checking if
	the handle was already taken. For r10 files with low HANDSEED values,
	this caused duplicate handle errors during table reading.

	spec: fix DIMSTYLE.DIMCLRD_N GH #1234
	get rid f the RS method <r13. rather add a CMC branch <r13 to use RS.
	Problem with in_dxf of DIMSTYLE 176-178.

2026-04-04  Reini Urban  <reini.urban@gmail.com>

	dxf,encode: fix writing CMC
	compose method and rgb, fixing empty method errors.

	FIXME: DIMCLR{D,E,T}_N RS => CMC for <r13
	because in_dxf sees only 176 mapping to DIMCLRD_N, which is only valid for <r13

2026-04-04  Reini Urban  <reini.urban@gmail.com>

	encode: don't overwrite computed R2004 header fields from DXF
	The r2004_file_header.spec IF_ENCODE_FROM_EARLIER_OR_DXF block
	hardcoded last_section_id, numsections, section_map_id and
	section_array_size to placeholder values (19/17/19/19),
	clobbering the correctly computed values from the section map
	and info page setup. This caused the decoder to see a wrong
	section_map_address and trigger a repair.

	out_dxf: skip thumbnail sentinel prefix in DXF output
	For R2004+, thumbnail.chain starts with a 16-byte sentinel
	at byte 0 (thumbnail.byte = 16). Writing it into the DXF caused
	encode_r13_thumbnail to wrap it in sentinels again, producing a
	double sentinel that corrupted the overall_size on re-read.
	Skip the sentinel prefix using pic->byte offset.

	in_dxf: fix double hex-decoding of binary pair values
	dxf_read_binary already decodes hex to binary for text DXF,
	so remove the redundant in_hex2bin calls in add_xdata,
	entity preview, BLOCK_HEADER preview, OLE2FRAME and
	THUMBNAILIMAGE readers. Use memcpy with pair->value.s.len
	uniformly, like the DXFB path.

2026-04-04  Reini Urban  <reini.urban@gmail.com>

	in_json: fix eed strlen overflow
	by terminating an empty string.
	testcase: ./dwg example_2018.json

	dxf-check of 2004 dwgs regressed from 4 to 34 failures.
	It converted to r2000 before.

2026-04-04  Reini Urban  <reini.urban@gmail.com>

	encode: fix FIELD_T16 leak

	encode: fix dwg_encode_eed_data TU leak

2026-04-04  Reini Urban  <reini.urban@gmail.com>

	encode: fix logical precedence problem
	with FIELD_T16: if (!IS_FROM_TU (dat))

	testcase: ./dwg example_2004.json

2026-04-04  Reini Urban  <reini.urban@gmail.com>

	document dwg_version and maint_version
	maint_version is the really important info.
	is_maint is misnamed. Should be maint_rel_version.

	encode: replace is_maint switch by lookup table
	add the is_maint byte to dwg_versions[]

2026-04-03  Reini Urban  <reini.urban@gmail.com>

	encode: set is_maint and maint_version
	dxf2dwg: keep the version, unless it is r2007

	encode: more IS_FROM_TU fixes
	when reading from JSON or DXF, we have UTF-8

	encode: fix r2010+ object encoding for JSON/DXF import
	Clear stale obj->bitsize and obj->handlestream_size for R_2010b+
	before encoding. When importing from JSON, these contain values from
	the original DWG, causing obj_string_stream to reposition dat to an
	invalid absolute position (realloc: invalid pointer crash).
	Also fix handlestream_size fixup version guard from R_2013b to R_2010b,
	since R_2010 also has the UMC handlestream_size field.

	encode: fix r2004 file header CRC32 calculation
	The CRC32 was calculated from the in-memory struct before the spec's
	IF_ENCODE_FROM_EARLIER_OR_DXF block modified fields. Recalculate the
	CRC from the actual on-disk bytes in file_dat after the spec has
	written everything, to ensure the CRC covers the final values.

	encode: patchup summaryinfo_address for r2004+
	The summaryinfo_address in the DWG file header was written as 0
	because it's set after sections are written but the header is
	written earlier. Add a patchup at 0x20 similar to thumbnail_address.

	encode: fix r2004 file_header for DXF import
	The R2004_Header file_dat was initialized with R_INVALID versions,
	so SINCE(R_2004a) in r2004_file_header.spec was skipped and
	header_size stayed 0, causing ODA "Out of range" errors.
	Copy version/from_version/opts from dat into file_dat.
	Also use IF_ENCODE_FROM_EARLIER_OR_DXF in the spec so header fields
	are initialized for same-version DXF imports.

	encode: skip obj_string_stream when bitsize is not yet known
	During encode, obj->bitsize is 0 (calculated after encoding).
	obj_string_stream computes start = obj->bitsize - 1 = 0xFFFFFFFF,
	causing bit_set_position buffer overflow errors for every r2007+ object.
	Guard both entity and object encode paths.

	encode: fix fixup_NOD is_tu check for DXF import
	Use IS_FROM_TU_DWG() instead of version >= R_2007, which accounts
	for the DWG_OPTS_IN flag. When importing from DXF, strings are UTF-8
	not TU, even when the target version is R_2007+.
	Fixes heap-buffer-overflow in bit_convert_TU.
	Also allow r2010+ encoding, and update WE_CAN message.

	improve/update fuzzing

	dwgfuzz: show mode with --version

	more fuzzing compilation fixes

	fix fuzzing, esp. the LOG macros must be statements now
	and yes, fuzzing only works with the 2 modern compilers.

	decode: fix fuzzer overflow case in xdata
	with wrong xdata_size overflowing also dat->size

	decode: fix fuzzer overflow in dwg_decode_add_object
	Fixes CIFuzz

	chore: fix some -Wunused-variables

2026-04-03  Reini Urban  <reini.urban@gmail.com>

	in_dxf: fix more -Walloc-size warnings
	we use the smallest APPID object for the start, and alloc later.
	Suppress the -Walloc-size warnings for these cases. The compiler is
	right.

	We still need -Wno-alloc-size though.

2026-04-03  Reini Urban  <reini.urban@gmail.com>

	encode,in_dxf: fix -Walloc-size warnings
	Expand ADD_OBJECT1 macro with GCC14_DIAG_IGNORE(-Walloc-size) around
	the calloc, since _obj is intentionally declared as the largest control
	type but allocation uses the actual (smaller) type.

	In encode use the bigger size for the cast to be corret.

2026-04-03  Reini Urban  <reini.urban@gmail.com>

	in_dxf: fix -Werror=array-bounds in add_eed
	Allocate at least sizeof(Dwg_Eed_Data) for EED data to avoid GCC
	warning about partial out-of-bounds access when the EED stream size
	is smaller than the struct size.

	make regen-unknown

	decode: 2004 header underflow

	add logging.c
	replace LOG macros by functions
	GH #1231

2026-04-02  Reini Urban  <reini.urban@gmail.com>

	WIP common: export a single loglevel for all
	mainly for decode2 and encode2, but then also for all the others,
	because we must think of LTO/odr.

	Also had to rename unit-test/common.c to unit-test/tests_common.c
	to avoid name clashes.

	Fixes GH #1224 disappeared log lines for dwg2 objects

2026-04-02  Reini Urban  <reini.urban@gmail.com>

	spec: fix AcDbMTextObjectEmbedded fields
	The specs seem to be better than me.

	repro: ./log ../to/2018/from_ACadSharp/AecObjects.dwg
	the 2nd ATTDEF

	GH #1233

2026-03-31  Reini Urban  <reini.urban@gmail.com>

	spec: rename PROXY_OBJECT.dwg_versions
	rename to version. conflicts with the new global.
	it was private, but for testing I needed to export it.

	test: fix check_minimal for mingw

2026-03-30  Reini Urban  <reini.urban@gmail.com>

	spec: DIMASSOC honor the last has_lastpt_ref
	There is only one error case missing, where there's an additional point.
	But all other last has_lastpt_ref: 0 cases end there.

	GH #1031

2026-03-30  Reini Urban  <reini.urban@gmail.com>

	promote DIMASSOC to unstable
	lots of coverage

2026-03-30  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Improve DIMASSOC object

2026-03-30  Reini Urban  <reini.urban@gmail.com>

	fix dimassoc unit-test for DEBUGGING

2026-03-29  Reini Urban  <reini.urban@gmail.com>

	spec: Fix r2004+ sections, checked against ODA specs
	- auxheader zero_18: maint_version fields now always read as RS (not
	  RL for R_2018+), HANDSEED reads as RL (not RLL) zero_18: { 0 0 0 }
	  reads correctly
	- appinfo comment_checksum: Guarded with num_strings >= 2/3. no more
	  error with num_strings=1
	- AcDs num_segidx: Changed bounds check from sizeof(Dwg_AcDs_Segment)
	  to sizeof(Dwg_AcDs_SegmentIndex). 72 segments now pass validation

2026-03-29  Reini Urban  <reini.urban@gmail.com>

	spec: fix FIELD/TABLE TABLE_value_fields parsing
	Skip value data when format_flags bit 1 (mask 0x02) is set, per ODA
	spec "Not present in case bit 1 in Flags is set". Also add missing
	data_size BL before kPoint (2RD) and k3dPoint (3RD) values.

	Fixes bit_read_TU buffer overflow in FIELD objects.

2026-03-29  Reini Urban  <reini.urban@gmail.com>

	decode: skip num_owned for xref BLOCK_HEADERs
	xref blocks (blkisxref or xrefoverlaid) don't store num_owned in the
	data stream. Reading it shifted all subsequent fields by 2 bits,
	causing garbage base_pt.z, wrong num_inserts, and invalid preview_size.

	Fixes GH #1179 Level0.dwg decode errors with those xref's.

2026-03-28  Reini Urban  <reini.urban@gmail.com>

	encode: fix color.handle order in entity handle stream
	The encoder wrote color.handle to hdl_dat during common_entity_data.spec,
	but START_HANDLE_STREAM flushed common handles (layer) before the
	accumulated special handles (color.handle), reversing the order.
	The decoder expects color.handle before layer.

	Move color.handle writing to dwg_encode_common_entity_handle_data,
	so it's part of the common handle stream in the correct order.
	Fixes ODA "Object improperly read: <AcDbPolyline>" on dbcolor_2004.

2026-03-28  Reini Urban  <reini.urban@gmail.com>

	json: fix DBCOLOR.color.handle field

	encode: fix R2004+ ODA recovery errors
	Fix thumbnail_address to point after the 32-byte encrypted page header.
	Patch offset 0x0D in the file header after all sections are written.
	Write secondheader (108-byte copy of encrypted R2004_Header) after all
	sections, fixing the secondheader_address TODO.
	Use store_R2004_section for SYSTEM_MAP so the pre-computed size in the
	self-entry matches the actual on-disk size.
	Disable LZ compression for data section pages (use raw copy with
	compressed=1) as the compressor output is not yet ODA-compatible.

2026-03-28  Reini Urban  <reini.urban@gmail.com>

	json: preserve class dwg_version, maint_version and num_instances
	Write dwg_version and maint_version per class to JSON for R2004+.
	Fix num_instances not being written due to the FIELD macro skipping
	fields with "num_" prefix. Read them back in the JSON reader.

	Without this, dwgwrite from JSON defaults all class versions to
	the file header version, causing ODA to reject the written DWG.

	Fixes json-check blank_Acad2004 roundtrips.

2026-03-28  Reini Urban  <reini.urban@gmail.com>

	out_dxf: fix VIEWPORT id, add BLOCK_RECORD fields
	Fix VIEWPORT DXF output: the overall paperspace viewport (entmode 0)
	gets on_off=0 and id=0. Active viewports auto-increment id starting
	at 1 via new dwg->last_viewport_id counter.

	Add missing insert_units (70), explodable (280), block_scaling (281)
	fields to BLOCK_RECORD TABLE entries for R2007+.

	Fixes GH #1213

2026-03-28  Reini Urban  <reini.urban@gmail.com>

	update generated src/config.h.in

	ci: fix macos, need autoreconf -f

2026-03-28  Reini Urban  <reini.urban@gmail.com>

	dxfb: fix pre-R14 binary DXF group codes and roundtrip
	Fix GROUP macro in out_dxfb.c: use 0xFF escape prefix for codes >= 255,
	not >= 1000. Codes 255-999 (280, 281, 330, etc.) were silently truncated
	to their low byte, corrupting pre-R14 binary DXF output.

	Fix in_dxf.c reader to handle 1-byte group codes for pre-R14 binary DXF,
	with 0xFF escape for codes >= 255. Auto-detect the format by checking
	byte 23 after the sentinel.

	Also fix HEADER_RL to use VALUE_INT to respect DXF code sizes.

	Surprisingly fixes the last failing dxfb.test failure with example_2007
	roundtrips.

2026-03-28  Reini Urban  <reini.urban@gmail.com>

	dxfb: more harmonization with out_dxf

	dxfb-check: default to .dxb extension

	dwgwrite: accept -I dxb or .dxb input files
	and its uppercase variants

	dwgread: also accept -O DXB for dxfb

	dwg2dxf: default to .dxb extension with -b

	add dxfb.test

2026-03-28  Reini Urban  <reini.urban@gmail.com>

	dxfb: fix binary value sizes for codes 280-289 and CMC colors
	Fix binary DXF value sizes: VALUE_RC for codes 280/281 in classes,
	HEADER_RC for ENDCAPS/JOINSTYLE, VALUE_RL for CMC codes >= 90.
	Harmonize dxfb block/entity write loops with out_dxf.
	Add timeout to dxfb-check.

	ODA uses int16 (2 bytes) for group codes 280-289, not int8 (1 byte)
	as originally assumed. Fix VALUE_RC macro to write 2 bytes for codes
	280-289. Fix VALUE_INT dispatch: DWG_VT_INT8 falls through to INT16.
	Fix dxfb_CMC: only use VALUE_RL for codes 90-99, not all codes >= 90
	(was incorrectly writing 4 bytes for CMC color codes 176-178).
	Revert HEADER_RS back for ENDCAPS/JOINSTYLE (code 280 needs int16).
	ODA now converts the dxfb output successfully.

2026-03-28  Reini Urban  <reini.urban@gmail.com>

	dxfb: fix and use dxf_read_binary
	We need a seperate Dxf_Pair len field for binary strings.

	dxfb: some type fixes and some testing
	use RS for group 70. fix solid BINARY fields.

2026-03-28  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Revert removing of spaces in script files
	The script file contains spaces on the end of lines, which each means
	<ENTER>.
	The space is functional part of the script.

	commit ab63c4a7342bf09954e5066934b775f8aa100052
	Author: Reini Urban <reini.urban@gmail.com>
	Date:   Thu Dec 4 10:49:37 2025 +0100

	    prek: install and changes

2026-03-28  Guilherme V. Favretto  <97709742+guifavretto@users.noreply.github.com>

	bits: fix -Werror=discarded-qualifiers

2026-03-28  Guilherme V. Favretto  <97709742+guifavretto@users.noreply.github.com>

	Fix compilation issues on modern systems with GCC
	In systems with modern glibc (like Arch Linux), including system
	headers before config.h could lead to _POSIX_C_SOURCE macro
	redefinition errors. Added include guards to config.h and a #ifndef
	protection for _POSIX_C_SOURCE to prevent this.

	* configure.ac: Add AH_TOP and AH_BOTTOM for CONFIG_H include guards.
	  Use AH_VERBATIM to wrap _POSIX_C_SOURCE in #ifndef.

2026-03-24  Reini Urban  <reini.urban@gmail.com>

	dxfb: sync with out_dxf. if (dxf) guards missing
	e.g. VALUE_BINARY
	preventing dxfb-check roundtrips for example_2000

	asan: fix asan: allocation-size-too-big errors
	HAVE_ASAN was never defined

2026-03-24  Trail of bits  <disclose@trailofbits.com>

	Fix decompress_R2004_section buffer overflow
	With ossfuzz. Security relevant with special crafted DWG files

2026-03-23  Reini Urban  <reini.urban@gmail.com>

	bump the SO_VERSION to 0:14:0
	for the r2004 write

2026-03-23  Reini Urban  <reini.urban@gmail.com>

	get_next_owned_entity: stop before skipping last_entity if it's a sub-entity type
	When last_entity is an ATTDEF (e.g. block "BLOKO" in example_r14.dwg),
	the while loop that skips sub-entity types (ATTDEF, ATTRIB, VERTEX...)
	advanced past last_entity before checking it, because the existing
	early-exit check was placed after the advance. This caused the
	traversal to continue beyond the block's boundary, emitting entities
	from subsequent blocks (duplicate SVG IDs, extra entities).

	Add an early-exit check before the advance inside the while loop so
	that if last_entity itself is a sub-entity type, it is returned
	immediately without skipping it.

	Reproducer: dwg2SVG example_r14.dwg produced duplicate dwg-object IDs
	due to block traversal running into the next block's entities.

	Fixes GH #1114

2026-03-23  Reini Urban  <reini.urban@gmail.com>

	in_dxf: accept CMC extension codes 420/430/440 in specific object fields
	Extend the matching condition to also accept CMC extension codes
	computed as f->dxf + (420|430|440 - 62). Also add a specific branch
	for codes 420-429 in the CMC handler to OR the value with 0xc3000000
	(setting method=truecolor), matching the behavior of dxf_read_CMC.

	Fixes: DBCOLOR "Invalid DXF code 420" error in hatch_color_ref.dxf

2026-03-23  Reini Urban  <reini.urban@gmail.com>

	in_dxf: fix LWPOLYLINE.flag CLOSED logic
	take the 70 value and convert 1 to 512, and 128 to 256.
	Fixes GH #1189

2026-03-23  Reini Urban  <reini.urban@gmail.com>

	dwg_insert_entity: fix entity linking for loaded empty blocks
	When a DWG is loaded from file, BLOCK_HEADER.first_entity is a
	non-NULL pointer to a null handle (absolute_ref=0), not a NULL
	pointer. The previous !_owner->first_entity check failed in this
	case, so first_entity was never updated and prev/next_entity links
	were not set on the added entity.

	Fix the condition to also check absolute_ref, set both prev_entity
	and next_entity to null handles (code 4) for the first entity in
	a block, and set nolinks=0. Also set next_entity=null for any new
	last entity in the else branch, and add a fallback to update
	first_entity when adding to a loaded empty block.

	Fixes GH #1105

2026-03-23  Reini Urban  <reini.urban@gmail.com>

	Update NEWS

2026-03-23  Reini Urban  <reini.urban@gmail.com>

	dwgadd: implement table-by-name for SET_ENT string fields
	Instead of a handle for a table member, you can now also use a name.
	dwg_dynapi_common_set_value() for common entity fields (e.g. layer) and
	dwg_dynapi_entity_set_value() for entity-specific handle fields.
	Non-handle string fields fall through to the existing code path.

	* examples/dwgadd.c (SET_ENT): add handle-by-name resolution in the
	  string branch.
	* examples/dwgadd.example_r11: use uppercase "FOO" — pre-R13 requires
	  uppercase symbol table names.

2026-03-23  Reini Urban  <rurban@cpan.org>

	dwgadd: add testcase to set layer
	this does not work yet, as the layer must be a handle, not a name.
	TODO: translate a string to a handle via dwg_find_tablehandle().

2026-03-23  Reini Urban  <reini.urban@gmail.com>

	more README

2026-03-22  Reini Urban  <reini.urban@gmail.com>

	unit-test: fix uninitialized intensity_style in pointcloud.c
	clang warns about passing uninitialized struct as const pointer
	to CHK_SUBCLASS_TYPE. Initialize to zero.

2026-03-22  Reini Urban  <reini.urban@gmail.com>

	gen-dynapi: fix SUBCLASSES regression from dwg_spec_shared.h
	The %defined hash was local to each dxf_in() call, so when
	dwg_spec_shared.h processed ACTION_3DSOLID/COMMON_3DSOLID defines,
	the next dxfin_spec call for dwg.spec/dwg2.spec got a fresh empty
	%defined. expand_define() then failed to find these defines and
	never copied the AcDbModelerGeometry/AcDb3dSolid superclass entries
	to ASSOCASMBODYACTIONPARAM, EXTRUDEDSURFACE, LOFTEDSURFACE,
	NURBSURFACE, PLANESURFACE, REVOLVEDSURFACE, SWEPTSURFACE,
	and ACSH_BREP_CLASS.

	Fix: make %defined global so it persists across dxfin_spec calls.
	Also restore the 8 superclass entries in dynapi.c.

2026-03-22  Reini Urban  <reini.urban@gmail.com>

	encode r11: always update entities_end after encoding
	The encoder only set entities_end when it was zero (from the input
	file). Since the input usually has a valid entities_end, the encoder
	kept the stale value instead of computing the new one from the output.
	This caused the second decode pass to read too few entities bytes,
	then interpret the BLOCK sentinel as garbage entity data, producing
	cascading errors like 'Invalid obj->size 53196 changed to 56'.

	Remove the 'if (!dwg->header.entities_end)' guard so entities_end is
	always set to dat->byte after encoding entities.

2026-03-22  Reini Urban  <reini.urban@gmail.com>

	fix preR13 encode extras entities in wrong section
	encode_preR13_entities() for ENTITIES_SECTION_INDEX was not skipping
	extras entities (POLYLINE_2D + JUMP at end of object list, after block
	entities), writing them into the table section area and shifting
	blocks_start by 17 bytes. This corrupted all table records
	(BLOCK_HEADER, LAYER, STYLE, LTYPE, VPORT).

	Replace the broken in_extras JUMP-based detection with past_blocks flag:
	for ENTITIES_SECTION_INDEX, skip entities after block region;
	for EXTRAS_SECTION_INDEX, only include entities after block region.

	Fixes json roundtrip for r10/entities.

2026-03-22  Reini Urban  <reini.urban@gmail.com>

	json.test: honor TODO list for all checks, allow extra entities
	The TODO failures (r11/ACEB10, r1.4/entities) were only skipped in
	check_roundtrip() but not in the json/minjson/geojson checks.
	Also allow roundtrips to produce extra entities (>= not ==).

	fix json.test: dwgread -y is invalid
	wrong tests got undetected for some time

2026-03-22  Reini Urban  <reini.urban@gmail.com>

	tests: link decode2/encode2 for decode_test/encode_test
	The spec split created decode2.c and encode2.c but the test builds
	didn't know about them, causing link errors (e.g. dwg_decode_CAMERA).

	* test/unit-testing/CMakeLists.txt: add decode2.c to decode_test sources
	* test/unit-testing/Makefile.am: add decode2.lo to decode_test_LDADD,
	  encode2.lo to encode_test_LDADD

2026-03-22  Reini Urban  <reini.urban@gmail.com>

	split dwg.spec into dwg.spec + dwg2.spec to reduce compile times
	Split the 12,801-line dwg.spec at the FIELDLIST/GEODATA boundary into
	two halves. encode.c and decode.c each get a companion *2.c file that
	compiles the second half with non-static functions, roughly halving
	their .o sizes (encode: 23MB->13MB, decode: 20MB->14MB).

	Other consumers (free, print, out_dxf, out_dxfb, out_json) simply
	include both spec files.  Shared macros (COMMON_ENTITY_DIMENSION,
	WIRESTRUCT_fields, 3DSOLID helpers, TABLE_value_fields) live in the
	new dwg_spec_shared.h.  Encode field macros extracted to enc_macros.h.

	Fixes GH #353

2026-03-21  Reini Urban  <reini.urban@gmail.com>

	Merge branch 'smoke/write2004-1'

	encode_test: merge store/compress_R2004_section tests
	compress_R2004_section already dispatches to store_R2004_section
	internally, so the ifdef split was unnecessary. Keep both test
	vectors (auxh + ofs).

	encode/json: preserve AppInfo payload on roundtrip
	And skip encoding empty Security and FileDepList sections

	encode: fix R2004 section page CRC handling

2026-03-21  Reini Urban  <reini.urban@gmail.com>

	encode: fix unknown tail bits, a MSB problem
	* src/encode.c (dwg_encode_unknown_bits, dwg_encode_unknown_rest):
	Write full unknown-bytes first, then replay remaining mod bits explicitly.
	Avoid bit-position rewind that dropped low tail bits in non-byte-aligned payloads.
	(dwg_encode_add_object): Restore object end padding bits to 1 as required.

	Fixes json-check example_2000 ODA cast failure caused by TABLESTYLE tail-bit
	corruption (rowstyles[2].text_style handle drift).

2026-03-21  Reini Urban  <reini.urban@gmail.com>

	encode: enable r2004 compressor path
	- Enable HAVE_COMPRESS_R2004_SECTION in encode.c.
	- Compile compress_R2004_section in normal builds (not DEBUG-only).
	- Use compress_R2004_section for SECTION_INFO/SECTION_SYSTEM_MAP when
	  compression is enabled.
	- Keep store_R2004_section only as the !HAVE_COMPRESS_R2004_SECTION path.
	- Remove fake-store fallback calls inside compress_R2004_section;
	  use literal-stream fallback instead.

	Added unit-test to encode_test.

2026-03-21  Reini Urban  <reini.urban@gmail.com>

	encode: fix compress_R2004_section LZ77 compressor
	Rewrite the R2004 LZ77 compressor based on the ODA specs.
	Uses hash-based match finding instead of
	brute-force search, with delayed match writing for proper trailing
	literal count encoding.

	Add roundtrip tests (compress → decompress → compare) for both
	store_R2004_section and compress_R2004_section.

2026-03-21  Reini Urban  <reini.urban@gmail.com>

	doc: fix for the new encode 2004 feature
	also fix some compilation warnings.

	encode: fail cleanly for >r2004, fix wrong warning
	Writing r2004 works now. The SINCE(R_2004a) block erroneously logged
	"Writing R2004 sections not yet finished" even for r2004 itself.
	For >r2004 (r2010+), return DWG_ERR_NOTYETSUPPORTED instead of
	continuing into broken state and crashing with realloc corruption.

	in_json: handle BSd type in BS array parser
	The VERTEX_PFACE_FACE.vertind field is type BSd (signed short) stored
	as a JSON array, but BSd was missing from the JSMN_ARRAY handler for
	BS/BS*/RS types, causing JSON parse errors and lost objects.

	encode: bump copyright header

	json.test: fix roundtrips, mark ODA regressions
	- Use unquoted $as to avoid passing empty string arg to dwgwrite.
	- Add --as=r2000 for r2007+ roundtrips (writing >r2004 unsupported).
	- Only write .json.log for non-TODO roundtrip failures.
	- Add example_2004 to ODA check list.
	- Mark example_2000 and example_2004 as ODA regression TODOs:
	  example_2000: "Object of class AcDbVisualStyle can't be cast to AcDbTableStyle"
	  example_2004: ".dwg file needs recovery"

	encode: fail on encoding r2007

	json: preserve r2004 color alpha
	- export/import color.alpha_raw so JSON round-trips the alpha flag
	- reinstate encoder color.raw synthesis so the encoder sees the flag set
	- stop pruning the alpha bit in bit_write_ENC since JSON now carries the payload

2026-03-21  Reini Urban  <reini.urban@gmail.com>

	encode: stop duplicating raw unknown tails
	* src/encode.c (dwg_encode_raw_UNKNOWN_OBJ,
	  dwg_encode_raw_UNKNOWN_ENT): Do not append deferred
	  handle/unknown tail data a second time after writing preserved
	  same-version unknown_bits.

	This keeps ./rw example_2004 unchanged and restores object 214 in
	../json-check example_2004 to the original r2004 size/bitsize boundary
	(Size 365, bitsize 2883). The remaining failure is now isolated to later
	unstable entity color encoding rather than UNKNOWN_OBJ preservation.

2026-03-21  Reini Urban  <reini.urban@gmail.com>

	encode: write raw same-version unknown objects
	* src/encode.c (dwg_encode): Keep same-version JSON unknown objects and entities on the raw path instead of rewriting them as placeholders.
	* src/encode.c (dwg_encode_raw_UNKNOWN_OBJ, dwg_encode_raw_UNKNOWN_ENT, dwg_encode_add_object): Add dedicated raw UNKNOWN_OBJ/UNKNOWN_ENT helpers so imported unknown_bits are written again through the normal common object/entity preamble. For UNKNOWN_OBJ also flush the deferred handle stream instead of collapsing the object to a stub.

	This keeps ./rw example_2004 unchanged and improves ../json-check example_2004 from WRONGCRC UNHANDLEDCLASS INVALIDHANDLE VALUEOUTOFBOUNDS to UNHANDLEDCLASS VALUEOUTOFBOUNDS. The remaining mismatch is later in the preserved UNKNOWN_OBJ bit layout/size accounting.

2026-03-21  Reini Urban  <reini.urban@gmail.com>

	encode: always write r2004 AuxHeader section
	* src/encode.c (dwg_encode):
	Do not skip AcDb:AuxHeader when auxheader.dwg_version is unset.
	encode_auxheader already has a defaults path, and JSON-driven r2004
	writes rely on it.

	This restores the AuxHeader section-info entry for example_2004 and
	removes the later SECTIONNOTFOUND failure on reread.

2026-03-21  Reini Urban  <reini.urban@gmail.com>

	encode: fix r2004 classes section encoding
	* src/encode.c (encode_classes):
	Write the r2004 per-class metadata fields in the format the
	decoder expects, and compute max_num from the highest class
	number instead of assuming a dense count-based range.

	This restores sane AcDb:Classes decoding for example_2004 while
	keeping the writer on the uncompressed r2004 path.

2026-03-21  Reini Urban  <reini.urban@gmail.com>

	encode,decode: fix more r2004 object stream layout
	* src/encode.c (encode_objects_handles, dwg_encode):
	Reserve the r2004 object map prefix in the object stream and keep
	page_hdr[4] as the real decompressed-page start offset.

	* src/decode.c (read_2004_compressed_section):
	Fix uncompressed r2004 multi-page reconstruction to copy each page
	from the right file offset into the right decompressed offset.

2026-03-21  Reini Urban  <reini.urban@gmail.com>

	encode: fix more r2004 object and handle layout
	* src/encode.c (encode_objects_handles): Keep the first Handles split
	assertion guarded for r2004, reserve the initial Handles page-size
	slot, and patch it at offset 0 for the first r2004 Handles page.
	(encode_preR13): Keep uncompressed r2004 page headers using start
	offset 0, which matches the current uncompressed reader path.
	(encode_preR13): Preserve the earlier r2004 section/header structural
	fixes while moving the remaining failure further into object/handle
	decoding.

	This checkpoint gets example_2004 past the former SECTION_SYSTEM_MAP,
	SummaryInfo, AcDbObjects bounds, and initial Handles framing failures.
	The remaining errors are later object-map/object-payload mismatches,
	not the top-level r2004 section structure.

2026-03-21  Reini Urban  <reini.urban@gmail.com>

	encode: fix more r2004 section structure
	* src/encode.c (encode_preR13): Fix r2004 section/header bookkeeping
	  for section counts, ids, and system-map sizes.
	  (store_R2004_section, stored_R2004_section_size): Keep the
	  uncompressed system-section path, but account for stored size
	  correctly.
	  (encode_preR13): Compute SECTION_SYSTEM_MAP checksums from
	  comp_data_size, initialize section_infohdr consistently, and preserve
	  the encrypted header overlap at 0x100 so SummaryInfo is not clobbered.

	This fixes the top-level r2004 structural issues seen in example_2004:
	SECTION_SYSTEM_MAP now verifies,
	last_section_id/section_info_id/section_map_id are consistent, and the
	SummaryInfo page header is no longer corrupted by the final header
	write.

	The remaining failure is later in AcDbObjects page metadata/layout;
	./rw example_2004 is unchanged.

2026-03-21  Reini Urban  <reini.urban@gmail.com>

	encode: fix more r2004 section info layout
	* src/encode.c (dwg_encode): Keep the first data section name in the
	section info table.
	(dwg_encode): Emit the last partial r2004 page entry instead of
	dropping it when a section spans multiple pages.
	(dwg_encode): Fix r2004 header numsections so the trailing INFO and
	SYSTEM_MAP pages are not counted as data sections.

	Validation:
	./dwg -y -v4 example_2004.min.json still succeeds.
	./log -lmanual_2004.log.new -v4 example_2004.dwg progresses further in
	r2004 decode, but the generated file still fails later with WRONGCRC
	VALUEOUTOFBOUNDS and SECTIONNOTFOUND.
	./rw example_2004 remains unchanged and completes successfully.

2026-03-21  Reini Urban  <reini.urban@gmail.com>

	encode: rebuild moved r2004 section infos
	* src/encode.c (section_info_rebuild): Rebuild all stored section_info
	section pointers after section-array reallocations instead of assuming
	sections stay sorted by enum type.

	Validation:
	../json-check example_2004 progresses further: section map
	and section info parse farther before the remaining SECTIONNOTFOUND
	failure.
	./rw example_2004 remains unchanged and completes successfully.

2026-03-21  Reini Urban  <reini.urban@gmail.com>

	encode: fix r2004 json-check crash
	* src/encode.c (encode_objects_handles): Use a Bit_Chain array
	directly for r2004 object and handle sections instead of casting it
	through Bit_Chain **.
	(dwg_encode): Zero-initialize sec_dat before preserving populated
	entries for SECTION_OBJECTS and SECTION_HANDLES.
	(dwg_encode): Keep numbering section pages in stream order for the
	preserved r2004 sections.

	Validation: ../json-check example_2004 no longer crashes in dwgwrite,
	but the reread still fails with SECTIONNOTFOUND.
	./rw example_2004 remains unchanged and completes successfully.

2026-03-20  Reini Urban  <reini.urban@gmail.com>

	encode: wip r2004 use LZ store framing for system sections
	System sections (SECTION_INFO, SECTION_SYSTEM_MAP) must be written with
	valid LZ framing (literal_length + data + 0x11 terminator) because the
	decoder always runs decompress_R2004_section on them. Previously used raw
	copy_R2004_section which caused buffer overflow on re-decode.

	Add store_R2004_section() that wraps raw data in LZ "store" format.
	Set compression_type=2 in system section headers.
	Patch comp_data_size in header after writing.

2026-03-20  Reini Urban  <reini.urban@gmail.com>

	encode: wip r2004 section fixes - preview chain, page sizes, section map rebuild
	- fix SECTION_PREVIEW writing to wrong chain (was appending to SummaryInfo)
	- use actual content size per page instead of max_decomp_size
	- break before SECTION_INFO in section map rebuild loop to avoid duplicates

	encode: fix r2004 section writing with correct page headers and section map
	- Data sections get 32-byte encrypted page header (XOR'd with sec_mask)
	  before max_decomp_size bytes of content per page
	- System sections (SECTION_INFO, SECTION_SYSTEM_MAP) get 20-byte header
	  with section magic (0x4163003b / 0x41630e3b), sizes, compression type,
	  and Adler-32 checksum
	- Section map rebuilt in stream order (not enum order) after data sections
	  are written, storing only (number, size) pairs without addresses
	- Remove spurious FIELD_RLL(address) from preliminary section map write;
	  decoder computes addresses from accumulated sizes
	- Fix alloc condition: was '<' instead of '>' causing buffer overflow

2026-03-19  Reini Urban  <reini.urban@gmail.com>

	decode: change section_max_decomp_size for Preview
	The specs don't reflect the sizes from the field.
	Fixes part of GH #1045

	decode: skip DICTIONARY.numitems < 10000 check
	See GH #1045, a large dictionary with obj->size 8381480 and numitems 26189.
	FIELD_VECTOR_T does a proper overflow check.

	post-release docs
	didn't use make release yet

2026-03-19  Reini Urban  <rurban@cpan.org>

	dwgwrite: write to the proper version

2026-03-18  Reini Urban  <reini.urban@gmail.com>

	Release 0.13.4
	see NEWS

	build: add release helpers

	harmonize dxf-check, json-check log files
	logs: .log, .log.new. for dxf also an intermediate .dwg2dxf.log.
	This avoids the clash of .log with .log.orig

	decode: fixup wrong XRECORD.xdata_size <r2004
	Maybe an ACAD bug, writing a wrong xdata_size.
	E.g. with 2000/Multileader.

2026-03-18  Reini Urban  <reini.urban@gmail.com>

	encode: fix bit_write_MS for overlarge values where value & 0xFFFF < 0x8000
	For overlarge MS values (> 0x7fff) where the lower 16 bits don't naturally
	have bit 15 set (e.g. 88177 = 0x15831), the first RS word was written without
	the required bit-15 flag. The reader uses bit 15 of the first word to decide
	whether to read a second word; without it, the size was decoded incorrectly.

	Values like 45924 (0xB364) happened to work because their lower 16 bits
	already had bit 15 set, masking this bug. Values like 88177 (0x5831 lower 16)
	caused wrong object sizes and cascading CRC failures on DXF roundtrip.

2026-03-17  Reini Urban  <reini.urban@gmail.com>

	fixup dxf-check f06058da1c9b5ccb
	didn't move the dxf.err file back.

	dxf: fix ownerhandle version mismatch
	src/common_object_handle_data.spec has R_13b1, do that in out_dxf also.
	Fixes DICTIONARY.ownerhandle in example_r13.dwg dxf roundtrips.
	GH #1223

2026-03-17  Reini Urban  <reini.urban@gmail.com>

	encode: fix CRC start address for overlarge MS objects. Fixes GH #1222
	When obj->size crosses the 0x7fff boundary (overlarge MS needing 2 RS
	words instead of 1), the memmove shifts data right by 2 bytes and
	obj->address is correctly adjusted. But `address += 2` wrongly shifted
	the CRC start address into the middle of the MS size field, so the
	written CRC covered only bytes 2..N instead of 0..N of the object.

	Also the size was not big enough.

	The decode side always passes the pre-MS object start to bit_check_CRC,
	so remove `address += 2` (overlarge) and `address -= 2` (downsize) to
	keep `address` at the true object start for bit_write_CRC.

2026-03-17  Reini Urban  <reini.urban@gmail.com>

	decode: the last 2 VISUALSTYLE fields only when room
	Unfortunately dat->size is not yet shrinked to its actual size.
	Fixes e.g. timoria/TestFiles/2000/test_write_2000_new_All.dwg

	ci: pinact run -u

	decode: guard optional 3DSOLID history_id handle read
	* src/dwg.spec (COMMON_3DSOLID): For non-DXF decode, read
	  history_id only when version > 1 and at least 8 bits remain in
	  hdl_dat. This avoids trailing bit_read_RC overflow reports on
	  objects with no history_id.
	* src/spec.h: Add fallback AVAIL_BITS macro so spec expressions that
	  reference it also compile in non-decoder builds.

2026-03-17  Reini Urban  <reini.urban@gmail.com>

	in_dxf: fix SubDMesh DXF binary import (GH #272)
	* src/in_dxf.c (in_hex2bin callers): Fix precedence bug so read gets the decoded byte count
	  instead of a boolean.
	* src/in_dxf.c (add_MESH): Initialize unknown_b1/unknown_b2 defaults for DXF-imported MESH.

	This fixes dxf-check for Rotterdam_Centrum/Bruggen/Erasmusbrug.dwg ODA AcDbSubDMesh read errors

2026-03-17  Reini Urban  <reini.urban@gmail.com>

	Revert "decode: fix CRC check start for handle-map objects"
	This reverts commit e12563c5a18bd9639298306cd354ce76cc8d8342.

2026-03-17  Reini Urban  <reini.urban@gmail.com>

	spec: fix dwg_set_dataflags for TEXT/ATTRIB/ATTDEF via add API. GH #1164
	When using dwg_add_TEXT/ATTRIB/ATTDEF and setting rotation or oblique_angle
	via the API, dwg_set_dataflags() was not called during encoding because
	dwg_add_empty(R_2000) sets from_version = R_2000, making the condition
	  dat->from_version < R_2000
	false. Change to <= R_2000 so the dataflags are always recomputed when
	encoding R_2000 output, covering both API-created objects (from_version ==
	version) and objects whose fields were modified after decode.

	Applies to TEXT, ATTRIB and ATTDEF — all three share the same condition.

2026-03-17  Reini Urban  <reini.urban@gmail.com>

	decode: fix wrong memmove for LZ77 back-reference decompression. GH #1204
	The #ifdef NDEBUG path used memmove() to copy compressed back-references,
	but memmove copies from the original source bytes. When comp_offset <
	comp_bytes the source and destination windows overlap and the LZ77
	run-length extension requires reading back newly-written bytes as pos
	advances. memmove defeats this, producing wrong output in release builds.

	Fix: always use the byte-by-byte loop; keep the asserts under #ifndef NDEBUG.

2026-03-17  Reini Urban  <reini.urban@gmail.com>

	libredwg.spec: upgrade to 0.13.4
	- Fix %{_sharedir} -> %{_datadir} (standard RPM macro)
	- python3-lxml already correct (switched from python3-libxml2)
	- SO version stays at 0.0.13 (no ABI bump in configure.ac)
	- Add changelog entry

	NEWS: add 0.13.4 release notes

2026-03-17  Reini Urban  <reini.urban@gmail.com>

	in_dxf: fix CMC color index for entity fields with DXF code >= 90
	The generic entity field dispatcher treated any CMC field with DXF code
	>= 90 as an RGB truecolor value (pair->value.l >> 0x18 = method). But
	MULTILEADER uses codes 91/92/93 for line_color, text_color, block_color
	as plain color indices (0=ByBlock, 256=ByLayer, etc.), not RGB values.

	When value=0 was stored as rgb=0x00000000, ODA read method=0x00 (invalid,
	valid range 0xc0-0xc8), emitting "Color index 65535" and misaligning the
	bit-stream, triggering "CRC does not match".

	Fix: in the code >= 90 branch, distinguish by value: real RGB truecolors
	always have high byte set (> 257), so values <= 257 are color indices
	and are routed through dxf_set_CMC_index() for correct method/rgb.

2026-03-17  Reini Urban  <reini.urban@gmail.com>

	in_dxf: fix CMTC color method/rgb for TABLESTYLE and CellStyle color fields
	Add dxf_set_CMC_index() helper that properly maps a DXF color index to the
	CMC method and rgb bytes required by the R_2004 CMTC encoding: index 0 →
	0xc1 (ByBlock), 256 → 0xc2 (ByLayer), 257 → 0xc8 (None), others → 0xc3
	plus palette RGB.

	Previously add_TABLESTYLE and add_CellStyle only set color->index from DXF
	code 62, leaving method=0 and rgb=0.  When SUB_FIELD_CMTC later writes
	those colors it forces R_2004 mode (full BS+BL+RC CMC), so rgb=0x00000000
	gave ODA method=0 (invalid, valid range 0xc0–0xc8) causing "Cannot set C
	to that value" and a misaligned bit-stream that triggered "CRC does not
	match".

	Also fix dxf_read_CMC to compute a default method/rgb when no 420 truecolor
	code follows the 62 index code, using the same mapping.

2026-03-17  Reini Urban  <reini.urban@gmail.com>

	dxf-check: move oda errs to .

2026-03-16  Reini Urban  <reini.urban@gmail.com>

	build: fix codepages build with build-in-srcdir

	in_dxf: resolve DIMENSION.block field name to BLOCK handle
	The 'block' field (DXF code 2, anonymous dimension block name like '*D8')
	was stored in obj_hdls for deferred resolution but resolve_postponed_object_refs
	only handled 'block_header', not 'block'. Add 'block' alongside 'block_header'
	to resolve it to the BLOCK table handle, preventing duplicate anonymous blocks.

	in_dxf: fix phantom BLOCK_HEADER entry when new_object reuses existing object
	When new_object uses the 'Reuse existing BLOCK_HEADER' path it
	decrements dwg->num_objects, making idx >= num_objects. The outer
	dxf_tables_read loop then accessed a stale partial object at idx,
	which got an auto-assigned handle (0x47A) and was added as a phantom
	entry to BLOCK_CONTROL.entries, causing ODA 'Duplicate Record name (429)'.

2026-03-16  Reini Urban  <reini.urban@gmail.com>

	in_dxf: fix SORTENTSTABLE DXF import: parse ents[], sort_ents[], block_owner
	Handle codes 331 (ents handles), 5 (sort_ents handles), and the
	subsequent 330 (block_owner) for SORTENTSTABLE objects in new_object().

	Fixes GH #1091: ODA 'AcDbSortentsTable can't be cast to AcDbEntity'
	caused by code 5 overwriting the object handle with sort_ents values.

2026-03-16  Reini Urban  <reini.urban@gmail.com>

	decode,in_dxf: fix nolinks for r2000 entity chains from DXF
	in_postprocess_handles sets entity nolinks=1 when the previous entity
	is at array index obj->index-1.  But objects in the r2000 binary are
	written in handle-sorted order, not array order.  When non-entity
	objects (APPID, VPORT table records) have handles between two
	consecutive entity handles, they appear between the entities in binary.
	Setting nolinks=1 makes ODA follow the binary-next object as the
	entity chain, which is a non-entity, causing:
	  "Object of class AcDbRegAppTableRecord can't be cast to AcDbEntity"
	  "Object of class AcDbViewportTableRecord can't be cast to AcDbEntity"

	Fix: call dwg_fixup_BLOCKS_entities after DXF import to recompute
	nolinks based on handle arithmetic (cur-1 / cur+1) rather than array
	adjacency.  This clears the incorrect nolinks=1 flags and sets the
	explicit prev/next_entity handles that ODA requires.

	Fixes 2000/A.dwg and sample_2000.dwg DXF roundtrips (GH #1091).

2026-03-16  Reini Urban  <reini.urban@gmail.com>

	in_dxf: fix VX_TABLE_RECORD handle mismatch for VIEWPORT
	dwg_add_VX creates a VX_TABLE_RECORD and adds it to VX_CONTROL.entries
	using the handle returned by dwg_new_handseed.  Calling dwg_new_handseed
	a second time and overwriting vxobj->handle.value left VX_CONTROL.entries
	pointing to a non-existent handle while VIEWPORT.vport_entity_header
	pointed to a different, skipped handle.

	ODA then failed to write the DXF with "Object was permanently erased".

	Fix: remove the second dwg_new_handseed call; use the handle that
	dwg_add_VX already assigned.

	Fixes Ceco.NET-People-Men-Sm-471.dwg DXF roundtrip (GH #1091).

2026-03-16  Reini Urban  <reini.urban@gmail.com>

	fix EED size calculation and overflows
	working on fixing json roundtrips for
	to/2000/from_uloz.to/VÝKRES_VÝZTUŽE_STROP.dwg

2026-03-16  Reini Urban  <reini.urban@gmail.com>

	common: add my_strcasecmp unit tests
	Compile my_strcasecmp unconditionally so it can be tested and used
	regardless of HAVE_STRCASECMP. The #define strcasecmp my_strcasecmp
	alias is still only set when the system lacks strcasecmp.

	Add common_strcasecmp_tests() to test/unit-testing/common_test.c

	Closes GH #1207

2026-03-16  Reini Urban  <reini.urban@gmail.com>

	common: fix and rename strcasecmp to my_strcasecmp
	Rename the fallback implementation to my_strcasecmp and add

	Fix the broken implementation:
	- Drop the bogus strcmp() shortcut (case-sensitive, useless here)
	- Return proper negative/0/positive instead of 0/1
	- Handle strlen(a) < strlen(b) correctly via final char difference
	- Use (unsigned char) cast before toupper() as required by the standard

	GH #1207

2026-03-15  Reini Urban  <reini.urban@gmail.com>

	chore: clang-format off macros
	to bypass prek clang-format

	docs: Better AGENTS.md recipes for reprodcucers

	dwg.spec: relax HATCH seeds and handles

	dwg.spec: tolerate truncated FIELD data

	dwg.spec: clamp BLOCKLOOKUPPARAMETER unknown_t

	in_dxf: tolerate FIELD value preamble

	dxf-check: clear stale ODA error files

2026-03-14  Reini Urban  <reini.urban@gmail.com>

	decode: fix CRC check start for handle-map objects
	The per-object CRC for r13b1-r2000 handle-map objects must start after the
	initial MS size field. dwg_decode_add_object() used the handle-map entry
	address, which caused false WRONGCRC reports (notably for ES2_S_2010 XRECORD
	[247]).

	* src/decode.c (dwg_decode_add_object): Check CRC starting at obj->address-2
	  to match the encoder.

2026-03-14  Reini Urban  <reini.urban@gmail.com>

	dxf: avoid exporting invalid SORTENTSTABLE handle refs
	When exporting SORTENTSTABLE, some inputs (e.g. td/2010/ES2_S.dwg) contain
	NULL/zero handle references which were written to DXF as 331/5 = 0. This
	produces malformed DXF and breaks DXF->DWG (r2000) roundtrips, triggering
	invalid handles rejected by ODA.

	* src/out_dxf.c (VALUE_HANDLE, FIELD_HANDLE): Skip emitting DXF handle group
	  codes 331 and 5 when the resolved absolute_ref is 0.

2026-03-14  Reini Urban  <reini.urban@gmail.com>

	in_json: make partial OBJECTS entries releasable on parse errors
	Fuzzed/invalid JSON can abort after json_OBJECTS already allocated
	object/entity containers and their payloads. With preR13 input, the free path
	ignored UNKNOWN_OBJ/UNKNOWN_ENT, so those allocations were not released,
	triggering LeakSanitizer.

	* src/in_json.c (json_OBJECTS): Set type/fixedtype to UNKNOWN_OBJ/UNKNOWN_ENT
	  immediately after allocation so dwg_free can dispatch a proper free handler.
	* src/free.c (free_preR13_object): Handle UNKNOWN_OBJ/UNKNOWN_ENT (and DUMMY)
	  in the preR13 switch.

2026-03-13  Reini Urban  <reini.urban@gmail.com>

	free: avoid OOB in preR13 entity cleanup with injson
	When reading malformed/partial JSON (DWG_OPTS_INJSON), preR13 entities may be
	created without initialized layer/ltype handle pointers. The preR13 free path
	unconditionally touched these handles, which could read past the end of the
	allocation under ASan.

	* src/free.c (free_preR13_object): Guard correct union member for entities and
	  skip freeing preR13 entity handles for DWG_OPTS_IN inputs.

	Fixes ossfuzz 470417487

2026-03-13  Reini Urban  <reini.urban@gmail.com>

	docs: add AGENTS.md with repository guidance for coding agents

2026-02-11  Reini Urban  <reini.urban@gmail.com>

	fix -Wdefault-const-init-field-unsafe with clang

2026-02-10  Reini Urban  <reini.urban@gmail.com>

	dxf: encode to UTF-8 for r2007+
	add a VALUE_TVc for const string literals.
	bit_u_expand always shrinks, but still do a copy then.

	@matabar also tried a fix, but his was incorrect.
	But thanks for the analysis!

2026-02-10  Reini Urban  <reini.urban@gmail.com>

	bits: swap wrong calloc args
	harmless, but be consistent

	spec: fix ARC_DIMENSION dxf codes 40,41
	for arc_start_param and arc_end_param.
	See github.com/mozman/ezdxf examples_dxf/uncommon.dxf#L1434 e.g.

2026-02-06  Reini Urban  <rurban@cpan.org>

	switch py-libxml2 to py-lxml (#84)
	tested ok.

2026-02-05  Reini Urban  <reini.urban@gmail.com>

	dxf: negative color index
	GH #1214

	also add missing the CMC method to the binary variant for consistency.

2026-02-05  Reini Urban  <reini.urban@gmail.com>

	ci: pinact run -u
	also ossfuzz manually:
	curl -s https://api.github.com/repos/google/oss-fuzz/commits/master | jq -r '.sha'

2026-02-04  Reini Urban  <reini.urban@gmail.com>

	decode: fix heap-overflow by 1
	Fixes fuzzing case GH #1215, analog to ossfuzz 63483
	Thanks to @Keryer (Qi Kery)

	json: improve color index, add Dwg_Color_Method enum
	See GH #1216

2026-02-03  Reini Urban  <reini.urban@gmail.com>

	codepages: add comments about exceptions
	and add a regen-h target

	oda: get deb version dynamically

	oda: bump to 26.12

	prek: run with clang-format

	prek: install and changes

2025-12-17  Sakura  <1178743577@qq.com>

	fix: memory out of bounds

2025-12-02  Reini Urban  <reini.urban@gmail.com>

	ci: pinact run -u
	actions/checkout@v6.0.0, codeql-action@v4.31.6

2025-11-24  luzpaz  <luzpaz@users.noreply.github.com>

	Fix various typos Found via: `codespell -q 3 -S "./.git,*.patch,ChangeLog,./NEWS,./src/codepages" -L 2rd,aadd,addd,aded,afe,ba,baed,beed,caf,childs,daa,ded,ede,fo,gir,gord,gost,nam,noo,oce,re-use,ro,siz,te,teh,tekst,ue,uptodate`

2025-11-19  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix Vertex entity index4 parsing

2025-11-03  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix r2007 TOLERANCE entity
	TOLERANCE entity need a has_strings bit.

2025-10-28  Reini Urban  <reini.urban@gmail.com>

	json: protect from NULL or wrong _obj
	fatal. Thanks to 7erryX (GH #1190)

2025-10-18  Reini Urban  <reini.urban@gmail.com>

	CI: bump oda to 26.9

	gh: switch from -m32 to modern --host=i686-linux-gnu
	for latest distros

2025-09-03  Michal Josef Špaček  <michal.josef.spacek@gmail.com>
	    Reini Urban  <reini.urban@gmail.com>

	Fix some REAL xdata types
	dwg_resbuf_value_type missed some REAL and POINT3D ranges.
	Fixes GH #1178

2025-09-01  Reini Urban  <reini.urban@gmail.com>

	oda: bump to 26.7

	decode: fix FIELD_NUM_INSERTS
	Fixes GH #1177

	spec: rename BLOCK_HEADER.loaded_bit to xref_loaded

2025-08-12  Reini Urban  <reini.urban@gmail.com>

	spec: use signed VERTEX_PFACE_FACE.vertind [BSd]
	e.g. -5 instead of 65531

2025-08-11  Reini Urban  <reini.urban@gmail.com>

	encode: fix dwg_set_dataflags
	oops, critical encoder bug!
	dataflags are reverse, if a bit is absent then the field needs to be used.
	also the default with_factor is 1.0

	thanks to Erfan Sadigh Nejati for finding this bug.
	Fixes GH #1164

2025-08-10  Reini Urban  <reini.urban@gmail.com>

	configure: detect emcc
	and fix failing probes because of -Werror -Wlimited-postlink-optimizations
	Fixes the configure & make part of GH #1073

2025-08-09  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix dwgadd error with bad --as version

2025-07-30  Reini Urban  <reini.urban@gmail.com>

	indxf: fix empty CLASSES GH #1068

2025-07-28  Reini Urban  <reini.urban@gmail.com>

	encode: log MLEADERSTYLE class_version: 2
	taken from APPID.ACAD_MLEADERVER eed

	decode: fixup FIELD.value_string and format

2025-07-23  Reini Urban  <reini.urban@gmail.com>

	indxf: more FIELD improvements
	can now read good DXF's with FIELD's,
	but not yet our written FIELD's

2025-07-15  Reini Urban  <reini.urban@gmail.com>

	doc: document more VERTEX_* flags
	in addition to our LOG_FLAG_VERTEX

	rapidrtrendersettings docs
	and max checks. still wrong

	api: change LARGE_RADIAL_DIMENSION fields
	first_arc_pt => chord_pt
	leader_len => jog_angle
	jog_point => jog_pt
	ovr_center: DXF 12 => 14

	indxf: add_FIELD
	special-cases all over.
	not covering all yet.

2025-07-03  Reini Urban  <reini.urban@gmail.com>

	oda: back to 26.4
	26.5 disappeared

	gh: pinact run -u
	security: pin our github actions

2025-06-30  Reini Urban  <reini.urban@gmail.com>

	dynapi: fix indxf conversion from r2007+ to strings
	Fixes GH #1163 part 2
	JSON and DXF import leaves TABLE.name as TV (i.e. UTF-8)
	for the future encode to r2000

	oda: bump to 26.5

	oda: create .dwg.err not .json.err

2025-06-25  Reini Urban  <reini.urban@gmail.com>

	encode: set TEXT.dataflags also on indxf

	logging: fix TV for indxf

2025-06-24  Reini Urban  <reini.urban@gmail.com>

	logging: mark T as TV

	api: rename SecondHeader.dwg_version to dwg_versions
	lo-byte dwg_version, high-byte maint_version

2025-06-23  Reini Urban  <reini.urban@gmail.com>

	indxf: fix IMAGE.imagedefreactor setter
	wrong dynapi usage, ref even refs

	dynapi: fix #lines

	indxf: fix IMAGE.clip_verts
	by defaulting num_clip_verts to 2

	indxf: set BLOCK_HEADER.base_pt = BLOCK.base_pt

	more obj_absowner
	: check if rel or abs
	if [ -z $1 ]; then
	    h=4
	else
	    h=$1
	fi
	for f in *.json; do
	  echo $f
	  jq .FILEHEADER.version "$f"
	  echo "ownerhandle = ($h."
	  jq ".OBJECTS[] | select(.ownerhandle[0] == $h) | [.object, .entity]" "$f" | sort -u
	done

2025-06-20  Reini Urban  <reini.urban@gmail.com>

	Replace more FORMAT_RLLx with FORMAT_HV

	make: fix log-dwg
	wrong xargs syntax

	dxf: minor tunings
	write APPID 71 1 only with ADE_PROJECTION.
	use absolute handles with DICTIONARY

2025-06-19  Reini Urban  <reini.urban@gmail.com>

	dxf: fix *X block name resolution
	use the BLOCK.name not BLOCK_HEADER.name for anonymous block names.
	Fixes a part of GH #1091

	trace: back to HEX for abs handles

	dwgadd: protect from missing insert block
	i.e. BLOCK not found

	api: merge R11_HANDSEED with HANDSEED
	also add dwg_init_handseed(), needed for some examples

2025-06-19  Reini Urban  <reini.urban@gmail.com>

	api: replace BITCODE_RLLx with BITCODE_HV
	for handle value. It inistally was RL, but later upgraded to RLL
	(64-bit long long handles).

	change the auxheader version from RL to HV

2025-06-19  Reini Urban  <reini.urban@gmail.com>

	indxf: fixup dwg_set_next_objhandle
	per default use the next HANDSEED. only for initial add_Document
	use dwg->next_hdl.
	Fixes Object of class AcDbVXTable can't be cast to AcDbBlockHeader.

	also set *MODEL_SPACE entmode = 2 correctly for older versions.

2025-06-18  Reini Urban  <reini.urban@gmail.com>

	indxf: VIEWPORT needs to create a matching VX_TABLE_RECORD
	TODO: and if the VIEWPORT is *Active, it needs to set HEADER.VX_TABLE_RECORD
	On LAYOUT.active_viewport

2025-06-17  Reini Urban  <reini.urban@gmail.com>

	indxf: improve VERTEX layer
	to use the parents layer.
	still not 100% correct though

	indxf: fix empty layer in VERTEX subents
	set it to the CLAYER for an immediate fix

	indxf: fixup find_hv logic
	no duplicate entries. e.g. BLOCK_HEADERs
	down from 31 dxf r14 roundtrip errors to 12.

2025-06-17  Reini Urban  <reini.urban@gmail.com>

	indxf: set more ownerhandles
	in fact for most objects take them from reactors.
	just not table records.

	this reduced the r2000 dxf roundtrip errors from 36 to 20.

2025-06-17  Reini Urban  <reini.urban@gmail.com>

	spec: remove LTYPE.unknown_r13
	looks very wrong. and it's not in ODA's spec

	indxf: add dxf_postprocess_MLINESTYLE
	analog to LAYOUT. owned by a DICTIONARY, but no block_header field.
	strangely it is not triggered, so I added it to the reactors code also.

	encode: no default VX, just VX_CONTROL
	helps dxf roundtrips

	dxf-check: use $ODAFileConverter_geometry
	put annoying popups to the side, on X only

	WIP indxf: enable and fix dxf_postprocess_LAYOUT
	to fixup the ownerhandle vs block_header 330 confusion.
	BLOCK_HEADER vs DICTIONARY

	fixup dxf: fix LAYER.flag roundtrips
	no free => flag tracing

2025-06-16  Reini Urban  <reini.urban@gmail.com>

	dxf: fix LAYER.flag roundtrips
	flag0, linewt (wrong type), plotflag (on if plotstyle?)
	GH #1091

	fix signed xdata ints from/to json/dxf
	Fixes GH #1040

	encode: rename internal pvzadr to size_adr

	decode: trace TF and BINARY
	e.g. for string_area
	./dxf-check sample_2000|less

	indxf: fix duplicate table record entries
	esp. with r2000. GH #1091

2025-06-15  Reini Urban  <reini.urban@gmail.com>

	indxf: fix wrong DICT.ownerhandle
	when there is no NOD, or NOD not at 0.1.C
	Fixes ODA error: Object of class AcDbBlockBegin can't be cast to AcDbDictionary
	GH #1159

	indxf: fixup DICT.ownerhandle to NOD if NOD is elsewhere
	e.g. r13 dxf
	also fix to stable VX_CONTROL handle

	dxf: set more unitX_name and ratios
	for r13-r14

	encode: write no TV-ZERO with r14
	only since r2000

	dxf.test: insert order for r13, r14
	acad/oda add 2 INSERT's for roundtrips or whatever.

	dxf.test: pline order is fixed for r13, r14
	insert order TODO in GH #1159

2025-06-15  Reini Urban  <rurban@cpan.org>

	dxf.test: add failing r14,r13 INSERT dxf conversion
	wrong SEQEND

2025-06-15  Reini Urban  <reini.urban@gmail.com>

	indxf: set default isbylayerlt
	and pspace entmode on the pspace BLOCK.
	See Part 5 of GH #1159

	indxf: set R_13c3
	because the AC1013 $ACADVER is not set in DXF

	indxf: add r13 table record ownerhandles
	only needed for r13, later they are 0.
	Part 4 of GH #1159

	dxf: uppercase ltypes <r2000
	also fix in internal identifier

	dxf: r13c3 confusion - PROXYGRAPHICS
	we dont know if r13 or r13c3 on indxf.
	so emit $PROXYGRAPHICS if it is set with r13 also

	indxf: fix dxf_tables_read leak

	indxf: set NOD dicts owner
	Fixes part 3 of GH #1159

2025-06-14  Reini Urban  <reini.urban@gmail.com>

	bump copyright years
	now checked properly

	indxf: comment about is_xref_ref
	which can be 0 <r14 on unused table records.
	we would need a table_used hash to record usage.

	indxf: fix duplicate control entries
	don't add and remove, just add if not wrong.
	Fixes GH #1159

2025-06-13  Reini Urban  <reini.urban@gmail.com>

	dwg_api: DIMSTYLE comments for add

2025-06-13  Reini Urban  <reini.urban@gmail.com>

	decode_r11: set entmode 3 for blocks
	there was a wrong obj->address check, we can fake.
	and store it also in out_json.

	now some BLOCK's have no name

2025-06-13  Reini Urban  <reini.urban@gmail.com>

	preR13: fix dwg.block_control and HEADER.BLOCK_CONTROL_OBJECT missing

	set the ltype flag to 64 (loaded)
	by default. just BYBLOCK,BYLAYER are never loaded.
	and >r13 this bit is ignored.

	outdxf: fix some wrong r9 header vars
	some missing, and some only since r10.
	and fix some early defaults.
	from michal's new blank dxf's GH #1100

	add: more preR13 defaults
	need VPORT.*Active since r10 already.
	GH #1100

	add: more HEADER defaults

	WIP encode: fix preR13 entities iteration
	fix the in-BLOCK logic, but broke json-check r11/entities-3d,
	missing the BLOCKs
	GH #1100

	decode_preR13: fix CLAYER double-free
	GH #1102, GH #1100 Fixes  Missing TEXTSTYLE, CLAYER, CELTYPE and DIMSTYLE values in header

	dwg_add_handleref: trace re-used handleref
	and clean enlarged object_ordered_ref areas.
	trying to fix r10 CLAYER double-free

	add: set standard table records with r9 already
	GH #1100

	add: set unit1_text with r10 already

2025-06-10  Reini Urban  <reini.urban@gmail.com>

	dwgadd: better --help output
	we can save as planned versions with dxf or json

	dxf-check: improve. print oda errors at the end again
	json-check-2000 errors:
	LINKRODS_from_autocad_r13.json.err
	STEERING_from_autocad_r13.json.err
	example_r14.json.er

	ci: bump windows-2019 to 2022
	will be retired soon

2025-06-08  Reini Urban  <reini.urban@gmail.com>

	injson: eed structure comment

	fix dwg_add_handle ubsan: invalid negation
	Fixes GH #1154

	bits ubsan: handle wrong negation
	Fixes GH #1153
	0x80000000 (-2147483648) negated stays negative

2025-06-06  Reini Urban  <reini.urban@gmail.com>

	injson: fix uninitialized ptrs

	decode: fix UB in bsearch cmp
	Fixes GH #1152

2025-06-06  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Add tests for read_MC/UMC/MS

2025-06-05  Reini Urban  <reini.urban@gmail.com>

	ci: fix PRs

	fixup fix add_LAYOUT

2025-06-03  Reini Urban  <reini.urban@gmail.com>

	add: fix add_LAYOUT and its test
	undefine NEED_VPORT_FOR_MODEL_LAYOUT, a LAYOUT
	can be attached to the pspace BLOCK_HEADER without a VIEWPORT.
	test ok now, fixes LAYOUT in GH #1137

	WIP fix add LAYOUT test
	Attach a layout to a VPORT in mspace, not VIEWPORT.
	Fix the LAYOUT.block_header for this case.
	Set NEED_VPORT_FOR_MODEL_LAYOUT for the add LAYOUT api.
	See GH #1137

	decode: clear new dwg->object and dwg->object_ref on realloc
	See GH #1045

2025-06-02  Reini Urban  <reini.urban@gmail.com>

	dynapi: fix a dwg_dynapi_entity_set_value null deref
	Fixes GH #1122. Fuzzing only

	add: set DICTIONARY.cloning to all NOD members also

	add: fix add_LEADER with associated_annotation
	analog to before. create a required DIMSTYLE before the entity.
	GH #1137

2025-06-01  Reini Urban  <reini.urban@gmail.com>

	add: fix add_DIMENSION
	first create the dimstyle, then the entity.
	Fixes GH #1148

	indxf: fix LAYER_INDEX.numlayers realloc
	clear the new struct. in case of errors, the free of handle would fail.
	Fixes GH #1147 part 3

	ci: fixup checkout for tag

	ci: no fetch-depth: 50, broken with tags

	indxf: fail on MLINE num_* setting twice
	with fuzzed or bad input.
	Fixes last part 3 of GH #1146

	indxf: fix double-free in HATCH.path errors
	with fuzzed or bad input.
	Fixes part 2 of GH #1146

2025-05-31  Reini Urban  <reini.urban@gmail.com>

	ci: Update oda version

	indxf: fix failed dxf_read_rll
	when no number can be read, set the number to 0.
	Fixes GH #1146

	injson: fix NULL in_hex2bin argument
	Fixes GH #1142

	add_test: add oda check with LIBREDWG_DEBUG 2
	passes

2025-05-26  Reini Urban  <reini.urban@gmail.com>

	encode: always compute the HANDSEED
	dont take anything granted.
	Fixes GH #1127 (part of GH #1105)

2025-05-23  Reini Urban  <reini.urban@gmail.com>

	adjust MAX_SIZE_BUF on ASAN
	See GH #1144

	indxf: protect calloc failures
	set the counter to 0
	Fixes fuzzing null-deref GH #1141

2025-05-21  Reini Urban  <reini.urban@gmail.com>

	injson: fix uninit access on missing FILEHEADER.version/dwg_version
	Fixes uninitialized/2/testcase by Matteo Marini.

2025-05-20  Reini Urban  <reini.urban@gmail.com>

	indxf: fix invalid LAYER_INDEX.entries
	a Matteo Marini testcase submitted privately (uninitialized/1)

2025-05-13  Reini Urban  <reini.urban@gmail.com>

	tests: rename $TeighaFileConverter to $ODAFileConverter

	silence ODAFileConverter_geometry popups on X
	.profile: export ODAFileConverter_geometry="-geometry 150x150+0-0"

	gitignore local helper scripts

	build-aux/clang-format-all.sh src include test/unit-testing/

	dynapi: fix regen indentation
	Fixes GH #1136 and conforms to clang-format

	fix distclean: clean dxf.err leftovers
	and remove dynapi_test.c target, which is really for build_dir
	but have no .c in build_dir.

	fix git-version-gen
	by fetching more commits and tags.
	since we always tag builds via appveyor,
	depth 50 should be enough to catch such a tag.

	add library version api
	So that other programs can inspect the version parts.
	Fixes GH #1133

2025-05-12  Reini Urban  <reini.urban@gmail.com>

	update TODO: pre-R13

	remove unused vars
	detected by clang-cl

	config.rpath: egrep -> grep -E

2025-05-12  Reini Urban  <reini@spexai.com>

	extend git-version-gen to NEWS parsing

	single LIBREDWG_SO_VERSION source
	move from dwg.h back to configure.ac
	grep this for cmake

	bump VERSION_MINOR to 13

2025-05-03  Reini Urban  <reini.urban@gmail.com>

	decode: fix dat.chain double-free
	the chain may be reallocated but is copied.
	e.g in solid_background

2025-05-02  Reini Urban  <reini.urban@gmail.com>

	dxf: don't split utf-8 sequences, cquote all
	Fixes rest of GH #986

	debug: add all missing unhandled types

	unit-testing: more coverages
	for SOLID_BACKGROUND, GEODATA, LARGE_RADIAL_DIMENSION.
	not distributed, but public samples.

2025-04-30  Reini Urban  <reini.urban@gmail.com>

	encode: wrong __counted_by optimizations
	with eed and some additional fields before the final char[].
	fails with gcc-15 and esp. with mingw.
	wrong memcpy **buffer overflow** warnings.

	indxf: explicit realloc(0) to free
	detected with valgrind

	decode_preR13: better GH #1131 protection
	also with the 2 other wrong sizes.
	CiFuzzer detected still an OOM

	decode_preR13: protect from illegal header.entities_end
	also abort when decoding a single entity makes no progress,
	due to overflow.
	Fuzzed in GH #1131

2025-04-22  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix hardcoded HANDSEED value for AC1015 DWG file
	In DWG AC1015 is more handles than 0x25, there were conflict.

	Fix DWG file format
	It's breaker for opening in AutoCAD R14, AutoCAD 2000.

2025-04-22  Reini Urban  <reini.urban@gmail.com>

	fix dwg_section_page_checksum usage
	need to do this for every section on encode.
	first the header weith a zero'd checksum field to get the seed for the body.
	Fixes GH #1044

2025-04-20  Reini Urban  <reini.urban@gmail.com>

	decode_test: tcc does not zero structs

2025-04-20  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix encoding of LAYER table flag0

	Add default value for LAYER table linewt variable

	Fix LAYER table boolean values

2025-04-19  Reini Urban  <reini.urban@gmail.com>

	decode: windows/msvc portability quirks

2025-04-18  Reini Urban  <reini.urban@gmail.com>

	decode: skip old section checks
	which break now 2004/Leader, 2018/Leader, ...

	decode_test: new decompression unit tests

	change/extend bit_explore_chain

	decode: fix encrypted_section_header.unknown
	wrong ODA specs.

	decode read_R2004_section_info refactoring
	use FIELDs and dec streams.

	refactor 2004 decompression
	See GH #439 for the decompression bug analysis.
	Simplify to use our bit chains

	fix PRI_SIZE_T_MODIFIER on 32bit and windows

2025-04-17  Reini Urban  <reini.urban@gmail.com>

	decode: remove some DEBUG checks

	decomp: sync -v9 decompress logging with work/decomp-gh439
	count position from 0, not the end

2025-04-11  Reini Urban  <reini.urban@gmail.com>

	DEBUG decompression sections

2025-04-11  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix ellipse drawing in SVG

	Fix SVG rotate syntax

2025-04-05  Reini Urban  <reini.urban@gmail.com>

	reedsolomon: fix DEBUG code

	decode: fix eed DEBUG sanity checks

2025-04-05  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Log decrypted R2004 header

	Change logging of decrypted block to LOG_TF_HEX

	Split LOG_TF to LOG_TF_HEX and rest

2025-04-04  Reini Urban  <reini@spexai.com>

	mingw: update python2 to mingw-w64-x86_64-python
	mingw-w64-x86_64-python3 is now a virtual package provided by mingw-w64-x86_64-python
	mingw-w64-x86_64-python2 is gone.

2025-04-04  Daniel Nikolov  <114946180+danikolovv@users.noreply.github.com>

	fix docs: Functions Decoding
	change first and second example.
	process_BLOCK_HEADER (block_control->entries[i]);

2025-03-22  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	BLOCK_RECORD isn't present in AC1009 DXF

2025-03-22  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix DXF defaults for AC1009
	Main issue is PUCSXDIR/PUCSYDIR with value (0.0, 0.0, 0.0) which is
	invalid in AutoCAD. These values are present from AutoCAD R11.

	HANDSEED is present from AutoCAD R10.

	The oldCECOLOR_lo is present in range R1.5 and R12

2026-03-17  Reini Urban  <reini.urban@gmail.com>

	Release 0.13.4
	see NEWS

	build: add release helpers

	decode: guard optional 3DSOLID history_id handle read
	* src/dwg.spec (COMMON_3DSOLID): For non-DXF decode, read
	  history_id only when version > 1 and at least 8 bits remain in
	  hdl_dat. This avoids trailing bit_read_RC overflow reports on
	  objects with no history_id.
	* src/spec.h: Add fallback AVAIL_BITS macro so spec expressions that
	  reference it also compile in non-decoder builds.

2026-03-17  Reini Urban  <reini.urban@gmail.com>

	in_dxf: fix SubDMesh DXF binary import (GH #272)
	* src/in_dxf.c (in_hex2bin callers): Fix precedence bug so read gets the decoded byte count
	  instead of a boolean.
	* src/in_dxf.c (add_MESH): Initialize unknown_b1/unknown_b2 defaults for DXF-imported MESH.

	This fixes dxf-check for Rotterdam_Centrum/Bruggen/Erasmusbrug.dwg ODA AcDbSubDMesh read errors

2026-03-17  Reini Urban  <reini.urban@gmail.com>

	Revert "decode: fix CRC check start for handle-map objects"
	This reverts commit e12563c5a18bd9639298306cd354ce76cc8d8342.

2026-03-17  Reini Urban  <reini.urban@gmail.com>

	spec: fix dwg_set_dataflags for TEXT/ATTRIB/ATTDEF via add API. GH #1164
	When using dwg_add_TEXT/ATTRIB/ATTDEF and setting rotation or oblique_angle
	via the API, dwg_set_dataflags() was not called during encoding because
	dwg_add_empty(R_2000) sets from_version = R_2000, making the condition
	  dat->from_version < R_2000
	false. Change to <= R_2000 so the dataflags are always recomputed when
	encoding R_2000 output, covering both API-created objects (from_version ==
	version) and objects whose fields were modified after decode.

	Applies to TEXT, ATTRIB and ATTDEF — all three share the same condition.

2026-03-17  Reini Urban  <reini.urban@gmail.com>

	decode: fix wrong memmove for LZ77 back-reference decompression. GH #1204
	The #ifdef NDEBUG path used memmove() to copy compressed back-references,
	but memmove copies from the original source bytes. When comp_offset <
	comp_bytes the source and destination windows overlap and the LZ77
	run-length extension requires reading back newly-written bytes as pos
	advances. memmove defeats this, producing wrong output in release builds.

	Fix: always use the byte-by-byte loop; keep the asserts under #ifndef NDEBUG.

2026-03-17  Reini Urban  <reini.urban@gmail.com>

	libredwg.spec: upgrade to 0.13.4
	- Fix %{_sharedir} -> %{_datadir} (standard RPM macro)
	- python3-lxml already correct (switched from python3-libxml2)
	- SO version stays at 0.0.13 (no ABI bump in configure.ac)
	- Add changelog entry

	NEWS: add 0.13.4 release notes

2026-03-17  Reini Urban  <reini.urban@gmail.com>

	in_dxf: fix CMC color index for entity fields with DXF code >= 90
	The generic entity field dispatcher treated any CMC field with DXF code
	>= 90 as an RGB truecolor value (pair->value.l >> 0x18 = method). But
	MULTILEADER uses codes 91/92/93 for line_color, text_color, block_color
	as plain color indices (0=ByBlock, 256=ByLayer, etc.), not RGB values.

	When value=0 was stored as rgb=0x00000000, ODA read method=0x00 (invalid,
	valid range 0xc0-0xc8), emitting "Color index 65535" and misaligning the
	bit-stream, triggering "CRC does not match".

	Fix: in the code >= 90 branch, distinguish by value: real RGB truecolors
	always have high byte set (> 257), so values <= 257 are color indices
	and are routed through dxf_set_CMC_index() for correct method/rgb.

2026-03-17  Reini Urban  <reini.urban@gmail.com>

	in_dxf: fix CMTC color method/rgb for TABLESTYLE and CellStyle color fields
	Add dxf_set_CMC_index() helper that properly maps a DXF color index to the
	CMC method and rgb bytes required by the R_2004 CMTC encoding: index 0 →
	0xc1 (ByBlock), 256 → 0xc2 (ByLayer), 257 → 0xc8 (None), others → 0xc3
	plus palette RGB.

	Previously add_TABLESTYLE and add_CellStyle only set color->index from DXF
	code 62, leaving method=0 and rgb=0.  When SUB_FIELD_CMTC later writes
	those colors it forces R_2004 mode (full BS+BL+RC CMC), so rgb=0x00000000
	gave ODA method=0 (invalid, valid range 0xc0–0xc8) causing "Cannot set C
	to that value" and a misaligned bit-stream that triggered "CRC does not
	match".

	Also fix dxf_read_CMC to compute a default method/rgb when no 420 truecolor
	code follows the 62 index code, using the same mapping.

2026-03-17  Reini Urban  <reini.urban@gmail.com>

	dxf-check: move oda errs to .

2026-03-16  Reini Urban  <reini.urban@gmail.com>

	build: fix codepages build with build-in-srcdir

	in_dxf: resolve DIMENSION.block field name to BLOCK handle
	The 'block' field (DXF code 2, anonymous dimension block name like '*D8')
	was stored in obj_hdls for deferred resolution but resolve_postponed_object_refs
	only handled 'block_header', not 'block'. Add 'block' alongside 'block_header'
	to resolve it to the BLOCK table handle, preventing duplicate anonymous blocks.

	in_dxf: fix phantom BLOCK_HEADER entry when new_object reuses existing object
	When new_object uses the 'Reuse existing BLOCK_HEADER' path it
	decrements dwg->num_objects, making idx >= num_objects. The outer
	dxf_tables_read loop then accessed a stale partial object at idx,
	which got an auto-assigned handle (0x47A) and was added as a phantom
	entry to BLOCK_CONTROL.entries, causing ODA 'Duplicate Record name (429)'.

2026-03-16  Reini Urban  <reini.urban@gmail.com>

	in_dxf: fix SORTENTSTABLE DXF import: parse ents[], sort_ents[], block_owner
	Handle codes 331 (ents handles), 5 (sort_ents handles), and the
	subsequent 330 (block_owner) for SORTENTSTABLE objects in new_object().

	Fixes GH #1091: ODA 'AcDbSortentsTable can't be cast to AcDbEntity'
	caused by code 5 overwriting the object handle with sort_ents values.

2026-03-16  Reini Urban  <reini.urban@gmail.com>

	decode,in_dxf: fix nolinks for r2000 entity chains from DXF
	in_postprocess_handles sets entity nolinks=1 when the previous entity
	is at array index obj->index-1.  But objects in the r2000 binary are
	written in handle-sorted order, not array order.  When non-entity
	objects (APPID, VPORT table records) have handles between two
	consecutive entity handles, they appear between the entities in binary.
	Setting nolinks=1 makes ODA follow the binary-next object as the
	entity chain, which is a non-entity, causing:
	  "Object of class AcDbRegAppTableRecord can't be cast to AcDbEntity"
	  "Object of class AcDbViewportTableRecord can't be cast to AcDbEntity"

	Fix: call dwg_fixup_BLOCKS_entities after DXF import to recompute
	nolinks based on handle arithmetic (cur-1 / cur+1) rather than array
	adjacency.  This clears the incorrect nolinks=1 flags and sets the
	explicit prev/next_entity handles that ODA requires.

	Fixes 2000/A.dwg and sample_2000.dwg DXF roundtrips (GH #1091).

2026-03-16  Reini Urban  <reini.urban@gmail.com>

	in_dxf: fix VX_TABLE_RECORD handle mismatch for VIEWPORT
	dwg_add_VX creates a VX_TABLE_RECORD and adds it to VX_CONTROL.entries
	using the handle returned by dwg_new_handseed.  Calling dwg_new_handseed
	a second time and overwriting vxobj->handle.value left VX_CONTROL.entries
	pointing to a non-existent handle while VIEWPORT.vport_entity_header
	pointed to a different, skipped handle.

	ODA then failed to write the DXF with "Object was permanently erased".

	Fix: remove the second dwg_new_handseed call; use the handle that
	dwg_add_VX already assigned.

	Fixes Ceco.NET-People-Men-Sm-471.dwg DXF roundtrip (GH #1091).

2026-03-16  Reini Urban  <reini.urban@gmail.com>

	fix EED size calculation and overflows
	working on fixing json roundtrips for
	to/2000/from_uloz.to/VÝKRES_VÝZTUŽE_STROP.dwg

2026-03-16  Reini Urban  <reini.urban@gmail.com>

	common: add my_strcasecmp unit tests
	Compile my_strcasecmp unconditionally so it can be tested and used
	regardless of HAVE_STRCASECMP. The #define strcasecmp my_strcasecmp
	alias is still only set when the system lacks strcasecmp.

	Add common_strcasecmp_tests() to test/unit-testing/common_test.c

	Closes GH #1207

2026-03-16  Reini Urban  <reini.urban@gmail.com>

	common: fix and rename strcasecmp to my_strcasecmp
	Rename the fallback implementation to my_strcasecmp and add

	Fix the broken implementation:
	- Drop the bogus strcmp() shortcut (case-sensitive, useless here)
	- Return proper negative/0/positive instead of 0/1
	- Handle strlen(a) < strlen(b) correctly via final char difference
	- Use (unsigned char) cast before toupper() as required by the standard

	GH #1207

2026-03-15  Reini Urban  <reini.urban@gmail.com>

	chore: clang-format off macros
	to bypass prek clang-format

	docs: Better AGENTS.md recipes for reprodcucers

	dwg.spec: relax HATCH seeds and handles

	dwg.spec: tolerate truncated FIELD data

	dwg.spec: clamp BLOCKLOOKUPPARAMETER unknown_t

	in_dxf: tolerate FIELD value preamble

	dxf-check: clear stale ODA error files

2026-03-14  Reini Urban  <reini.urban@gmail.com>

	decode: fix CRC check start for handle-map objects
	The per-object CRC for r13b1-r2000 handle-map objects must start after the
	initial MS size field. dwg_decode_add_object() used the handle-map entry
	address, which caused false WRONGCRC reports (notably for ES2_S_2010 XRECORD
	[247]).

	* src/decode.c (dwg_decode_add_object): Check CRC starting at obj->address-2
	  to match the encoder.

2026-03-14  Reini Urban  <reini.urban@gmail.com>

	dxf: avoid exporting invalid SORTENTSTABLE handle refs
	When exporting SORTENTSTABLE, some inputs (e.g. td/2010/ES2_S.dwg) contain
	NULL/zero handle references which were written to DXF as 331/5 = 0. This
	produces malformed DXF and breaks DXF->DWG (r2000) roundtrips, triggering
	invalid handles rejected by ODA.

	* src/out_dxf.c (VALUE_HANDLE, FIELD_HANDLE): Skip emitting DXF handle group
	  codes 331 and 5 when the resolved absolute_ref is 0.

2026-03-14  Reini Urban  <reini.urban@gmail.com>

	in_json: make partial OBJECTS entries releasable on parse errors
	Fuzzed/invalid JSON can abort after json_OBJECTS already allocated
	object/entity containers and their payloads. With preR13 input, the free path
	ignored UNKNOWN_OBJ/UNKNOWN_ENT, so those allocations were not released,
	triggering LeakSanitizer.

	* src/in_json.c (json_OBJECTS): Set type/fixedtype to UNKNOWN_OBJ/UNKNOWN_ENT
	  immediately after allocation so dwg_free can dispatch a proper free handler.
	* src/free.c (free_preR13_object): Handle UNKNOWN_OBJ/UNKNOWN_ENT (and DUMMY)
	  in the preR13 switch.

2026-03-13  Reini Urban  <reini.urban@gmail.com>

	free: avoid OOB in preR13 entity cleanup with injson
	When reading malformed/partial JSON (DWG_OPTS_INJSON), preR13 entities may be
	created without initialized layer/ltype handle pointers. The preR13 free path
	unconditionally touched these handles, which could read past the end of the
	allocation under ASan.

	* src/free.c (free_preR13_object): Guard correct union member for entities and
	  skip freeing preR13 entity handles for DWG_OPTS_IN inputs.

	Fixes ossfuzz 470417487

2026-03-13  Reini Urban  <reini.urban@gmail.com>

	docs: add AGENTS.md with repository guidance for coding agents

2026-02-11  Reini Urban  <reini.urban@gmail.com>

	fix -Wdefault-const-init-field-unsafe with clang

2026-02-10  Reini Urban  <reini.urban@gmail.com>

	dxf: encode to UTF-8 for r2007+
	add a VALUE_TVc for const string literals.
	bit_u_expand always shrinks, but still do a copy then.

	@matabar also tried a fix, but his was incorrect.
	But thanks for the analysis!

2026-02-10  Reini Urban  <reini.urban@gmail.com>

	bits: swap wrong calloc args
	harmless, but be consistent

	spec: fix ARC_DIMENSION dxf codes 40,41
	for arc_start_param and arc_end_param.
	See github.com/mozman/ezdxf examples_dxf/uncommon.dxf#L1434 e.g.

2026-02-06  Reini Urban  <rurban@cpan.org>

	switch py-libxml2 to py-lxml (#84)
	tested ok.

2026-02-05  Reini Urban  <reini.urban@gmail.com>

	dxf: negative color index
	GH #1214

	also add missing the CMC method to the binary variant for consistency.

2026-02-05  Reini Urban  <reini.urban@gmail.com>

	ci: pinact run -u
	also ossfuzz manually:
	curl -s https://api.github.com/repos/google/oss-fuzz/commits/master | jq -r '.sha'

2026-02-04  Reini Urban  <reini.urban@gmail.com>

	decode: fix heap-overflow by 1
	Fixes fuzzing case GH #1215, analog to ossfuzz 63483
	Thanks to @Keryer (Qi Kery)

	json: improve color index, add Dwg_Color_Method enum
	See GH #1216

2026-02-03  Reini Urban  <reini.urban@gmail.com>

	codepages: add comments about exceptions
	and add a regen-h target

	oda: get deb version dynamically

	oda: bump to 26.12

	prek: run with clang-format

	prek: install and changes

2025-12-17  Sakura  <1178743577@qq.com>

	fix: memory out of bounds

2025-12-02  Reini Urban  <reini.urban@gmail.com>

	ci: pinact run -u
	actions/checkout@v6.0.0, codeql-action@v4.31.6

2025-11-24  luzpaz  <luzpaz@users.noreply.github.com>

	Fix various typos Found via: `codespell -q 3 -S "./.git,*.patch,ChangeLog,./NEWS,./src/codepages" -L 2rd,aadd,addd,aded,afe,ba,baed,beed,caf,childs,daa,ded,ede,fo,gir,gord,gost,nam,noo,oce,re-use,ro,siz,te,teh,tekst,ue,uptodate`

2025-11-19  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix Vertex entity index4 parsing

2025-11-03  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix r2007 TOLERANCE entity
	TOLERANCE entity need a has_strings bit.

2025-10-28  Reini Urban  <reini.urban@gmail.com>

	json: protect from NULL or wrong _obj
	fatal. Thanks to 7erryX (GH #1190)

2025-10-18  Reini Urban  <reini.urban@gmail.com>

	CI: bump oda to 26.9

	gh: switch from -m32 to modern --host=i686-linux-gnu
	for latest distros

2025-09-03  Michal Josef Špaček  <michal.josef.spacek@gmail.com>
	    Reini Urban  <reini.urban@gmail.com>

	Fix some REAL xdata types
	dwg_resbuf_value_type missed some REAL and POINT3D ranges.
	Fixes GH #1178

2025-09-01  Reini Urban  <reini.urban@gmail.com>

	oda: bump to 26.7

	decode: fix FIELD_NUM_INSERTS
	Fixes GH #1177

	spec: rename BLOCK_HEADER.loaded_bit to xref_loaded

2025-08-12  Reini Urban  <reini.urban@gmail.com>

	spec: use signed VERTEX_PFACE_FACE.vertind [BSd]
	e.g. -5 instead of 65531

2025-08-11  Reini Urban  <reini.urban@gmail.com>

	encode: fix dwg_set_dataflags
	oops, critical encoder bug!
	dataflags are reverse, if a bit is absent then the field needs to be used.
	also the default with_factor is 1.0

	thanks to Erfan Sadigh Nejati for finding this bug.
	Fixes GH #1164

2025-08-10  Reini Urban  <reini.urban@gmail.com>

	configure: detect emcc
	and fix failing probes because of -Werror -Wlimited-postlink-optimizations
	Fixes the configure & make part of GH #1073

2025-08-09  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix dwgadd error with bad --as version

2025-07-30  Reini Urban  <reini.urban@gmail.com>

	indxf: fix empty CLASSES GH #1068

2025-07-28  Reini Urban  <reini.urban@gmail.com>

	encode: log MLEADERSTYLE class_version: 2
	taken from APPID.ACAD_MLEADERVER eed

	decode: fixup FIELD.value_string and format

2025-07-23  Reini Urban  <reini.urban@gmail.com>

	indxf: more FIELD improvements
	can now read good DXF's with FIELD's,
	but not yet our written FIELD's

2025-07-15  Reini Urban  <reini.urban@gmail.com>

	doc: document more VERTEX_* flags
	in addition to our LOG_FLAG_VERTEX

	rapidrtrendersettings docs
	and max checks. still wrong

	api: change LARGE_RADIAL_DIMENSION fields
	first_arc_pt => chord_pt
	leader_len => jog_angle
	jog_point => jog_pt
	ovr_center: DXF 12 => 14

	indxf: add_FIELD
	special-cases all over.
	not covering all yet.

2025-07-03  Reini Urban  <reini.urban@gmail.com>

	oda: back to 26.4
	26.5 disappeared

	gh: pinact run -u
	security: pin our github actions

2025-06-30  Reini Urban  <reini.urban@gmail.com>

	dynapi: fix indxf conversion from r2007+ to strings
	Fixes GH #1163 part 2
	JSON and DXF import leaves TABLE.name as TV (i.e. UTF-8)
	for the future encode to r2000

	oda: bump to 26.5

	oda: create .dwg.err not .json.err

2025-06-25  Reini Urban  <reini.urban@gmail.com>

	encode: set TEXT.dataflags also on indxf

	logging: fix TV for indxf

2025-06-24  Reini Urban  <reini.urban@gmail.com>

	logging: mark T as TV

	api: rename SecondHeader.dwg_version to dwg_versions
	lo-byte dwg_version, high-byte maint_version

2025-06-23  Reini Urban  <reini.urban@gmail.com>

	indxf: fix IMAGE.imagedefreactor setter
	wrong dynapi usage, ref even refs

	dynapi: fix #lines

	indxf: fix IMAGE.clip_verts
	by defaulting num_clip_verts to 2

	indxf: set BLOCK_HEADER.base_pt = BLOCK.base_pt

	more obj_absowner
	: check if rel or abs
	if [ -z $1 ]; then
	    h=4
	else
	    h=$1
	fi
	for f in *.json; do
	  echo $f
	  jq .FILEHEADER.version "$f"
	  echo "ownerhandle = ($h."
	  jq ".OBJECTS[] | select(.ownerhandle[0] == $h) | [.object, .entity]" "$f" | sort -u
	done

2025-06-20  Reini Urban  <reini.urban@gmail.com>

	Replace more FORMAT_RLLx with FORMAT_HV

	make: fix log-dwg
	wrong xargs syntax

	dxf: minor tunings
	write APPID 71 1 only with ADE_PROJECTION.
	use absolute handles with DICTIONARY

2025-06-19  Reini Urban  <reini.urban@gmail.com>

	dxf: fix *X block name resolution
	use the BLOCK.name not BLOCK_HEADER.name for anonymous block names.
	Fixes a part of GH #1091

	trace: back to HEX for abs handles

	dwgadd: protect from missing insert block
	i.e. BLOCK not found

	api: merge R11_HANDSEED with HANDSEED
	also add dwg_init_handseed(), needed for some examples

2025-06-19  Reini Urban  <reini.urban@gmail.com>

	api: replace BITCODE_RLLx with BITCODE_HV
	for handle value. It inistally was RL, but later upgraded to RLL
	(64-bit long long handles).

	change the auxheader version from RL to HV

2025-06-19  Reini Urban  <reini.urban@gmail.com>

	indxf: fixup dwg_set_next_objhandle
	per default use the next HANDSEED. only for initial add_Document
	use dwg->next_hdl.
	Fixes Object of class AcDbVXTable can't be cast to AcDbBlockHeader.

	also set *MODEL_SPACE entmode = 2 correctly for older versions.

2025-06-18  Reini Urban  <reini.urban@gmail.com>

	indxf: VIEWPORT needs to create a matching VX_TABLE_RECORD
	TODO: and if the VIEWPORT is *Active, it needs to set HEADER.VX_TABLE_RECORD
	On LAYOUT.active_viewport

2025-06-17  Reini Urban  <reini.urban@gmail.com>

	indxf: improve VERTEX layer
	to use the parents layer.
	still not 100% correct though

	indxf: fix empty layer in VERTEX subents
	set it to the CLAYER for an immediate fix

	indxf: fixup find_hv logic
	no duplicate entries. e.g. BLOCK_HEADERs
	down from 31 dxf r14 roundtrip errors to 12.

2025-06-17  Reini Urban  <reini.urban@gmail.com>

	indxf: set more ownerhandles
	in fact for most objects take them from reactors.
	just not table records.

	this reduced the r2000 dxf roundtrip errors from 36 to 20.

2025-06-17  Reini Urban  <reini.urban@gmail.com>

	spec: remove LTYPE.unknown_r13
	looks very wrong. and it's not in ODA's spec

	indxf: add dxf_postprocess_MLINESTYLE
	analog to LAYOUT. owned by a DICTIONARY, but no block_header field.
	strangely it is not triggered, so I added it to the reactors code also.

	encode: no default VX, just VX_CONTROL
	helps dxf roundtrips

	dxf-check: use $ODAFileConverter_geometry
	put annoying popups to the side, on X only

	WIP indxf: enable and fix dxf_postprocess_LAYOUT
	to fixup the ownerhandle vs block_header 330 confusion.
	BLOCK_HEADER vs DICTIONARY

	fixup dxf: fix LAYER.flag roundtrips
	no free => flag tracing

2025-06-16  Reini Urban  <reini.urban@gmail.com>

	dxf: fix LAYER.flag roundtrips
	flag0, linewt (wrong type), plotflag (on if plotstyle?)
	GH #1091

	fix signed xdata ints from/to json/dxf
	Fixes GH #1040

	encode: rename internal pvzadr to size_adr

	decode: trace TF and BINARY
	e.g. for string_area
	./dxf-check sample_2000|less

	indxf: fix duplicate table record entries
	esp. with r2000. GH #1091

2025-06-15  Reini Urban  <reini.urban@gmail.com>

	indxf: fix wrong DICT.ownerhandle
	when there is no NOD, or NOD not at 0.1.C
	Fixes ODA error: Object of class AcDbBlockBegin can't be cast to AcDbDictionary
	GH #1159

	indxf: fixup DICT.ownerhandle to NOD if NOD is elsewhere
	e.g. r13 dxf
	also fix to stable VX_CONTROL handle

	dxf: set more unitX_name and ratios
	for r13-r14

	encode: write no TV-ZERO with r14
	only since r2000

	dxf.test: insert order for r13, r14
	acad/oda add 2 INSERT's for roundtrips or whatever.

	dxf.test: pline order is fixed for r13, r14
	insert order TODO in GH #1159

2025-06-15  Reini Urban  <rurban@cpan.org>

	dxf.test: add failing r14,r13 INSERT dxf conversion
	wrong SEQEND

2025-06-15  Reini Urban  <reini.urban@gmail.com>

	indxf: set default isbylayerlt
	and pspace entmode on the pspace BLOCK.
	See Part 5 of GH #1159

	indxf: set R_13c3
	because the AC1013 $ACADVER is not set in DXF

	indxf: add r13 table record ownerhandles
	only needed for r13, later they are 0.
	Part 4 of GH #1159

	dxf: uppercase ltypes <r2000
	also fix in internal identifier

	dxf: r13c3 confusion - PROXYGRAPHICS
	we dont know if r13 or r13c3 on indxf.
	so emit $PROXYGRAPHICS if it is set with r13 also

	indxf: fix dxf_tables_read leak

	indxf: set NOD dicts owner
	Fixes part 3 of GH #1159

2025-06-14  Reini Urban  <reini.urban@gmail.com>

	bump copyright years
	now checked properly

	indxf: comment about is_xref_ref
	which can be 0 <r14 on unused table records.
	we would need a table_used hash to record usage.

	indxf: fix duplicate control entries
	don't add and remove, just add if not wrong.
	Fixes GH #1159

2025-06-13  Reini Urban  <reini.urban@gmail.com>

	dwg_api: DIMSTYLE comments for add

2025-06-13  Reini Urban  <reini.urban@gmail.com>

	decode_r11: set entmode 3 for blocks
	there was a wrong obj->address check, we can fake.
	and store it also in out_json.

	now some BLOCK's have no name

2025-06-13  Reini Urban  <reini.urban@gmail.com>

	preR13: fix dwg.block_control and HEADER.BLOCK_CONTROL_OBJECT missing

	set the ltype flag to 64 (loaded)
	by default. just BYBLOCK,BYLAYER are never loaded.
	and >r13 this bit is ignored.

	outdxf: fix some wrong r9 header vars
	some missing, and some only since r10.
	and fix some early defaults.
	from michal's new blank dxf's GH #1100

	add: more preR13 defaults
	need VPORT.*Active since r10 already.
	GH #1100

	add: more HEADER defaults

	WIP encode: fix preR13 entities iteration
	fix the in-BLOCK logic, but broke json-check r11/entities-3d,
	missing the BLOCKs
	GH #1100

	decode_preR13: fix CLAYER double-free
	GH #1102, GH #1100 Fixes  Missing TEXTSTYLE, CLAYER, CELTYPE and DIMSTYLE values in header

	dwg_add_handleref: trace re-used handleref
	and clean enlarged object_ordered_ref areas.
	trying to fix r10 CLAYER double-free

	add: set standard table records with r9 already
	GH #1100

	add: set unit1_text with r10 already

2025-06-10  Reini Urban  <reini.urban@gmail.com>

	dwgadd: better --help output
	we can save as planned versions with dxf or json

	dxf-check: improve. print oda errors at the end again
	json-check-2000 errors:
	LINKRODS_from_autocad_r13.json.err
	STEERING_from_autocad_r13.json.err
	example_r14.json.er

	ci: bump windows-2019 to 2022
	will be retired soon

2025-06-08  Reini Urban  <reini.urban@gmail.com>

	injson: eed structure comment

	fix dwg_add_handle ubsan: invalid negation
	Fixes GH #1154

	bits ubsan: handle wrong negation
	Fixes GH #1153
	0x80000000 (-2147483648) negated stays negative

2025-06-06  Reini Urban  <reini.urban@gmail.com>

	injson: fix uninitialized ptrs

	decode: fix UB in bsearch cmp
	Fixes GH #1152

2025-06-06  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Add tests for read_MC/UMC/MS

2025-06-05  Reini Urban  <reini.urban@gmail.com>

	ci: fix PRs

	fixup fix add_LAYOUT

2025-06-03  Reini Urban  <reini.urban@gmail.com>

	add: fix add_LAYOUT and its test
	undefine NEED_VPORT_FOR_MODEL_LAYOUT, a LAYOUT
	can be attached to the pspace BLOCK_HEADER without a VIEWPORT.
	test ok now, fixes LAYOUT in GH #1137

	WIP fix add LAYOUT test
	Attach a layout to a VPORT in mspace, not VIEWPORT.
	Fix the LAYOUT.block_header for this case.
	Set NEED_VPORT_FOR_MODEL_LAYOUT for the add LAYOUT api.
	See GH #1137

	decode: clear new dwg->object and dwg->object_ref on realloc
	See GH #1045

2025-06-02  Reini Urban  <reini.urban@gmail.com>

	dynapi: fix a dwg_dynapi_entity_set_value null deref
	Fixes GH #1122. Fuzzing only

	add: set DICTIONARY.cloning to all NOD members also

	add: fix add_LEADER with associated_annotation
	analog to before. create a required DIMSTYLE before the entity.
	GH #1137

2025-06-01  Reini Urban  <reini.urban@gmail.com>

	add: fix add_DIMENSION
	first create the dimstyle, then the entity.
	Fixes GH #1148

	indxf: fix LAYER_INDEX.numlayers realloc
	clear the new struct. in case of errors, the free of handle would fail.
	Fixes GH #1147 part 3

	ci: fixup checkout for tag

	ci: no fetch-depth: 50, broken with tags

	indxf: fail on MLINE num_* setting twice
	with fuzzed or bad input.
	Fixes last part 3 of GH #1146

	indxf: fix double-free in HATCH.path errors
	with fuzzed or bad input.
	Fixes part 2 of GH #1146

2025-05-31  Reini Urban  <reini.urban@gmail.com>

	ci: Update oda version

	indxf: fix failed dxf_read_rll
	when no number can be read, set the number to 0.
	Fixes GH #1146

	injson: fix NULL in_hex2bin argument
	Fixes GH #1142

	add_test: add oda check with LIBREDWG_DEBUG 2
	passes

2025-05-26  Reini Urban  <reini.urban@gmail.com>

	encode: always compute the HANDSEED
	dont take anything granted.
	Fixes GH #1127 (part of GH #1105)

2025-05-23  Reini Urban  <reini.urban@gmail.com>

	adjust MAX_SIZE_BUF on ASAN
	See GH #1144

	indxf: protect calloc failures
	set the counter to 0
	Fixes fuzzing null-deref GH #1141

2025-05-21  Reini Urban  <reini.urban@gmail.com>

	injson: fix uninit access on missing FILEHEADER.version/dwg_version
	Fixes uninitialized/2/testcase by Matteo Marini.

2025-05-20  Reini Urban  <reini.urban@gmail.com>

	indxf: fix invalid LAYER_INDEX.entries
	a Matteo Marini testcase submitted privately (uninitialized/1)

2025-05-13  Reini Urban  <reini.urban@gmail.com>

	tests: rename $TeighaFileConverter to $ODAFileConverter

	silence ODAFileConverter_geometry popups on X
	.profile: export ODAFileConverter_geometry="-geometry 150x150+0-0"

	gitignore local helper scripts

	build-aux/clang-format-all.sh src include test/unit-testing/

	dynapi: fix regen indentation
	Fixes GH #1136 and conforms to clang-format

	fix distclean: clean dxf.err leftovers
	and remove dynapi_test.c target, which is really for build_dir
	but have no .c in build_dir.

	fix git-version-gen
	by fetching more commits and tags.
	since we always tag builds via appveyor,
	depth 50 should be enough to catch such a tag.

	add library version api
	So that other programs can inspect the version parts.
	Fixes GH #1133

2025-05-12  Reini Urban  <reini.urban@gmail.com>

	update TODO: pre-R13

	remove unused vars
	detected by clang-cl

	config.rpath: egrep -> grep -E

2025-05-12  Reini Urban  <reini@spexai.com>

	extend git-version-gen to NEWS parsing

	single LIBREDWG_SO_VERSION source
	move from dwg.h back to configure.ac
	grep this for cmake

	bump VERSION_MINOR to 13

2025-05-03  Reini Urban  <reini.urban@gmail.com>

	decode: fix dat.chain double-free
	the chain may be reallocated but is copied.
	e.g in solid_background

2025-05-02  Reini Urban  <reini.urban@gmail.com>

	dxf: don't split utf-8 sequences, cquote all
	Fixes rest of GH #986

	debug: add all missing unhandled types

	unit-testing: more coverages
	for SOLID_BACKGROUND, GEODATA, LARGE_RADIAL_DIMENSION.
	not distributed, but public samples.

2025-04-30  Reini Urban  <reini.urban@gmail.com>

	encode: wrong __counted_by optimizations
	with eed and some additional fields before the final char[].
	fails with gcc-15 and esp. with mingw.
	wrong memcpy **buffer overflow** warnings.

	indxf: explicit realloc(0) to free
	detected with valgrind

	decode_preR13: better GH #1131 protection
	also with the 2 other wrong sizes.
	CiFuzzer detected still an OOM

	decode_preR13: protect from illegal header.entities_end
	also abort when decoding a single entity makes no progress,
	due to overflow.
	Fuzzed in GH #1131

2025-04-22  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix hardcoded HANDSEED value for AC1015 DWG file
	In DWG AC1015 is more handles than 0x25, there were conflict.

	Fix DWG file format
	It's breaker for opening in AutoCAD R14, AutoCAD 2000.

2025-04-22  Reini Urban  <reini.urban@gmail.com>

	fix dwg_section_page_checksum usage
	need to do this for every section on encode.
	first the header weith a zero'd checksum field to get the seed for the body.
	Fixes GH #1044

2025-04-20  Reini Urban  <reini.urban@gmail.com>

	decode_test: tcc does not zero structs

2025-04-20  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix encoding of LAYER table flag0

	Add default value for LAYER table linewt variable

	Fix LAYER table boolean values

2025-04-19  Reini Urban  <reini.urban@gmail.com>

	decode: windows/msvc portability quirks

2025-04-18  Reini Urban  <reini.urban@gmail.com>

	decode: skip old section checks
	which break now 2004/Leader, 2018/Leader, ...

	decode_test: new decompression unit tests

	change/extend bit_explore_chain

	decode: fix encrypted_section_header.unknown
	wrong ODA specs.

	decode read_R2004_section_info refactoring
	use FIELDs and dec streams.

	refactor 2004 decompression
	See GH #439 for the decompression bug analysis.
	Simplify to use our bit chains

	fix PRI_SIZE_T_MODIFIER on 32bit and windows

2025-04-17  Reini Urban  <reini.urban@gmail.com>

	decode: remove some DEBUG checks

	decomp: sync -v9 decompress logging with work/decomp-gh439
	count position from 0, not the end

2025-04-11  Reini Urban  <reini.urban@gmail.com>

	DEBUG decompression sections

2025-04-11  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix ellipse drawing in SVG

	Fix SVG rotate syntax

2025-04-05  Reini Urban  <reini.urban@gmail.com>

	reedsolomon: fix DEBUG code

	decode: fix eed DEBUG sanity checks

2025-04-05  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Log decrypted R2004 header

	Change logging of decrypted block to LOG_TF_HEX

	Split LOG_TF to LOG_TF_HEX and rest

2025-04-04  Reini Urban  <reini@spexai.com>

	mingw: update python2 to mingw-w64-x86_64-python
	mingw-w64-x86_64-python3 is now a virtual package provided by mingw-w64-x86_64-python
	mingw-w64-x86_64-python2 is gone.

2025-04-04  Daniel Nikolov  <114946180+danikolovv@users.noreply.github.com>

	fix docs: Functions Decoding
	change first and second example.
	process_BLOCK_HEADER (block_control->entries[i]);

2025-03-22  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	BLOCK_RECORD isn't present in AC1009 DXF

2025-03-22  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix DXF defaults for AC1009
	Main issue is PUCSXDIR/PUCSYDIR with value (0.0, 0.0, 0.0) which is
	invalid in AutoCAD. These values are present from AutoCAD R11.

	HANDSEED is present from AutoCAD R10.

	The oldCECOLOR_lo is present in range R1.5 and R12

2025-03-14  Reini Urban  <reini.urban@gmail.com>

	ci: add --enable-debug build step
	but no make check.
	Fixes GH #1098

	dxf: fix --enable-debug compilation
	Fixes GH #1095

2025-03-13  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix logging of classes
	Similar output as latest DWG format.

	Before the commit:
	=======> Classes (start): 13739
	         Classes (end)  : 15146
	         Length         : 1407
	         Size : 1369 [RL]
	number: 500 [BS]
	proxyflag: 0 [BS]
	appname: ObjectDBX Classes [TV]

	  cppname: AcDbPolyline [TV]
	dxfname: LWPOLYLINE [TV]
	is_zombie: 0 [B]
	item_class_id: 498 [BS]

	number: 501 [BS]
	proxyflag: 32768 [BS]
	  is R13 format proxy (32768)
	appname: ObjectDBX Classes [TV]

	  cppname: AcDbHatch [TV]
	dxfname: HATCH [TV]
	is_zombie: 0 [B]
	item_class_id: 498 [BS]

	After the commit:
	=======> Classes (start): 13739
	         Classes (end)  : 15146
	         Length         : 1407
	         Size : 1369 [RL]
	-------------------
	Number:           500 [BS]
	Proxyflag:        0 [BS]
	Application name: "ObjectDBX Classes" [TV]
	C++ class name:   AcDbPolyline [TV]
	DXF record name:  LWPOLYLINE [TV]
	is_zombie:        0 [B]
	item_class_id:    498 [BS]
	-------------------
	Number:           501 [BS]
	Proxyflag:        32768 [BS]
	  is R13 format proxy (32768)
	Application name: "ObjectDBX Classes" [TV]
	C++ class name:   AcDbHatch [TV]
	DXF record name:  HATCH [TV]
	is_zombie:        0 [B]
	item_class_id:    498 [BS]

2025-03-13  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Remove error in check by bit_read_H()
	-1 means one byte for first bit_read_RC() in bit_read_H().

	Before patch:
	--common_size: 718
	proxy_id: 515 [BL 90]
	dwg_versions: 0x19 [BLx 95]
	> maint_version: 0
	> dwg_version: 19
	from_dxf: 0 [B 70]
	> data_numbits: 2325 [ 93]
	9094D65747269633530004B34000000600000000000000002881000000180000000000000000A202229258409E5840A25840A65840B05840B4000000000000001220233000000180009940000006000000000000000028800000000000000A2
	objids[0] = (5.1.F) abs:15 [H]
	[add handleref (5.0.0) abs:0] objids[1] = (5.0.0) abs:0 [H]
	[add handleref (5.1.14) abs:20] objids[2] = (5.1.14) abs:20 [H]
	[add handleref (5.1.F) abs:15] objids[3] = (5.1.F) abs:15 [H]
	ERROR: bit_read_RC buffer overflow at 403.2 + 1 > 404
	num_objids: 4
	 padding: +6
	 object_map{5C77} = 117
	 padding: FF/3F (6 bits)
	crc: 2EFA [RSx]
	 check_CRC 993626-994032 = 406: 2EFA == 2EFA

	After patch:
	--common_size: 718
	proxy_id: 515 [BL 90]
	dwg_versions: 0x19 [BLx 95]
	> maint_version: 0
	> dwg_version: 19
	from_dxf: 0 [B 70]
	> data_numbits: 2325 [ 93]
	9094D65747269633530004B34000000600000000000000002881000000180000000000000000A202229258409E5840A25840A65840B05840B4000000000000001220233000000180009940000006000000000000000028800000000000000A2
	objids[0] = (5.1.F) abs:15 [H]
	[add handleref (5.0.0) abs:0] objids[1] = (5.0.0) abs:0 [H]
	[add handleref (5.1.14) abs:20] objids[2] = (5.1.14) abs:20 [H]
	[add handleref (5.1.F) abs:15] objids[3] = (5.1.F) abs:15 [H]
	num_objids: 4
	 padding: +6
	 object_map{5C77} = 117
	 padding: FF/3F (6 bits)
	crc: 2EFA [RSx]
	 check_CRC 993626-994032 = 406: 2EFA == 2EFA

2025-03-12  Reini Urban  <reini.urban@gmail.com>

	more PROXY specs
	add and fix combined dwg_versions field.
	add graphical proxy_data fields. (ent only)

2025-03-10  Reini Urban  <reini.urban@gmail.com>

	dxf: write TABLESTYLE <r2010
	needed for CELLSTYLEMAP.

	ODA error: Object of class AcDbCellStyleMap can't be cast to AcDbEntity
	with dxf-check 2000/Circle

2025-03-09  Reini Urban  <reini.urban@gmail.com>

	out_dxf: also use PROXY objids code
	and for in_dxf: PUSH_HV already logs

	in_dxf: more PROXY objids

2025-03-08  Reini Urban  <reini.urban@gmail.com>

	spec: refactor PROXY_{OBJECT,ENTITY}
	rename class_id to proxy_id
	add class_id as 91
	rename version to dwg_version, fix its DXF representation

2025-03-06  Reini Urban  <reini.urban@gmail.com>

	decode: less -v3 crc logging
	for easier json-check -v3 diffs

	dxf-check: improve
	use the test dir, not to override our dxf's
	and use the right .err file.

	in_dxf: fix DIMSTYLE code 5
	to resolve DIMBLK, and not set the handle

	encode: improve section_order_trace
	max numsections

2025-03-05  Reini Urban  <reini.urban@gmail.com>

	dxf: dont write LAYER 370 0

	PUSH_HV: dont push duplicate refs

	dxf: trace ownerhandle 330
	which was wrong in some r13 files

	dxf: TABLE_WRITE_FIXUP_NUMENTRIES
	skip empty tables for the TABLE_CONTROL.num_entries DXF output (70)
	See GH #1091

	dxf: UCSXORI and HANDSEED are r10 only
	not r9

	dxf-check: use ./dxf -o
	because ./dxf mangles even the basename.
	so we can continue with the ODA checks.

	dxf.test: dirname fixups in ODA roundtrip test

2025-03-03  Reini Urban  <reini.urban@gmail.com>

	dxf.test: more ODA roundtrip tests for in_dxf
	GH #1085

	dxf tests: oda can only write r12+ DWGs

	dxf: revise add ".0" for negative numbers
	GH #1083

	dxf: AcDbSpatialIndex is ODBX_OR_A2000CLASS
	but not version dependent. rather randomly

	add ODAFileConverter probe
	and use it in dxf.test and dwgadd_test.sh

	ci: add gjv, a geojson validator

	ci: install missing latexml and fixed relaxng-svg11
	Needed for svg validation with --enable-release.
	Fixes GH #1088

2025-03-03  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Add ".0" to BD, RD fields if not present
	The result is similar as from AutoCAD.
	It helps with naive diff between AutoCAD outputs and DXF outputs from
	LibreDWG.

2025-02-28  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix VPORT.UCSICON in DXF output and input
	The values 1 and 2 of UCSICON are swapped between DWG and DXF
	representation. There are another values 0 and 3 which are valid.

2025-02-28  Reini Urban  <reini.urban@gmail.com>

	add: fixup add_POLYLINE_3D
	and add more LOG_ERROR Out of memory

	encode: fix last vertex -> seqend: next_entity must be 0
	fix IN_POSTPROCESS_SEQEND.
	Major: Fixes arg confusion, needs the SEQEND obj, not the owner.
	Fixes GH #1086

2025-02-27  Reini Urban  <reini.urban@gmail.com>

	add oda checks to dwgadd_test.sh
	GH #1065

2025-02-27  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix $BLIPMODE in DXF output
	$BLIPMODE is present in DXF in <R14 every time

2025-02-26  Reini Urban  <reini.urban@gmail.com>

	add: fix wrong examples
	cross-checked with oda.
	See GH #1065

	outdxf: fix old LTYPE
	oda error: Invalid index

	out_dxf: fix empty $DIMBLK
	and other empty VALUE_TFF.
	found via dxf-roundtrip

2025-02-25  Reini Urban  <reini.urban@gmail.com>

	gh: re-enable oda download

2025-02-23  Reini Urban  <reini.urban@gmail.com>

	spec: rename LAYER.on to LAYER.off
	See GH #1080

2025-02-21  Reini Urban  <reini.urban@gmail.com>

	fix r14 LAYER.on
	Fixes GH #1080

2025-02-20  Reini Urban  <reini.urban@gmail.com>

	unit-tests: wrong attdef errormsg
	but still crashes for me with
	to/2018/from_ACadSharp/AecObjects.dwg

	spec: simplify LAYER free logging

2025-02-20  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix layer logging in Free section

2025-02-14  Reini Urban  <reini.urban@gmail.com>

	fix actions/upload-artifact

2025-02-14  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix LAYER 62 DXF output in case of disabled layer
	If the layer is disabled, color has negative value.

	Add logging of flag0 bits in LAYER

	Fix presence of LAYER 290 in DXF output
	Field 290 is presenting in case of 0 only.

	Fix indexes in LAYER 70 DXF output
	GH#1077

2024-12-24  aled-ua  <bugbuster.cc@gmail.com>

	Fix vuln OSV-2024-384

2024-12-12  Reini Urban  <reini.urban@gmail.com>

	dynapi_test: improve finding the tests
	from an extra builddir

2024-12-08  Reini Urban  <reini.urban@gmail.com>

	fix more C++ regressions

	m4: fix clang++ compilation
	which failed with -Wdeprecated in AX_PRINTF_SIZE_T

2024-12-08  Reini Urban  <rurban@cpan.org>

	indxf: __counted_by() and -Warray-bounds with flex. EED struct
	use __counted_by__ attribute and -fstrict-flex-arrays=3 since gcc-15 and clang-18.

2024-12-08  Reini Urban  <reini.urban@gmail.com>

	dynapi: parse SUB_FIELD_VECTOR dxf codes

2024-12-08  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix BLOCKSTRETCHACTION object codes
	Part of GH#1054
	Revised by Reini Urban

2024-12-06  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix BLOCKSTRETCHACTION situation after handles
	Last fix was wrong. Each handle could have zero, one or more indexes.

	Fixes GH#1053

2024-12-01  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix HATCH entity
	Fixes GH#1047

	Tested on example in issue.

2024-12-01  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix tests

	Fix BLOCKSTRETCHACTION handles
	Fixes GH#1049

2024-11-19  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix signed ints
	Fixes Windows conversion of AuxHeader->minus_1

2024-10-15  Reini Urban  <reini.urban@gmail.com>

	debug: add NanoSPDS classes dxf<->cpp names
	and regen dynapi

	debug: fix GEOPOSITIONMARKER
	spec and test. no coverage still

2024-10-13  Reini Urban  <reini.urban@gmail.com>

	spec: refactor AcDbMTextObjectEmbedded to SUBCLASS
	functions can return errors, and we can still continue
	outside the subclass.

2024-10-10  Reini Urban  <reini.urban@gmail.com>

	unknown: add ATTDEF with MTEXT bits

2024-10-08  Reini Urban  <reini.urban@gmail.com>

	spec: ATTDEF refactor, re-use AcDbMTextObjectEmbedded
	as embedded subclass for ATTRIB, ATTDEF, GEOPOSITIONMARKER.
	Very similar to MTEXTOBJECTCONTEXTDATA.

2024-10-06  Reini Urban  <reini.urban@gmail.com>

	spec: more attdef, attrib changes
	names now from the official adesk dxf specs ("secondary").
	there's only AecObjects_from_ACadSharp_2018

	spec: change some ATTRIB fields
	analog

2024-10-05  Reini Urban  <reini.urban@gmail.com>

	spec: change some ATTDEF fields
	See https://github.com/ixmilia/dxf-rs/blob/main/spec/EntitiesSpec.xml

	dxf: more MIF types in dxf_fixup_string

	document ELLIPSE fields
	and more. from the ODA SDK

	change ARCALIGNEDTEXT field names
	See https://github.com/ixmilia/dxf-rs/blob/main/spec/EntitiesSpec.xml

2024-10-04  Reini Urban  <reini.urban@gmail.com>

	dxf: fix dxf_fixup_string logic
	Fixes most parts of GH #986 (thanks to @vagran/Artyom Lebedev).

	Remaining is proper utf8-len splitting. not 250 bytes but runes.
	This needs to be done by converting overlong strings to UCS-2,
	split them at 250
	and then output them as UTF-8.

2024-10-04  Reini Urban  <reini.urban@gmail.com>

	more missing final \n in stderr prints

	dwgwrite: missing \n in Unknown DWG header.from_version

	confusing whitespace missing: *ATTRIBUTE_MALLOC

	indxf: fix ubsan errors, NULL strings and failing alloc
	Fixes GH #1007

2024-09-30  Reini Urban  <reini.urban@gmail.com>

	escape: fix error: null destination pointer

2024-09-29  Reini Urban  <reini.urban@gmail.com>

	bump pslib to 0.4.8
	now with -lm needed

2024-09-28  Reini Urban  <reini.urban@gmail.com>

	mips: wrong -Werror=maybe-uninitialized warnings
	with gcc-12-mips-linux-gnu 12.3.0-17ubuntu1cross3

	define MAX_SIZE_BUF
	esp. for asan: allocation-size-too-big
	which is harmless, but throws a better error msg in add_ent_preview for a BLL.
	Fixes GH #1006, fuzzing DXF input

	indxf: check invalid preview_size
	Fixes GH #1006, fuzzing invalid DXF input

	bits: extend BLL tests, fix write_BLL
	fix test leaks.

	bits: fix bit_read_BLL esp. for preview_size
	fixes the MESH problems from GH #1019

2024-09-21  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Improve angle logging
	Previous in LTYPE table:

	dashes[3].length: -0.2 [BD 49]
	dashes[3].complex_shapecode: 4 [BS 75]
	dashes[rcount1].style: (5.1.10) abs:16 [H 340] => STYLE STANDARD
	dashes[3].x_offset: 0 [RD 44]
	dashes[3].y_offset: 0 [RD 45]
	dashes[3].scale: 0.1 [BD 46]
	dashes[rcount1].rotation: 1.5708 [BD 50]  90º
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	dashes[3].shape_flag: 3 [BS 74]
	                      ABS_ROTATION(0x1) IS_TEXT(0x2)

	After change:

	dashes[3].length: -0.2 [BD 49]
	dashes[3].complex_shapecode: 4 [BS 75]
	dashes[rcount1].style: (5.1.10) abs:16 [H 340] => STYLE STANDARD
	dashes[3].x_offset: 0 [RD 44]
	dashes[3].y_offset: 0 [RD 45]
	dashes[3].scale: 0.1 [BD 46]
	dashes[3].rotation: 1.5708 [BD 50] 90º
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	dashes[3].shape_flag: 3 [BS 74]
	                      ABS_ROTATION(0x1) IS_TEXT(0x2)

2024-09-20  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix LTYPE logging
	Maximum number if 1 (ABS_ROTATION) + 4 (IS_SHAPE)

2024-09-20  Reini Urban  <reini.urban@gmail.com>

	doc: ODA spec patches for LTYPE

2024-09-17  Reini Urban  <reini.urban@gmail.com>

	oda: switch to self-hosted

	oda: bump ODAFileConverter for gh action to 25.7
	but is not free to download anymore, needs an account.

	dwgadd: fix read* logic, add tests
	Fixes GH #1008. This broke with the refactoring for 0.13
	Thanks to @khlukekim for the report

2024-08-16  Reini Urban  <reini.urban@gmail.com>

	encode: also disable LAYER.material

	dxf: fix int to unsigned short promotion
	with -Wformat on apple m2. Fixes GH #1001

	dxf: resolve empty BLOCK.name
	which is mandatory in DXF.
	Fixes GH #999

2024-08-16  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix compilation of 3DSOLID_materials in debug mode

2024-08-16  Reini Urban  <reini.urban@gmail.com>

	spec: fix BLOCKSTRETCHACTION_handles.long1 type
	Thanks to @billydotzhang, fixes GH #1001

2024-07-31  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix autogen.sh
	There is situation after clone from git repository.
	.tarball-version doesn't exists in this time.

2024-07-27  Reini Urban  <reini.urban@gmail.com>

	encode: more disable_3DSOLID_materials
	disable materials in 3DSOLIDs and all its subtypes.
	GH #954

2024-07-13  Reini Urban  <reini.urban@gmail.com>

	api: promote WIPEOUT back to stable
	Lets see if encoded WIPEOUT still cause redraw crashes
	(GH #244)

2024-07-10  Reini Urban  <reini.urban@gmail.com>

	dwgadd: fix FMT_ANY on windows
	with sscanf_s. text, attrib and such are now working

2024-07-09  Reini Urban  <reini.urban@gmail.com>

	more -Wno-alloc-size
	configure and cmake. failed on mingw.

	actions: bump to ilammy/msvc-dev-cmd@v1
	node 20

	actions: bump to actions/upload-artifact@v4
	and fix mingw-failure.tgz artifact

	actions: use hendrikmuhs/ccache-action
	with ccache and cache

2024-07-07  Reini Urban  <reini.urban@gmail.com>

	dwg_section_type: cosmetics

	oda: bump to ODAFileConverter-25.5.0.0-1

	actions: bump to actions/setup-python@v5
	v4 is deprecated, node 16 -> 20

2024-07-06  Reini Urban  <reini.urban@gmail.com>

	api: rename IMAGE.size to image_size
	because of json clashes.
	Helps also GH #954

	cmake: set -Wno-error=alloc-size
	needed for in_dxf

	msvc: set /utf-8 option
	Fixes GH #988

2024-07-05  Reini Urban  <reini.urban@gmail.com>

	decode_r2007: fix invalid section name_length
	Only with invalid dwgs, fuzzing GH #989

	encode: fix scale_flag: 1 (INSERT DD 41)
	Fixes GH #990.
	With scale_flag 1 we must not write scale.x

2024-06-15  Reini Urban  <reini.urban@gmail.com>

	.clang-format: help fmt

2024-06-14  Reini Urban  <reini.urban@gmail.com>

	dwggrep: fix usage, add -n for --tables
	Fixes GH #982

2024-06-02  Reini Urban  <reini.urban@gmail.com>

	clang-format-all src

	AUTHORS: add Gong Xiangyang

2024-06-02  gongxy  <83904580@qq.com>

	Optimize dwg_add_Handleref

2024-06-02  Reini Urban  <reini.urban@gmail.com>

	Revert "compcert: fix use of undeclared identifier __FUNCTION__"
	Apparently compcert defines __FILE__ and __LINE__ just fine.
	Just have to find out how.
	This reverts commit 989c8dcf3b174336ec16f9161b6c77abb5639c21.

2024-06-02  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Add test data for R2000
	The *scr files are the 2d/3d entity sets and the DWG/DXF files are the
	script command output in R2000.

2024-05-02  Reini Urban  <reini.urban@gmail.com>

	gh actions: faster codecov -O0

	indxf: fix ent.310 double free
	freshly allocate a dxf string for dwg_dynapi_common_set_value()
	Fixes ossfuzz 66109

	gh action: continue in codecov upload error

2024-05-01  Reini Urban  <reini.urban@gmail.com>

	compcert: no duplicate __attribute_deprecated_msg__ definition

2024-05-01  Reini Urban  <rurban@cpan.org>

	compcert: fix use of undeclared identifier __FUNCTION__
	a compiler extension.
	Only half-way through: compcert throws
	Fatal error: uncaught exception Stack overflow
	Raised by primitive operation at Debugvar.join.join2 in file "extraction/Debugvar.ml", line 196, characters 36-57
	even with all __FUNCTION__ removed.

	But still good to catch C11 extensions, like anonymous structs/unions
	(which are also problematic for tcc dwarf support).

	Usage:
	../configure 'CC=ccomp -v -fstruct-passing -flongdouble -std=c11'
	  --disable-bindings --disable-werror && make

2024-05-01  Reini Urban  <reini.urban@gmail.com>

	gh actions: use secret.CODECOV_TOKEN

	codecov: codecov.io upload may fail
	or timeout

	dwg: name Dwg_R200*_Header anon union
	API breaker.
	Fixes GH #966 (-Wpedantic), GH #867 (compcert and -Wc11-extension)
	and probably tcc debugging.

	codecov: fixup codecov_io.sh from libtool .libs

2024-04-30  Reini Urban  <reini.urban@gmail.com>

	appveyor: cygwin -Werror
	__XSI_VISIBLE redefined
	__nonnull_all redefined

	appveyor: target not found: mingw-w64-i686-perl

	decode: wrong read_2004_compressed_section check
	Fixes GH #974

2024-04-27  Reini Urban  <reini.urban@gmail.com>

	remove AC_DISABLE_STATIC again
	why did I add this? with deebe761059f5a845 when updating to autoconf 2.71
	it breaks macOS builds. and static progs are fine for me, even if huge.
	we still should support --en/disable-shared and --en/disable-static.

	fix macos gh actions deps

2024-04-27  Reini Urban  <reini.urban@gmail.com>

	bit_read_H: cap handles at 64, not 32 bit
	Fixes GH #967. Thanks Michal for the r2000 example.

2024-04-15  Reini Urban  <reini.urban@gmail.com>

	encode: even more wrong bit_chain_alloc usages

	encode: more wrong bit_chain_alloc usages

2024-04-14  Reini Urban  <reini.urban@gmail.com>

	encode: fix copy_R2004_section overflow check
	was completely wrong.
	Fixes oss-fuzz 63824

	encode: protect more in_postprocess_SEQEND NULL-derefs
	e.g. oss-fuzz 68030

2024-04-03  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Remove if in DICTIONARYWDFLT
	Variables are in all DXFs where is DICTIONARYWDFLT object.

	Fix DICTIONARYWDFLT object
	In R13, R14, R2000 DWG files is same structure.

2024-03-30  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Add logging of ATTDEF flags in R14

2024-03-28  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Log mlinestyle flag

2024-03-26  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Log style FLAG

2024-03-20  Reini Urban  <reini.urban@gmail.com>

	encode: convert xdata TV from utf8 also
	Fixes GH #873

2024-03-19  Reini Urban  <reini.urban@gmail.com>

	bits: convert TV from utf8 back to codepage
	when imported from JSON. Fixes GH #873

2024-03-19  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix spaces in logging of SPLINE scenario
	Actually:
	scenario: 2 [BL 0]
	         BEZIER(0x2)

	After:
	scenario: 2 [BL 0]
	          BEZIER(0x2)

2024-03-19  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Log LTYPE shape flag

	Fix ltype dashes on R13

	Improve logging of text dashes

2024-03-18  Reini Urban  <reini.urban@gmail.com>

	dwg_api: relax invalid name checks
	only warn, no error

	dwg_is_valid_name_u8: less code

	codepages: add is_valid_name u8 API and tests
	with the u8 and native API.
	add and in_json needs u8, the rest native.
	single and multibyte, TV and TU.

2024-03-18  Reini Urban  <reini.urban@gmail.com>

	codepages: add dwg_codepage_isalnum
	for all the codepages.
	except utf8, utf16 which falls back to iswalnum().
	we really dont want to switch locale back and forth just to
	use the broken system libc isalnum() api.
	at least windows would have a is*_l variant.

	for chars under 128 we just refer to libc isalnum(), and our alnum
	tables ignore them.

	Fixes GH #958

2024-03-18  Reini Urban  <reini.urban@gmail.com>

	gh: fix sanitizer issue

	gh: skip broken sanitize run-time for a while
	See https://github.com/actions/runner-images/issues/9491

2024-03-17  Reini Urban  <reini.urban@gmail.com>

	gh: sanitize with -O1, use contains
	substring checks.

2024-03-16  Reini Urban  <reini.urban@gmail.com>

	oda: update to 25.1

	GTAGS: add gtags.files
	for a much smaller proper GPATH file

	bits: fix bit_utf8_to_TU
	off-by-one, and no test coverage!
	Fixes GH #959

2024-03-16  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Improve vector logging
	New one in MLINE:

	verts[0].vertex: (-1.20008e+06, -800053, 0) [3BD 11]
	verts[0].vertex_direction: (1, 0, 0) [3BD 12]
	verts[0].miter_direction: (2.22045e-16, 1, 0) [3BD 13]
	verts[0].lines[0].num_segparms: 2 [BS 74]
	verts[0].lines[0].segparms[0]: 0 [BD 41]
	verts[0].lines[0].segparms[1]: 0 [BD 41]
	verts[0].lines[0].num_areafillparms: 0 [BS 75]
	verts[0].lines[1].num_segparms: 2 [BS 74]
	verts[0].lines[1].segparms[0]: 0 [BD 41]
	verts[0].lines[1].segparms[1]: 0 [BD 41]
	verts[0].lines[1].num_areafillparms: 0 [BS 75]
	verts[1].vertex: (-1.20008e+06, -800053, 0) [3BD 11]
	verts[1].vertex_direction: (1, 0, 0) [3BD 12]
	verts[1].miter_direction: (2.22045e-16, 1, 0) [3BD 13]
	verts[1].lines[0].num_segparms: 2 [BS 74]
	verts[1].lines[0].segparms[0]: 0 [BD 41]
	verts[1].lines[0].segparms[1]: 0 [BD 41]
	verts[1].lines[0].num_areafillparms: 0 [BS 75]
	verts[1].lines[1].num_segparms: 2 [BS 74]
	verts[1].lines[1].segparms[0]: 0 [BD 41]
	verts[1].lines[1].segparms[1]: 0 [BD 41]
	verts[1].lines[1].num_areafillparms: 0 [BS 75]

	Affected lines with segparms.
	Previously something:
	verts[rcount1].lines[rcount2].segparms[0]: 0 [BD 41]

2024-03-11  Reini Urban  <reini.urban@gmail.com>

	configure: fix test: too many arguments

	configure: support --disable-docs
	because texlive is huge, and it is only needed for releases.
	Fixes GH #839 feature request

2024-03-10  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix setting of ltype to entity
	For case if ref doesn't defined

2024-03-10  Reini Urban  <reini.urban@gmail.com>

	dwgadd: block adds the BLOCK_HEADER also
	and check for valid names before

	dwg_api: fix non_null's

	add: reject invalid table names
	See also GH #949

	dwg_api: make most obj,ent args mandatory
	Helps GH #949
	(untested)

	dwg_api: add dwg_ent_set_ltype
	by name, not by handle. easier to check the 3 builtin tablerecords

2024-03-10  Reini Urban  <reini.urban@gmail.com>

	print: fix VALUE_RS type confusion
	0 is int, not short. But C doesn't know numeric literals shorter than int,
	so the new Apple M1 clang is overly strict.

	Fixes GH #951, -Werror,-Wformat on the M1

2024-03-10  Reini Urban  <reini.urban@gmail.com>

	spec: fix BLOCKSTRETCHACTION.hdls[].longs type
	Thanks to @romanjlewis in GH #951

	GH actions: ninja should already be installed
	I think

2024-03-10  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix RLL which is longlong

	Add missing FIELD_RCd, used in second header

2024-03-09  Reini Urban  <reini.urban@gmail.com>

	injson: fix some windows long nonsense
	use uint32_t instead (BITCODE_BL).
	Fixes GH #943

	json: fix signed ints
	Fixes 2 cases of GH #943

2024-03-03  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix warning with sections
	header.sections is 0
	header.num_sections is right number to check

2024-02-26  Reini Urban  <reini.urban@gmail.com>

	doc: ODA spec patches

	indxf: log COMMON TF as string
	such as COMMON.preview

	dxf.test: MINSERT is silently skipped on r13
	and MULTILEADER on r14. Enable r14 dxf.test
	Fixes GH #342

	README: add dwgadd

	Release 0.13.3
	esp. for the missing dwg2ps.1
Full history from the git log
-----------------------------

2024-02-26  Reini Urban  <reini.urban@gmail.com>

	Release 0.13.3

	dist: check for dwg2ps.1 and dwgadd.1 explicitly
	The examples manpages were missing.
	See GH #941

2024-02-21  Reini Urban  <reini.urban@gmail.com>

	in_dxf: comment, can read binary dxf also

2024-02-20  Reini Urban  <reini.urban@gmail.com>

	indxf: fix HATCH null-deref
	Fixes oss-fuzz 66843

	indxf: fix UAF
	Fixes oss-fuzz 66835

2024-02-16  Reini Urban  <reini.urban@gmail.com>

	spec: debug uncertainties in BLOCKSTRETCHACTION_handles

	unknown: use strEQ macros

	unknown: fix pi_fn vbase for libtool'd unknown
	in the .build-debug/examples/.libs subdir

	spec: add BLOCKSTRETCHACTION subclasses
	support dxf_test for array of structs with primitive types
	(BLOCKSTRETCHACTION_codes*)

2024-02-15  Reini Urban  <reini.urban@gmail.com>

	unknown: add 10xx fields,
	which are not EED mostly

	log_unknown_dxf: more enhanced BLOCK fields

	github: bump actions/checkout@v4
	"Node.js 16 actions are deprecated.  Please update the following actions to
	use Node.js 20: actions/checkout@v3"

	dxf_test: now we have longer paths

	encode: wrong DWG_MAX_OBJSIZE
	introduced for fuzzing, but STEERING_from_autocad_r13.dwg has a larger 3DSOLID

	spec: promote SUN object to stable

	spec: update coverage comments
	after running unknown with the new dwg/dxf pairs.
	several objects do look very stable though, such as some
	AcDbBlock1PtParameter objects: BLOCKBASEPOINTPARAMETER,
	BLOCKLOOKUPPARAMETER, BLOCKPOINTPARAMETER.

	unknown: fix num_classes calc
	we need to compare by value, not pointer, as the unknown_dxf[i].name strings
	are distinct

	unknown: regen alldxf incs
	with test-old dxfs

	unknown: regen alldwg.inc with test-old dxfs

	unknown: EVALUATION_GRAPH is UNSTABLE
	not DEBUG anymore. regen the unknown inc's
	via full-regen-unknown.
	test-old DWG/DXF pairs not yet included.

2024-02-14  Reini Urban  <reini.urban@gmail.com>

	spec updates
	Note: opensuse seperates it into -tools and 0

	make dist: fail releasing on missing libps
	Fixes GH #941

	add build-aux/install-pslib to --enable-release
	Fixes GH #941

	indxf: fix OLE2FRAME.data [310] initial case
	Also fixes ossfuzz 66639

2024-02-13  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix typo

2024-02-11  Reini Urban  <reini.urban@gmail.com>

	encode: fix uninit old_data segv
	esp. on downconverting.
	OUT=0 VER=13 examples/llvmfuzz_standalone ../test/test-data/DS_libereco_R2007.dwg

	support beta VERSIONs, no holes
	Fixes GH #908

2024-02-10  Reini Urban  <reini.urban@gmail.com>

	Release 0.13.2

	check make dist for missing subdirs
	See GH #937

2024-02-10  Reini Urban  <reini.urban@gmail.com>

	github: fix make release, no extra python
	install missing python3-libxml2 and libxslt
	See GH #937

	add install-libxslt helper, needed for the
	python libxml2 package if installed extra.

2024-02-09  Reini Urban  <reini.urban@gmail.com>

	Release 0.13.1
	A bugfix release,
	with one minor feature dwgread .min.json added. See NEWS

	NEWS: Fixed SummaryInfo.props[].tag and value types to T16

2024-02-09  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix summaryinfo props

2024-02-09  Reini Urban  <reini.urban@gmail.com>

	decode_r11: update HANDSEED on new handles
	Fixes decoding and roundtrips of
	e.g. r11/from_autocad_r12/sample/BASEPLAT.DWG
	esp. on ctrl entries.

2024-02-09  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix comments of ObjFreeSpace and SecondHeader

2024-02-08  Reini Urban  <reini.urban@gmail.com>

	bits: write only 4 byte handles on error

	bits: sizeof bits union may be 16
	detected by cppcheck. not sure which compiler actually does such things,
	but keep it the specs

	bits: fix leak
	detected by cppcheck

	decode_r11: accept 1 missing byte
	esp. with TEXT entities. eg from_autocad_2.62/MENUTREE.DWG
	there might be one more unknown byte

	decode: cap handles at 32bit
	Fixes GH #935, which has a r2000 example which has an undocumented high bit set
	in most handles.
	In fact, searching found no examples with more then 4 byte handles.

	json-check: use min.json
	dwg: support .min.json
	json: support -m

	json: option DWG_OPTS_MINIMAL for minJSON (minimized)
	no whitespace at run-time.
	We don't write minimal JSON as with minimal DXFs anymore
	($ACADVER, $HANDSEED, and then ENTITIES only).
	With ideas from GH #886

2024-02-07  Reini Urban  <reini.urban@gmail.com>

	injson/dxf: fix LTYPE.numdashes setter
	ERROR: Unknown num_dashes field

	encode: fix downconvert_DIMSTYLE
	when the eed already had one member, AcadAnnotative.
	e.g. ../to/2013/from_github_santicastro/Triskele_centered_with_connectors_extract.dwg

2024-02-06  Reini Urban  <reini.urban@gmail.com>

	Prepare 0.13.1 bugfix release

2024-02-06  Reini Urban  <reini.urban@gmail.com>

	indxf: add add_sub_ASSOCDEPENDENCY
	for the 2 special classes ASSOCGEOMDEPENDENCY or ASSOCVALUEDEPENDENCY.
	add SUB_FIELD_* parsers, which need o for the field ptr, and f for its type.

	Fixes ASSOCGEOMDEPENDENCY dxf import with example_2000
	(which was suppoed to be stable)

2024-02-06  Reini Urban  <reini.urban@gmail.com>

	dynapi: add dwg_dynapi_subclass_set_value
	needed for indxf. can also be used for injson

	gen-dynapi: fix ASSOCGEOMDEPENDENCY subclass
	and fixup the lines for debugging

	dxfb-check: harmonize with dxf-check

	encode: fix ERROR: Wrong object size on MS adjust
	when the new size doesnt fit the old MS size (overlarge MS size),
	we move the stream by 2, but forgot to adjust the end_address calc,
	leading to wrong ERROR: Wrong object size and CRC calc

	XRECORD.cloning logging: print the DXF code

	distcheck: cleanup check_oda files
	so far only locally

	json.test: print the right ODAFileConverter name
	as with json-check

2024-02-05  Reini Urban  <reini.urban@gmail.com>

	dxf.test: except skipped r13 LIGHT entity
	which must be skipped in r13 DXFs

	spec: improve PROXY fields and dxf codes
	but still cannot roundtrip

	indxf: fix xdata_size with BINARY

	outdxf: fix BINARY
	esp. for 310 xdata fields, with wrong value types.
	Ensure correct values and lengths 127

2024-02-05  Reini Urban  <reini.urban@gmail.com>

	dxf spec: change DIMSTYLE.DIMTXTDIRECTION from 295 to 294
	ODA has it documented as 295 B0, netDXF as 294.
	Acad has it undocumented. It has a default of 0, so only
	present if reversed.
	But accept indxf of 295 also (for ODA and backcompat)

	See GH #835

2024-02-05  Reini Urban  <reini.urban@gmail.com>

	debug: enable MTEXTATTRIBUTEOBJECTCONTEXTDATA.context
	as embedded SCALE object, if the SCALE is not 1:1.
	See GH #851

	fix missing bindings/Makefile.in
	Fixes GH #934

	log timeduration better
	Fixes GH #916

2024-02-04  Reini Urban  <reini.urban@gmail.com>

	up/downgrade MLINESTYLE_line.lt. fields
	Add a new dwg_find_tablehandle_index() helper, which is
	needed for more upgraders.
	Fixes GH #924

2024-02-04  Reini Urban  <reini.urban@gmail.com>

	spec: fix MLINESTYLE_line.lt_ fields to union
	because of the tricky overflow check in REPEAT_CHKCOUNT_LVAL.
	Fixes #924

	WIP add_test. dxf from/to 2018 needs a converter.

2024-02-04  Reini Urban  <reini.urban@gmail.com>

	disable broken gcc-14 -Walloc-size
	Fixes GH #931

	doc: mention ACadSharp

	fix -Wcalloc-transposed-args
	Fixes GH #931, thanks to @topazus

2024-02-04  Reini Urban  <reini.urban@gmail.com>

	Release 0.13
        See NEWS.
	Read and write DWGs from r1.1 to r11 also

2024-02-03  Reini Urban  <reini.urban@gmail.com>

	encode: extra 2ndheader write
	See GH #860

2024-02-02  Reini Urban  <reini.urban@gmail.com>

	doc: one more ODA spec update
	more links

	doc: update ODA spec patches
	links

	spec: fix MESH 2 missing bits
	2018/Surface take these 2 bits from the handles.
	Fixes the MESH ODA error

2024-02-01  Reini Urban  <reini.urban@gmail.com>

	spec: fix LEADER.endptproj for r13c3
	fixes r13c3/from_autocad_r14/bflyhse.dwg ODA roundtrip errors

2024-02-01  Reini Urban  <reini.urban@gmail.com>

	encode: write 0 padding bits, not 1
	eg. as seen in CARWHEEL_from_autocad_r13 with STYLE padding bits

	in the original it was 0, in the new 0x77, leading to an oda error in this
	style object, and different CRCs.
	Might be related to GH #346

2024-02-01  Reini Urban  <reini.urban@gmail.com>

	NEWS for 0.13

2024-01-31  Reini Urban  <reini.urban@gmail.com>

	comment: add more AEC objects
	found in some ACadSharp example

	encode: r2004 classes
	Forgot the 3 extra fields as in read_2004_section_classes().

2024-01-30  Reini Urban  <reini.urban@gmail.com>

	dxfclasses: add missing MESH/AcDbSubDMesh class

	bump the copyrights to 2024

2024-01-30  Reini Urban  <reini.urban@gmail.com>

	injson: fix Dwg_VALUEPARAM subclass
	with a proper subclass name we can now almost import
	ASSOCACTION's.

	Missing: resolve of inlined Dwg_EvalVariant
	ERROR: Unknown subclass field VALUEPARAM_vars.code
	ERROR: Unknown subclass field VALUEPARAM_vars.u

2024-01-30  Reini Urban  <reini.urban@gmail.com>

	insjon: fix MESH.crease malloc array
	e.g. 2018/Surface. GH #830

	encode: downconvert header.sections

2024-01-29  Reini Urban  <reini.urban@gmail.com>

	encode: fix sections patchup, fix header crc
	we wrote num_sections, not sections.
	the ODA crc calc. is also widely complicated, it is
	rather simple

	encode: skip the 2ndheader rewrite on size changes
	in real ACAD dwgs this 2ndheader template address is just zeroed.
	only in the header.section it is then correct

	2ndheader: re-write 2ndheader when its size changed
	for the template address.
	also fix 2ndheader.num_sections (6 not 7)

	llvmfuzz_standalone_tz.sh: accept file arg

	bits: comment bit_TV_to_utf8 leak case
	Answering JoraGevorgyan, GH #926.
	See ossfuzz 66248

2024-01-29  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Remove UNTIL (R_2000)
	Everything is UNTIL (R_2000), so we don't need.

	Fix encoding of second header
	logging address is address after sentinel, same in decoding
	address is address before sentinel
	size is second header block + begin sentinel

	Fix section numbers
	sections are sections in header and aux header
	num_sections are all sections

2024-01-27  Reini Urban  <rurban@cpan.org>

	doc: Update README for preR13

2024-01-27  Reini Urban  <reini.urban@gmail.com>

	encode: extend max num_classes
	to overflow into negative

	bits_test: print error hint

	fix json
	e.g. ./json example_2004

	log: fixes for not existing args

	encode: print section names
	as with decode

	encode: missing template.address
	Need to move section_order into a global array

	encode: section_order adjust num_sections internally

	encode: maybe auxheader needs padding

	encode: maybe move auxheader before thumbnail

	decode: fix AVAIL_BITS, independent on obj->size
	AVAIL_BITS only depends on dat.
	fix the 2ndheader size check.

2024-01-27  Reini Urban  <rurban@cpan.org>

	encode: section_order harmonization
	use functions for each section, so that we can re-use 2004 code for 2000.
	and write sections in arbitrary order.

	2000 as in 2004

2024-01-27  Reini Urban  <rurban@cpan.org>

	encode: add section_order[] and section_move funcs
	but not used yet

2024-01-24  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Remove maximum of classes

2024-01-23  Reini Urban  <reini.urban@gmail.com>

	indxf: reject invalid number pairs
	0\nSECTION ok,
	0SECTION not ok.

	indxf: fix float-conversion overflow, fuzzing only
	with extremely large numbers.
	Fixes ossfuzz 65937

	injson: ditto for RD*
	consume the token, and warn

	injson: fix RS* overflow, fuzzing only
	Fixes ossfuzz 66046

2024-01-18  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix dictionary for R_13c3
	There were typo in variable.

2024-01-11  Reini Urban  <reini.urban@gmail.com>

	shfmt: regen-shfmt without -kp

	shell: regen-shfmt

	shell: improve .DWG stripping

2024-01-07  washcloth  <wsh@riski.sh>

	Use python3 syntax and modernize shebang env
	Many systems do not provide the /usr/bin/python link. Instead use the
	env program to specify a python3 working environment. Presumably during
	a conversion to python3, a print statement during an error check was
	still in python2 syntax, this is now changed to proper python3 syntax.

2024-01-03  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	maint_versions to hexadecimal

	Fix presence of unknown variables

2024-01-02  Reini Urban  <reini.urban@gmail.com>

	spec: finish OSMODE BS

2024-01-01  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix OSMODE variable in header
	it's BS not BL

2023-12-31  Reini Urban  <reini.urban@gmail.com>

	json.test: fix check_oda

	check_oda: r2000,r14 only

2023-12-31  Reini Urban  <rurban@cpan.org>

	add oda check to json.test

	indxf: fix double-free
	ossfuzz 64318 WIP

2023-12-31  Reini Urban  <reini.urban@gmail.com>

	spec: promote LAYOUTPRINTCONFIG to unstable
	we do have coverage, and it looks complete
	(just 6 padding bits)

	need convert_LTYPE_strings_area also for out_dxf, svg, json

	encode: add convert_LTYPE_strings_area
	for 256/512 byte conversions.
	See GH #910

	in_dxf: fix LTYPE.strings_area for r2007+
	Fixes GH #910

	spec: fix LTYPE for r13-2004 for in_dxf
	wrong if-else brackets

	spec: change LAYOUTPRINTCONFIG to entity
	detected by OUT=3 examples/llvmfuzz_standalone ../test/test-data/2000/5.dxf
	is entity in dxf's (281: 1) and dwg's (item_class_id 498)

	Fix missing json dat->version
	Fixes GH #910

	Fix dxfb_3dsolid heap-buffer-overflow with VALUE_BINARY (s, l)
	Fixes GH #911

2023-12-31  Reini Urban  <rurban@cpan.org>

	encode r11: protect from wrong tbl->number

2023-12-30  Reini Urban  <reini.urban@gmail.com>

	ninja ci: lukka/run-vcpk fails
	vcpkg.json.in is not found

	dxf: disable the VX table
	Import and output. It is not observed, not documented in DXF.
	Analog to DXFB

2023-12-27  Reini Urban  <reini.urban@gmail.com>

	*-check: fix dxf $r, esp. for r13

	bits: extra bit_read_TF length overflow check
	ERROR: bit_read_TF buffer overflow at 2441.0 + -559041242 > 3806

2023-12-27  Reini Urban  <rurban@cpan.org>

	header.spec: move section field into spec
	so that it is tracked in json, to en-/disable
	a potential r13 second header.

	Fixes GH #860

2023-12-26  Reini Urban  <reini.urban@gmail.com>

	json: fix type confusion

	encode: fix downconvert_DIMSTYLE eed overflow
	need room for the final size=0, num_eed includes that.
	esp. when all the DIMSTYLE APPID's already exist.

	formatting only

2023-12-25  Reini Urban  <reini.urban@gmail.com>

	bits: fix fuzzing bit_H_to_dat overflow
	with invalid handle size

	encode: fix NULL deref in remove_EXEMPT_FROM_CAD_STANDARDS_APPID
	Fixes GH #901
	OUT=0 VER=3 examples/llvmfuzz_standalone ../ti/gh901/other/testcase

2023-12-24  Reini Urban  <reini.urban@gmail.com>

	decode: fixup for 2ndheader wrong overflow check
	10c79fd51df35afdc3e0272e58075e8d5d2e9a3c added obj, which fails with AVAIL_BITS.
	Thanks to Michal, GH #860

	postprocess_SEQEND: improve Missing owner
	log the handle, search the owner on preR13, as in indxf

2023-12-23  Reini Urban  <reini.urban@gmail.com>

	in_dxf: fix uninit in \M+ scanning
	Fixes testcase 0 from GH #901, detected by Matteo Marini.

	decode: fix fuzzer error with Invalid auxheader_size
	testcase 1 of GH #901

2023-12-23  Reini Urban  <rurban@cpan.org>

	more dwg_next_handle fixes.
	Fixes GH #891.
	dwg->num_objects is unreliable <r2.0, containing
	empty objects

2023-12-21  Reini Urban  <reini.urban@gmail.com>

	fix dwg_next_handle
	For GH #891.
	Scan all objects backwards for the next handle, not the global refs.
	preR13 has almost no global refs

	alive.test: enable preR13 tests

	doc: patch updates

	decode: header pos asserts

2023-12-21  Reini Urban  <rurban@cpan.org>

	injson logging: no hex thumbnail_address

2023-12-18  Reini Urban  <reini.urban@gmail.com>

	decode_r2007: fix heap overflow by one
	Just a harmless 1 byte overflow with an invalid odd section->name_length.
	not security relevant.
	Fixes GH #899. Fuzzing only

2023-12-16  Reini Urban  <reini.urban@gmail.com>

	json: change <r13 VERTEX_2D.point to 2RD
	also for in_json json_3DPOINT()
	Resolves PR #893 differently

2023-12-16  Frank  <f.vanleeuwen@unovica.nl>

	AdDbAssocDimDependencyBody typo

2023-12-15  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Remove zero_5 from header

	Remove zero_5 from second header

2023-12-15  Reini Urban  <reini.urban@gmail.com>

	regen-dynapi for BSd TREEDEPTH

2023-12-14  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Simplify decoding of ObjFreeSpace section and second header
	These two sections are independent

	Fix TREEDEPTH header variable
	It is signed number

2023-12-07  Reini Urban  <rurban@cpan.org>

	fix 2ndheader logging null-deref
	Fixes fuzz GH #890

2023-12-05  Reini Urban  <rurban@cpan.org>

	json: dont cquote 3DSOLID.acis_data
	they are chunked by 256 max, not encoded, and without any
	to be escaped chars

2023-12-03  Reini Urban  <rurban@cpan.org>

	oda: fix shell warning
	oda: line 51: [: =: unary operator expected

	dwg2SVG: feature ordering
	not too late

2023-12-01  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	maint_version in aux header to hex format

	Fix R_2002 dwg_version

	Fix comments about AutoCAD releases

2023-11-30  Reini Urban  <rurban@cpan.org>

	make: run log-dwg and check-ossfuzz in parallel
	and esp. with spaces in filename support (find -print0 | xargs -0)

	logging: improve 2ndheader.dwg_version (hex)

	outdxf: protect against ACIS.block_size overflow
	terminate the encr_sat_data[i] block.
	Fixes ossfuzz 59124

	indxf: fix some fuzzing leaks on errors
	ossfuzz 44697

	fix more unused vars detected by msvc/clang-cl

2023-11-29  Reini Urban  <rurban@cpan.org>

	fix unused vars detected by msvc/clang-cl
	WIP

	fix 2ndheader
	Fixes GH #860.
	Write the correct 2ndheader.size, and address.
	write no objfreespace of none read (even if num_sections)
	patch the 2ndheader.size

	decode_r11: add dwg_next_handseed
	Fixes Duplicate handle errors with r11.
	Fixes GH #879

	bits: fix RLL_BE
	reading and writing, down to RS_BE.
	Fixes the r11 HANDSEED and EED handles, Fixes GH #883

	no abort() in libraries

	bits: fix bit_TV_to_utf8_codepage heap-buffer-overflow
	Fixes GH #881

	bits: protect from more size overflows
	Fixes GH #880

2023-11-28  Reini Urban  <rurban@cpan.org>

	decode: zero-init objfreespace also

2023-11-28  Reini Urban  <rurban@cpan.org>

	emscripten/WASM support
	Closes GH #876

	Compiles fine with:
	emconfigure ../configure --disable-bindings --disable-shared
	make -j -s

	but not tested in a browser (no stdio in the console via node programs dwg...)

2023-11-28  Reini Urban  <rurban@cpan.org>

	decode_r11: assign free handles for new objects
	See GH #879
	And fail on existing duplicate object handles.

	unit-tests: add --all option, alias to -an

	spec: r11 signed VX_TABLE_RECORD RS fields

	WIP: encode r11 blocks all BLOCK into BLOCKS
	Interestingly seems to fix GH #879

2023-11-27  Reini Urban  <rurban@cpan.org>

	r11: harmonize POS logging

	oda: better fix for r11

	fix CMC and H tracing
	on encode log the POS after the write, not before. analog to decode.

	json: simplify SUB_FIELD_T, VALUE_TEXT_TU, VALUE_TEXT
	All of them must convert to UTF-8

	doc diff: add more specs

	api: fix GEODATA.north_dir to 2RD
	also fixes GEODATA imports

	api: fix GEODATA.north_dir to 2RD
	also fixes GEODATA imports

	auxheader: wrong maint_version casts
	Fixes GH #871

2023-11-27  Frank  <f.vanleeuwen@unovica.nl>

	fix GEODATA num pts

2023-11-24  Reini Urban  <rurban@cpan.org>

	objfreespace: since r13 already
	Fixes GH #872

	objfreespace: set objects_address only r13-r2000
	r2004-r2007 has 0

	encode: set objfreespace defaults
	Fixes GH #869

	api: clearup dwg_add_SEQEND blkhdr confusion
	Fixes GH #856

	spec: fix r13 DICTIONARYWDFLT
	Fixes GH #864

2023-11-23  Reini Urban  <rurban@cpan.org>

	encode: skip MATERIAL (and its NOD)
	and its common handle link.

	encode: keep thumbnail and template section order
	if we have the old addresses. else honor the old version logic.
	Fixes GH #853

2023-11-23  Reinhard Urban  <reinhard.urban@nubix.de>

	encode: fix r13c3 templates
	oda errors went from 213 to 172. master has 99 of 971 though.
	but fixed most r14 errors, only 3 vs 30 in master.

	json: add json_section_objfreespace

2023-11-23  Reini Urban  <rurban@cpan.org>

	Rename the MEASUREMENT section 4 to Template
	for consistency

	r13 objfreespace
	do decode (also with section[3].address == 0)
	add encode.

2023-11-23  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	r13-2000: Fix encoding of 2ndheader, add objfreespace
	In DWG file header is address and size for objfreespace section.
	The 2ndheader is after that section with extra sentinels, main data and crc.

	Improve logging of sections

	auxheader hasn't sentinel - fix comment

	2ndheader have sentinels - fix comments

2023-11-23  Reini Urban  <rurban@cpan.org>

	spec: fix appinfo class_version 2/r2004
	analog to SummaryInfo.
	e.g. test-old/2004/from_cadforum.cz/corvette.dwg

	HACKING: update commit prefixes

2023-11-23  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Unify log of maint_version
	Same as in HEADER and Second Header

2023-11-21  Reini Urban  <rurban@cpan.org>

	encode: honor secondheader.num_sections
	on empty num_sections.

	injson: fail on arrays when a primitive expected
	e.g. ossfuzz 63057

	doc: probe for HAVE_ODA_SPEC

2023-11-20  Reini Urban  <rurban@cpan.org>

	doc: diff.pdf - Variabele typo

	doc: diff.pdf - MTEXT, LEADER, FIELD

	add doc/ODA-5.4.2-libredwg-diff.pdf
	a colored diff as pdf

	decode: cleanup dead code

	add doc/ODA-5.4.2-libredwg.patch
	as generated privately

2023-11-14  Reini Urban  <rurban@cpan.org>

	json-check: keep old err
	to see regressions and improvements

2023-11-13  Reini Urban  <rurban@cpan.org>

	decode_r11: fix dat->byte wraparound heap-buffer-overflow
	Fixes ossfuzz 64118

2023-11-10  Reini Urban  <rurban@cpan.org>

	spec: fixed PROXY.data size hack
	fixes overflow with ossfuzz 63814

	decode: missed a dat restore
	on an decode error (MS size overflow)

	decode: improve bit_read_fixed buffer-overflow
	on wrap-around.

2023-11-09  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix layer.on decoding

2023-11-09  Reini Urban  <rurban@cpan.org>

	add timeout to llvmfuzz_standalone_*.sh
	some tests hang

2023-11-08  Reini Urban  <rurban@cpan.org>

	encode: fix NULL-deref with old files (r1.1)
	Fixes ossfuzz 63895

	free: fix DWGCODEPAGE indxf leak
	Releated to ossfuzz 63895

	indxf: fix stack-buffer-overflow
	Fixes ossfuzz 63919

	encode: fix r2004 section dat leaks
	with no info pages

2023-11-06  Reini Urban  <rurban@cpan.org>

	encode: fix 2ndheader hdl overwrite
	fixed size patchup

	encode: fix r1.4/entities roundtrip for BLOCK/ENDBLK
	need to keep BLOCK/ENDBLK in entities, no blocks section.

	suppress -Wcast-align warnings
	we already know about them already, and there's a branch to fix it.

	encode: revert -Wstringop-overflow suppression
	the error was a MIN/MAX confusion, not a compiler bug.

	2ndheader: add VALUEOUTOFBOUNDS checks
	because example_r14 overflows num_hdl still

	encode: set 2ndheader.handles[].name
	for better logging

	encode: forgot 2ndheader.junk_r14
	json also.

	injson: fix RS[] type confusion
	check that the parsed type (ie. HEADER.layer_colors) fits
	the real type sizes.
	Fixes ossfuzz 63824, a stack overflow

2023-11-03  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	junk_r14 is from r14 to r2000

	Fix CRC

	Fix second header structure

2023-11-03  Reini Urban  <rurban@cpan.org>

	encode: add LOG_TFv
	same problem as with write_TFv on downgrading

	encode: more downgrading support
	add dwg_supports_eed and dwg_supports_obj.
	skip writing unsupported entities and objects pre-R13.
	>= r13 we keep our old logic for handles refs.

	json: dont skip *MODEL_SPACE BLOCK_HEADER
	only with encode later

	llvmfuzz_standalone: dont print unnecessary SEED
	when we dont need rand(), when all env vars already given

2023-11-02  Reini Urban  <rurban@cpan.org>

	encode: even more encode_check_num_sections checks

	indxf: fail on setting a num_ values twice
	Fixes GH #859

	encode: more encode_check_num_sections checks

	free: fix HYPERLINKBASE double-free
	add bit_wcs2dup

	cmake: sort probes

	add HAVE_GETTIMEOFDAY probe

	more llvmfuzz_standalone_*.sh
	rename llvmfuzz_standalone_all.sh to llvmfuzz_standalone_tz.sh
	add llvmfuzz_standalone_data.sh
	fix env vars to check all permutations.
	skip leaks only on indxf

	encode abstract into encode_check_num_sections
	needed also for <r2.0b

2023-11-01  Reini Urban  <rurban@cpan.org>

	encode: fix new r11 sections on upgrade

	llvmfuzz: honor config.h

	encode: some unused variables

	llvmfuzz: better seed precision (millisecs)

	llvmfuzz_standalone: improve repro output

	header_variables_dxf.spec: fix summaryinfo types

	encode: add new r11 sections on upgrade

	encode: no 2ndheader sections overflow
	on downgrade

	spec: index 6 out of bounds for type Dwg_SecondHeader_Sections[6]
	with encode (fuzzing)

	encode,json: downgrade TV strings to TFv
	which might be shorter than the TF, so skip the slack.

2023-10-31  Reini Urban  <rurban@cpan.org>

	add llvmfuzz_standalone_all.sh
	and test most versions

	llvmfuzz: support env SEED

	bits: fix CHK_OVERFLOW
	CHK_OVERFLOW_PLUS is ok.
	Fixes ossfuzz 55579, 54163, 54162, 57911, 60993

2023-10-31  Reini Urban  <rurban@cpan.org>

	spec: change 2ndheader handles[].hdl to static
	Boy, do I hate these gcc -Wstringop-* bugs! Still not fixed in 11.4
	after 4 releases.

	Fixes ossfuzz 61796 in free() in encode

2023-10-31  Reini Urban  <rurban@cpan.org>

	fuzz: limit max. alloc size to 0x10000000000
	taken from asan: AddressSanitizer: requested allocation size
	0xffffffff00cee7ad (0xffffffff00cef7b0 after adjustments for alignment, red
	zones etc.) exceeds maximum supported size of 0x10000000000

	fixes some fuzzing DOS attacks.
	also optimize bit_write_TF when needing more room.
	and fix it when aligned.

2023-10-31  Reini Urban  <rurban@cpan.org>

	encode r11: forgot writing eed raw size
	Fixes ./rw r11/ACEB10

2023-10-30  Reini Urban  <rurban@cpan.org>

	decode_r11: fixup Invalid obj->size change

2023-10-30  Reini Urban  <rurban@cpan.org>

	decode_r11: more wrong obj->size checks
	Fixes more preR13 fuzzing tests
	$ examples/llvmfuzz_standalone ../tz/*/clusterfuzz-testcase-*

	but breaks ./rw r11/ACEB10

2023-10-30  Reini Urban  <rurban@cpan.org>

	dxf2dwg: honor --force-free also with errors
	to repro ../tz/indwg/clusterfuzz-testcase-minimized-llvmfuzz-5075763015057408.dxf

	llvmfuzz_standalone: srand the env vars
	and print them

	bit_TV_to_utf8: fix illegal write
	on failed iconv conversions with too short destlen.
	Fixes ossfuzz 63629

	dwgfuzz: fix some NULL derefs
	e.g. clusterfuzz-testcase-minimized-llvmfuzz-4602743341580288
	Fixes ossfuzz 63690

	injson: fix pre-R2 layer_colors setter
	stack-overflow even.

	decode_r11: fix heap-overflow by 1
	Fixes ossfuzz 63483

	indxf: fix dxfname double-free
	analog to dxf_entities_read.
	Fixes ossfuzz 65537

	dynapi: fix fixed_string termination
	Fixes ossfuzz 59523

	dynapi: fix r11 MENU size
	Fixes ossfuzz 50194 regression

	json: protect NULL derefs
	Fixes ossfuzz 47352

	indxf: fix spline fitpts check
	Fixes ossfuzz 44697

	indxf: fix heap overflow, wrong type
	Fixes ossfuzz 44483

	fuzz: avoid double fclose on IO errors
	Fixes ossfuzz 39933

	injson: no exit in a library
	Fixes ossfuzz 37355
	indxf ditto: fixes ossfuzz 46916

	dwg_api.h: check for __attribute_deprecated__
	e.g. already defined with compcert

	.clang-format: fix syntax error

2023-10-29  Reini Urban  <rurban@cpan.org>

	regen-dynapi: formatting

	decode_r13: ignore invalid obj->size
	Fixes ossfuzz 63463 heap-overflow

	free: fix preR13 unknown_rest leaks

	geojson: check out of memory
	With invalid ARC angles.
	Fixes ossfuzz 63690

	llvmfuzz: fix missing initializers

2023-10-27  Reini Urban  <rurban@cpan.org>

	json-check: use $ODAFileConverter_geometry env

2023-10-26  Reini Urban  <rurban@cpan.org>

	json-check: revert geometry again (wayland vs X)

	indent: proper VERSION blocks

2023-10-25  Reini Urban  <rurban@cpan.org>

	cmake: require C99 standard
	and define HAVE_C11 via __STDC_VERSION__

	set PRI_SIZE_T_MODIFIER on cross
	check HAVE_C11, but don't use it, because mingw ignores it.
	rather set PRI_SIZE_T_MODIFIER manually then (based on mingw32,
	mingw64, ppc64, mips32, aarch64)

	fix and run clang-format-all
	support new -Wanalyzer warnings

	add AX_PRINTF_SIZE_T %zu formatting
	Fixes GH #857

2023-10-23  Reini Urban  <rurban@cpan.org>

	encode: silence unknown_rest if unneeded

	encode: on dwg_encode_unknown_bits skip the rest

	injson: fix Unknown type for REGION.revision_bytes RC with STRING
	dynapi doesn't know of this array type (yet).

2023-10-21  Reini Urban  <rurban@cpan.org>

	encode: revise preview_size check
	for encode, where we dont have the obj->size.
	eg. example_2018

2023-10-21  Reini Urban  <rurban@cpan.org>

	decode: improve Invalid preview_size error
	with to/r13/from_autocad_r13/ROBOT.DWG. check against the obj->size
	not some hardcoded too low limit.

	But now this file fail with out of memory on outjson

2023-10-20  Reini Urban  <rurban@cpan.org>

	Revert "json-check: geometry at lower-left corner"
	This reverts commit 09c73ba18d4c4f2f8b29b252c7648191b182375b.
	This does not work on Fedora (wayland).

	add unknown_rest to replace some unknown_bits
	oda errors went down from 174 to 168 of 969

	WIP attdef debug

	json: we emit non-empty unknown_bits
	so remove JSON DECODE_UNKNOWN_BITS.
	GH #855

	convert JUMP.trailing also to unknown_bits

	preR13 store ERROR: offset slack in unknown_bits
	Fixes GH #855

	json-check: fixup source dwg as first line

	json-check: geometry at lower-left corner

	json-check: source dwg as first line in .err
	for easier regression checks

2023-10-19  Reini Urban  <rurban@cpan.org>

	indxf: fix dxfname double-free
	Fixes ossfuzz 57481

2023-10-17  Reini Urban  <rurban@cpan.org>

	injson: fix R2004_Header.file_ID_string
	not hex

2023-10-13  Reini Urban  <rurban@cpan.org>

	spec: rename ATTRIB,ATTDEF.mtext_handles to mtext_style
	and add missing attrib unit-test field checks.
	those r2018 mtext fields are still unstable.

2023-10-12  Reini Urban  <rurban@cpan.org>

	encode: disable downconvert_relative_handle
	Of course r2000 can read relative handles just fine.
	They are mandatory for prev,next_entity links.
	Just first,last_ links and similar 4 links were always absolute.
	Just VX_TABLE_RECORD.ownerhandle is relative.

	But this must be defined in the caller, if obj or NULL.

2023-10-11  Reini Urban  <rurban@cpan.org>

	json-check: better cleanup on success

	dwg_sentinel: remove superfluous bounds-check

2023-10-10  Reini Urban  <rurban@cpan.org>

	encode: refactor r13-r2000, thumbnail, meas, objects CRC
	esp. write objects crc. Fixes all ODA CRC errors with all r2000 test files.

	TODO: we could also check if the old r2000 dwg has the template/image before or after.
	ODA is not quite right

	Fixes GH #853

2023-10-10  Reini Urban  <rurban@cpan.org>

	decode: comments only

	json-check: change .log.orig, improve diff
	ignore the indices.
	no double initial logs, just the outjson log.
	fix invalid ACAD11 r, wrong checks.

2023-10-09  Reini Urban  <rurban@cpan.org>

	encode: fixup header.thumbnail_address
	wrong pos.
	also keep an existing r14 auxheader.

	encode: fix Handles page CRC as BE
	fixes WRONGCRC errors with overlarge Handles page sizes

	encode: patchup header.thumbnail_address
	which may move the thumbnail upfront. Fixes GH #853

	encode: no TV-ZERO with r13c3

2023-10-06  Reini Urban  <rurban@cpan.org>

	decode: more work on dwg_section_page_checksum
	but still wrong (for writing r2004)

	decode: add dwg_section_page_checksum overflow check

	spec: hack FIELD a bit
	to fix 2018/TS1 json-roundtrips.
	need the logic when to omit TABLE_value.value_string

2023-10-05  Reini Urban  <rurban@cpan.org>

	decode_r2007: fix fuzzing out-of-bounds
	reset invalid section->num_pages.
	Fixes GH #850

	refactor injson dynapi for inline arrays
	maybe the reason for the GH #851 readDWG crash.
	simplifies a lot.

2023-10-03  Reini Urban  <rurban@cpan.org>

	bits: %u dat->bit warnings
	on mingw32

	cmake: use -Wno-error=array-bounds

2023-10-03  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix comment about layer_colors in header file

	Add r1.1 and r1.2 versions for dwgadd
	It's working

	Remove obsolete warning for pre r1.4
	All versions like r1.1 and r1.2 are working.
	There are not evidence for AC1.30 DWG files

2023-10-02  Reini Urban  <rurban@cpan.org>

	bits: more iconv fuzzing fixes
	check now also errno and the full dest range.
	Fixes again ossfuzz 62363

2023-09-30  Reini Urban  <rurban@cpan.org>

	fuzz: fix decode_preR13_section overflow
	with negative tbl->number.
	Fixes GH #848, maybe.

2023-09-24  Reini Urban  <rurban@cpan.org>

	decode: add dxf logging to VECTORs

2023-09-23  Reini Urban  <rurban@cpan.org>

	injson: add_handle for all object handles
	to fill the object_map{}, to properly resolve 0 handles later.
	See GH #830

2023-09-23  WU LONGYONG  <chunibyo.wly@gmail.com>

	fix: the number of dividing angle
	if want to cut an angle to 10 points
	the delta angle should be divided  as 10-1=9

2023-09-22  Reini Urban  <rurban@cpan.org>

	fix dwg_resolve_handle
	when the handle wasn't found.
	Too eager bounds check.

	See GH #830

2023-09-22  Reini Urban  <rurban@cpan.org>

	injson: fix sort_ents add_handleref
	this is an exception for code 0. No obj, see GH #830

	WIP: Warn Wrong ref_object ref->obj->handle.value != ref->absolute_ref
	with 2018/Surface with 0.2.2CF

	enable-check-less: also for programs, examples
	ubsan needs 44m on github. make check from 9m to 14m (even with check_less)

2023-09-21  Reini Urban  <rurban@cpan.org>

	configure: default to -fhardened compiler flags

2023-09-21  chunibyo  <chunibyo.wly@gmail.com>

	fix angle normalization loop
	and a segment fault bug.

2023-09-21  Gian Maria Gentilini  <38076337+gentilinigian@users.noreply.github.com>

	spec: Add LEADER.hookline_on flag calculation
	Re-calculate AutoCAD's hookline display rules, different to ODA.
	(but more likely more correct)

	Rewritten by Reini Urban.
	Insignificant contribution.

2023-09-19  Reini Urban  <rurban@cpan.org>

	spec: add RLLd type (signed int64)
	though unused yet.
	Dwg_R2007_Section will need that.
	The AcDS sortedidx is not, I think

	json: more bit_TV_to_utf8 iconv protections
	check heap overflows with iconv dest result

	bits: memcpy-param-overlap
	Fixes oss-fuzz 62461, though not repro

2023-09-12  Reini Urban  <rurban@cpan.org>

	indxf: fix double-free with INVALIDDWG cases
	when the dxfname was allocated and the import error occured later.
	Fixes oss-fuzz 59428

	bits: fix double-free in Out of memory error
	Fixes oss-fuzz 48236 crash

2023-09-11  Reini Urban  <rurban@cpan.org>

	encode: dont encode from invalid version
	and dont realloc a nullptr.
	Fixes oss-fuzz 62132

	decode: fix unsigned overflow
	asan: allocation-size-too-big
	Fixes oss-fuzz 59899

2023-09-06  Reini Urban  <rurban@cpan.org>

	bit_read_TV: optimize TV-ZERO logging a bit

	decode: log xdata.type RS with -v4
	not just insane. I forgot where the xdata_size came from. the RS type

2023-09-04  Reini Urban  <rurban@cpan.org>

	decode_r11: fix wrong ltype size for POLYLINE/VERTEX
	Fixes GH #832

2023-09-01  Reini Urban  <rurban@cpan.org>

	rename R_2022 to R_2022b
	this beta-only format was not used in regular releases until r2024

	encode: in_postprocess_SEQEND with one entity
	there is no nolinks (single vertex).
	TODO: the same for the BLOCK entity chain

2023-09-01  Reini Urban  <rurban@cpan.org>

	encode: fix in_postprocess_SEQEND from injson
	where we have no target version.
	fix the nolinks setter.
	log the vertex index.

	Fixes GH #829 for POLYLINE, BLOCK not yet

2023-09-01  Reini Urban  <rurban@cpan.org>

	configure: rename --enable-mimalloc to --with-mimalloc
	it's an optional library, not a feature.

2023-08-31  Reini Urban  <rurban@cpan.org>

	injson: support 3BD* points
	Fixes e.g. 3DSOLID_wire.points.
	Detected via GH #827

	json: skip duplicate COMMON_3DSOLID
	See GH #827

2023-08-31  Reini Urban  <rurban@cpan.org>

	spec: improve WIRESTRUCT_fields
	mostly the 2 BLd fields to appear as -1.
	and to skip num_points with json.

	See GH #827

2023-08-31  Reini Urban  <rurban@cpan.org>

	bmp: fix wrong r2007 overflow errors
	general logical error, but only appearing with r2007 thumbnails.
	Fixes GH #824

2023-08-31  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix presence of AuxHeader
	I has no evidence, that AuxHeader is in any DWG files like AC1013 and
	AC1014.

	Fix MEASUREMENT value
	The possible values for the MEASUREMENT field are:
	0 - English
	1 - Metric

2023-08-31  Reini Urban  <rurban@cpan.org>

	dwgbmp: extend to emit WMF and PNG
	See GH #824

	dwgwrite: new version defaults, don't write r2000, but old versions asis
	readers would perfer r2000 or higher, oda can only read from r9 on,
	but for the sake of sanity don't upconvert preR13 to r2000 per default.
	only <r1.4 upconvert to r1.4, and >=r2004 down to r2000.
	This way we have much less up/downconverting changes.

2023-08-30  Reini Urban  <rurban@cpan.org>

	update NEWS

	promote RENDERENVIRONMENT to stable
	dxf and coverage ok

	spec: fix RENDERENVIRONMENT.fog_color
	the last text environ_image_filename is still unknown

	spec: rename ObjFreeSpace num fields
	no num_ prefix, to let them appear in json.
	they are not vector sizes.

2023-08-29  Reini Urban  <rurban@cpan.org>

	indxf: fix SUMMARY strings
	no use-after-free, convert from codepage to TV
	fixes ./dxf example_201*.dwg

	injson: handle 3DSOLID.revision_bytes[9] TFFx

	encode: more downconvert_TABLESTYLE
	because some border colors were invalid.
	fill in sensible defaults

	*-check: stabilize .log.orig creation
	because some b's are other than other b's

	json: im-/export the R2007_Header
	analog to R2004.

	json: skip r2004fileheader with r2007
	it is empty there

2023-08-29  Reini Urban  <rurban@cpan.org>

	json: fix xdicobjhandle logic
	write now the xdicobjhandle if not missing.
	Fixes oda errors Invalid input
	  AcDbBlockTableRecord(1F),
	and Object of class AcDbRegAppTableRecord cant be cast to AcDbEntity

	See GH #322

2023-08-29  Reini Urban  <rurban@cpan.org>

	encode: abstract delete_hv
	and fix another memmove error, the ptr size!
	and also fix a shift_hv leak

	encode: fixup remove_EXEMPT_FROM_CAD_STANDARDS_APPID memmove
	too many entries!

2023-08-29  Robert Scott  <code@humanleg.org.uk>

	dwg2SVG: define _GNU_SOURCE to expose strcasestr with musl libc

2023-08-28  Jarkko Hautakorpi  <jarkko.hautakorpi@pok.fi>

	decode r11: error: ‘__builtin_strncat’ output truncated before terminating nul
	copying as many bytes from a string as its length
	[-Werror=stringop-truncation]
	header_variables_r11.spec:164:20: note: length computed here
	164 |       size_t len = strlen ((char*)&_obj->MENUEXT[1]);

2023-08-28  Reini Urban  <rurban@cpan.org>

	add examples/odaversion helper

	encode: fixup FREED objects
	they did appear twice, so skip them in the HANDLES omap list already

	logging: RLx on eed 71, when overlarge
	i.e. rgb colors

	encode: skip also UNUSED objects
	and print the name and handle

	2ndheader: wrong crc type
	only detected by clang
	Fixes GH #820

2023-08-27  Reini Urban  <rurban@cpan.org>

	encode: skip freed object
	namely the APPID.EXEMPT_FROM_CAD_STANDARDS

	fix gcc14 -Wanalyzer-null-argument
	with is_class_unstable (dwg_type_name (type))

	gcc14: silence more wrong -Wanalyzer bugs

	gcc14: silence wrong -Wanalyzer-allocation-size
	in ADD_ENTITY ALIGNMENTPARAMETERENTITY

	indxf: fix -Wanalyzer-possible-null-argument
	null dxfname, CWE-690, with gcc 14

	encode: avoid uninitialized dat->chain"s
	leading to false gcc 14 -Wanalyzer-malloc-leak errors
	in bit_chain_init

2023-08-26  Reini Urban  <rurban@cpan.org>

	encode: remove APPID.EXEMPT_FROM_CAD_STANDARDS
	GH #817

	reedsolomon: document matrix ranges
	gcc-14 warns
	reedsolomon.c:307:54: error: dereference of possibly-NULL '*_20 + _22 + (sizetype)i' [CWE-690] [-Werror=analyzer-possible-null-dereference]
	  307 |               ^= f256_multiply (coeff, matrix[src][j][i]);

	fix CWE-401 -Wanalyzer-malloc-leak
	detected with latest gcc

	add config --with-{geojson,dxf}-precision
	And switch the default back from the RFC recommended 6 to max 16.
	See GH #810

	Revert "encode: remove APPID.EXEMPT_FROM_CAD_STANDARDS"
	Flaky, and we need to add removal of this handle from individual EED's also
	This reverts commit 3247beebd2efd84241a8406536fc89870fc676dc.

2023-08-25  Reini Urban  <rurban@cpan.org>

	encode: remove APPID.EXEMPT_FROM_CAD_STANDARDS
	GH #817

	add oda tool
	with json or dwg input

	regen-dynapi: summaryinfo T16

2023-08-24  Reini Urban  <rurban@cpan.org>

	encode: fix OLE2FRAME wrong MAX_SIZE_TF
	they can be much larger.
	Fixes json-check 2000/TS1

	encode: r2004_file_header.file_ID_string

	encode: fix r2004 assertions

	json-check: delete the old errors
	because without new errors this would stay

	dwg2ps: handle T16 summaryinfo types
	Fixes GH #812
	Also add Subject Info

2023-08-24  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix error handling in dwg_encode()

	Fix number of sections in encoding of header (preR13)

2023-08-23  Reini Urban  <rurban@cpan.org>

	add: default TDCREATE
	via TDUCREATE. WIP not sure how to create these julian days since 1970

	encode: on downconvert add the missing VX_CONTROL object
	Fixes GH #811

	encode: always write SecondHeader now
	for r13b1-r2000.
	Maybe that's what's causing the oda recovery warnings

	spec: fix summaryinfo <2007
	T16 is not always TU
	this fixes esp. decode errors.

2023-08-22  Reini Urban  <rurban@cpan.org>

	c99: regen codepages, fix -Wc99-designator
	array designators are a C99 extension,
	and illegal with C++

	c++compat fixes

	gh: mips decode.lo needs more than 25m

	logging: less -v3 decode tracing
	no crc address ranges.
	no EED raw TF content

2023-08-21  Reini Urban  <rurban@cpan.org>

	escape: honor codepage in htmlescape()
	add asian codepage support

	escape: workaround gcc-12 uaf var-tracking bug
	See GH #801

2023-08-18  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix creating of line entity in preR13
	3DLINE entity isn't in R11
	In R10 is possibility of 3DLINE or LINE (with 3d support). Rewrite to
	use of LINE.

	Fix thumbnail on the end of data

2023-08-18  Reini Urban  <rurban@cpan.org>

	unit-tests: silence ERROR: dwg_ref_get_object: empty ref
	rather resolve them

	decode_2007: refactor to Bit_Chain
	the page and section maps. now they are proper fields.
	See GH #806

2023-08-17  Reini Urban  <rurban@cpan.org>

	preR13: set HEADER.LTYPE_CONTINUOUS ref
	See GH #761

	logging: 2ndheader handles
	Fixes GH #804

	bits: simplify bit_write_H via bit_H_to_dat
	Releated to GH #804

	encode: fix 2ndheader copypasta
	VX_CONTROL_OBJECT for 10th handle.
	Fixes GH #803

	ubsan: stricter alignment checks
	when even alloced pointers are not memaligned. (as with ubsan or other weird archs)

	logging: only insane T if there is a high char

2023-08-16  Reini Urban  <rurban@cpan.org>

	logging: LOG_INSANE_T on unusual codepages
	See GH #802

	bits: fix strlen(NULL)
	Fixes ossfuzz 61497, 61494

	msvc: fix declspec position
	also clang-cl

	encode: fixup section[4] fields
	before writing the MEASUREMENT_R13 section.
	Fixes GH #792

	bits: fix ubsan alignment checks
	Fixes ossfuzz 59124

2023-08-15  Reini Urban  <rurban@cpan.org>

	logging: fix null-deref
	with empty dwg_find_tablehandle results

	bits: fix bit_u_expand and add tests
	Fixes GH #802

	bits: add MIF support to bit_u_expand
	Tests missing

2023-08-15  Reini Urban  <rurban@cpan.org>

	bits: bit_TV_to_utf8 handle asian codepages
	non-asian <0x80 exceptions not-yet.
	add LOG_TRACE_TV with utf-8 conversion

	See GH #802

2023-08-14  Reini Urban  <rurban@cpan.org>

	codepages: remove CP_SHIFTJIS
	it is CP932 now

	codepages: add CP932 (alias for shiftjis)
	also add missing the c < 128 exceptions for a few asian codepages.
	and fix the MIN_*_UC unused defines.

	codepages: fix dwg_codepage_isasian
	and document the asian multi-byte specialities.
	Closes GH #802

2023-08-13  Reini Urban  <rurban@cpan.org>

	svg: fix and simplify htmlescape
	no realloc use-after-free
	Fixes GH #801

	dxf: convert all MIF \M+1-5 DXF encodings to \U+xxxx
	as documented by ODA, not in any DXF nor FrameMaker documentation.
	Fixes GH #428

2023-08-11  Reini Urban  <rurban@cpan.org>

	json: fix print_wcquote to print utf-8
	not \uxxxx chars, when possible.
	Fixes GH #655

	dynapi: special-case HEADER.codepage
	for dwgadd. Fixes GH #727

	examples: add wine/valgrind support to dwgadd_test.sh

	logging: compacter FIELD_VECTOR tracing
	on decode

2023-08-11  Reini Urban  <rurban@cpan.org>

	change 2ndheader: handles and sizes
	always set handles, rename them.
	identified the source for all 2ndheader.handle fields,
	the HANDSEED and CONTROL_OBJECT parts from the header_vars,
	so we can always set them reliably.

	fix sample_2000 with unknown_10 == 0x14 => unknown_rc4[3]

2023-08-09  Reini Urban  <rurban@cpan.org>

	spec: ARRAYITEMLOCATOR.itemloc[3] inlined array
	use SUB_FIELD_VECTOR_INL
	node[4] is now also an inlined json array.

	add 2ndheader.spec
	and rename second_header to secondheader
	Fixes GH #800

	decode: better vcount logging
	strip the vcount (e.g. entries[]), and add LOG_RPOS throughout

	spec: move ASSOCGEOMDEPENDENCY, ASSOCNETWORK to stable
	can be ex-/imported via json and dxf

	unit-testing: improve failing assoc2dconstraintgroup
	check max num_connections and empty connections

2023-08-08  Reini Urban  <rurban@cpan.org>

	actions: --disable-werror on macOS CI
	which throws -Werror=cast-align, by not honoring
	$ax_cv_check_cflags__Wcast_align = yes

2023-08-07  Reini Urban  <rurban@cpan.org>

	2ndheader: rename handlers.size to num_data

	spec: harmonize SUB_FIELD_VECTOR API
	type before size

	2ndheader: fix unknown_rc4 reset hack
	no dat->byte -= 2, check unknown_10 for subsequent length 2 or 4
	just for json stay with length 4 for now, as in_json _INL cannot decide on 2/4 yet.

	decode: better 2ndheader logging
	spezialize the section and handlers repeats

2023-08-04  Reini Urban  <rurban@cpan.org>

	decode: enhance APPINFO.max_decomp_size
	as seen in GH #797

2023-08-04  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Improve logging of addresses

2023-08-03  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Improve logging output for unknown_rc4 in second header
	Main intent is removing of [i], not intuitive

	Before:
	unknown_rc4[i]: 0x78 [RC 0]
	unknown_rc4[i]: 0x1 [RC 0]
	unknown_rc4[i]: 0x5 [RC 0]
	unknown_rc4[i]: 0x0 [RC 0]

	After:
	unknown_rc4[0]: 0x78 [RC 0]
	unknown_rc4[1]: 0x1 [RC 0]
	unknown_rc4[2]: 0x5 [RC 0]
	unknown_rc4[3]: 0x0 [RC 0]

2023-08-03  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Improve logging output for second header null_b[]
	Improve logging output

	Main intent is removing of [i], not intuitive

	Before:
	null_b[i]: 0 [B 0]
	null_b[i]: 0 [B 0]
	null_b[i]: 0 [B 0]
	null_b[i]: 0 [B 0]

	After:
	null_b[0]: 0 [B 0]
	null_b[1]: 0 [B 0]
	null_b[2]: 0 [B 0]
	null_b[3]: 0 [B 0]

2023-08-03  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix indentation of clang-format off comment

	Fix dxf in FIELD_VECTOR_INL logging

2023-08-03  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Improve logging output for zero_5 header variable
	Main intent is removing of [i], not intuitive

	Before:
	zero_5[i]: 0x0 [RC 0]
	zero_5[i]: 0x0 [RC 0]
	zero_5[i]: 0x0 [RC 0]
	zero_5[i]: 0x0 [RC 0]
	zero_5[i]: 0x0 [RC 0]

	After:
	zero_5[0]: 0x0 [RC]
	zero_5[1]: 0x0 [RC]
	zero_5[2]: 0x0 [RC]
	zero_5[3]: 0x0 [RC]
	zero_5[4]: 0x0 [RC]

2023-08-03  Reini Urban  <rurban@cpan.org>

	bits: fix bit_TV_to_utf8 and bit_u_expand
	fix the json_cquote leak with codepages.
	bit_TV_to_utf8 via iconv requires at least a destlen + 1 for the final \0.
	optimize empty strings.
	bit_u_expand needs to check for not-found substrings.

	json: set dat->codepage
	for json utf8 conversion.
	Fixes GH #788

	bit_write_T16 converts from/to TU16
	For GH #788

	indent

2023-08-03  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix logging
	There was a trailing newline

2023-08-03  Reini Urban  <rurban@cpan.org>

	update NEWS

	bump copyright's

	add a vcpkg.json

	cmake: fix deprecation warnings
	tested with 3.27.1

2023-08-03  Reini Urban  <rurban@cpan.org>

	-Wcast-align fixes
	need ATTRIBUTE_ALIGNED()

	but we would really need to alias all BITCODE_T as BITCODE_TU
	and then downcast for TV, to ensure the 2 alignment.

2023-08-03  Reini Urban  <rurban@cpan.org>

	enable more warnings, -Wmissing-field-initializers
	and fix a few others

	logging: log resolve_objectref_vector with HANDLE
	too much roundtrip noise

2023-08-02  Reini Urban  <rurban@cpan.org>

	json: fix json_write_TF \r and \n quoting

	injson: support SecondHeader section
	GH #792

	json: write SecondHeader section
	GH #792
	Not really sure if useful enough

	bit_utf8_to_TV: skip invalid UTF-8 characters
	helps with fuzzing. e.g. ossfuzz 57481

2023-08-01  Reini Urban  <rurban@cpan.org>

	template: use TU16 cast
	Fixes GH #788

2023-07-31  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Move address and offset to LOG_HANDLE
	This is better to diff between dwgread log outputs

2023-07-31  Reini Urban  <rurban@cpan.org>

	encode: fix PROXY numbits calc.
	e.g. json-check example_r13

	CMC: set method only in upconvert when undefined
	Fixes GH #785

	CMC: method c2 (entity) defaults to 0xffffff rgb
	See GH #785

	CMTC: also keep from_version >= 2004
	Should fix GH #785, upconvert should be skipped also

	bits_test: add BS 1 test
	as XRECORD.cloning is written wrongly

2023-07-31  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Implement template description write support
	Only for AC1013 .. AC1018

	Rewrite decoding of template to use existing template_private()

2023-07-31  Reini Urban  <rurban@cpan.org>

	indxf: not too small
	Fixes GH #786

2023-07-28  Reini Urban  <rurban@cpan.org>

	add arc_split, angle_vector_2d: split arcs into lines
	for geojson arc and circle so far.
	TODO pline bulges
	Fixes GH #520
	Arc's must be closed, which is weird, but demanded by the spec as closed Polygon.

2023-07-27  Reini Urban  <rurban@cpan.org>

	dxf: exit Convert SAB ACIS on len=0
	at the end of the SAB.
	./dxf example_2013

	bigendian: workaround add_LibreDWG_APPID error
	in dwg_dynapi_entity_value in dwg_find_tablehandle

	bigendian: fix bit_read_TU
	wrong byteswap and wrong tests

	fix r11 HANDSEED RLLs, analog to EED

	decode_r2007 bigendian sections

2023-07-26  Reini Urban  <rurban@cpan.org>

	bigendian: improve bit_read_DD

	bigendian: fix bit_read_TU16 and bit_read_T32

	bits: fix bigendian TU tests
	and optimize bit_write_T a bit. we already have the length.

2023-07-25  Reini Urban  <rurban@cpan.org>

	bigendian: various fixes and more bits tests
	add more RD and BD tests, esp. for the new optimized branches

	rename _LE to _BE variants, which are really big-endian.  Wrongly named and
	unneeded.

2023-07-25  Reini Urban  <rurban@cpan.org>

	fix EED entity RLL: wrong conversion on aligned bit=0
	also remove unneeded bits _LE variants (which are BE anyway)

2023-07-25  Reini Urban  <rurban@cpan.org>

	build: conditional AC_CONFIG_FILES on --disable-bindings
	and not HAVE_PYTHON_LIBXML2.
	Which should simplify make dist and docker builds without bindings.

	with --disable-bindings the dist would exclude that now.
	without makeinfo even the docs.

2023-07-25  Reini Urban  <rurban@cpan.org>

	add a Dockerfile.ppc64 with the current sources, for bits testing

	auxheader: change TDCREATE to TIMERLL
	from TD

	bigendian: fix bit_u_expand()

	iconv: fails at run-time on powerpc64-linux-gnu
	and now also on macOS with utf-8 constants

2023-07-24  Reini Urban  <rurban@cpan.org>

	iconv: use UTF-8//TRANSLIT//IGNORE as tocode
	but it still fails with 22 on powerpc64

	modernize iconv.m4 probes

	dwgread: fix getopt_long usage
	with -o. Fixes GH #784

	fixup common_test linkage

2023-07-24  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Add tests for dwg_find_color_index()

2023-07-23  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix LTYPE.strings_area conversion from JSON to DWG

2023-07-22  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Add tests for bit_read_CMC

2023-07-21  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix find of RGB color index

2023-07-21  Reini Urban  <rurban@cpan.org>

	bigendian: fix dwg_set_handle_size

	make check-minimal deps

	add in_hexbin_tests
	and add error checks to the non-release version

2023-07-20  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Use in_hex2bin() in bits.c

	Move in_hex2bin() to bits.c
	This function is used in in_dxf.c and in_json.c

2023-07-20  Reini Urban  <rurban@cpan.org>

	spec: resolve plotview only from non-empty name
	also more logging.
	log example_2004 BE crash in json encode: add APPID LibreDWG

	add check-minimal target
	e.g. for ppc64 via qemu
	to keep CI timeouts at about 20m

2023-07-20  Reini Urban  <rurban@cpan.org>

	big-endian: run-time checks and most fixes
	I actually can check big-endian now, on ubuntu mips and ppc64 cross.
	But no debugging yet. And tests don't run through yet.

	Fix the Rx and Rx_LE variants for big-endian.
	Fixes GH #774

2023-07-19  Reini Urban  <rurban@cpan.org>

	configure: add AM_TESTS_ENVIRONMENT support for qemu cross-builds
	debian-style with qemu binfmt support.
	redhat sys-root style rpm's are broken by redhat,
	and would need manual labor. (even if they do sound better in theory)

2023-07-18  Reini Urban  <rurban@cpan.org>

	logging: change FORMAT_RD from %f to %g
	be less verbose

	unit-tests: fix RSd used table field

2023-07-17  Reini Urban  <rurban@cpan.org>

	add mips Dockerfile
	to actually test big-endian: many failures

	bigendian: broken since 0.12.5
	as reported by suse obs, which does have a proper big-endian gcc,
	unlike fedora (missing sys-root).
	debian/ubuntu also have a proper powerpc64-linux-gnu cross target.
	add 64-bit (ppc) and 32-bit (mips) big-endian CI compilation targets.
	(without check so far)

2023-07-15  Reini Urban  <rurban@cpan.org>

	iconv: honor mingw WINICONV_CONST
	else fails on some mingw systems

	xdata: fix XDATA handle representation
	the 8 byte are only the handle value.

2023-07-13  Reini Urban  <rurban@cpan.org>

	dxfb: sync dxfb-check with dxf-check
	almost done

	outdxfb: handles confirmed as hex strings
	as with ascii dxf

	outdxfb: <=r12 requires leading 0xff
	for eed group codes

	afl: last AFL++ compilation fixes
	can now build all programs and examples,
	with --disable-werror.

2023-07-12  Reini Urban  <rurban@cpan.org>

	afl: fix AFL++ encode compilation
	obj is accessed now via downconvert_relative_handle()

2023-07-11  Reini Urban  <rurban@cpan.org>

	encode: define MAX_SIZE checks
	for fixed strings and vectors.
	we had these numbers before.

	Fixes ossfuzz #58143

2023-07-11  Reini Urban  <rurban@cpan.org>

	examples: missing bits dependencies

	bits: one more bit_TV_to_utf8 leak on error
	but not yet ossfuzz #58132 finished

2023-07-10  Reini Urban  <rurban@cpan.org>

	bit_TV_to_utf8: overlarge destlen
	fixes ossfuzz #58008

	fuzz: honor dwg_sections_init errors
	also encode_r11_auxheader.
	Fixes ossfuzz #58019

2023-07-08  Reini Urban  <rurban@cpan.org>

	c++compat
	don't include limits.h from spec.h
	as it mixes up decls.

2023-07-07  Reini Urban  <rurban@cpan.org>

	clang-format: run
	build-aux/clang-format-all.sh src include test/unit-testing/ test/xmlsuite/

	clang-format: prepare
	add more statement macros
	skip src/codepages/*.h (read-only)

	shellcheck: {json,dxf}-check

2023-07-06  Reini Urban  <rurban@cpan.org>

	decode: allow empty section_map_address
	Fixes GH #769

2023-06-29  Reini Urban  <rurban@cpan.org>

	decode_r11: clear on realloc ctrl entries
	Fixes ossfuzz 59428, double-free

2023-06-28  Reini Urban  <rurban@cpan.org>

	unit-tests: missing and wrong SWEEPOPTIONS_fields
	debugging only

	free: fix UAF with debug_classes

	dxf: default empty revision_guid 2
	ODA throws invalid input there

	extend dxf-check roundtrips
	also check the generated DXF with oda

2023-06-27  Reini Urban  <rurban@cpan.org>

	decode: improve dwg_section_page_checksum
	now exactly as described in ODA, but still wrong

	decode: disable dwg_section_page_checksum warning status
	no DWG_ERR_WRONGCRC, as the calculation is still wrong

	decode: unify CRC mismatch log messages

	json-check: echo the correct ODA exec, add timeout
	for 2 r10 files

2023-06-27  Reini Urban  <rurban@cpan.org>

	encode: "was overlarge size" fixups
	size and bitsize stay the same, just move the content.
	test with ../json-check -v5 2007/colorwh

	Fixes 17 ODA errors 'CRC does not match' and .dwg needs recovery.
	22 left

2023-06-27  Reini Urban  <rurban@cpan.org>

	bit_copy_chain: better docs

	ACTION_3DSOLID: fix double-free
	do not flush the hdlstream 2x. Fixes GH #497

	bit_copy_chain: skip equal chains
	GH #497

	encode: fix obj_flush_hdlstream
	honor unaligned rhs dat chains.
	though handles should be always aligned.

2023-06-26  Reini Urban  <rurban@cpan.org>

	restore c++-compat
	and some unused vars

2023-06-25  Reini Urban  <rurban@cpan.org>

	encode: downconvert_relative_handle only
	with non-class objects

	decode: fix wrong ERROR obj_string_stream overflow
	without strings, such as eg with IMAGEDEF_REACTOR in 2007/Leader

2023-06-24  Reini Urban  <rurban@cpan.org>

	windows compiler warnings
	unused vars

	in_json: fix LTYPE.strings_area type from TF
	to BINARY (hex).

	encode: fix bit_downconvert_CMC
	for non-truecolor color index

	prefer newer ODA over old TeighaFileConverter

	encode: downconvert_relative_handle
	r2000 cannot read relative handles

2023-06-23  Reini Urban  <rurban@cpan.org>

	json-check: support r11 files

	encode: fix downconvert_DIMSTYLE
	by adding a dwg_has_eed_appid() check.
	Now it roundtrips via ODA

	encode: add experimental downconvert_DIMSTYLE
	only EED for DIMSTYLE.Annotative

	encode: format Dwg_Section_Type stream_order

	encode: add downconvert_MLEADERSTYLE

2023-06-22  Reini Urban  <rurban@cpan.org>

	format: fix DISABLE_NODSTYLE to StatementMacros

	dwg_next_entity: fix fuzzing error
	when the next_entity handle points to an object, not entity.
	Fixes ossfuzz #60008

2023-06-21  Reini Urban  <rurban@cpan.org>

	spec: demote MLEADERSTYLE back to unstable
	no json roundtrips yet.
	ODA throws Object improperly read: <AcDbMLeaderStyle> (E5)
	with most 2010+ examples.

2023-06-20  Reini Urban  <rurban@cpan.org>

	spec: fix MLEADERSTYLE round-trips
	set class_version.
	but still fails with ODA

2023-06-20  Reini Urban  <rurban@cpan.org>

	spec: fix MULTILEADER for r14
	we had a slack of 19 bits, which are exactly the
	r2000 bits missing (arrowheads, blocklabels, ...)

	r14/Leader roundtrips now ok with oda via json
	fixes Object improperly read: <AcDbMLeader> (640) with example_r14

2023-06-20  Reini Urban  <rurban@cpan.org>

	spec: fix entity_common vs entity field clashes
	esp. for the importers. We did set the wrong fields

	encode: support downconvert_TABLESTYLE
	to produce correct TABLESTYLE objects from versions >= r2007
	since free follows the from_version, we need to specialize
	free_TABLESTYLE also, to delete the version subclasses.

2023-06-19  Reini Urban  <rurban@cpan.org>

	spec: ditto for HATCH.paths[].polyline_paths
	the preprocessor got confused and produced wrong .i files

	spec: free HATCH_gradientfill already covered
	SINCE with free already checks from_version

	spec: fix wrong HATCH.segs
	they are really in paths[].segs

	*-check: support DS_libereco_R20* dwgs
	enable teigha on r9-r11
	no test/$b.dwg copy

2023-06-16  Reini Urban  <rurban@cpan.org>

	spec: fix HATCH.pixel_size roundtrips
	by storing the calculated has_derived flag into the json

	spec: fix VX_CONTROL entries handle type
	dedected by ODA roundchecks

	encode: always re-calculate bitsize in START_HANDLE_STREAM
	fixes json roundtrip in example_2000 with ELLIPSE (BE 210 differences)
	we should check for floats, plus strings.

	*-check: support -v5 argument

	spec: remove wrong UNKNOWN_BITS_REST in STYLE
	this was the handles, not some secret bits.
	CRC is now ok again, ODA complains now not about the style but the ELLIPSE

	spec: fix PLOTSETTINGS (and LAYOUT) dxf order

2023-06-15  Reini Urban  <rurban@cpan.org>

	preR13: move old entities to stable
	for the importers

2023-06-14  Reini Urban  <rurban@cpan.org>

	decode: fix r2007 Section[%d]->pages[%d] overflow check
	Fixes GH #763

	add --enable-debug support to dxf?-check tools

	debug: alive is fixed
	dxf not yet

2023-06-13  Reini Urban  <rurban@cpan.org>

	dxf: rename TABLECONTENT.dxfname back to TABLECONTENT
	it was wrong. see example_2000.dxf

	injson: skip unneeded fixup Type

	dwgadd: add CHK_MISSING_BLOCK_HEADER
	to ensure hdr is nonnull

	encode: fix double-free of klass->dxfname of TABLECONTENT

	encode: fix TABLECONTENT type fixup
	ignore the given dxfname there, rather search by class id
	--enable-debug only

	decode: more precise bit_read_TV overflow checks
	for preR13, when we need to read 2 byte lengths, not BS

	decode: skip earlier on FIELD_VECTOR_T overflows
	to avoid chunk strings (e.g. invalid utf-8) in the json.
	Fixes debug build of import of json example_2000 with DIMASSOC.xrefpaths

2023-06-12  Reini Urban  <rurban@cpan.org>

	dxfclasses: -Wlto-type-mismatch

	tinycc: -C -E is invalid, only -E

	avoid math macro redefinition
	unit-tests: error: M_PI_2 redefined

	unit-tests: add _CAST macros
	where needed. all other field checks are now again type-strict

2023-06-11  Reini Urban  <rurban@cpan.org>

	remaining -Werror fixes
	suppress -Wmaybe-uninitialized (false positives), -Wformat and
	-Wstringop-truncation.
	Mostly with ubsan or macOS.

2023-06-09  Reini Urban  <rurban@cpan.org>

	config: add --disable-werror
	for autoconf and cmake.
	fatalize all warnings

	fix clang -Wtautological-constant-out-of-range-compare
	comparisons short > 0xc0000000 at compile-time

	encode: int vs uchar truncation

	m4: fix mingw gcc -Wformat-y2k probes
	mingw gcc requires -Wformat with the -Wformat suboptions

	encode: long to short truncations

	indxf: silence wrong -Wstringop-truncation
	https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88780
	esp. on old mingw gcc

	dwgadd: formatting only

2023-06-08  Reini Urban  <rurban@cpan.org>

	dwgadd: -Wmaybe-uninitialized

	encode: -Wmaybe-uninitialized

	decode_test: pragma pack warning
	with msvc.
	warning C4103: alignment changed after including header, may be due to
	missing #pragma pack(pop)

	outdxf: fix unsigned loop overflow
	which never goes < 0 when decr len -= 255.
	Fixes GH #759, thanks to @weikenxq

2023-06-08  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Improve flags_r11

2023-06-07  Reini Urban  <rurban@cpan.org>

	json: fix json_write_TF \\ quoting
	Fixes GH #756

2023-06-07  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	To readable code

	Remove trailing code

	Fix size of APPID table record in preR13

2023-06-05  Reini Urban  <rurban@cpan.org>

	add: formatting only

	add: support and document pface triangles

	add: fix r11 pline and vertex flags
	and improve the examples for 3D.
	Still wrong flags all-over though.
	Fixes GH #754

2023-06-03  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Sort EED codes

	Fix conversion of appid to JSON

2023-06-02  Reini Urban  <rurban@cpan.org>

	dwgadd: add HEADER.point support
	Fixes GH #750

2023-06-02  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Identify VX is_on option

	Identify VX variables

2023-06-02  Reini Urban  <rurban@cpan.org>

	dwgadd: fix crazy dynapi string issue
	char text[120] and &text is different as a pointer to s heap string.
	we rather deref it twice for all buffers and structs, than fixing the static
	fixed buffers.

	Fixes GH #747

2023-06-02  Reini Urban  <rurban@cpan.org>

	add: add tests for HEADER texts
	and other

2023-06-02  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Remove trailing "1" from log output

	Fix parsing of HEADER text value

2023-06-02  Reini Urban  <rurban@cpan.org>

	rename the _R11 Dwg_Object_Type_r11 type values to _r11
	Rename the _R11 Dwg_Object_Type_r11 type values to _r11,
	to avoid conflicts with the POLYLINE_R11 fixedtype.

	This is preparation to add POLYLINE_R11 entity

2023-06-02  Reini Urban  <rurban@cpan.org>

	add: forgot SEQEND.type in dwg_add_Attribute
	fixes r11 dwgadd.example_r11

2023-06-02  Reini Urban  <rurban@cpan.org>

	encode r11: refactor encode_preR13_entities
	blocks might be in between normal entities, see dwgadd.example_r11
	instead pass an enum arg for entities, blocks or extras, and decide
	there then, what to emit.

	Fixes GH #746

2023-06-01  Reini Urban  <rurban@cpan.org>

	json: fix TF slack regression
	A TF string of WIDE\0W should be printed with full slack.
	Fixes GH #745

2023-05-31  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Run prepared tests

2023-05-31  Reini Urban  <rurban@cpan.org>

	outjson: fix json_write_TF null-deref
	handle null strings as ""
	Fixes ossfuzz 58904

	indxf: honor version for default HEADER strings
	FINGERPRINTGUID and VERSIONGUID must be wide as default, or
	bit_convert_TU will overflow later.
	fuzzing bug found by coolkingcole huntr.dev/bounties

	add: no PLOTSTYLE placeholder <r2000
	dwgadd warnings

2023-05-31  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Improve bit_read/write_BE tests

2023-05-31  Reini Urban  <rurban@cpan.org>

	actions: no ACTIONS_ALLOW_UNSECURE_COMMANDS

	upgrade to ilammy/msvc-dev-cmd@v1.12.1 for node
	Node.js 12 actions are deprecated

	upgrade to lukka/run-vcpkg@v11 for vs2019-ninja

	dwgadd: fix int vs float decisions
	now also with checking the target size and type. (stack-overflows)
	Fixes GH #741

2023-05-31  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Add tests for bit_read/write_TV

	Add tests for bit_read/write_TF

2023-05-30  Reini Urban  <rurban@cpan.org>

	fix FORMAT_MC

	minor type errors
	wrong unit-tests
	and improve obj.type to BS (short)

	-fno-strict-overflow warning with clang

	encode: wrong Empty TF with length 0 warning
	and dont log "(null)" [T]

	encode: fix r14 write_BE
	no r2000+ default bit

	dwgadd: more TRACE

	dwgadd: add examples with header floats to parse

	dwgadd: scanf float before int
	Fixes GH #741

2023-05-29  Reini Urban  <rurban@cpan.org>

	fix 32-bit handle sizes
	32bit did not zero the higher bits, leading
	to too high handle values with the add api.

	msvc: no /lm with cmake

	msvc: ucrt has sys/stat.h
	fixes last msvc warning

	add_test: MSVC truncation warning

	gperf: silence one more truncation warning

	add extra ubsan action workflow
	asan+ubsan runs into the 60min timeout

	add -m32 action workflow
	for the 32bit write handle bug

	actions: -O1 for asan,ubsan
	to catch more UB's

	add_test: ok many objects

	alive.test: silence the libtool prefix

	STYLE: debug UNKNOWN_BITS_REST

2023-05-27  Reini Urban  <rurban@cpan.org>

	fix r11 -Wstringop-truncation
	__builtin_strncpy specified bound 32 equals destination size.
	detected with -O2 -fsanitize=undefined

	enforce -fwrapv esp. with broken gcc
	See https://thephd.dev/c-undefined-behavior-and-the-sledgehammer-guideline
	gcc removing bounds checks without any warning

	dwg_api: clang-format some macros

	encode: wrong mingw32 formats, size_t

	add_test: debug dwg_getall_OBJECT failures
	on mingw 32bit

	decode: log read_BE fields (default or not)

	encode: log write_BE fields (default or not)

2023-05-25  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Regenerate dynapi

2023-05-24  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix preR13 DIMARROW header variable
	The name DIMARROW is used in r1.4 DXF format and it's different that
	DIMASZ

	Improve unknown variables in preR13

2023-05-23  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix preR13 SHAPE entity logging

	Identify x_ang in preR13 POINT entity

	Add preR13 DIMENSION_RADIUS/DIAMETER extrusion

2023-05-22  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix preR13 DIMENSION_LINEAR extrusion

	Identify EXTRUSION in preR13 ATTRIB/ATTDEF entities

	Add preR13 point extrusion

2023-05-20  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix vertical alignment in preR13 ATTDEF entity

	Remove obsolete comment

	Fix vertical alignment in preR13 ATTRIB entity

2023-05-18  Reini Urban  <rurban@cpan.org>

	r11: skip BLOCK_HEADER *MODEL_SPACE
	on output

	encode: more missing size_t's

	r1.4 encode: keep deleted and unused entities

	json-check: no teigha for r1.4

	spec: rename ENDREP fields
	to avoid the json magic with num_
	fixes json roundtrips

2023-05-17  Reini Urban  <rurban@cpan.org>

	silence uninitialized vars warnings for AFL fuzzing

	injson: protect overlarge xdata strings

	change ulong to size_t. msvc size_t truncation warnings
	use size_t (64bit) for the windows long problem, instead of unsigned long (32bit).
	which is a problem for large files on windows.
	use the %zu formatter throughout.

	indxf: msvc SCANF_2X has "%2hhX"

2023-05-16  Reini Urban  <rurban@cpan.org>

	more WINE test fixups

	dxf*-check: better teigha checks
	from json-check

	programs: add -I for config.h

	decode r11: avoid double evaluation in r11 HANDSEED
	esp. with mingw

	add wine support for programs tests

2023-05-15  Reini Urban  <rurban@cpan.org>

	no inline for be64toh

2023-05-13  Reini Urban  <rurban@cpan.org>

	gperf: enforce size_t
	and fix it up via regen-gperf, where needed

	fix gperf on macOS
	macOS 12.6.5 lies about its gperf version, using size_t as 3.0

	c++ compat for programs, examples
	just it does not link yet

	indxf: full c++ compat
	by additional macros. but we get better type checks in the rest

	regen-perf: major c++ compats
	get rid of deprecated register keyword. regen with gperf 3.2
	note that macOS gperf says 300, but emits size_t!

	minor c++ compat

	encode: fix 2x string_area, zero-padding
	re-add the zero to strings. (compared with sources)
	auxheader padding.
	clear APPID_CONTROL size to recalc when added entries.

	dxfb-check: new debian pkg ODAFileConverter

	extend all handle values to 64bit
	the eed entity handle needs 8 byte. so the handle.value and absref would too.

	use strtoull for eed.5.entity longlong values
	otherwise it would overflow. extend handle values to 64bit
	got dataloss on r11/ACEB10 EED.5.entity values via json

2023-05-13  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix version of AutoCAD for preR13 entity types

2023-05-12  Reini Urban  <rurban@cpan.org>

	dwggrep: fix print_match without PCRE
	don't double convert from UCS-2 to UTF8

	injson: fix 32bit RLL setters
	long is not big enough for RLL there.
	detected with 32bit asan

2023-05-11  Reini Urban  <rurban@cpan.org>

	encode r9: fix numentities calculation and patchup
	no extras.
	and write the correct value.
	fix blocks entities calculation.

	write TF slack
	to json, write \0 as \u0000.
	from json, use json_fixed_string.
	encode: all TF strings must now be of adequate size (check in_dxf)

	dxf2dwg: dat-> . confusion

2023-05-11  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Merge pull request #723 from michal-josef-spacek/fix_warning
	Fix warning with logging of addr

2023-05-10  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix warning with logging of addr

2023-05-10  Reini Urban  <rurban@cpan.org>

	encode r11: avoid ending junk

	injson fuzz: fix dwg_next_handle for !dwg->num_objects

	r11: fix writing r11 handles, change json for handles
	change json handle format to size 3
	esp. for object handles. we need to write the size
	fix writing r11 handles, analog to read_H

	encode r11: fix EED, skip handle
	r11 EEDs dont read/write the appid handles, they use the appid_index instead
	fixes writing ACEB10_r11
	-v5 log the handles position (before)

2023-05-09  Reini Urban  <rurban@cpan.org>

	encode r11: fix extras section
	calc. jump_entity_section for JUMP (in_json).
	extras starting off from the last block index.

2023-05-08  Reini Urban  <rurban@cpan.org>

	json.test: fixed json roundtrips

	encode: fixup address patchup
	evert part of 0d00fd5c203ded9b495d187819558ee5747d6a32

	fuzz injson: stack-overflow with over-long
	fixed strings.

	fuzz encode: protect in_postprocess_SEQEND

	fuzz injson: protect >dashes_r11[12] oob
	allow max 12 elements

	fuzz injson: protect from missing version

	fuzz: fix dwg_find_first_type oob

	dwgwrite: fix invalid type argument of ->
	only detected with afl-gcc-fast

	encode r11: fix header.blocks_start without blocks
	write the sentinels, set proper blocks_start.

	encode r11: support EED types 0 and 3

2023-05-07  Reini Urban  <rurban@cpan.org>

	encode r10: skip table crc

	encode r11: unify CASE_ENCODE_TYPE
	no special-cases anymore. the flag_r11 fixups were wrong

	m4: fix -D_FORTIFY_SOURCE=2 probe
	it didnt error, only warn

	encode r11: fix tbl->flags_r11 for r9-r11

	encode r11: init on valid header.dwg_version = 0
	and don't init it away.

	encode r11: encode_preR13_section with spec tables
	Fixes GH #720

	temp. regen-dynapi

2023-05-05  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix vertex entity flags

	Fix POLYLINE and VERTEX entity decoding in preR13

	Fix detection of POLYLINE and VERTEX entities in preR13
	There are common POLYLINE and VERTEX entities in preR13.
	There are concrete POLYINE and VERTEX entities later.
	This is detection of concrete entities and use code in dwg.spec for
	precise decoding.

2023-05-05  Reini Urban  <rurban@cpan.org>

	encode_r11: fix VPORT
	simple json roundtrips now ok, blocks not yet

	decode_r11: fix sentinel search diagnostics

	log: fix -larg

	common.c: DWG_SENTINEL_R11_ simplier sentinel values in comments
	to be searched for in logs

	decode_r11: delete unused comments/code

	log.in: fix -llogfile option

	harmonize SENTINEL_R11 macro/enum names
	and simplify the case switches

	decode_r11: search sentinel +- 200 bytes around

	encode r11: fix LTYPE.pattern_len
	which broke dashes_r11[11]

	api: rename LTYPE.num_dashes to numdashes
	with r11 the vector is fixed-size 12, not dependent on num_dashes.
	hence we need to write it into json, and read it back in.
	without the "num_" vector size magic.

	encode r11: fix STYLE.bigfont_file

	decode_r11: dont overwrite block_entity->handleref.size
	now json-check r11/entities-2d fails at STYLE.bigfont_file

	api: change BLOCK_HEADER.flag2 to RSd
	simplier and more logical. defaults to 0xffff

2023-05-04  Reini Urban  <rurban@cpan.org>

	encode r11: disable encode_preR13_DIMENSION
	it changes its flag_r11 for no good reason. we rather rely on the fixedtype
	calcuclated earlier. fixes a couple of roundtrip errors

	encode r11: fix dwg_add_handleref for empty absref
	we cannot search the handles when we haven't resolved them yet.

2023-05-03  Reini Urban  <rurban@cpan.org>

	encode r11: deleted entities also
	for easier comparisons

	injson: special-case TFv table sizes
	because we need to access them beyond their length.
	we would need json_fixed_string for this, but realloc is
	also ok, because the dynapi registered these strings as TV, not TF.

	decode_r11: auxheader.R11_HANDSEED leak

	encode r11: fix add with non-consecutive table records
	when using an arbitrary add api, we cannot ensure that all
	table records are one after each other.

	encode r11: sync UCS with spec

	encode: honor UCS.ucs_elevation when encoding from r2000+
	to earlier versions. but the default ucsorg is just a 2RD,
	I don't see any flag value to add the elevation there.

	decode_r11: improve VERTEX type detection, rename r11_auxheader
	See GH #713. use the pline type for subsequent vertex types.
	add VERTEX_MESH opts.
	reformat some encode funcs,
	rename r11_auxheader funcs

	encode r11: write_sentinel as macro
	and skip writing deleted r11 entities.
	it would be useful, but there are encode problems with json and dxf
	in the type mapper, I couldn't find good fixes for yet.

	json.test: todo preR13 roundtrips

	json-check: no teigha write <r12

	encode r11: fixup empty header.num_sections
	which prohibited patching the control tbl addresses

	encode_r11: add missing encode_preR13_auxheader
	This fixes most preR13 json roundtrips.

2023-05-02  Reini Urban  <rurban@cpan.org>

	encode r11: write mand. extras sentines and set extras_start

	encode r11: common tbl used, add tbl crc

	encode r11: move r11 check into the function

	encode r11: patch the section address'es
	because we dont know the entities_end address yet,
	when we write the section hdr's.
	re-use the static Section[id].address for this, which is only written later.

	json: skip the final \r in acis_data strings
	esp. for json, where we did split only on \n, not \r\n.

	encode_r11: better write_sentinel
	with -v4 logging, and just the ID
	remove unneeded bit_write_sentinel
	default to r11 numheader_vars = 205

	WIP encode r11: add missing sentinels
	because we still get SECTIONNOTFOUND errors

	json.test: extend to all versions
	example?r13 has an encoding problem
	and ACEB10_r11 cannot be read back in

	doc: r11 doc updates
	and dwgread has no --as VERSION argument (yet)

2023-04-29  Reini Urban  <rurban@cpan.org>

	encode: undo minimal DXF hack
	creating invalid header strings e.g.

	gen-dynapi for SHAPE.style_id 2
	r11_idx => name

	preR11 leaks fixed
	preR13 imports and outdxf dont leak anymore.
	Fixes GH #466

	encode_r11: calculate HANDSEED

	fix preR13 free CMC
	somehow the name strings became invalid

	encode_r11: set HEADER.numentity_sections to 3

	decode_r11: non-global dwg_decode_preR13_handleref
	add to the refs vector.
	to avoid duplicates,
	and to avoid BLOCK_HEADER.block_entity leaks.

	examples/dwg2svg2: prefer paperspace
	if there are paperspace entities, only output them.
	Else all modelspace entities.

	examples/dwg2svg2: API fixes for preR13
	use fixedtype, check if paperspace exists

	dxf: fix dxf_print_rd
	reduce precision is still broken, disable it.
	fixup for d7f200788
	fixes dxf-check

	encode r11: calc. the control table sizes
	also set entities_end. See GH #716

	dxf r11: fix HANDLE (style, 2)
	but we really should resolve the style_id to its r11 name

	decode_r11: set handles for all, fixes get_first_owned_block()
	without proper handle we cannot resolve entities, like in get_first_owned_block

	decode_r11: set hdr->block_entity, endblk_entity

	json.test: stricter check_roundtrip

2023-04-28  Reini Urban  <rurban@cpan.org>

	dxf.test: stricter check_roundtrip

2023-04-27  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Add missing logging of vertex flag in VERTEX_PFACE in R13

2023-04-27  Reini Urban  <rurban@cpan.org>

	helpers: portable make addprefix workaround
	add shellcheck target.
	add old tests to roundtrip testers

2023-04-27  Reini Urban  <rurban@cpan.org>

	encode: more fuzzing assertions => error
	overwriting dat->chain at pos 0.
	add some more basic checks.
	like NULL checks and overflow checks.

	all detected by llvmfuzz

2023-04-27  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Add logging of SOLID R11 opts

2023-04-26  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix parsing of preR13 tables
	Table definitions in dwg.spec need obj->size, which wasn't here.

2023-04-26  Reini Urban  <rurban@cpan.org>

	fix dwg2SVG for preR13, wrong type
	BTW: we see all these new errors, because we never before iterated over r11
	entities.

	log: timeout 30 with bigger files automatically
	eg td/2007/fischer_anchor_base_and_dynamic_blocks.dwg

	unit_testing: changed the test-old files
	space to _

	add exit 1 for helpers, disable broken shfmt
	shfmt 3.4.3-1 creates broken if indents

	dxf: dxf_cvt_tablerecord triggers at r2000, not r13
	e.g. TEXTSTYLE STANDARD or Standard

2023-04-25  Reini Urban  <rurban@cpan.org>

	latest shellcheck 0.9.0, shfmt

	dxf: resolve r11_idx table names
	FIELD_HANDLE_NAME via dwg_handle_name()

	dwg_api.h: cygwin/newlib already has __nonnull_all

	dxf: $UCSXORI preR11, FLATLAND 70 r20 only

	dxf: fix dxf_print_rd trailing spaces
	no trailing spaces

	dxf: skip *MODEL_SPACE BLOCK before r11

	decode_r11: set ownerhandle->r11_idx, entities[] logging

	dxf: version-specific table entries

	decode_r11: parse even empty tables
	Fixes GH #709
	we need to parse the sentinels and add the control table objects, even if
	the table is empty or has invalid entries

2023-04-24  Reini Urban  <rurban@cpan.org>

	encode: -Wmaybe-uninitialized first_block

	encode preR13: encode missing last entity/block
	also fix writing all entities r1.x, not just until the first block.
	with r1.x there is no blocks section.
	Fixes GH #702

	automake: rename SH_SOURCES to shell_sources
	dont trample on reserved names
	for shfmt only

	decode_r11: fail on sentinel error
	or empty table number or size.
	Fixes GH #708

	dwggrep: formatting only

	missing #include AX_STRCASECMP_HEADER

	geojson: fixed for preR13
	fixedtype, not type.
	Fixes ossfuzz 58306

	indxf: accept lowercase DWGCODEPAGE
	e.g. example_r13.dxf has "ansi_1252"

	appveyor: on cygwin set git safe.directory
	this fixes the cygwin build on appveyor

	appveyor: remove cygwin32
	Cygwin is not supported on 32-bit Windows

	decode: check failing mallocs in spec

	log: support --big, HACKING: recommend tcc
	--big is needed to bypass timeouts

2023-04-23  Reini Urban  <rurban@cpan.org>

	dwg.in: check json,dxf,dxfb for fuzzed input

2023-04-21  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix blocks_size for preR13
	Constant 0x40000000 was added in AC1001 version to blocks_size

2023-04-21  Reini Urban  <rurban@cpan.org>

	appveyor: deploy libiconv-2.dll also
	Fixes GH #700

	dxf: fix dxf_fixup_string, uninitialized _buf
	detected by valgrind with MTEXT

	disable failing setup-python-libxml2
	Requirement already satisfied

2023-04-18  Reini Urban  <rurban@cpan.org>

	codeql: update checkout also to latest node 16

	codeql: update to v2
	https://github.blog/changelog/2023-01-18-code-scanning-codeql-action-v1-is-now-deprecated/

2023-04-18  Reini Urban  <rurban@cpan.org>

	dxf: fix wrong floating truncation and format
	use %G, not %f, don't strip overlarge ints.
	now:
	$PEXTMIN
	 10
	1E+20
	before:
	$PEXTMIN
	 10
	100000000000000000

	Fixes GH #687

2023-04-18  Reini Urban  <rurban@cpan.org>

	unset HAVE_PYTHON_LIBXML2 on cross
	Fixes GH #698, for 32bit cross e.g.
	python demand-loads the shared libxml2 without honoring libpath hints

	common_cvt_TIMEBLL_tests: fix 32bit overflows

2023-04-18  Reini Urban  <rurban@cpan.org>

	check calloc overflows, esp. with 32-bit
	New alloc limit:
	"requested allocation size 0xd0000618 (0xd0001618 after adjustments for
	alignment, red zones etc.) exceeds maximum supported size of 0xc0000000
	(thread T0)"

	detected by fuzzing. Fixes GH #694, #695, #696, #697

2023-04-18  Reini Urban  <rurban@cpan.org>

	more FORMAT_UMC, esp. for 32-bit

	decode_r11: add BLOCK.name as 2

2023-04-17  Reini Urban  <rurban@cpan.org>

	decode_r11: set BLOCKS header (owner)
	to generate the entities[]

2023-04-17  Reini Urban  <rurban@cpan.org>

	r11-iter: resolve JUMP's
	WIP add missing BLOCK_HEADER.entities[].
	resolve extras section JUMP entities.

	GH #635

2023-04-15  Reini Urban  <rurban@cpan.org>

	actions: apt-get update needed now

	dxf.test: skip symbolic links
	which I made locally for testing

	decode: fix bit_read_UMC
	@arturred at GH #386 was right, UMC may need up to 8 byte.
	The #662 testcase works now, and the samples also.
	Fixes GH #662 and #126. ERR-2 from #386 not yet.

2023-04-14  Reini Urban  <rurban@cpan.org>

	decode: better recovery from UMC bug
	reading from the HANDLES stream easily gets corrupted with a wrong
	read_UMC function. Better recovery logic, and add a unit-test

	GH #662, #386, #126 and znacky_all_dwg_from_cadforum.cz_2004.log

2023-04-13  Reini Urban  <rurban@cpan.org>

	injson r11: split MENU into MENUEXT
	Fixes ossfuzz 57969

	bits: change TV-ZERO policy GH #683
	write the same length as when reading. dont include the final zero
	preR2004.

	encode r11: fix control resolver GH #693
	the object_map is only stored with an obj. without
	it cannot resolve.
	add more -v4 and -v5 handle resolver logging

	use less control handles with r11
	esp. for out_json. the de/encoding is done elsewhere for r11 still

	log more handles helper functions (esp. r11 resolver)

	encode r11: calc the control address
	with sentinels for r11

	json: extend r11 handles to size 3 with absref
	the default r11 control entries get code 3 (the major r11 usage so far)
	also parse the r11 _control address

2023-04-12  Reini Urban  <rurban@cpan.org>

	encode r11: add missing UCS - VX sections

	more r11 _CONTROL object support
	which is not yet de/encoded via spec, but use it for JSON at least.
	rename tbl->flags to tbl->flags_r11 and add it to JSON.

	encode r11: control table flags_r11 and search
	GH #693, TODO: address and num

2023-04-11  Reini Urban  <rurban@cpan.org>

	bit_read_T32: fix size overflow
	With fuzzed input, GH #692

	encode: don't skip entities in blocks section
	wrong entmode

	encode r11: eed write RS not BS

	encode: wrong BLOCK_HEADER.unknown_r11
	With the new diagnostics of the previous commits
	a new ACEB10-rewrite.dwg problem appeared:
	  ERROR: Wrong BLOCK.number or size
	  ERROR: LAYER.size overflow
	on encode.

	decode_r11: catch wrong table size or number in the header
	only warn at the first violation, because the number can be wrong.
	only error when the number is wrong later.
	Fixes ossfuzz 56972

	decode_r11: fail in fuzzed overlarge entities_size
	e.g. ossfuzz 49618

	add make check-ossfuzz target

	dxf: Assume DWG file
	similar to json. mostly for ossfuzz reproducers

2023-04-09  Reini Urban  <rurban@cpan.org>

	bit_TV_to_utf8: handle out of memory

	use the safer dwg_ref_object() more often

	protect from use-after-free realloced dwg->objects
	may not access ref->obj when dirty_refs.

2023-04-07  Reini Urban  <rurban@cpan.org>

	document the new r11 JUMP entity and EXTRAS section
	See also https://github.com/LibreDWG/libredwg/discussions/691

2023-04-06  Reini Urban  <rurban@cpan.org>

	free: skip TABLE/TABLECONTENTS.cells free (workaround)
	because it's 0x21, not a pointer. Someone is overwriting it,
	because it's shared with TABLECONTENT. use a subclass instead.

	--enable-debug only

2023-04-06  Reini Urban  <rurban@cpan.org>

	unit-testing classes cleanup

	fix dwg_add_HATCH overflow on HATCH.LWPOLYLINE path segs
	detected only with c++ fixes

	strrplc: more checks, truncation warning
	conversion from 'size_t' to 'const int', possible loss of data

	fix most C++ type strictness problems
	and improve jump_entity_section error handling.
	only in_dxf is missing

	encode: set dat->codepage

	encode: refactor encode_preR13_entities GH #689
	use from/to indices, not positions.
	dxfwrite ACEB10_r11.json works now again.

2023-04-05  Reini Urban  <rurban@cpan.org>

	injson: fix remaining r11 BLOCK,ENDBLK leaks
	we freed the wrong temp. entities

	injson: fix r11 section overflow
	we can read up to VX

	encode: support eed code 1 (the appid_index)

	injson: rename POLYLINE_2D.extra_r11 to _text
	else we get a type error.
	fix last entity reading (GH #679).
	support eed code 1 (the appid_index) for ACEB10_r11.

	injson: accept RSd HEADER

	r11 injson: forgot VPORT table

	r11 json: change r11_idx repr, fix color_r11 RCd in_json

	r11 handles: decode, encode, json
	json specialize r11 only two elems with signed r11_idx.
	encode/decode: signed -1 for unused r11_idx, use handleref.size, not the code

	injson: preR13 special cases

	codepages: handle dxf undefined as CP_UNDEFINED
	CP_DWG is gone

	minor codepage encode and dxf fixes
	esp. the DWGCODEPAGE dxf versions.
	accept r11 $DWGCODEPAGE undefined.

	README: disable-write and codepage updates
	also the 2 new optional libs

	API: enable reading preR13 dwg with --disable-write #688
	enable the add API with --disable-write, but skip some postR13 postprocessing
	from encode.

2023-04-04  Reini Urban  <rurban@cpan.org>

	alive.test: add more preR13 tests
	example_r13 and r1.4/entities are stable.
	r11/entities r10/entities r2.x/entities fail rw.

	FIXME: chibicc fails at bit_read_4BITS_tests

	-Winline eed_need_size
	gcc4 says: eed_need_size.isra.3: call is unlikely and code size would grow

	tcc found missing returns

	bits: add asian cp tests
	fix bits loglevels for warn/errors

	windows clang-cl can scanf %2hhX

	ctest: use wine

	bits: more msvc truncation fixes
	conversion from 'size_t' to 'const int', possible loss of data.
	bits_test segfaults with vs2019

	support bit_TV_to_utf8 without iconv
	TODO: asian codepages TV to utf-8,
	e.g. gh90-dxf_r14.log with "����1", ie. "<B2><BC><BE><D6>1"

	add our own codepage mappings
	iconv is way too instable.
	also fix the CP_JOHAB hole.

	wip iconv

	bits: add bit_u_expand
	convert all \U+XXXX sequences to UTF-8

	iconv: add codepages.c and helpers via iconv

	stabler bit_TV_to_utf8 conversion

	abstract codepage API, convert via iconv

	cmake+configure: add AM_ICONV probe from gcc
	also to cmake via FindIconv()

	add dxf_set_DWGCODEPAGE and enum Dwg_Codepage

	mingw: check less with mingw
	we dont want to wait 1hr for the artefact

	fix wrong header.section_info size allocation
	detected by c++ compilation tests

2023-04-03  Reini Urban  <rurban@cpan.org>

	dynapi: free old malloced values generally
	cppcheck was right about the leak

	indxf: free old strings in dwg_dynapi_header_set_value()
	there is a leak in dwg_dynapi_header_set_value() in in_dxf.c:1288

	indxf: fix DIMENSION_LINEAR.oblique_angle
	old name ext_line_rotation DXF 52

	indxf: fix dxf_read_rl: RL overflow
	esp. with colors, like C2FFFFFF

	indxf: fix dxfname leaks with dimensions

	indxf: fix AcDb*ViewStyle leaks
	of skipped pairs

	clang-format off for else_do_strict_subclass chains ...

	free: no dxfname leaks
	alloced on indxf or injson

	dxf: add SPLINE.fit_pts
	missing from scenario 1
	for dxf and free (e.g. added via indxf). not yet calculated.

	indxf: dont overwrite invalid dwg->header.from_version
	on indxf we only know the from_version, and still have an invalid header.version.

	indxf: fix dxfname leaks on errors

	indxf: fail on missing mandatory CONTROL object
	Fixes ossfuzz #44483

2023-04-01  Reini Urban  <rurban@cpan.org>

	examples: support mimalloc in api-only samples
	we need to use the very same malloc/free calls.
	Fixes dwg2svg2 free()

2023-04-01  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Identify address in SEQEND entity
	Address mean begin of sequence (polyline with vertexes or insert with
	attributes)

	Log degrees in RD

	Improve tests for handles

2023-03-31  Reini Urban  <rurban@cpan.org>

	decode: improve fuzzing overflow on auxheader crc calc
	Improve on 8651fa27dd2de731e706e2ba09f0d28e4e0dce33
	Fixes part 3 of GH #677

	bits: stabilize bit_utf8_to_TU for invalid strings
	Fixes both fuzzer bugs GH #681 poc0.bit_utf8_to_TU and poc1.bit_wcs2nlen
	hexhive: nice fuzzer!

	3dface: rename FACE3D to _3DFACE prefix

2023-03-31  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Add logging of 3dface invisible flag

2023-03-30  Reini Urban  <rurban@cpan.org>

	dxf_test: fix -Wformat-overflow
	value is always NULL

	my_stat: config has no include guard
	already included before in all cases.
	avoid duplicate inclusion

	in_json: support HEADER.layer_colors[128]
	Fixes GH #676

2023-03-30  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix CECOLOR JSON conversion in preR13

	Fix CECOLOR in JSON conversion for preR2

	Fix SNAPUNIT and GRIDUNIT in JSON conversion for preR2

2023-03-30  Reini Urban  <rurban@cpan.org>

	add UNKNOWN_BITS_REST
	for now used for the STYLE slack after bigfont_file.
	a "A" 4 after the empty bigfont.
	      "num_unknown_bits": 12,
	      "unknown_bits": "4104"
	See GH #322

	decode: fix DEBUG_HERE overflow

	bit_utf8_to_TU: implement cquoted option
	yet unused

2023-03-30  Reini Urban  <rurban@cpan.org>

	bits: fix size truncation warnings
	from msvc: '=': conversion from size_t to unsigned int, possible loss of data

	warn and truncate overlong strings.

2023-03-30  Reini Urban  <rurban@cpan.org>

	outdxf: fix SAB fuzzing sign-confusion
	1.: use unsigned length
	2.: fix wrong size check for case 9, long len.

	Fixes GH #677

2023-03-30  Reini Urban  <rurban@cpan.org>

	decode: fix fuzzing overflow with invalid auxheader_address
	Sanitize wrong auxheader_address or auxheader_size.
	Fixes part1 of GH #677

	encode: unused var in in_postprocess_SEQEND

	encode: fix ent->color.alpha
	add a BLx color.alpha_raw field, so that encode does not loose this information
	on decode

2023-03-28  Reini Urban  <rurban@cpan.org>

	header: remove unused STYLE.unknown

2023-03-26  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix table logging of is_removed flag

	Rewrite logging of removed viewport to common way

2023-03-24  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix DIMSTYLE DIMALTZ and DIMALTTZ for AC1012

	Fix header DIMALTZ and DIMALTTZ for AC1012

2023-03-23  Evgeny Sobolev  <esobolev321@gmail.com>

	indxf: Fix last entity for block

2023-03-23  Reini Urban  <rurban@cpan.org>

	json: assume DWG type for fuzzer input

2023-03-22  Reini Urban  <rurban@cpan.org>

	add JUMP unit-test
	PR #670

2023-03-21  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Identify JUMP entity

	Identify id for DWGCODEPAGE in DXF

	Remove duplicit codepage

2023-03-20  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix EED appid index variable in preR13

	Fix TILEMODE header variables in preR13

2023-03-18  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix EED layer for preR13
	This is RS not RC

2023-03-17  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix LEADER path_type and annot_type

	Fix indentation in LEADER logs

2023-03-16  Reini Urban  <rurban@cpan.org>

	spec: fix LEADER.hookline_on
	which apparently is bit 8 off in arrowhead_type.
	not spec'd in ODA, and differently implemented in their theiga dxf converter.
	Fixes GH #656

2023-03-13  Evgeny Sobolev  <esobolev321@gmail.com>

	Fix incorrect read w-coordinate for spline

2023-03-01  Reini Urban  <rurban@cpan.org>

	Dockerfile.centos7: merged centos7 to master

2023-03-01  gongxy  <83904580@qq.com>

	Optimization find_prev_entity,Accelerate DWG generation.

2023-03-01  Reini Urban  <rurban@cpan.org>

	avoid which, use POSIX

	centos7 has an incomplete endian.h

	centos7 has only automake 1.13.4

	Move Dockerfiles into build-aux
	to avoid copying all the test-data to the docker daemon

2023-03-01  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix tables in preR13

	Fix vx table in preR13

	Fix view table in preR13

2023-02-23  Reini Urban  <rurban@cpan.org>

	cmake: -DENABLE_LTO=Off
	for faster build times

	Support --enable-mimalloc

2023-02-22  Reini Urban  <rurban@cpan.org>

	minor clang-tidy issues

2023-02-20  Reini Urban  <rurban@cpan.org>

	actions: add vs2019-ninja
	a bit complicated, but a good documentation

2023-02-19  Reini Urban  <rurban@cpan.org>

	docs updates

	Merge branch 'smoke/VS2019'
	add Visual Studio 2019 Support

	CI: cmake msys and msvc error search

	msvc: fix unit-tests

2023-02-18  Reini Urban  <rurban@cpan.org>

	msvc: fix cmake packaging
	new dll name.
	enable tests when cross-compiling on linux

	msvc: out_json warnings

	fix VS2019 type cast
	see the VS2019 action:
	error C2440: type cast: cannot convert from BITCODE_TIMERLL to BITCODE_TIMERLL

2023-02-18  Reini Urban  <rurban@cpan.org>

	VS2019 specific fixes, __VA_ARGS__, __attribute__, suppress warnings
	* __VA_ARGS__ macro support
	* __attribute__ only with __GCC__
	* suppress C4101 uninitialized recount warnings, and strcpy insecure warnings.
	* no proper const var support
	  (with the even weirder error: cannot allocate an array of constant
	  size)
	* strict dllexport/dllimport decls: fix various omissions

	clang-cl can handle it, VS2019 errors. See the new VS2019 CI

2023-02-18  Reini Urban  <rurban@cpan.org>

	add msvc support
	now that I can cross-compile it on linux via clang-cl (cmake and ninja),
	and added a CI for VS2019 on Windows.
	via ucrt, so only newer Visual Studio's.
	See previous commits.

	Fix some wrong types along the way, clang-cl x86_64 finds much more
	deviating integer sizes.

	WIP

2023-02-18  Reini Urban  <rurban@cpan.org>

	add VS2019 CI

2023-02-17  Reini Urban  <rurban@cpan.org>

	tcc fixes
	wrong dwg_get_HEADER_utf8text (tcc has HAVE_NONNULL)

2023-02-15  Reini Urban  <rurban@cpan.org>

	add make clang-tidy target and probes
	Closes GH #645

	clang-tidy: fix some bits.c violations

2023-02-14  Reini Urban  <rurban@cpan.org>

	apply regen-shfmt

	add shfmt checks

	cvt_TIMEBLL: fix tm_hour and tm_mday GH #639

	unit-test: add cvt_TIMEBLL tests, catch GH #639

2023-02-14  gongxy  <83904580@qq.com>

	fix cvt_TIMEBLL Interpretation of date.ms

2023-02-13  Reini Urban  <rurban@cpan.org>

	Merge branch 'smoke/polyline_has_extra-gh548'

	regen-dynapi with new DWG_TABLE detection

	POLYLINE.extra_r11: variable size
	16 or 17

	polyline.layer with IN_EXTRA is really the offset
	GH #548.
	Log the offset

	spec: other r11 extra, use 2 RLLs instead
	they indeed do like some encoded links into the extra entity section,
	for the replaced curve_fit plines, sitting there.
	See GH #548

	spec: OPTS_R11_POLYLINE_HAS_EXTRA = 0x8000
	See GH #548
	HAS_EXTRA means that this entity is replaced by entity in extra entity section.

2023-02-12  Reini Urban  <rurban@cpan.org>

	README, NEWS Updates

	Merge branch 'smoke/preR13-tables'

	free: fix block_control.entries leak/double-free preR13
	We know the number of tables, but add_ may add some beforehand.

	free: fix auxheader.R11_HANDSEED leak

	decode_r11: remove dead code

	decode_r11: fail on critical section errors only
	we properly save/restore dat now.

2023-02-11  Reini Urban  <rurban@cpan.org>

	decode_r11: check crc

	decode_r11: setup and link control tables
	GH #538

	decode_r11: move blocks,extra_size calc earlier
	for logging only

	out_json: no MENUEXT
	as it cannot be imported.
	TODO: split on import or downgrade. GH #636

	header: rename r11 entity section names, fix r11 in_json
	as before: blocks and extras. extras seems to be similar to AcDs sections,
	additional entity data. (like calculated spline curve points)

	spec: add DWG_TABLE, fix dwg_decode_<TABLE> visibility
	the tables are non-static for r11 decoding, the DWG_OBJECT stays static

	decode: support for preR13 objects
	no handles, no eed too early.
	GH #538

	decode: move r11 tables to dwg.spec
	GH #538

2023-02-11  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Remove duplicit xline command

2023-02-09  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix aux header

2023-02-09  Reini Urban  <rurban@cpan.org>

	fix rw 2.10/entities
	dont endless loop on misread objects, invalid types

	decode: replace if-else chain with switch-case
	catch errors, simplier code

	improve dwg_sentinel a bit
	check out-of-bounds, use const

	fixup r11 sentinels

2023-02-09  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Report undefined data before tables

	Fix sentinels in preR13 tables

	Improve preR13 entity blocks encoding
	We have three blocks of entities.
	The change is simplifing decode_preR13_section() and improving
	decode_preR13_entities() to handle all things in entity section.
	Including sentinels in R11.

	Add r11 sentinels

	Rename sentinel from DWG_SENTINEL_R11_HEADER_END to DWG_SENTINEL_R11_ENTITIES_BEGIN

	Fix name of variable which mean number of sections which have entities

2023-02-09  Reini Urban  <rurban@cpan.org>

	decode r11: improve broken obj->size
	avoid an endless loop there.
	testcase: ./rw r2.10/entities

	more __nonnull checks
	from internal common.h

	is_valid_tag: re-add NULL check
	Fixes ossfuzz 55769

	regen-dynapi

2023-02-08  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix VX table

2023-02-08  Reini Urban  <rurban@cpan.org>

	unit-tests: fix 2 -Wredundant-decls for dwg_is_valid_tag

	NEWS: 2 more ossfuzz bugs fixed

2023-02-07  Reini Urban  <rurban@cpan.org>

	regen-dynapi

	cppcheck: uninitvar in mpolygon.c

	Update docs and Copyright years

	cppcheck: limit unit-testing define combinations

	cppcheck: suppress wrong preprocessorErrorDirective
	dwggrep.c:1970:0: error: failed to expand LOG_ERROR,
	Wrong number of parameters for macro LOG_ERROR. [preprocessorErrorDirective]

	cppcheck: one more memleakOnRealloc, in htmlwescape

	cppcheck: Fix dwgbmp.c Resource leak: fh [resourceLeak]

	cppcheck: suppress wrong memleak warning
	we copy just the pointer, not the string.

	cppcheck: suppress wrong double-free warning

	cppcheck: fix dxf_read_file memleak on error

	add cppcheck integration

2023-02-06  Reini Urban  <rurban@cpan.org>

	bits: fix cppcheck
	Common realloc mistake: str nulled but not freed upon failure [memleakOnRealloc]

	autoconf -Wsyntax warning

	dwg_api: fixup wrong EXPORTs

	mingw: upload src/dwg_api.i on failure
	and the config.h.
	Press Cancel Workflow on error, after the artefact upload, for faster finish.

	dwg_api.c: add missing EXPORT's
	harmless, but better than deviating from the header.
	fixup doxygen comments

	actions: make -j ...
	and don't run make check on tags

	bump LIBREDWG_SO_VERSION to 0:13:0
	for the changed add and r11 API

	spec: protect from wrong PROXY_OBJECT overflow errors
	on unaligned data. but we read whole bytes with TF

	dynapi: fix -Wdiscarded-qualifiers

	encode: fixup invalid tags
	accept them, just warn

	better integrate dwg_is_valid_tag

2023-02-05  Reini Urban  <rurban@cpan.org>

	dwgadd: -Wmaybe-uninitialized with older compilers

	importers: use dwg_is_valid_tag checks
	but no conversion, just ignore wrong tags.
	See GH #628

2023-02-05  Reini Urban  <rurban@cpan.org>

	api: add dwg_is_valid_tag checks
	for the add API. TODO encode and importers,
	but they need to upcase the lc letters

	See GH #628

2023-02-03  Reini Urban  <rurban@cpan.org>

	add: more r11 opts and flags, esp. POLYLINE/VERTEX
	but still encode is broken for these

	dwgadd: fix ATTDEF,ATTRIB tag to any string
	Fixes GH #628

	NEWS: Update fixed fuzzing bugs

	change versions: add R_2007a, remove unused
	checked against ODA.

	spec r11: add MENUEXT support
	Fixes GH #626

2023-02-02  Reini Urban  <rurban@cpan.org>

	decode: initialize sp from src
	this time -Wmaybe-uninitialized was correct. only caught with -O2

2023-02-02  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix dwgadd attdef and attrib parsing
	attdef and attrib prompt could be FMT_ANY
	attdef default value could be FMT_ANY

2023-02-02  Reini Urban  <rurban@cpan.org>

	decode_r11: initialize used
	typical wrong -Wmaybe-uninitialized

	dwgadd: version specific examples
	temp. created for each test

	dwgadd: fix scan_pts swallowing the last newline
	which lost the dimstyle init

	dwgadd: add MLINE support, leading to a new error
	added better diagnostics

	dwgadd: finish the trace logging

	dwgadd: fix angle stack-overflow
	convert to the right type.
	Closes GH #611

	dwgadd: fix scan_pts3d slack, and scan_faces

	dwgadd: fix viewport, add layout warning

	dwgadd: fix "text" parsing
	and add some logging. we need to parse until the next "
	Fixes GH #609

	dwgadd: add lwpolyline and polyline_pface
	broken: text, mline, layout

	dwgadd: support angles in degree
	See GH #611.
	Fixes GH #610
	Also see GH #609: wrong sscanf usage.

2023-02-02  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix extra flag
	It's after entity options
	-> Cleanup of color_r11

2023-02-01  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Add start_width and end_width to POLYLINE_3D entity

2023-02-01  Reini Urban  <rurban@cpan.org>

	dwgadd: support add_ATTRIB
	See GH #619

	spec: BLOCKGRIP comments only

	dwgadd: fix clang-format
	also our public headers

	dwgadd example fixups

2023-02-01  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Add dwgadd example for AutoCAD r1

	Fix dwgadd example
	attdef is entity which define attribute, must be before main attribute
	entity.

	Support attdef entity in dwgadd

	Export dwg_add_ATTDEF function
	attdef is regular entity, independent on other

2023-02-01  Reini Urban  <rurban@cpan.org>

	LOG_FLAG_R11 space

	regen-dynapi for POLYLINE_3D.extrusion

2023-02-01  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix POLYLINE_MESH curve_type

	Fix curve_type logging

	Fix polyline 2d curve_type

	Identify invis_flags in 3DFACE entity

	Fix line entity unknown
	Size of entity is variable
	In case with extrusion is 56+24

	Fix polyline 3d curve type

	Fix polyline_3d extrusion

	Fix UCS used

	Fix UCS table

	Fix preR13 VPORT table

	Use used variable from COMMON_TABLE_FLAGS

	Move R11 used to PREP_TABLE

	Fix vport table flag

2023-01-31  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	spec: Fix tag and prompt in r11 attdef entity

2023-01-31  Reini Urban  <rurban@cpan.org>

	decode: search for section_map_address
	Closes GH #617
	ODA fails with "Unexpected end of file", so failing looks ok.

	decode_r11: fix AUXHEADER decode_preR13_section_chk
	Fixes fuzzed GH #616. tbl overflow without bounds check

2023-01-30  Reini Urban  <rurban@cpan.org>

	fixup add API errors

2023-01-30  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix presence of ATTDEF entity

	Fix presence of some entities in preR13

	Fix encoding of block name in pre R_2_0b

	Fix LINE in pre R_2_4

	Sort code blocks by AutoCAD version

2023-01-30  Reini Urban  <rurban@cpan.org>

	spec: simplify to PRER13_SECTION_HDR()

	spec: move preR13_section_hdr() into header_variables_t11.spec
	massive simplification

	decode: fix decode_preR13_section
	according to header.num_sections.
	Fixes GH #591

	global HEADER.num_sections and sections
	num_sections for the allocated section[], sections read from the
	header.

	encode r11: header crc and sentinel only since r11

	decode: fail on wrong r2000 Classes header
	Fixes GH #615

	fix decode ubsan: align src or dst in bfr_read_32,64

2023-01-28  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix arc start and end angles
	We need to convert to radians

2023-01-26  Reini Urban  <rurban@cpan.org>

	log SPLINE flags, rename splineflags1 to splineflags

	rename Dwg_Section_Type_R13 to Dwg_Section_Type_r13
	section harmonization.
	triggered by GH #591, which I cannot repro.

2023-01-26  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Cleanup comments

2023-01-25  Reini Urban  <rurban@cpan.org>

	decode: fix overflows with fuzzed entities_start
	Fixes GH #594

	entities_start may be < 2
	objects may be size 0 and address < 2, leading to overflows

2023-01-25  Reini Urban  <rurban@cpan.org>

	logging: simplify block_offset_r11, RLx is good enough

	Update cirrus to freebsd-13-1

	decode: fix r11 blocks_start GH #589
	analog to blocks_end

	bump file codas and modifications

2023-01-25  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Identify PUCSNAME

	Identify UCSNAME in preR13
	This is index to UCS table

	Fix gen-dynapi.pl for debian sysinc
	Debian has includes in arch dependent directory too
	Closes PR #604

	Identify aspect ratio
	Closes PR #603

	Fix SKPOLY
	Closes PR #600

	Unify and rename unknown_unit1-4 header vars
	unify between preR13 and postR13
	PR #599, squashed

	Identify flag_3d in preR13 header
	It's same variable as flag_3d in VIEW table.
	Not saved to DXF

2023-01-25  Reini Urban  <rurban@cpan.org>

	endian: probe for htobe64, be64toh (unused)
	but only with <byteswap.h>

2023-01-24  Reini Urban  <rurban@cpan.org>

	spec: cleanup r11 BLOCK actions

	spec: fix some -Wformat (detected via macOS clang)
	some wrong types.

	move ATTRIBUTE_FORMAT from test_common.h to common.h
	we will need that for smaller logging

	fix ax_gcc_func_attribute.m4
	use -Werror

	spec: simplify r11 HANDSEED via endian macros
	also enable all other actions than decode

	cmake: endian support

	endian: enable all APPLE extensions for memmem
	the default from src/config.h _POSIX_C_SOURCE 200809L disables most.

	endian: define __XSI_VISIBLE 700 only on cygwin
	clashes with macOS for memmem, which does not work with _XOPEN_SOURCE 700

	endian: support macOS and mingw with be conversions

	endian: enable default endian macros
	need _DEFAULT_SOURCE for __USE_MISC

	endian: remove unneeded swaps

	fix WORDS_BIGENDIAN uncertainties
	on le, just pass through.
	mingw detected le but failed with unknown byte order

	WIP endian: more conversions

	WIP endian: swap the bits (1)
	TODO: some writers, handles

	WIP r2004 endian compat
	roughly based on GH #120.
	older glibc need _BSD_SOURCE for the byteswap macros, some
	_POSIX_SOURCE, newer _DEFAULT_SOURCE.

2023-01-23  Reini Urban  <rurban@cpan.org>

	fixup unknown_59 size, regen, fixup timezone
	timezone is a protected global on darwin

2023-01-22  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix handseed

2023-01-21  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix unit mode header variable

2023-01-21  Reini Urban  <rurban@cpan.org>

	strncpy for dynapi_test.c

	spec: check shorter AppInfo
	on some dwgs. which led to leaks.
	also fix a wrong static overflow check

	use more older test-data

	dist the 3 new r9 files

2023-01-21  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Add r9 test files

	Add unknown_r11 to VIEW table
	This variable is similar as in other tables for this version of DWG file

2023-01-20  Reini Urban  <rurban@cpan.org>

	r11: move entites/blocks_start/end to header
	rename block_addr to block_offset_r11, see GH #483.
	TODO: write the r11 block_entities.
	regen the dynapi.

	decode_r11: improve DIMENSION logging

	decode_r11: change DIMENSION_ANG3PT
	as proposed by Michal, GH #587

	more minor r11 dims: one dimstyle size error
	Fixes GH #582

	decode: minor 0x8000 harmonization

2023-01-19  Reini Urban  <rurban@cpan.org>

	r11 dimensions: more ANG3PT fields, more dimstyle
	Fixes GH #587

	decode_r11: fix block entities
	mask end

	log flags as hex, add more flag enums and logs
	undocumented LEADER.pathtype 2

	r11: add weird LINE.unknown_r11 GH #586
	On some lines only, not backed up by some flag or opts.
	The DXF misses those 2 numbers.
	E.g.
	start: (20.000000, 51.000000) [2RD 10]
	end: (20.000000, -51.000000) [2RD 11]
	unknown_r11: (-3.626858, 10.000000) [2RD 0]

2023-01-19  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix text_rotation in preR13

	Fix xline2end_pt in preR13

	Fix preR13 dimstyle

2023-01-18  Reini Urban  <rurban@cpan.org>

	silence the -Wformat-y2k warning in load_dwg.c

2023-01-18  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix DIMENSION_ORDINATE in preR13
	Removing of flag2 field

	Add clone_ins_pt to preR13

	Fix dimension entity

2023-01-18  Reini Urban  <rurban@cpan.org>

	fix dwg_sections_init: renamed, fuzzing GH 581
	On a mismatch between dwg->header.numheader_vars and dwg->version,
	a r11 tbl overflow could happen.
	Fixes GH #581

	add_test: TODO flaky dxf tests GH #572

	extend load_dwg to add/update a fingerprint

2023-01-16  Reini Urban  <rurban@cpan.org>

	re-add probe for attribute format(ms_printf)

	decode_r2007: fix decompression overflows
	mostly with fuzzing, GH #578.
	dst_size may be inexact, pass through the real decomp/data size

2023-01-16  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix logging of flags/opts in free

	Fix LOG_LEADER_PATHTYPE macro

	Fix log in free mode

2023-01-13  Reini Urban  <rurban@cpan.org>

	log: strip .DWG also

	regen-dynapi: block_addr, extra_r11 again

	fixup r11 EED for FREE and ENCODE

2023-01-13  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix color vs pspace

	Fix insert entity point in preR13

	Decode eed in preR13 entities

	Log open/close in eed

	Update decoding of eed to preR13

2023-01-12  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix table log of flag

	Fix error in free for BLOCK_HEADER

2023-01-12  Reini Urban  <rurban@cpan.org>

	GH actions: cancel outdated branch workflows

	encode r11: handle entities errors

	rewrite r11: check wrong dwg->cur_index

	alive.test: fix DISABLE_WRITE check

	xmlsuite: english wording

	r11: sync STYLE, fixes bigfont_file leak

2023-01-12  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix view table

	Fix layer table

	Fix style table

	Fix VIEWPORT entity id

	Improve block decoding

	Identify is_removed flag for tables

2023-01-08  Reini Urban  <rurban@cpan.org>

	xmlsuite: add ObjectName props

	xmlsuite: add MTEXT support

	xmlsuite: allow simple errors, fix double-free
	but still does not work properly again

2023-01-07  Reini Urban  <rurban@cpan.org>

	sync dwg.spec from decode_r11
	yet unused, GH #538

	rename AX_RESTRICT to AX_C_RESTRICT
	opposed to CC_RESTRICT.
	https://github.com/autoconf-archive/autoconf-archive/pull/271

	r11 VIEWPORT handling
	a bit more handles, see GH #435

	fix mingw -Wpointer-to-int-cast
	pointer arithmetic

	update ax_add_fortify_source to 3
	check -D_FORTIFY_SOURCE=3 first

	update to latest m4/ax_valgrind.m4
	alive.test already has valgrind support

	ax_pkg_swig.m4: reapply my mingw fix

2023-01-06  Reini Urban  <rurban@cpan.org>

	update most autoconf-archive m4's
	just not my extended m4/ax_compiler_flags_cflags.m4

	configure: replace deprecated $as_echo

2023-01-06  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Log LWPOLYLINE flag
	rurban: Fixed VERTEXIDCOUNT name

2023-01-05  Reini Urban  <rurban@cpan.org>

	init_sections: another bounds-check error
	ossfuzz 54237

	use spec.h table flags for r11 also

	Log table flags
	Replaces PR #562

	decode_r11: fix wrong HAS_ELEVATION filter
	for r10 LINE, POINT, 3DFACE: also catch deleted entities.
	Fixes GH #558

	out_dxf: skip deleted entities explicitly
	as documented. but still does not work.
	the LINE in the BLOCK is missing, and the INSERT

	preR13: log and document deleted entities
	when type > 127. we rather keep them. processors (like viewers or converters)
	must filter them out by themselves.

	add r10/tmp_line test-data
	by Michal. See GH #558

	add r2.10/block test-data
	by Michal. See GH #483

2023-01-05  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Identify text extrusion

	Log attrib entity flags
	rurban: kept comments

2023-01-05  Reini Urban  <rurban@cpan.org>

	Really fix blocks_end
	a zero and a size of 0x40000000 denotes an empty BLOCK section

2023-01-05  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix blocks_end

2023-01-05  Reini Urban  <rurban@cpan.org>

	.gitignore: .ccls-cache
	some emacs thing

	fixup block flags, use the old names
	even if is_ref_ref and is_xref_dep are mixed up in the old code.
	they should be exchanged later

2023-01-05  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Log block flag

2023-01-04  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Identify block options and log them

	Fix block entity in preR13

	Add PRESET flag for attdef entity

2023-01-04  Reini Urban  <rurban@cpan.org>

	r11: less table offsets
	the one missing byte in several tables

	decode_r11: change wrong curve_fit POLYLINE_2D to VERTEX_2D
	an extra vertex created via pedit L F, but with wrong type.
	Fixes GH #548

	xmlsuite: robust check.py
	only take test-data/r* or numeric dirs

	configure: fix libxml-2.0 probe

2023-01-04  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix LOG_FLAG_R11_MAX
	rurban: with adjustments. bitmasks need the sum, not the last

	Log attdef entity flags

	preR13: Fix 3DFACE spec

	Name some dimension options

	Log 3DLINE opts

	Fix align of logging

2023-01-04  Reini Urban  <rurban@cpan.org>

	more FLAG_R11_DIMENSION flags
	see acad_r12_dxf.pdf

	log more VERTEX flags
	keep the existing names, unlike PR #550

	more flags, and some simplifications
	those flags do have the same fieldname. only the prefix may vary for subclasses.

2023-01-03  Reini Urban  <rurban@cpan.org>

	programs: adjust --help and .1 for saveas version
	via regen-man

	classes: require dwg.h

	bash build-aux/clang-format-all.sh src programs examples test
	and add some more fixups

	decode: Better Invalid class size warning

	cleanup unused r11 opts and flags
	and warn if an unused appears

2023-01-03  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix bigfont_file in style table

2023-01-03  Reini Urban  <rurban@cpan.org>

	decode_r11: fail on invalid numsections
	Fixes ossfuzz 50191

	preR13 POLYLINE_MESH fixup
	new opts and DXF

2023-01-03  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix polyline mesh entity for preR13
	rurban: but still 4 byte too many (TEMP.DWG_from_autocad_r10_r10.log)

	Add extrusion to polyline entity

	Add extrusion to line entity

	Add extrusion to insert entity

2023-01-03  Reini Urban  <rurban@cpan.org>

	add HORIZ_ALIGNMENT flags and logging

	more LOG_TEXT_GENERATION and LOG_VERT_ALIGNMENT
	for all versions

2023-01-03  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Rewrite logging of R11 flags to HAS_ prefix

	Log vertical alignment
	rurban: with additions

	Log polyline flag
	rurban: with changes

	Add logging of vertex flag
	rurban: formatting, r11 types, %d

	Add logging for text generation
	rurban: minor changes

	Add pretty print of entity options
	rurban: Changed and simplified to R11 types

	Name unknown flag

2023-01-03  Reini Urban  <rurban@cpan.org>

	add_test: print dwg/dxf_read error code on fail

2023-01-02  Reini Urban  <rurban@cpan.org>

	indxf: sync with dwg_set_dataflags
	wrong dxf logic

	add dwg_log_dataflags and dwg_set_dataflags
	set the r2000 TEXT.dataflags when up-converting

	add dwg_log_proxyflag GH #469

	r11: fix POLYLINE_2D.flag
	Fixes GH #542

2023-01-01  Reini Urban  <rurban@cpan.org>

	decode_r11: fix ossfuzz 47189
	entities_end overflow

	injson: fix ossfuzz 47352
	skip empty entities

2022-12-31  Reini Urban  <rurban@cpan.org>

	fix dwg_bmp GH #539
	fix the dat.size
	allow huge max_decomp_size with r2004 (eg. material.dwg, Theigha bug?)

	decode: skip dwg_bmp early
	when header.thumbnail_address is 0, but there is
	still an empty thumbnail sentinel block.
	eg 2000/Multileader.dwg

	calc TDCREATE from TDUCREATE
	from the timezone offset. Fixes part of GH #394.
	I've looked at the DXF values, and there the TDUCREATE value
	matches the dwg, not TDCREATE.

2022-12-30  Reini Urban  <rurban@cpan.org>

	fix make codecov for out-of-tree configures

	decode: fix ossfuzz 54163 overflow
	when reading handles (e.g. an obj->size MS) from wrong address

	decode_r11: fix ossfuzz 49721 overflow
	when reading the UCS section hdr

	r11: DIMENSION opts flags, and 3d pts
	Closes GH #468

2022-12-29  Reini Urban  <rurban@cpan.org>

	r11: 3d DIM points since r10 only
	when the FLAG_R11_ELEVATION is missing

	decode_r11: better DIMENSION_RADIUS
	honor ELEVATION flag for 3D points

	spec: DIMENSION.flag 70
	no flag1, the DXF is the same as the DWG flag preR13

2022-12-28  Reini Urban  <rurban@cpan.org>

	spec: changed r11 DIMENSION spec
	GH #468
	refactor decode_preR13_DIMENSION

2022-12-27  Reini Urban  <rurban@cpan.org>

	replace missing R_13 checks with R_13b1

2022-12-26  Reini Urban  <rurban@cpan.org>

	spec: cleanup unused HEADER vars, regen-dynapi

	r11 UCS: the last byte is extra
	it does not belong to the UCS hdr

	spec: change HEADER USERI1-5 to signed

	r11: remaining unknown HEADER vars
	for proper roundtrips.

	add: more r11 header defaults

2022-12-25  Reini Urban  <rurban@cpan.org>

	fix preR13-dims flag_r11 logic
	Fixes GH #468. To be tested with rw -r2.6 and add.

	r11: write back HANDSEED

	r11 add HEADER.VPOINT(X,Y,Z)(ALT)
	the main and alternative VIEW directions

2022-12-20  Reini Urban  <rurban@cpan.org>

	examples: allow examples/dwgadd_test.sh invocation

	macOS diff -1 deprecation
	diff -bu1 interpretated as -b -u -1
	-u number is deprecated, use -U
	See GH #541

2022-12-19  Reini Urban  <rurban@cpan.org>

	add dwg_init_sections, default_numheader_vars
	it was too ugly. and wrong. Fixes GH #540

2022-12-17  Reini Urban  <rurban@cpan.org>

	fixup encode: grow header.sections on dwgadd
	-Wsign-compare

2022-12-16  Reini Urban  <rurban@cpan.org>

	encode: grow header.sections on dwgadd
	on r2004 with the MEASUREMENT section.

	encode for r2004 is not supported yet, but we can run into this
	heap overflow. Not explicitly forbidden yet, we just print a Warning.

2022-12-16  Reini Urban  <rurban@cpan.org>

	replace all R_13 checks with R_13b1
	preR13 goes PRE R_13b1 (AC1010)
	fix 3DFACE spec for R13b1 - R_13: VERSIONS (R_10, R_13) was wrong

2022-12-15  Reini Urban  <rurban@cpan.org>

	preR13: better wrong dat->chain free fix
	restore the proper dat on fatal error.
	Fixes GH #486

	decode: protect illegal object_end
	and underflowing header_vars.size.
	Also oss-fuzz 54163

	decode: Fixup illegal Header Length
	the extra RL after the header sentinel might be wrong.
	Fixes heap overflow in oss-fuzz 54163

	bits: fix dat->byte mult overflow
	e.g. with oss-fuzz 54163

	spec: start syncing dwg.spec preR13 tables with decode_r11
	GH #538

2022-12-15  Reini Urban  <rurban@cpan.org>

	preR13: fix wrong dat->chain free with preR13 tables
	and wrong data, leading to an early return. FIELD_VECTOR_INL
	behaves better, but see GH #538.

	But LTYPE only table with bit_reset_chain() because of some
	tbl->size logic later, so we are safe for now.

2022-12-15  Reini Urban  <rurban@cpan.org>

	dynapi: simplify TV strings

2022-12-15  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix DWG versions
	AC1.3 probably doesn't exist. After this patch version line is full

	Fix AutoCAD releases
	Releases based on
	https://autodesk.blogs.com/between_the_lines/autocad-release-history.html

	Fix DWG version in header

	Support MC0.0 DWG file
	Set dwg_version to 1 as first version of DWG file.

2022-12-14  Reini Urban  <rurban@cpan.org>

	dynapi: protect fixed TFv strings
	eg. from fuzzed illegal input.
	Fixes oss-fuzz #49928

	indxf: enforce dxf_fixup_header for missing $ACADVER
	HEADER is optional, so enforce some version. Needed for string conversions.
	R_INVALID is invalid

2022-12-14  Reini Urban  <rurban@cpan.org>

	dxf: fix EED 1004 with empty value
	need to print the GROUP 1004, even with empty value.
	Fixes GH #536

	DXFB has a better logic: do{} while, and is not affected.

2022-12-14  Reini Urban  <rurban@cpan.org>

	dxf: NOD must be the first OBJECTS item
	not just the first DICTIONARY.
	Fixes part 1 of GH #536

	json: fix LTYPE.dashes_r11 size
	fixed size 12 for json also.
	Fixes oss-fuzz #53617

	json: fix json_cquote for illegal (fuzzed) strings
	Fixes part of oss-fuzz #53617

	decode: fix assert with fuzzed illegal HEADER
	No Section Locator Records at 0x15
	Fixes oss-fuzz #47319

	decode: route AC1010 and AC1011 to r13, not preR13
	but I dont have any proper samples from those.
	only fuzzing DWG's

2022-12-13  Reini Urban  <rurban@cpan.org>

	decode: fix -v4 GH #368 asan crash
	invalid alloced result in FIELD_HANDLE

	add make log-dwg target
	individual log files, not a big check-dwg.log

	decode_r11: fix reading empty tables
	and r11 blocks (without 32byte sentinel)

	add: set HEADER.numsections
	otherwise we overflow with r11 in header_vars.
	logic from decode_r11

	dwgadd: disable --verify without -o DWG
	because we cannot read back in from stdout

	add: set HEADER.numheader_vars

	free: fix r1.4 leaks of deleted entities

	encode: name harmonization

	add: fixup HEADER.numentities
	via the dwg_add API

2022-12-12  Reini Urban  <rurban@cpan.org>

	dwgadd: bypass asan leak test for r1.4

	encode: fix preR13 entity size
	add crc

	encode preR13: no duplicate flag_r11 and size

	dwgadd: fixup FMT_ANY quirks, final "
	FMT_ANY %NNNs parses to the next whitespace, keeping the last "

	add: fix preR13 DIMENSION flags and types

	add: revert Michals R11 type adds
	only defined valid R11 types. set them manually

	add API: preR13 fixups flag_r11 and opts_r11

	encode preR13: more unhandled _R11 types
	Michals r11 type fixes changed our type handling, and set it to _R11.
	Fix it up for dwgadd

	decode: fix double-free of XRECORD.objid_handles
	silly code.
	Fixes GH #518

	encode preR13: fixup size
	if empty (e.g. dwgadd)

2022-12-12  Reini Urban  <rurban@cpan.org>

	encode: fix writing r13,r14 bitsize
	The position os different from r2000, but we can handle it
	here at the same place, because we patch it at bitsize_pos when missing.

	Fixes GH #531

2022-12-12  Reini Urban  <rurban@cpan.org>

	dwgadd: LOG_INFO

	dwgadd: fix -v options for --verify

	dwgad: enable r14,r13 tests without XRECORD
	DICTIONARY.ownerhandle still wrong

	spec: fix DICTIONARYWDFLT.cloning
	and remove cloning_r14

	dwg_add: fix add_DICTIONARY for the NOD

	configure: move DEBUG_CLASSES into config.h
	and use it to test dwgadd (#530)

2022-12-12  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix writing of 1.4 release DWG files
	We are setting entity type for proper version and <R11 has different
	types.

	Fix going over all objects.

2022-12-12  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix writing of 1.4 release DWG files
	We are setting entity type for proper version and <R11 has different
	types.

	Fix going over all objects.

2022-12-11  Reini Urban  <rurban@cpan.org>

	unit-tests: fix load field

2022-12-11  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix parsing of AutoCAD 1.4 entities
	num is index of actual object

	Fixing GH#471

2022-12-09  Reini Urban  <rurban@cpan.org>

	dwgadd: cleanup old code, fix retval
	Fixes GH #388 when only one object was added.

	dwgadd: check dwg_add_dat retval
	if it failed to add any object.
	e.g. r11 fails to add one point (GH #388)

	dwgadd: fix dwg leaks
	when add fails harmlessly, eg. r11 with one point

2022-12-08  Reini Urban  <rurban@cpan.org>

	dwgadd: enable more tests
	just the XRECORD double-free not.
	r11 errors on verify with 0x100, but not fatally

	dwgadd: adjust tests

	encode: fix writing incomplete tables (preR13)
	eg. as created by dwgadd <r13

	encode: fix missing HEADER.section[]

	bits: analog to TRACE_DD, fix CHK_OVERFLOW
	now count to the bits. r13,r14 create wrong common obj/ent handles
	which cause these overflows

	dwgadd: fix valgrind warnings
	dependent on uninitialized variable

2022-12-08  Reini Urban  <rurban@cpan.org>

	fix ACSH_init_evalgraph evalexpr leak
	The evalexpr handles are initialized as global, i.e.
	created in the object_refs[] vector.
	Se we can safely free it here.

	Fixes GH #529

2022-12-08  Reini Urban  <rurban@cpan.org>

	free: fix header_vars.unknown_text1 leak
	with dwgadd, resp. dwg_add_Document()

	fix the FIELD_DD overflows again
	this time count to the bits. See GH #505

	dwgadd: fix dat leaks

	dwgadd: add more tests
	and check the verify return value.
	GH #388

	dwgadd: fix dat->size overflows
	kept old dwgadd file size, did not set the new dwg file size.
	GH #388

2022-12-06  Reini Urban  <rurban@cpan.org>

	more fuzzing
	improve fuzzer documentation.
	run oss-fuzz on some push also

2022-12-05  Reini Urban  <rurban@cpan.org>

	dwgadd: use sscanf_s
	Closes GH #388

	dwgadd: forbid >r11 entities with <=r11

	gh: use latest actions
	for node16, node 12 deprecated in summer 2023

	dwgadd: add tests

	dwgadd: set loglevel, parse only once WIP

	dwgadd: support -a VERSION

	regen-man, adjust dwgadd.1

	dwgadd: support empty -o outfile
	write to stdout then.
	change --verbose from -v1 to -v3.

2022-12-01  Dmitry Sinyavin  <s0me0ne@s0me0ne.com>

	Various fixes to dwgadd GH #388
	CLA done

2022-12-01  Reini Urban  <rurban@cpan.org>

	Update NEWS, AUTHORS. prep 0.13 release

	bump appveyor tags

	unit-test: fix r11 leaks on errors
	as r11 samples still fail.
	r11 missing sections or section errors now return DWG_ERR_SECTIONNOTFOUND.

2022-12-01  Reini Urban  <rurban@cpan.org>

	decode_r11: protect from fatal r11 section errors
	Fixes GH #493

	with illegal (fuzzed) input

2022-11-30  Reini Urban  <rurban@cpan.org>

	decode_r11: fix NULL deref with fuzzed block names
	Fixes GH #528

2022-11-29  Reini Urban  <rurban@cpan.org>

	cmake: fix install
	missing public headers, missing programs executables

	decode_r11: fix post HEADER overflow
	fixes ossfuzz: 53750

	missing dat chain overflow GH #505
	rework PR 508: catch overflows when reading from it, not when
	merely advancing. One such case is TRACE_DD, which must be fixed there.

2022-11-23  Reini Urban  <rurban@cpan.org>

	dwglayers: skip empty layer handles
	Fixes GH #519, fuzzed invalid input

	decode_r11: failing dwg_get_first_object TABLE_CONTROL
	Fixed GH #524.

	decode_r11: implement PRE_TABLE(UCS)
	dwg_add_UCS accepts now a NULL origin, as needed by r11.

	decode_r11: better numsections calc.
	to avoid section[] overflows.

2022-11-20  David Korczynski  <david@adalogics.com>

	gh: add CIFuzz integration

2022-11-20  luz paz  <luzpaz@pm.me>

	Fix typos
	Found via `codespell -q 3 -S ./.git,ChangeLog,./NEWS -L 2rd,aadd,addd,aded,afe,ba,baed,beed,childs,daa,ded,ede,fo,gir,gost,nam,noo,oce,ro,siz,tekst,ue,uptodate`

2022-11-18  Reini Urban  <rurban@cpan.org>

	decode: fix fuzzing type confusion
	leading to arbitrary pointer reads.
	set the obj->type to UNKNOWN_* on unknown class, as the
	further type switches act on this type. eg out_json.
	Fixes oss-fuzzer #53468

2022-11-17  Reini Urban  <rurban@cpan.org>

	fix bit_advance_position buffer overflow error
	we may advance to the end of the stream.

2022-11-15  Reini Urban  <rurban@cpan.org>

	dynapi: regen tests without LAYER.flag
	broken with commit seperate LAYER.flag0

2022-11-14  Reini Urban  <rurban@cpan.org>

	dwg_decode_add_object comment only

	indxf: assign missing handles for tables
	for minimal DXF, GH #474.
	No entities yet, and still WIP.
	Also default to R12 as from_version.

	indxf: resolve table refs earlier
	when we start reading ENTITIES, after the tables.
	Fixes a part of GH #474, now only special table entries are missing.
	(e.g. LTYPE.CONTINUOUS)

	indxf: fix Invalid VPORT_CONTROL field objid ERROR
	we can set this object field directly, dynapi cannot.
	One part of GH #474

	cmake library DESTINATION #333
	add missing library DESTINATION also.
	thanks @j3pic

2022-10-16  Reini Urban  <rurban@cpan.org>

	api: seperate LAYER.flag0 from flag 70
	they are completely different bits.
	See GH #510.

	fix LAYER.plotflag calculation
	Fixes GH #509, thanks to @zamtmn (zcad)

2022-09-05  Reini Urban  <rurban@cpan.org>

	GitHub Workflows security hardening
	https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

2022-08-15  Reini Urban  <rurban@cpan.org>

	cirrus: FreeBSD 13 update to python39

2022-07-31  luz paz  <luzpaz@pm.me>

	Fix various typos
	Found via `codespell -q 3 -S ChangeLog,./NEWS -L 2rd,aadd,addd,aded,ba,childs,daa,ded,fo,gir,gost,noo,oce,ro,siz,tekst,ue`

2022-07-30  Reini Urban  <rurban@cpan.org>

	Revert "Fixes Stack-buffer-overflow in dynapi_set_helper"
	This reverts commit 4e3f073be2453148af5f4da4d5d22ce9e6c2f7a5.
	Testing if this fixes mingw.

2022-07-29  Reini Urban  <rurban@cpan.org>

	fixup Fixes Heap-buffer-overflow in dwg_decode_MINSERT_private
	invalid bit_advance_position fix.
	we need to advance it, even when out-of-bounds

	fixup decode_r2007 off-by-one
	commit fe03c5a89cbd441b6840335bd484cf08bc65c7c4 only set the size for one case,
	but we had three. Fix the real problem, the dest overflow check.

	unit-testing: enable preR13 DWGs

	preR13: fix --disable-write
	cannot decode_r11 without dwg_add_*
	Fixes GH #498

2022-07-29  Aleks L  <93376818+sashashura@users.noreply.github.com>

	Fixes Stack-buffer-overflow in decompress_rNUMBER
	https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=44432

	`sizeof (r2007_file_header) + 1` is passed in `read_file_header` which leads to off by one write buffer overflow.

2022-07-29  Aleks L  <93376818+sashashura@users.noreply.github.com>

	Fixes Heap-buffer-overflow in dwg_decode_MINSERT_private
	https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=31741 and
	https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=31591

	The out of bounds read happens in `TRACE_DD` macro at `dat->chain[dat->byte]` because of corrupted `dat->byte`: `dat->byte` equals to `dat->size`.
	The corruption happens before in `bit_advance_position`. When `advance == 2`, `dat->size == 2`, `dat->byte == 1`, `dat->bit == 6` it calculates `pos == 14` and `endpos == 16`.
	Then it passes the overflow check: `if (pos + advance > endpos)` and after
	```cpp
	  dat->byte += (bits >> 3);
	  dat->bit = bits & 7;
	```
	`dat->byte` becomes 2.

2022-07-29  Aleks L  <93376818+sashashura@users.noreply.github.com>

	Fixes Segv on unknown address in dwg_free_summaryinfo
	https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33059

	`dwg.summaryinfo.props[0].value` in `dwg_free_summaryinfo` is uninitialized pointer. It happens when `dwg_read_dxf` fails and partially initialized summary info object is created.

2022-07-28  Reini Urban  <rurban@cpan.org>

	api: fix dwg_dynapi_handle_name 3rd arg
	esp. needed for the unit-tests

	decode: set dirty_refs in dwg_decode_add_object_ref
	See GH #495

	preR13: fixup the new unknowns for r11 and r2.*
	regen-dynapi

2022-07-28  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix POLYLINE detection in preR13

	Fix VERTEX detection in preR13

	Fix r11_unknown on multiple tables

	Fix VIEW table for preR_10

2022-07-28  Reini Urban  <rurban@cpan.org>

	SKIP and TODO failing r11 tests for now
	but start smoking them.

2022-07-28  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix layer linetype index in preR13

	Fix STYLE for text entity

	Fix style in ATTRIB entity

	Fix style in ATTDEF entity

2022-07-28  Reini Urban  <rurban@cpan.org>

	preR13: set control object handles continuation
	otherwise the entries handles would start at 0 again

	encode r11: check table types
	errors cuased by wrong ctrl->entries handles/indices

	injson: r13 -> r13b1

	free: fix double-free of DIMSTYLE.DIMTXSTY
	esp. preR13, which has no handle.is_global

	preR13: en/decode the 5 new r10-r11 table headers
	which are embedded in the header section.
	also add the CONTROL objects with add_Document.
	header.numsections is wrong. should be header.numoldtables or such.

	encode r11: trace tables

	encode r11: write crc16 and r11_sentinel

	dwgrewrite: improve usage, allow more versions

	dwgrewrite: fix dwg_variable_dict dirty static var_dict
	!var_dict is not enough to check for a valid ref.
	Fixes invalid var_dict->obj

	WIP dynapi: TFv exceptions
	the reader needs large enough buffers

2022-07-28  Reini Urban  <rurban@cpan.org>

	improve dwg_ref_tblname return status
	if a fresh allocated or static string.
	Fixes dwgrewrite and dwggrep heap-use-after-free crashes,
	but not yet the dwg_find_dicthandle crash with LIGHT.

	make regen-dynapi

2022-07-28  Reini Urban  <rurban@cpan.org>

	rename FLAG_R11_HAS_ATTRIBUTES => FLAG_R11_HAS_ATTRIBS
	for consistency

2022-07-28  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Identify has_attributes flag

	Use of R11FLAG with named constant

2022-07-28  Reini Urban  <rurban@cpan.org>

	json: avoid heap-buffer-overflow for fixed json strings
	TFv, TFF and such. Luckily only for preR13 strings

	preR13: convert CONTROL objects back to tables
	on encode. flags not, but they look fixed

	UNKNOWN_UNTIL reading only with decode

	add r2.6 dim dwgs by Michal

2022-07-28  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix preR13 shape entity

	Fix linetype

2022-07-28  Reini Urban  <rurban@cpan.org>

	decode: improve CLASS logging
	LOG_POS always added a \n. but do that dependent on the trace level.

	decode: trace object vector REALLOCs

	improve decode EED logging
	LOG_POS add a \n, avoid duplicate \n

	free: fix one-byte leaks
	with empty TU handle names

	preR13: fix ref->obj crashes
	resolve_objectrefs when dirty.
	fixes the dwg2dxf crashes.

	preR13: more SHAPE fields (untested)

2022-07-28  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix shape entity handle

2022-07-28  Reini Urban  <rurban@cpan.org>

	preR13: log the flag_r11 bits

	r11: pspace and viewports
	but viewports not fully yet

	dwgrewrite beauty

	add preR13 handle support
	if the HANDLING header_var is set (ie some opts_r11 flag),
	we have special r11 handles.
	extend VALUE_H for this.

	preR13: more work on dimension opts

	preR13: abstract and use UNKNOWN_UNTIL(pos)
	for the unknown ranges, esp. in the header_vars_r11

2022-07-28  Reini Urban  <rurban@cpan.org>

	preR13: fix ltype sizes
	r11: 2
	before: 1

	also linewt is shorter pre-R11

2022-07-28  Reini Urban  <rurban@cpan.org>

	decode: fix revised dwg->object realloc strategy
	we have now a global dwg->num_alloced_objects.
	fixes heap-buffer-overflow with preR13

	preR13: common_entity_data.spec
	and harmonize ent to _ent fields.

	preR13: fix DIMENSION type switch
	and improve the fields a bit

	preR13: handling_r11, dwg->block_control, POLYLINE types
	support 2 more POLYLINE types.
	breaks the r11 tests now

	preR13: fix POLYLINE_PFACE

2022-07-28  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	preR13: Fix entities and block entities decoding
	PR #452

2022-07-28  Reini Urban  <rurban@cpan.org>

	r11: log unknowns

2022-07-28  Aleks L  <93376818+sashashura@users.noreply.github.com>

	Fixes Heap-use-after-free in dwg_free_TABLEGEOMETRY_private
	https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=46847

	The title is somewhat misleading, because it is a read out of bounds, but the memory out of the bounds is previously allocated and then freed, so it says use after free.
	In `add_TABLEGEOMETRY_Cell` function when `o->num_cells` equals to zero, the call to calloc doesn't return NULL because of https://linux.die.net/man/3/calloc#:~:text=If%20nmemb%20or%20size%20is%200%2C%20then%20calloc()%20returns%20either%20NULL%2C%20or%20a%20unique%20pointer%20value%20that%20can%20later%20be%20successfully%20passed%20to%20free().
	So it passes the check
	```cpp
	  if (!o->cells)
	    {
	      o->num_cells = 0;
	      return NULL;
	    }
	```
	Next it goes to `switch (pair->code)` which is 10. So it fails the `CHECK` because `i == -1` and return NULL, however the `o->cells` has the the address from zeor size calloc call.
	```cpp
	#define CHK_cells                                                             \
	  if (i < 0 || i >= (int)num_cells || !o->cells)                              \
	    return NULL;                                                              \
	```
	Later in `dwg_free_TABLEGEOMETRY_private` an offset of `tablegeometry` is added to the address in `o->cells` so it reasult in heap read overflow.

2022-07-28  Aleks L  <93376818+sashashura@users.noreply.github.com>

	Fixes Stack-buffer-overflow in dynapi_set_helper
	https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=46918

	`dwg_dynapi_header_set_value` in `json_HEADER` is called with a pointer to long:
	```cpp
	          long num = json_long (dat, tokens);
	          LOG_TRACE ("%s: %ld [%s]\n", key, num, f->type)
	          dwg_dynapi_header_set_value (dwg, key, &num, 0);
	```
	However the `f->size` is 255 which leads to stack overlow in `dynapi_set_helper` when `memcpy (old, value, f->size)` is called.

2022-06-27  luz paz  <luzpaz@pm.me>

	Fix various typos
	Found via `codespell -q 3 -S ChangeLog -L 2rd,ba,childs,daa,ded,fo,oce,ro,siz`

2022-06-26  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Add case with --disable-write
	There is issue with build actually in this special case.

2022-05-16  Reini Urban  <rurban@cpan.org>

	make distcheck: package the new files

2022-05-14  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Add test files for R11

2022-05-09  Reini Urban  <rurban@cpan.org>

	codeql: yaml syntax fixes
	paths must be in an extra codeql-config.yml file,
	as argument to init@v1

2022-05-08  Reini Urban  <rurban@cpan.org>

	json: support RSd, eg for TABLE.used fields
	and skip duplicates

2022-05-08  Reini Urban  <rurban@cpan.org>

	codeql UB: pointer overflow check
	When checking for integer overflow, you may often write tests like p + i <
	p.  This works fine if p and i are unsigned integers, since any overflow in
	the addition will cause the value to simply "wrap around." However, using
	this pattern when p is a pointer is problematic because pointer overflow has
	undefined behavior according to the C and C++ standards.  If the addition
	overflows and has an undefined result, the comparison will likewise be
	undefined; it may produce an unintended result, or may be deleted entirely
	by an optimizing compiler.

	fixes codeql #51, #52

2022-05-08  Reini Urban  <rurban@cpan.org>

	codeql: integer-multiplication-cast-to-long
	Multiplication result converted to larger type with possible arithmetic
	overflow. codeql #2, #3, #5

2022-05-08  Reini Urban  <rurban@cpan.org>

	CodeQL #53, compare long with narrow
	Comparison of narrow type with wide type in loop condition

	In a loop condition, comparison of a value of a narrow type with a value of
	a wide type may result in unexpected behavior if the wider value is
	sufficiently large (or small).  This is because the narrower value may
	overflow.  This can lead to an infinite loop.

2022-05-08  Reini Urban  <rurban@cpan.org>

	extend CodeQL #65, decode int overflow
	Extend aca2aead798c300f4fa40a7a85c49564a6408c82

	preR13: fix TEXT.common.ltype leak and exports

	dwg_api: fix preR13 vertex iterators

	fixed preR13 types dwg2ps
	and the old object check was also wrong.

	r11: change dashes_r11 to static [12] inlined

2022-05-07  Reini Urban  <rurban@cpan.org>

	r11: fix LTYPE dashes and STYLE

2022-05-06  Reini Urban  <rurban@cpan.org>

	security: no alloca in a loop
	CodeQL #50. looped num_eed or num_classes times for
	all strings. rather recycle the temp. stack buffer.

	get rid of alloca at all.

2022-05-06  Reini Urban  <rurban@cpan.org>

	Merge branch 'smoke/preR13-iterators'
	GH #453

	Create interim _CONTROL objects, holding the tables.  best as r2004 arrays,
	not as r2000 doubly-linked lists.  this would allow the old iteration via
	model_space -> block_control -> entities, as before.  e.g.  for dxf in/out,
	and all the helpers.
	There are still minor leaks to be fixed, and DXF to be tested.

2022-05-06  Reini Urban  <rurban@cpan.org>

	load_dwg: preR13 fixes with wrong types

	injson: more leaks

	preR13: allow dxfwrite memory leaks
	for now. GH #466

	preR13: harmonize color_r11 into color CMC
	and fix injson warning: gnore wrong index i, expected i-2

	clean: extend make clean to new tests
	make distcheck failed with distcleancheck

2022-05-05  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix R11 header sentinel
	There are multiple R11 header variants (204 and 205 header variables)

2022-05-05  Reini Urban  <rurban@cpan.org>

	injson: fix 2dpoint import
	into 3dpoints

	json: fix r2-r11 json for INSERT

2022-05-05  Reini Urban  <rurban@cpan.org>

	injson: don't Change wrong type to fixedtype
	for old preR13 dwg's.

	alive.test: abstract clean() function

2022-05-05  Reini Urban  <rurban@cpan.org>

	preR13: fix heap-over-flow with fixed TF strings
	strdup of such a TF shortens it, and runs into a heap-over-flow
	on bit_write_TF.

	r11: fix outdxf ENDBLK leaks

	r11: add crc16 and DWG_SENTINEL_R11_HEADER_END check
	Revises PR #458

	r11: read table crc16
	revises previous commit

2022-05-05  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix trailing bytes for table check

2022-05-05  Reini Urban  <rurban@cpan.org>

	autoupdate to autoconf 2.71
	but still try to be back-compat with autoconf-2.69

	decode: fix int overflow
	CodeQL #65: Multiplication result may overflow 'unsigned int'
	before it is converted to 'long'.

	CodeQL: restrict to sources, skip scanning unsafe test code

	preR13: add enum DWG_OBJECT_TYPE_R11, fix mspace BLOCK
	do not encode the artificial mspace BLOCK and ENDBLK, set its type to 0.
	return a proper dwg_add_BLOCK_HEADER result.

	preR13: split too large json_header_write_private functions
	variable tracking size limit exceeded with ‘-fvar-tracking-assignments’

	free: fix block_control->entries leak
	we allocated entries for model_space, and removed num_entries

	distcheck: ship the new preR13 test-data
	Fixes make distcheck

	preR13: fix leaks in common_entity

	preR13: add dwg_free_preR13_header_vars
	to match decode. Fixed all leaks.

	API: change dwg_add_Document, add dwg_new_Document
	else preR13 leaks the dwg.
	Down to 79 byte(s) leaked.

	preR13: set new dwg from add_Document
	and free the add_Document defaults when decoding it

	preR13: fix some table name leaks
	dwg_add_TABLE creates a new name.
	from 10304 leaking bytes down to 6456 with r11/ACEB10.

	indxf: fix missing AcDbZombieObject subclass
	fixes example_r13 alive.test

	tests: enable example_r13
	and fix a proxy_object unit-test with a NULL objid

	preR13: more json and encode tables
	with encode from json/dxf we don't have sections, just the control
	objects.

	preR13: block_header and style specs
	esp. for r11

	preR13: fix encode handle sizes
	fixes dwgrewrite

	preR13: fix unit-testing/decode_test undefined refs

	preR13: decode tables into objects
	set the entries handles, common fields

	preR13 json: set ctrl table fields
	size, num_entries, entries

	preR13 json: add object handles and r11_idx

	preR13 docs: Add Tables
	How the old tables are mapped into the new objects

	preR13 refactor: extra decode_r11.c module
	and add all the CONTROL objects for the tables.
	conveniently use dwg_add_Document for the initial setup,
	so that we can treat r11 similar to r2004 iterators.
	i.e. GH #443 Variant 2

	rename HEADER.num_entities and .num_bytes
	to .numentities and .dwg_size, not to be skipped in json

2022-05-05  Reini Urban  <rurban@cpan.org>

	WIP preR13: partial tbl support for in_json
	create the sections from the objects, but just the number.
	the size and address should be filled on encode

	Two variants:
	1. json dump the tables, entities and blocks, as in the dwg/dxf.
	   very simple, but special code for in_json.
	2. or create interim _CONTROL objects, holding the tables. this would allow iteration
	   via model_space -> block_control -> entities, as before. e.g. for dxf in/out, and
	   the helpers.

2022-05-05  Reini Urban  <rurban@cpan.org>

	preR13: rename the magic FILEHEADER.numheader_vars, numsections
	They are not exported to json, because the num_ fields are just
	the number of the related array.
	But here we have no related array, at least not trivially.
	Rather store them in json, so rename them.

	preR13: fix api impl. type => fixedtype
	needed esp. in the iterators. now the tests dont hang, just fail
	for injson and dxf

	preR13: activate alive.test, fix dwggrep a bit
	dwggrep and dxf would need the BLOCK_HEADER/BLOCK_CONTROL objects
	for basic entity/blocks iterators.
	injson and dxf still broken.

2022-05-05  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix 3dline entity

2022-05-03  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix 114 header variables

	Fix WORLDVIEW header variable

2022-05-03  Reini Urban  <rurban@cpan.org>

	add SECURITY.md
	github complained about it

	make regen-dynapi: VIEWDIR DXF

2022-05-03  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix preR13 layer index in entities

2022-05-01  Reini Urban  <rurban@cpan.org>

	fixup r2.10 dxf header_vars codes
	for TEXTSTYLE, CLAYER.
	Don't change the normal codes, just r2.10 is flipped

2022-04-30  Reini Urban  <rurban@cpan.org>

	fixed r2.10 dxf header_vars
	could not test the versions between r2.10-r2.6,
	so this needs to be adjusted later. I assumed r2.21

	preR13: work on dxf support
	fixed all the header vars so far.

	doc: Update pre-R13 capabilities
	list all supported revisions.
	add @registeredsymbol.
	add trademark paragraph.

	dwgadd: fix --disable-dxf compilation

	move api functions to dwg_api.c
	with --enable-write --disable-dxf --disable-json.
	Fixes GH #449

2022-04-30  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix preR13 line entity

	Fix preR13 3DFACE entity

2022-04-28  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Add AC1006 test DWG file

2022-04-26  Reini Urban  <rurban@cpan.org>

	preR13: support deleted entities r2.0-r11
	which are the entities moved into a BLOCK.
	eg test-data/r2.10/entities.dwg and r2.6, but also r1.4.

	preR13: fix POLYLINE_2D.end_width
	The other PR #448 fixes do look wrong to me

2022-04-26  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix style_id print in shape entity

2022-04-26  Reini Urban  <rurban@cpan.org>

	preR13: support block entities
	with no block_end, only num_entities in the loop.
	the blocks_offset is really the size minus 0x40000000, as Michal said.
	he was right. rename it.
	Now just the VIEW is wrong.
	Fixes GH #444

2022-04-25  Reini Urban  <rurban@cpan.org>

	gitignore preR13 docs

	preR13: fix SHAPE specs
	style_id and scale mostly.
	replaces PR #445

2022-04-24  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix begin block entity
	There is no block name in this entity.
	Block name from pre R_2_0 is converted to block table.

	Fix preR13 ATTRIB entity

	Fix preR13 attdef entity options

	Fix ATTDEF flags comment

	Add AC1003 test DWG file
	With script definition

	Add AC2.10 test DWG file
	With script definition

2022-04-24  Reini Urban  <rurban@cpan.org>

	encode: fix table object indices to write
	but still fails

2022-04-23  Reini Urban  <rurban@cpan.org>

	decode TF, less verbose tracing

	outjson: adapt to preR13
	and prepare the tests. no subdirs dwgs yet

	encode: fixed for r1.4
	tested ok with dwgrewrite, but no translations yet
	from other versions. json and dxf also not yet adapted.

	preR13: enable write of preR13 in programs

	enable decode_preR13 even in releases

	doc: fix recursive TEXINPUTS
	Fixes GH #404. Thanks to @AndrewAmmerlaan

2022-04-22  Reini Urban  <rurban@cpan.org>

	install: fix load_dwg.py destdir
	Fixes GH #406

	preR2: fix r1.4, change ENDREP fields
	ENDREP harmonized with MINSERT.
	re-enable r1.4 unit-test for load

	spec: fix shape spec for r13
	broken with 8f116dd9b79b587f163cb0bfafc33b49a8d503db

	disable r1.4 decoding in unit-test
	not yet stable

	preR13: fixes for old types
	use fixedtype for <R13 types

2022-04-21  Reini Urban  <rurban@cpan.org>

	encode: fix patching preR13 pos

	more LOAD support, make regen-dynapi
	dxf, json, unit-test

2022-04-21  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix pre R_2_0 shape entity

	Fix pre R_2_0 text entity

	Fix pre R_2_0 common entity reading
	There is no entity size.
	There is flag_r11 and flag2_r11 fields, but zeroed still

	Add load entity
	This entity is pre R_2_0

	Fix preR13 PSLTSCALE and TREEDEPTH header variables

2022-04-21  Reini Urban  <rurban@cpan.org>

	rename test-data/1_4 to 1.4

2022-04-21  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Add AC1.40 test DWG file

2022-04-21  Reini Urban  <rurban@cpan.org>

	Merge branch 'smoke/versions' into smoke/preR13
	Use a proper table and an API.
	E.g. support beta versions, diffing only in the dwg_version.

	indxf: same here
	but also set dwg_version from the struct

	in_json: use the new dwg_version_hdr_type()
	and not linear search topdown.
	also revise the version on dwg_version (if a beta).

2022-04-21  Reini Urban  <rurban@cpan.org>

	refactor DWG versions (GH #436)
	enable all the known alpha and beta versions,
	seperate pre and post release versions,
	add api to check the dwg_version with the magic header,
	change linear search backwards, so that we can list the versions chronologically.

	Fixes GH #436

	also adapt pre r2.0 changes to encode.

2022-04-21  Reini Urban  <rurban@cpan.org>

	WIP preR13: fix BLOCK_HEADER tables

2022-04-20  Reini Urban  <rurban@cpan.org>

	preR13: fix r9 header_vars
	missing num_entities and unknown_5.
	partially support POLYLINE, type 18,
	but this has different flags.

	encode: better FIELD_CAST tracing
	e.g. BLd

	indent only

	preR13: first r1.4 attempts

2022-04-19  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Stub for entity handling id

	Remove extrusion from point
	I don't think that extrusion is possible in point entity (tested on r14)

	Fix enums for FLAG and OPTS

	Fix elevation

	Fix decoding of entity with thickness
	thickness is common structure defined by flag before main entity

2022-04-19  Reini Urban  <rurban@cpan.org>

	preR13: free the dispatched VERTEX and POLYLINE ents

	dynapi: fix regen-dynapi in-tree
	as reported by Michal

2022-04-18  Reini Urban  <rurban@cpan.org>

	preR11: revise current_color_convert
	not a RD. rather the old smaller CMC struct, with only the low
	part interesting as index.

	mingw: appveyor native mingw host=x86_64-pc-mingw64

	mingw: disable shared mingw decode_test.exe
	duplicate symbols on linking

2022-04-18  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix current_color_convert and identify TREEDEPTH

2022-04-18  Reini Urban  <rurban@cpan.org>

	preR13: ltype is only one byte
	max 255 linetypes.
	ATTDEF.flags ditto

	preR13: fail with wrong entity

	preR13, entity repair, dimensions
	and fix POINT.z flag

	preR13: fix LINE opts
	matching michal's kaitai scripts

2022-04-18  Reini Urban  <rurban@cpan.org>

	preR13: dispatch VERTEX and POLYLINE
	use our types. but some opts are still unclear.

	dxf.test: relax roundtrip check from == to >=

2022-04-18  Reini Urban  <rurban@cpan.org>

	preR13: more _r11 indices replaced by handles
	TEXTSTYLE, CLAYER. Fixed some unit-tests

2022-04-17  Reini Urban  <rurban@cpan.org>

	preR13: fix ATTDEF

	preR13: harmonize _r11 indices with handles
	remove the special _r11 indices, and store them in our handles.
	this way we can convert them easier, name <-> idx <-> handle

	mingw: more exports

	spec: remove outdated comment
	we already handle the nolinks logic.
	this comment was added with the code in 2010.

	mingw: use -DDLL_EXPORT
	no extra LDFLAGS -fstack-protector on windows, link already includes CFLAGS.
	update TODO plans.
	fixup some missing EXPORT's.

	make dwg_version_hdr_type public API

2022-04-16  Reini Urban  <rurban@cpan.org>

	preR13: harmonize more _r11 fields
	rename color_rs/ltype_rs to _r11

	preR13: ATTRIB fixes
	and no handles at all

	preR13: fix INSERT.rotation
	and set has_attribs

	preR13: disable pre-R12 EED
	this code is probably wrong. I got it from dwg11.c
	have to read when EED's were introduced.

	preR13: fix TV BS, special-case free by fixedtype
	not type

	preR13: more entities
	and fixed the blocks detection via some temp. hack.
	still wrong free on wrong types

	mingw: missing C99 strftime %F %T
	the msvcrt

2022-04-15  Reini Urban  <rurban@cpan.org>

	preR13: decode and encode many entities now
	the _ent->opts_r11 and flag2_r11 are unclear yet.

	TIMERLL: add support for relative times
	where date.days == 0

	TIMERLL: re-implement proper time conversion
	from my old dwg11.c (1995), mandates now -lm.
	use TIMERLL in _r11.

2022-04-14  Reini Urban  <rurban@cpan.org>

	spec: <R13 change CLAYER_r11 name and DXF code 8

	spec: <R13 unknown_12 is TEXTSTYLE_r11
	Fixes GH #414. Thanks to @michal-josef-spacek for finding out

	fixup 3DLINE api
	hack upon hacks... oh my

	preR13: more decode fixes

	HACKING: advise about make regen-dynapi

	make regen-dynapi

2022-04-14  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Identify new pre R13 header variables

2022-04-14  Reini Urban  <rurban@cpan.org>

	<R13: add dwg_decode_preR13_header_variables
	the spec fields return on error. so wrap it.
	improve decoding the tables.

	spec: fix clang -Wtautological-constant-out-of-range-compare
	RCu can be max 255, then it wraps around

	<R13 unit-tests, fixup _3DLINE to 3DLINE name
	move the new ents to unstable. regen-dynapi.

2022-04-13  Reini Urban  <rurban@cpan.org>

	<R13: integrate the old 3 types
	into the loops. We got -Wunused-function warnings

	make regen-dynapi
	for the new preR13 entities

2022-04-13  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Add missing pre r13 entities

	Improve entity id comments
	Comments are in form (number1/number2) or (number1) or
	(number1/Tnumber3).
	number1 is entity id after r13
	number2 is entity id in r2.0-r13
	number3 is table id in r2.0-r13 (there are 5 basic tables and other
	tables are in header variables).

2022-04-13  Reini Urban  <rurban@cpan.org>

	work on preR13 header and entities
	can parse now the entities.
	cross-checked with Michals dwg*./ksy files from his perl cad modules

	add DEBUG ents: BREAKDATA, BREAKPOINTREF, *GRIPENTITY
	with not many fields for now.
	but I found coverage in free cadforum.cz samples,
	and latest ODA 23.2 knows it also.

2022-04-12  Reini Urban  <rurban@cpan.org>

	spec: add 25 UNKNOWN SECTION, improve auxheader.spec
	document the beta dwg_version fields

	work on ACAC103-4 support
	There's only a single example dwg though, and this might be
	from a beta revision.

	simplify dwg versions
	use a single array of releases, headers, versions.
	and add all the possible DWG versions (also the not yet seen,
	and the versions which did not change the DWG).

2022-04-11  Reini Urban  <rurban@cpan.org>

	Fix wrong ERROR: Skip section AcDb:AcDsPrototype_1b
	The size overflow error was incorrect, fixes one example from
	GH #144, esp. CFI - RIC - Room v3-2.dwg

2022-04-08  Reini Urban  <rurban@cpan.org>

	header.spec: document HEADER.security_type flags
	and regen-dynapi

2022-04-03  Reini Urban  <rurban@cpan.org>

	fix !HAVE_STRNLEN macro
	Fixes GH #418

	revert part of config.h.in: HAVE_DLFCN_H needed by mingw
	removed 4 commits before: b087dabf6 extend cmake probes

2022-03-24  Reini Urban  <rurban@cpan.org>

	indxf: fix use-after-free in the pair error-return design
	E.g. GH #425. On errors don't free pair and use pair.
	pair = NULL announces success, on error return the pair.

	add a EXPECT_UINT_DXF check esp. for BL. signed BL values have
	the type BLd.

2022-03-08  Reini Urban  <rurban@cpan.org>

	fix picat out-of-src, document svg11-relaxng install

2022-03-05  Reini Urban  <rurban@cpan.org>

	gh actions: add mingw-cmake smoker
	checkout submodules

2022-03-04  Reini Urban  <rurban@cpan.org>

	extend cmake probes
	for completeness sake

2022-03-04  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Add some AC2.10 .. AC1009 variables

2022-03-04  Reini Urban  <rurban@cpan.org>

	improve dwg_add_XRECORD_handle
	As found out in GH #419, memcpy copied into the
	wrong part of the union, and overly clever compilers
	might copy only 8, not >20 bytes.

2022-03-04  Neil Wakefield  <carmethene@gmail.com>

	Fix #422 - Missing functions in CMake/MinGW
	- Correctly set HAVE_* #defines in configuration step so that fallback options are used when these functions are not available.

	Fix #421 - BUILD_SHARED_LIBS not respected on WIN32
	- Reorder CMakeLists such that BUILD_SHARED_LIBS is set before running configure step
	- Use #cmakedefine so that ENABLE_SHARED is unset when BUILD_SHARED_LIBS is OFF

	Fix #420 - HAVE_ALLOCA_H and HAVE_LIBGEN_H symbols ignore results of cmake configure

2022-03-01  Reini Urban  <rurban@cpan.org>

	configure: remove outdated comment

2022-02-19  Reini Urban  <rurban@cpan.org>

	fix CirrusCI: git was missing from FreeBSD 13.0

	regen-dynapi for header_vars

2022-02-19  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Decode variables in AC1.50
	These variables are valid from AC1.50 to AC1009

2022-02-19  Reini Urban  <rurban@cpan.org>

	no out_dxf with --disable-dxf
	fix --disable-write cfg

	preR13 spec: resolve unknown_s[]
	by Michal GH #412.

	CodeQL with submodules

	fix wrong DWG too small error
	Michal sent an empty 1095 byte DWG r2.10
	Fixes GH #411

2022-02-18  Reini Urban  <rurban@cpan.org>

	Update codeql-analysis.yml

2022-02-17  Reini Urban  <rurban@cpan.org>

	Merge branch 'michal-josef-spacek-osmode'

	Merge branch 'master' into osmode

	Remove .travis

	Merge branch 'master' into osmode

	Add codeql-analysis.yml
	from the wizard

2022-02-17  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	GH#409: Fix OSMODE header variable
	From AC1.50 to AC1009 (old format) there is issue in place of OSMODE
	variable.

	BTW: FIELD_RS (unknown_12, 8); is TEXTSTYLE, but this is for another
	issue, we have second TEXTSTYLE variable for different DWG format.

	Values:
	  osnap_modes:
	    0: none
	    1: endpoint
	    2: midpoint
	    4: center
	    8: node
	    16: quadrant
	    32: intersection
	    64: insertion
	    128: perpendicular
	    256: tangent
	    512: nearest

2022-02-16  Reini Urban  <rurban@cpan.org>

	spec: fixup PLINEGEN preR11
	Fixes GH #408

	gcc -Wstringop-truncation bug #88780
	abstract the sizes to give gcc a chance.

	regen-dynapi for AXISMODE

2022-02-14  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Remove obsolete comment
	From `git show 5fa6e0374`

	...
	-  decode_preR13_table("BLOCK", ++tbl_id, dat, dwg);
	-  decode_preR13_table("LAYER", ++tbl_id, dat, dwg);
	-  decode_preR13_table("STYLE", ++tbl_id, dat, dwg);
	-  tbl_id++; // skip one
	-  decode_preR13_table("LTYPE", ++tbl_id, dat, dwg);
	-  decode_preR13_table("VIEW", ++tbl_id, dat, dwg);
	+  decode_preR13_section_ptr("BLOCK", SECTION_BLOCK, dat, dwg);
	+  decode_preR13_section_ptr("LAYER", SECTION_LAYER, dat, dwg);
	+  decode_preR13_section_ptr("STYLE", SECTION_STYLE, dat, dwg);
	+  // skip one
	+  decode_preR13_section_ptr("LTYPE", SECTION_LTYPE, dat, dwg);
	+  decode_preR13_section_ptr("VIEW", SECTION_VIEW, dat, dwg);
	...

2022-02-13  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Add AXISMODE and AXISUNIT

2022-02-06  Reini Urban  <rurban@cpan.org>

	Release 0.12.5
	add a github release action helper
	smoke also pull requests and tags (for the release)

	avoid UNKNOWN.tar.gz on --depth 1 checkouts

2022-02-06  Reini Urban  <rurban@cpan.org>

	dwg_next_entity: fix immediate cycles
	but we cannot yet detect non-immediate cycles, as from
	illegal, fuzzed DWGs. See GH #345

	bmp: better bounds-checks for wrong header_size
	Fixes fuzzed GH #354 (Illegal DWG bmp preview)

	encode: bounds-check remove_NOD_item
	with illegal DWGs. Fixes GH #357

	encode: protect from invalid ACDBPLACEHOLDER class_id
	Fixes GH #359, a fuzzed DWG with ACDBPLACEHOLDER as 53 (STYLE)

	encode: work on GH #364, #361 and #360
	but no idea yet, how the hdl_dat stream overflows here.
	all 3 cases the same problem in overlarge PLANESURFACE hdl_dat.

2022-02-05  Reini Urban  <rurban@cpan.org>

	indxf: more type protections
	in dxf_tables_read for illegal/fuzzed input. Fixes GH #366

	dxf: protect from wrong style type in SHAPE
	from fuzzed DWGs. Fixes GH #373

	indxf: fix double-free of LAYER.color.book_name
	Fixes GH #383

	fix free: -Wfree-nonheap-object of static arrays

	dwg2SVG: null-deref GH #390

2022-02-04  Reini Urban  <rurban@cpan.org>

	decode_r2007: format nits

	spec: face_modifier, BS cast for DXF
	Fixes GH #396 warning

	disarm cirrus FreeBSD smoker, no idea why it fails the tests.

	fix decode_r2007 off-by-one dst buffer-overflow
	We have one more byte to write to.
	Detected only by fuzzing, Fixes GH #391 and #392 by @s1vona

	outjson: fix JSON_END_REPEAT on early exit
	several unstable objects need to exit a REPEAT BLOCK on errors.
	fix that for json, e.g. with FIELD.ChildValue. Fixes GH #397

	cleanup dwgwrite AFL left-overs
	there is now a seperate main() for faster AFL fuzzing

2022-02-01  Reini Urban  <rurban@cpan.org>

	injson: protect from empty strings
	No NULL deref. Fixes oss-fuzz #36901,
	with json of '{}"AcDs"{"segments"[{"name"}]}('

2022-01-31  Reini Urban  <rurban@cpan.org>

	appveyor: update mingw deps as on github

	dxf: improve convert_SAB_to_SAT1
	for illegal DWGs. Fixes oss-fuzz #36728

	spec: set LEADER.box_width DXF 41
	needed for add_test LEADER dxf
	fixes indxf for LEADER.

2022-01-31  Reini Urban  <rurban@cpan.org>

	indxf: stricter dxf import
	2/3DPOINT* import only from matching DXF codes, not just
	some irrelevant.

	special-case clip_verts pairs (WIPEOUT, SPATIAL_FILTER, ...)
	when the num_ value is set, do the vector alloc.
	Fixes oss-fuzz #39025 with WIPEOUT.clip_verts

	indxf now fails on unstable classes, where all DXF groups are known.

2022-01-31  Reini Urban  <rurban@cpan.org>

	indxf: fix common entity handles
	don't mixup LWPOLYLINE points 390 with Entity plotstyle handle.
	also do material and visualstyle handles (the last one only partially)

	Fixes oss-fuzz #39025 with WIPEOUT.clip_verts

2022-01-30  Reini Urban  <rurban@cpan.org>

	in_json: invalid HANDLEs
	here we can have invalid user-input, dont assert.
	Fixes oss-fuzz #39755

	macos ci: enforce newer texinfo
	see https://github.com/abo-abo/swiper/issues/457#issuecomment-203689787
	also update mingw recipe (no autoreconf)

	spec: fix 2 auxheader type warnings
	RS -> RL

	support --disable-json and --disable-dxf
	in the various helpers. Actually needed for practical compilation times

	encode: enforce limit of max obj->size
	to avoid DDOS attacks. Fixes oss-fuzz #41021
	We let the overlarge obj->size through, but we just need to skip it.

2022-01-29  Reini Urban  <rurban@cpan.org>

	dxf_fixup_string: optimize
	remove dead code.
	this fixes a valgrind error on dwg2dxf example_2004.dwg

	Update cirrus freebsd to 13.0
	with updated python 3.8

2021-10-11  Reinhard Urban  <reinhard.urban@nubix.de>

	-Wstringop-truncation with clang

2021-10-06  Reini Urban  <rurban@cpan.org>

	update for latest shellcheck
	which came with new warnings

2021-10-06  Reinhard Urban  <reinhard.urban@nubix.de>

	mingw: fix github msys/mingw
	This is msys, so check for ld, which is probed for.

2021-10-05  Reinhard Urban  <reinhard.urban@nubix.de>

	spec: fix dwgadd.example path

	mingw: attempt to fix github msys/mingw action
	on msys the compiler is just named gcc, without prefix.
	but LD is searched for and thus has the mingw path prefix.
	so msys, mingw cross and mingw works now again.

2021-10-03  Reini Urban  <rurban@cpan.org>

	fix dictionarywdflt unit-test
	cloning_r14 is RL there

	fix -Wstring-concatenation
	detected by clang

	Fix handle sizes calc. and encode under Windows GH #346
	Handle corruption. Take the size of ulong, not a ptr.
	Tested round-trips manually.
	Fixes GH #346

2021-09-30  Reini Urban  <rurban@cpan.org>

	mingw64 cleanups
	fix wrong mingw-w64 check with _FORTIFY_SOURCE to add -lssp
	no double -lm in examples

2021-08-22  Reini Urban  <rurban@cpan.org>

	simplify alive.test on windows
	make test sets .exe in PROGS correctly, but not standalone

2021-07-07  huhexiang  <hhxnbw@163.com>

	dwgread: fix r2004_file_header crc32 calculation error

2021-07-06  Reini Urban  <rurban@cpan.org>

	bit_chain_alloc: add blocks in page size

2021-06-28  Reini Urban  <rurban@cpan.org>

	add bit_chain_alloc_size
	to allocate more than 1024 bytes in one swoop.
	we could use while, but this is better.
	needed eg for dwgrewrite, GH #364

2021-06-27  Reini Urban  <rurban@cpan.org>

	indxf: fix setting 10 to y (dxf+10, when dxf = 0)
	e.g. ASSOC2DCONSTRAINTGROUP.workplane[3] with code 10.
	Fixes GH #365, fuzzing only

	indxf: gracefully handle DXF EOF inside CMC
	Fixes GH #367, fuzzing only

	convert_SAB_to_SAT1: check more invalid SAB overflows
	with tag 14 subident also.
	Fixes GH #368, fuzzing only.

	dwg_handle_name: protect from strdup(NULL)
	Fixes GH #369

	spec: fix wrong VALUEPARAM allocation
	values[] are inlined, not per pointer.
	Detected by GH #370

	bit_eq_T: handle null args
	fixes GH #371

2021-06-26  Reini Urban  <rurban@cpan.org>

	spec: protect from less LWPOLYLINE widths than points
	on outdxf with illegal DWGs. Fuzzing only. Fixes GH #372

	indxf: one less dxf pair leak
	the last one

	indxf: check !pair in add_PERSUBENTMGR
	Fixes fuzzing GH #376

	spec: re-arrange MLEADER union fields a bit
	so that wrong types from illegal DXF don't corrupt handles. txt vs blk.
	They are now much better aligned.
	Fixes GH #378

	indxf: protect from overlarge counts
	fail with invalid dxf when xcalloc fails.
	fixes fuzzing GH #379

2021-06-24  Reini Urban  <rurban@cpan.org>

	indxf: missed a CHK_segs in add_HATCH
	fixes GH #380, fuzzing only

	indxf: abort on too many MULTILEADER groups 47
	Fixes GH #381, fuzzing only

2021-06-21  Reini Urban  <rurban@cpan.org>

	auxheader: wrong maint_version_* fields and types
	cast the types to silence warnings. fill both alt. variants of maint_version

	acds: wrong AcDs.segments.signature type

	macOS: require python 3.8 for gh actions
	but python 3.8 on macOS has a wrong linker cfg, -Wl,-stack_size is illegal for
	shared libs.

2021-06-20  Reini Urban  <rurban@cpan.org>

	indxf: fix fuzzing overflow with illegal subclasses
	disallow illegal subclasses, even with non-stable objects.
	Fixes GH #385. Can only appear with fuzzed input

	dxf: fix SAB_to_SAT1 overflow GH #384
	with fuzzed input data. wrong size check for ltoa conversion

2021-06-16  Reini Urban  <rurban@cpan.org>

	decode_r2007: more fixes for invalid section size
	Fixes GH #348. Check memcpy also with uncompressed pages.
	Fuzzing (illegal DWG's) only.

2021-06-16  Reinhard Urban  <reinhard.urban@nubix.de>

	spec fixups
	deleting /usr/share/man/man1/dwg* is not recommended.  we dont reserve that
	namespace for us alone

2021-06-16  Tadej Janež  <tadej.j@nez.si>

	Refactor Spec file for building RPM packages

2021-06-07  Reini Urban  <rurban@cpan.org>

	decode_r2007: fix for invalid section size
	See GH #350. With fuzzing section->data_size might not fit
	section_page->uncomp_size.

	dwgread: fix --disable-write --disable-dxf build

	dwg_section_wtype: fix fuzzing overflow
	with illegal and overlong section names. Fixes GH #349, #352
	section names cannot be longer than 24

2021-05-15  Reini Urban  <rurban@cpan.org>

	appveyor: revise fef6deb79 add -lssp to mingw
	add -lssp explicitly, but someone (libtool?) strips it nevertheless.
	enforce -fstack-protector on appveyor.
	need our git.

2021-05-12  Reini Urban  <rurban@cpan.org>

	decode: non fatal illegal/unknown class
	esp. with the case of Warning: Recover invalid offset
	the object is often illegal.
	Fixes the GH #338 regression.

	decode: r2013 has larger max_decomp_size
	for AppInfoHistory and SummaryInfo.
	See GH #338

	decode: improve performance for big DWG's
	double the size of allocated objects per cycle, not linear by 128.
	dramatically improves dwg decode performance for big DWG's.

2021-05-01  Reini Urban  <rurban@cpan.org>

	indxf: more NULL _ctrl->entries derefs
	e.g. oss-fuzz issue 33447

2021-04-25  Reini Urban  <rurban@cpan.org>

	Disable broken compiler optimizations
	See https://lore.kernel.org/lkml/CAHk-=wi_KeD1M-_-_SU_H92vJ-yNkDnAGhAS=RR1yNNGWKW+aA@mail.gmail.com/

	fix mingw release: add missing dwgfilter and the pcre dlls
	See GH #337

2021-04-18  Reini Urban  <rurban@cpan.org>

	configure: test syntax error (AM HAVE_CYGWIN)

	add -lssp to mingw
	started failing again, with only -fstack-protector and only on appveyor.
	mingw with gh actions not.

	configure: fix HAVE_ASAN_OR_LINUX AM_CONDITIONAL
	needed for examples/Makefile.am

	configure: invalid test -z args

	Fix mingw %zu warnings

2021-04-17  Reini Urban  <rurban@cpan.org>

	hardcode codecov_io.sh
	due to its recent breakin upstream

2021-04-09  Reini Urban  <rurban@cpan.org>

	cmake warnings
	target redwg has PUBLIC_HEADER files but no PUBLIC_HEADER DESTINATION
	install TARGETS given no LIBRARY DESTINATION for shared library target

	See GH #333

2021-04-08  Reini Urban  <rurban@cpan.org>

	dwg2SVG: flush stdout
	interestingly the libc does not flush stdout to pipes on process exit???

	dwg2SVG: improve ELLIPSE
	absolute rx and ry radii,
	rotation is the sm_axis (normal vector).
	Fixes GH #328

2021-04-08  Reini Urban  <rurban@cpan.org>

	build asan fuzzers only on request
	fixes failing cygwin smokes. we could install asan on the smokers,
	but we dont need it. only build it when requested.
	This needs no oss-fuzz build changes.

	See GH #330

2021-04-08  Reini Urban  <rurban@cpan.org>

	Fix configure bashism
	No string indexing in POSIX sh, for the new GPERF_VERSION check.
	Broken with 0.12.4
	Fixes GH #329
	Thanks to Alexey Dokuchaev

2021-04-06  Reini Urban  <rurban@cpan.org>

	Release 0.12.4
	See NEWS
	Mostly fuzzing patches only.

	dxf.test: honor --enable-release

	indxf: calloc NULL strings only if no code 0
	simplifies loop checks. code 0 must have a not-empty string values.
	See oss-fuzz issue 32758 and 32950

2021-04-01  Reini Urban  <rurban@cpan.org>

	indxf: calloc NULL strings
	empty string values are compared via strcmp and such.
	rather calloc a \0 byte, and don't crash. in_dxf is way
	too permissive, but we want to keep it that way.
	But only needed in fuzzed DXF files so far.

	Fixes oss-fuzz issue 32758

2021-04-01  Reini Urban  <rurban@cpan.org>

	indxf: reset j on non-vector fields
	we have several special cases for vectors or pts, where we
	need a global j counter. but when we set a single field, such as a
	num_clip_verts 91 or such. then we need to reset j, otherwise
	we could run into vector or pts overflows.
	As in oss-fuzz issue 32755

2021-03-31  Reini Urban  <rurban@cpan.org>

	indxf; fix NULL-deref with illegal DXF
	wrong points. Fixes oss-fuzz issue 32663

	dim_blockname NULL-deref protection
	found by oss-fuzz issue 32639, but not repro anymore

	SHAPE spec: protect dxf from empty _ctrl->entries
	NULL-deref. oss-fuzz issue 32627, but not repro.
	See also oss-fuzz issue 32670.

2021-03-29  Reini Urban  <rurban@cpan.org>

	indxf: fix type unsafeties in dynapi set
	dont just check for a known common field name, but also its valid types
	before setting its defaults.
	In particular scale can be not just 3BD_1, but also H or BD, 2BD.
	  grep '"scale"' ../src/dynapi.c

	Fixes oss-fuzz issue 32604

2021-03-28  Reini Urban  <rurban@cpan.org>

	fix in_json created_by leak
	should fix oss-fuzz issue 32408, which
	has an empty reproducer, but code-review brought me to that

2021-03-26  Reini Urban  <rurban@cpan.org>

	try to fix more indxf leaks
	but no

2021-03-25  Reini Urban  <rurban@cpan.org>

	indxf: protect from empty 3DSOLID 2 values
	fail with Invalid revision_guid earlier.
	Fixes oss-fuzz issue 32455

2021-03-24  Reini Urban  <rurban@cpan.org>

	spec: protect from NULL bit_eq_T args
	only with fuzzed/corrupt DWGs. Fixes oss-fuzz issue 32397

2021-03-23  Reini Urban  <rurban@cpan.org>

	outdxfb: NULL-deref in dxfb_process_VERTEX
	analog to outdxf. last_vertex might be NULL with broken objects (fuzzed).
	Fixes oss-fuzz issue 32348

2021-03-23  Reini Urban  <rurban@cpan.org>

	encode: protect NULL bit_write_TF chain
	With dwg_encode_xdata write a proper 0 size,
	but with lengths < 128 just write the empty string.

	Fixes oss-fuzz issue 32335, fuzzed dwgrewrite input only.
	This usually happens with overflowing (corrupt) XRECORD input.

2021-03-20  Reini Urban  <rurban@cpan.org>

	fixup indxf use-after-free
	from 3b47eb0fe81ab7ded5342208feac016076e0e668
	dont just free the pair.

	Detected by oss-fuzz issue 32275

2021-03-20  Reini Urban  <rurban@cpan.org>

	outdxf: protect cquote src overflow
	fixes oss-fuzz issue 32251

2021-03-18  Reini Urban  <rurban@cpan.org>

	free: fix encode and possible leak in VBA_PROJECT
	leak detected by oss-fuzz issue 32179, but unfort. oss-fuzz
	produces an broken empty reproducer.

	also fix the encoding case, where we used to have an empty obj->size.
	this is much more important.

	the leak might happen with a proper decode of VBA_PRODUCT.data
	but bit_read_TF failing on overflow, whilst the VECTOR_CHKCOUNT
	check passed. A reproducer would be really nice to fix this for
	all fuzzed TF fields with variable len. This fix is just a hack.

	There is even a related testcase in to/2013/from_upcommons.upc.edu/DRAWINGS.dwg
	with a proper detection ERROR: Invalid data size 7168. Need min.
	7168 bits for TF, have 90 for VBA_PROJECT.

2021-03-18  Reini Urban  <rurban@cpan.org>

	outdxfb: More NULL-deref protections as in outdxf
	fixes oss-fuzz issue 32171

2021-03-18  Reini Urban  <rurban@cpan.org>

	encode: disallow 3DSOLID num_blocks calculation
	from block_size[]. this might overflow with fuzzed/malicious data.
	all our input data (dwg. dxf, json) already sets num_blocks
	to a correct value already.

	Fixes oss-fuzz issue 32165 with dwgrewrite (broken block_sizes vector)

2021-03-18  Reini Urban  <rurban@cpan.org>

	clean more distcheck leftovers

	indxf: fix leaks with invalid objects or sections
	e.g. oss-fuzz issue 32094

2021-03-17  Reini Urban  <rurban@cpan.org>

	outdxf: uncondtionally zero-terminate cquote result
	because we immediately use strlen on it, which is on the stack.
	Fixes oss-fuzz issue 32112 (stack read overflow)

	more zero-termination fixes
	don't overflow when checking for zero-termination.
	asan is strict there.
	all our input paths enforce now zero-termination, so
	don't check.
	dat->chain[dat->size] must now always be 0. removed some weird
	dxf special-case where it was dat->size+1.

	gh action: -O1 asan times out. revert to -O0

2021-03-16  Reini Urban  <rurban@cpan.org>

	gh: add codecov.io integration, make distcheck
	coveralls.io is a bit too troublesome with our gcov files.

	Also add make distcheck, but only for --enable-release. And skip make check
	there, otherwise we will fall in the 60min timeout. 28min for the
	build, 8min for the check.

2021-03-16  Reini Urban  <rurban@cpan.org>

	indxf: improve fuzzer zero-termination
	don't allow \n without \0 in DXF.
	Fail earlier when the ASCII DXF buffer has none to avoid strtol overflows.
	Fixes oss-fuzz issue 32022

	Also clear errno before calling strtol.

2021-03-16  Reini Urban  <rurban@cpan.org>

	llvmfuzz_standalone: protect from illegal input args
	accept only files.
	ftell might return (long)-1, which will lead to an malloc error

2021-03-14  Reini Urban  <rurban@cpan.org>

	more bit_utf8_to_TV src overflow protections
	commit 54fdafc75275f1848bcb4e79c0313b9a13a8b01b
	introduced src overflow protection, but not really.
	acctually check unprotected inc's.

	Fixes oss-fuzz issue 32029

2021-03-13  Reini Urban  <rurban@cpan.org>

	decode preR13: fix overflow regressions
	fuzzing only. crashes15 id 145

2021-03-12  Reini Urban  <rurban@cpan.org>

	encode: fix use-after-realloc in API_ADD_TABLE
	There is a small window of opportunity to realloc the objs invalidating
	ctrl.
	Fixes oss-fuzz issue 31436.

	decode: protect unsigned int overflow on wrong obj->size
	only with fuzzed dwgs.

	fixup llvmfuzz_standalone on non-linux
	no weak linking on macOS nor Windows.
	our mingw smokers have no sanitizers.

	indxf: disable unused and leaking dxf_objs

	add llvmfuzz_standalone for reproducers
	esp. if we fixup missing zero-termination. yes, we do.
	bogus oss-fuzz bug reports for 31419, et al

2021-03-11  Reini Urban  <rurban@cpan.org>

	indxf: pair -Wmaybe-uninitialized

2021-03-10  Reini Urban  <rurban@cpan.org>

	protect bit_utf8_to_TV src from overflow
	fuzzing in_json only, everywhere else the src is big enough.
	Fixes oss-fuzz issue 31878

	Update NEWS, README

	dxfb: same protections as in dxf
	for fuzzing input

	add old gperf support
	needed for macOS CI target, which wants to generate dxfclasses.c
	with a gperf 3.0

	outdxfb: resolve wrong ref->obj handles
	check against wrong ref->obj.
	enable llvmfuzz for outdxfb.

2021-03-09  Reini Urban  <rurban@cpan.org>

	Prepare NEWS for 0.12.4

	indxf: better dxf_skip_ws overflow protection
	May fix oss-fuzz issue 31789, but not repro

	outdxf: forgot a LAYER_CONTROL entries case
	NULL-deref.
	Fixes oss-fuzz issue 31873

	decode: protect bit_read_BB_noadv
	analog to bit_read_BB.
	Fixes oss-fuzz issue 31591

	encode: fix write_DD for scale
	for INSERT. allow 1e-12 variance in equality check.
	Fixes GH #326

2021-03-09  Reini Urban  <rurban@cpan.org>

	encode: check if strings zero-terminate
	and re-calc the bitsize and size if changed.
	generally all dwg's created with r2004+ have zero-terminated strings,
	before not.

	Now the testcase with ./rw ../test/issues/gh326/Test_DWG_2000.dwg
	causes just 63 errors, not 187 anymore.
	See GH #326

2021-03-08  Reini Urban  <rurban@cpan.org>

	encode: add LOG_POS to strings

	decode: log used Section Page Map address

2021-03-08  Reini Urban  <rurban@cpan.org>

	decode: initialize bit_read_fixed on dat overflow
	Fixes GH #321.
	NULL dereference in header_variables_dxf.spec:26

	Thanks to @zodf0055980 for the analysis.

2021-03-08  Reini Urban  <rurban@cpan.org>

	encode: avoid hdl_dat double-free
	In case of an handle overflow, such as num_reactors.
	Fixes oss-fuzz issue 31724.

2021-03-06  Reini Urban  <rurban@cpan.org>

	llvmfuzz: copy if JSON
	because we temp. zero-terminate strings in the JSON.
	Fixes oss-fuzz issue 31660, and kills libfuzzer performance.

	more decode_3dsolid fuzzing protections
	TF returns on overflow, but does not clear block_size.
	Fixes oss-fuzz issue 31657

	outdxf: some NULL-deref protections
	with empty table entries.
	Fixes oss-fuzz issue 31656

	outdxf: protect stack-allocated string
	from overflow at strlen.
	Should fix oss-fuzz issue 31647, but not locally repro

	decode: fix harmless klass->appname leak
	fixes oss-fuzz issue 31564

	More FORMAT_RC -Wformat cast warnings
	this time for encode

	more decode_3dsolid fuzzing NULL deref
	better fix for oss-fuzz issue 31533
	blocks_size needs to be reset also when TF overflows.

	Fix some FORMAT_RC -Wformat cast warnings
	from calc. int, and without optimization in COMMON_TABLE_FLAGS (Layer).
	Seems problematic, but we want to be warnings free to catch real errors.

	decode_preR13: more PREP_TABLE protections
	fixes GH #325 heap overflow

2021-03-06  Reini Urban  <rurban@cpan.org>

	more encode bitsize fixups needed
	all entities with a DD type have no stable bitsizes.
	need to recalc it there too. Eg LWPOLYLINE with example_2000
	on dwgrewrite.

	also recalc size on was_bitsize_set

2021-03-05  Reini Urban  <rurban@cpan.org>

	encode: fix bitsize recalculation
	not just on unknown size/bitsize (DXF), also on JSON
	import and on rewrite across versions we need to recalc both sizes.
	e.g. on rewrite from r2004+ we miss the is_xdic_missing bit in all objects
	leading to an off-by-one bitsize.
	See GH #322

2021-03-03  Reini Urban  <rurban@cpan.org>

	Major outdxfb bugfix: write code 0 pairs

	outdxfb: fix table NULL-derefs
	Fixes GH #324, fuzzed by @zodf0055980.
	Analog to ascii dxf

	thumbnail: more bounds-checks
	protect from invalid header_size and BMP size.
	Fixes GH #323, fuzzed by @zodf0055980

	more decode bounds-checking
	when the common entity already overflowed, dont parse further.
	such as e.g. with EED overflow.
	Fixes oss-fuzz issue 31576

	acds: bounds-check invalid AcDs segment offset
	leading to heap-overflows with corrupt/fuzzed input data.
	Fixes GH #320, thanks to Yuan @zodf0055980 from Taiwan for fuzzing.

2021-03-01  Reini Urban  <rurban@cpan.org>

	decode_r2007: fail earlier with illegal system page data
	to avoid integer overflow in rounded calcs.
	Better fix for oss-fuzz issue 31574

	geojson: protect dwg_geojson_object
	with broken object, without parent (dwg)
	Fixes oss-fuzz issue 31542

	fix decode_3dsolid fuzzing NULL deref
	in case of an empty encr_sat_data[] block.
	Fixes oss-fuzz issue 31533

2021-02-28  Reini Urban  <rurban@cpan.org>

	llvmfuzz: set out_dat versions and opts
	dwg_read_dxf: set the opts here.
	needed for proper unicode conversions.
	as in our converters.

	bump copyright years to 2021

2021-02-28  Reini Urban  <rurban@cpan.org>

	encode: fix hdl_dat leak on errors
	when we have to return early within dwg.spec, such as HATCH errors
	and don't cleanup with DWG_OBJECT_END.

	Fixes oss-fuzz issue 31456

2021-02-28  Reini Urban  <rurban@cpan.org>

	VBA_PROJECT: ignore overlarge data_size
	which could lead to DDOS from malicious input,
	but mostly only pleasing fuzzers.

	Fixes oss-fuzz issue 31462

2021-02-28  Reini Urban  <rurban@cpan.org>

	llvmfuzz: fix leaks on input errors
	See e.g. oss-fuzz issue 31422
	we skip leak detection with libfuzzer, but not with honggfuzz.
	note that in_dxf still leaks heavily, a known limitation.
	so we'd need to skip leak checks with honggfuzz also, or disable in_dxf there.

	fix encode_3dsolid num_blocks calculation
	not default to 100. take the number from the block_size array.
	Fixes oss-fuzz issue 31470 heap-buffer-overflow

	encode: fix fuzzing buffer overflow
	Fixes oss-fuzz issue 31516
	detected by llvmfuzz

2021-02-28  Reini Urban  <rurban@cpan.org>

	llvmfuzz: enforce fuzzer data NULL-termination
	this is a workaround for a libfuzzer limitation.
	strtol or sscanf need a NULL-terminated buffer, or at least \n
	terminated.
	otherwise it reports buffer overflows.
	in real-code we enforce that in our input funcs.

	Fixes oss-fuzz issues 31450, 31419, 31454.

2021-02-27  Reini Urban  <rurban@cpan.org>

	indxf: break earlier

	ensure NULL-termination in dat_read_stream
	for sscanf, strtol and friends with asan.
	Fixes oss-fuzz issue 31454

2021-02-26  Reini Urban  <rurban@cpan.org>

	dwgadd: fix pspace command
	Closes GH #319, thanks to @chensccode

	encode: protect more API_ADD_TABLE cases
	Might fix oss-fuzz issue 31436

	outdxf: wrong usage of strncat
	fix dxf_CMC overflows.
	detected by llvmfuzz

	outdxf: more dxf_tables_write NULL ptr protections
	might fix oss-fuzz Null-dereference READ · dxf_tables_write  issue

	decode_r2007: protect from invalid repeat_count
	signed integer overflow with invalid input.
	fixes oss-fuzz issue 31432

	encode: fix dat->chain[pvzadr] overflow
	fixes oss-fuzz issue 31426

	decode: check decode_R13_2000 invalid classes
	fixes oss-fuzz issue 31425.

	outdxf: more cquote protection
	Fixes oss-fuzz Heap-buffer-overflow READ 1, issue 31416
	tested with 0.12.3.4139
	This bug was introduced with 0.10.1.3125

	dwgadd/fuzz: fix wrong sscanf usage
	need the secure variant. esp. on windows

	fix some windows format warnings

	fix -Wold-style-definition

	minor make release-web fixups

2021-02-26  Reini Urban  <rurban@cpan.org>

        Release 0.12.3

        Fix manual and release-web targets.

2021-02-25  Reini Urban  <rurban@cpan.org>

	encode: fix null-deref in DISABLE_NODSTYLE
	with empty NOD entries.
	detected by llvmfuzz

	fix outdxf overflow with Invalid shift-jis sequence \M+1xxxxxx
	detected by llvmfuzz

	indxf: abstract Premature DXF end to SAFER_STRTOL

	indxf: harden Premature DXF end errors
	we can assume there will always be a final "  0\nEOF" string.

	other string stream offset with r2010 Beta 2 samples.
	Fixes GH #318

	WIP wrong string stream hisize offsets
	with Gator Beta 2 samples. See GH #318
	to/2010/from_knowledge.autodesk.com/

	outdxf: handle invalid SAB abort
	detected by llvmfuzz

	outdxf logging: avoid wrong bitsize position overflow
	detected by llvmfuzz

	outdxf: fix crash with stale VERTEX
	fail with empty last_vertex.
	detected by llvmfuzz

	outdxf: protect empty tio.entity
	detected by llvmfuzz

	indxf: hard error on invalid dxf pair
	before we simply returned 0 (or NAN) on invalid dxf pairs.
	now we set the stream to the end to force an early exit.

2021-02-24  Reini Urban  <rurban@cpan.org>

	indxf: protect dwg_read_dxf the same as dxf_read_file
	check if input size is too small, and if it's not a DWG.
	llvmfuzz used the latter, which was not repro with dxf2dwg.

	encode: convert assert address to error

	fix bit_eq_TU for NULL args
	or conversion trouble.
	detected by llvmfuzz

	LTYPE: protect against empty strings_area
	detected via llvmfuzz

	injson: fix TFFx buffer-overflow
	write max TFF size.
	detected via llvmfuzz

	encode: protect object dat pos 0 overwrites
	don't assert, fail.
	detected via llvmfuzz

	decode: Size underflow for R2004_Header
	detected by llvmfuzz

	fix injson double-free
	created_by is static
	detected via llvmfuzz

	outdxf: protect dxf_CMC string overflows
	with fuzzing. llvmfuzz

2021-02-23  Reini Urban  <rurban@cpan.org>

	prelim. NEWS for next patch release

	geojson: add PAIR_Sc for non-null values

2021-02-23  Reini Urban  <rurban@cpan.org>

	abstract TU_to_int for ubsan access
	which was totally wrong in some cases. but only with ubsan or
	HAVE_ALIGNED_ACCESS_REQUIRED.

	fix out_json print_wcquote for unaligned/UBSAN strings.

2021-02-23  Reini Urban  <rurban@cpan.org>

	llvmfuzz: close the null file-handle
	running out of it

	Fix dwg2dxf uppercase extension problem
	GH #311, esp on Windows

	indxf: detect dxf_read_* premature DXF end
	A DXF line must end with \n.
	detected via llvmfuzz

	indxf: fix add_HATCH overflow logic, wrong hdl_idx check
	detected via llvmfuzz

	bit_TU_to_utf8_len: fix heap overflow
	force string being delimited.
	deteced by llvmfuzz

	indxf: fix 3DSOLID overallocation
	detected via llvmfuzz

	indxf: fix MTEXT text running lines, DXF 3
	detected via llvmfuzz

	dwgfuzz: add honggfuzz and llvmfuzz instructions
	See GH #317

	add suggested __attribute__ ((noreturn)) to examples/dwgadd
	clang -Wmissing-noreturn

	some libfuzzer assertions. see llvmfuzz

2021-02-23  Reini Urban  <rurban@cpan.org>

	protect invalid geojson input
	via llvmfuzz.

	cd .build-clang
	m -C src && \
	  clang -I../src -Isrc -g -O3 -fsanitize=address,fuzzer ../examples/llvmfuzz.c -Lsrc/.libs -lredwg;
	LD_LIBRARY_PATH=src/.libs ./a.out -detect_leaks=0 -rss_limit_mb=8000 -timeout=4000 ../test/test-data/

2021-02-23  Reini Urban  <rurban@cpan.org>

	replace prelim fuzz_dwg_decode.c with llvmfuzz.c
	with proper coverage

2021-02-23  davkor  <david@adalogics.com>

	Added initial fuzzer for OSS-Fuzz integration.

2021-02-22  Reini Urban  <rurban@cpan.org>

	add release-web maintainer target

	docs: fix make refman out-of-tree

	doxygen update to 1.8.20
	which deprecated several external programs

2021-02-22  Reini Urban  <rurban@cpan.org>

	Release 0.12.2
	Fixed extending the write buffer for the 2 CRC bytes. Occurs very
	seldomly

	update .cirrus.yml
	autoconf update requires latest m4

	fix bit_write_CRC overflow
	need to extend the buffer on write.
	Fixes GH #315

2021-01-31  Reini Urban  <rurban@cpan.org>

	Release 0.12.1
	Fuzzer bugfixes and EED 3 for layer handle.
	See NEWS

2021-01-31  Reini Urban  <rurban@cpan.org>

	dwgbmp: fix Preview offset
	honor the sentinel, esp. >= 2004
	and fix the size overflow check.

	dwgbmp works now again.

2021-01-31  Reini Urban  <rurban@cpan.org>

	unit-testing: -Wuninitialized MTEXT.num_column_heights

2021-01-31  Reini Urban  <rurban@cpan.org>

	fix eed_3.layer from 4 to 8 byte
	causing wrong offsets into the entities. many thanks to @shanzhugit
	for the DWG example with a EED layer code 3, and wrong entity data.
	Fixes GH #310.

	This is analog to the xdata OBJECTID which also takes 8 byte.

2021-01-31  Reini Urban  <rurban@cpan.org>

	bit_TU_to_utf8_len, bit_read_TU_len
	and swap the strict-align variants (ubsan) of wchar bytes

2021-01-30  Reini Urban  <rurban@cpan.org>

	dwgadd: -Wsometimes-uninitialized
	on clang

2021-01-17  Reini Urban  <rurban@cpan.org>

	decode: fix LOG_TF for null strings
	fuzzed DWG's only

2021-01-17  Reini Urban  <rurban@cpan.org>

	harden dwg_get_first_object
	not only check the type, but also if _obj is valid.
	Simplifies a lot of checks.

	dwglayers got a new error warning and early exit

2021-01-17  Reini Urban  <rurban@cpan.org>

	eed: detect size overflow earlier
	we read the size into a short, but multipled it with 2, with possible overflow.
	eg. with a wstring len of 32810 => 65622 overflowing an ushort.
	This may lead to a subsequent encode_eed overflow.
	Fixes GH #307, with invalid fuzzed DWG only

2021-01-17  Reini Urban  <rurban@cpan.org>

	decode: check wrong APPID_CONTROL's with malcrafted DWG's
	add more checks when we search for the matching APPID for
	ACAD_MLEADERVER with a broken MLEADERSTYLE object.
	Fixes 1/2 of GH #307

	Modified-by: Reini Urban <rurban@cpan.org>

2021-01-17  Reini Urban  <rurban@cpan.org>

	dwg_find_class: null-deref of empty class.dxfname
	which must not happen, but fuzzers create such invalid DWGs.
	assert more null args for internal code.
	Fixes GH #309

	dwglayers: fail on empty layer name
	and report its handle.
	detected by fuzzing, only invalid DWG's have no layer name.
	Fixes GH #308

	decode_3dsolid: skip unknown versions
	usually only needed for fuzzed DWGs
	See GH #304

	json: more null-deref protections
	Fixes GH #306, fuzzed by Chew Kin Zhong

	decode preR13: stricter table checks
	error fatally on wrong end of table offset.
	heap-buffer-overflow from GH #304, but this code is not
	used in release versions.

2021-01-17  Reini Urban  <rurban@cpan.org>

	decode: wrong TFF VECTOR_CHKCOUNT, fix TFF overflows
	protect from invalid free on static TFF fields on overload.

	See GH #304, fuzzed by Chew Kin Zhong

2021-01-17  Reini Urban  <rurban@cpan.org>

	fix dwg_next_entity null-derefs
	with broken/undecoded entities from fuzzed DWGs.
	Fixes GH #305, out_svg. fuzzed by Chew Kin Zhong.


2020-12-31  Reini Urban  <rurban@cpan.org>

	Release 0.12
	See NEWS.
	New add API to easily create new DWGs (or DXFs) from scratch,
	for CAD programs.
	New dwgadd helper.
	Removed deprecated old API functions.

	windows tests: remove \r on mingw cross-compile results

	windows tests: forgot some EXEEXT's
	which fixes i.e. mingw32 cross tests on linux.

	api: add portable SCANF_2X "%2hhX" for windows
	and removed most outdated sscanf %2hhX code, replaced by in_hex2bin.
	this failed on mingw32

	unit-testing: fix include paths
	config.h is in build-dir, the rest in srcdir, all are covered in -I aready.
	failed in cmake: make check only.

	skip add fuzzing for --disable-write

2020-12-30  Reini Urban  <rurban@cpan.org>

	add examples/dwgadd
	taken from dwgfuzz -add, but extended.
	A nice and useful add API example.

	Still leaks memory though

2020-12-30  Reini Urban  <rurban@cpan.org>

	add API: fix use-after-free in ADD_ENTITY
	blkobj might be invalidated by an dwg->object[] realloc.
	This cannot happen with ADD_OBJECT (taking only dwg)
	and ADD_TABLE_OBJECT, where ctrl is only used if already exists
	and does not has to be added.

	add API: fix STYLE.name leak
	for the general case. 2x strdup

2020-12-30  Reini Urban  <rurban@cpan.org>

	dwgfuzz: try to use sscanf_s
	which glibc/bsd did not implements, because politics and they do not
	care about bounds checks.

	So to protect from stack overflows use %119s size bounds, and restrict
	the charset.  We can do that for fuzzing, but for a real "add" language we
	would need to accept utf8, and write a real parser.

2020-12-29  Reini Urban  <rurban@cpan.org>

	clang -Wint-in-bool-context
	gcc didnt find this bug. but not relevant

	dxf: fix asan overflow in write eed of ""

	dxfwrite: fix STYLE IS_FROM_TU conversion

	api: delete wrong (out-of-date) dwg->*_control fields
	they are not updated when updating _ctrl->entries or num_entries,
	not on importers or on add.
	just delete this, it's easy enough to get it.

	outdxf: fix TABLES for imported dwgs
	remove tablectrl->objid, which is only set by decode, not by any importer
	nor the add api.
	check the table controls.
	sync out_dxfb from out_dxf

	add API: add PDFDEFINITION tests
	fix shared path defs, and create new dict names (base - 2)
	check that only one ACAD_PDFDEFINITIONS dict is created and shared.
	check that PDFDEFINITION objects can be shared, and that the name field
	is incremented.

2020-12-28  Reini Urban  <rurban@cpan.org>

	bit_eq_T: fix for imports
	indxf and injson dont convert to TU, which is used for dwg_find_dictionary()

	indxf: fix UNDERLAY
	fix object_alias and entity_alias for UNDERLAY.
	Add missing subclass for UNDERLAY, due to the UNDERLAY_fields macro which is not expanded

	add api: add_PDFUNDERLAY
	not yet fully implemented, PDFDEFINITION 1:1, not yet shared.
	TODO in_dxf. out_dxf and dwg looks ok.

2020-12-27  Reini Urban  <rurban@cpan.org>

	unit-testing: avoid *SURFACE DEBUGGING crashes
	the transmatrices may be NULL, even when dynapi returned sucesss.

2020-12-27  Reini Urban  <rurban@cpan.org>

	indxf: fixup wrong type
	would crash in free.
	fuzz 20, id: 293

	also delete dead code, replaced by dwg_object_name()

2020-12-27  Reini Urban  <rurban@cpan.org>

	unit-testing: list all the no coverage objects

	dynapi: more NULL ptr protections
	esp. for pre-R13 DWGs

	api: fix dgndefinition cov and typedef

	promote ASSOCARRAYACTIONBODY to unstable
	nodist coverage, some transmatrix values are nan.

	spec: fix ASSOCARRAYACTIONBODY
	wrong subclass

2020-12-27  Reini Urban  <rurban@cpan.org>

	promote most DYNBLOCK objects and POINTCLOUD to unstable
	they have proper fields, and some coverage

	POINTCLOUD
	POINTCLOUDEX
	ASSOC2DCONSTRAINTGROUP
	ASSOCACTIONPARAM
	ASSOCARRAYMODIFYPARAMETERS
	ASSOCARRAYPATHPARAMETERS
	ASSOCARRAYPOLARPARAMETERS
	ASSOCARRAYRECTANGULARPARAMETERS
	ASSOCASMBODYACTIONPARAM
	ASSOCCOMPOUNDACTIONPARAM
	ASSOCFACEACTIONPARAM
	ASSOCOBJECTACTIONPARAM
	ASSOCOSNAPPOINTREFACTIONPARAM
	ASSOCPATHACTIONPARAM
	ASSOCPOINTREFACTIONPARAM
	ASSOCVARIABLE
	ASSOCVERTEXACTIONPARAM
	BLOCKALIGNEDCONSTRAINTPARAMETER
	BLOCKANGULARCONSTRAINTPARAMETER
	BLOCKARRAYACTION
	BLOCKDIAMETRICCONSTRAINTPARAMETER
	BLOCKHORIZONTALCONSTRAINTPARAMETER
	BLOCKLINEARCONSTRAINTPARAMETER
	BLOCKLOOKUPACTION
	BLOCKLOOKUPPARAMETER
	BLOCKPARAMDEPENDENCYBODY
	BLOCKPOINTPARAMETER
	BLOCKPOLARSTRETCHACTION
	BLOCKRADIALCONSTRAINTPARAMETER
	BLOCKSTRETCHACTION
	BLOCKUSERPARAMETER
	BLOCKVERTICALCONSTRAINTPARAMETER
	BLOCKXYGRIP
	PARTIAL_VIEWING_INDEX
	POINTCLOUDCOLORMAP
	POINTCLOUDDEF
	POINTCLOUDDEFEX
	POINTCLOUDDEF_REACTOR
	POINTCLOUDDEF_REACTOR_EX

2020-12-27  Reini Urban  <rurban@cpan.org>

	promote more dynblocks
	to stable: BLOCKALIGNMENTGRIP BLOCKALIGNMENTPARAMETER BLOCKLOOKUPGRIP BLOCKROTATIONGRIP
	to unstable: BLOCKPOLARGRIP BLOCKPOLARPARAMETER ASSOCDIMDEPENDENCYBODY

	indxf: more simplier dynblock import methods
	with just 2 args, as with else_do_strict_subclass.
	to be able to move grip objects to stable.

	indxf: add_RENDERSETTINGS
	but no coverage yet

2020-12-27  Reini Urban  <rurban@cpan.org>

	spec: fix ObjectContextData
	abstract AcDbTextObjectContextData_fields
	rename TEXTOBJECTCONTEXTDATA.flag to horizontal_mode,
	promote FCFOBJECTCONTEXTDATA to unstable,
	rename MTEXTOBJECTCONTEXTDATA.flag to attachment,
	fix spec MTEXTOBJECTCONTEXTDATA points and extents confusion: same order.
	disable AcDbObjectContextData.has_dic: no room in the *OCD.pi.log's, looks ok now.

	Almost all OCD objects do look stable now.

2020-12-26  Reini Urban  <rurban@cpan.org>

	spec: promote 7 objects to unstable
	PLANESURFACE, DATALINK,
	ALDIMOBJECTCONTEXTDATA, BLKREFOBJECTCONTEXTDATA,
	LEADEROBJECTCONTEXTDATA, MTEXTOBJECTCONTEXTDATA,
	TEXTOBJECTCONTEXTDATA

	unit-testing: more coverage

	dwgfuzz: fix SET_ENT -Wnonnull
	don't allow NULL into dwg_dynapi_entity_set_value.
	The compiler already warns, so should be fair.
	Without HAVE_NULL we explicitly check against NULL.

	unit-testing: use test_code_nodist
	for not distributed DWGs. We cannot add coverage for all stable
	objects yet. But some of them report FAIL, when we try a not existing
	test file.

	unit-testing: fix abstractobject_ASSOCARRAYPARAMETERS
	DEBUGGING only

	unit-testing: fix heap-overflow in 3dsolid tests
	We wrote size 4 into BITCODE_BS color.
	also fix wrong free's

	more dxf classes: AcDgnLS, Underlay, ...
	yet unused

	dynapi: improve abstractobject_ASSOCARRAYPARAMETERS
	Ignore duplicate object structs, add xref to the original.
	Fix dwg_api.h typedef struct _dwg_abstractobject_ASSOCARRAYPARAMETERS
	to fx unit-testing type warnings

2020-12-25  Reini Urban  <rurban@cpan.org>

	dynapi: unify duplicate abstractobject fields WIP

	spec: use abstractobject_ASSOCARRAYPARAMETERS typedef
	for the 4 same-struct classes.

	spec: set all subclass parents, not just the first
	major bug, but only used internally.

	indxf: break on wrong PERSUBENTMGR num_steps
	out of the loop. still wrong spec

	indxf: accept 3DSOLID code 3
	line continuations

	indxf: fix HATCH with spline boundaries

	indxf: implement new RENDER* importers

	dwgwrite: remove experimental warning

	spec: promote some RENDER* objects to UNSTABLE
	RENDERGLOBAL, RENDERENVIRONMENT, RENDERENTRY

	unit-testing: fix SOLID header
	we were testing the wrong entity all the time

	unit-testing: add more coverage, but not in dist

	spec: fix DEBUGGING PARTIAL_VIEWING_INDEX_Entry.parent type

2020-12-24  Reini Urban  <rurban@cpan.org>

	add dwgfuzz -add support
	my sample .fuzz-in-add/fuzz-add, special dwgfuzz -add format:

	version 2000
	text "test" (0.0 1.0 0.0) 8
	attribute 8 0 "prompt" (0.0 1.0 0.0) "tag" "text"
	attdef 8 0 "prompt" (0.0 1.0 0.0) "tag" "default_text"
	block "bloko"
	line (0 1 0) (1 1 0)
	endblk
	insert (0 1 0) "bloko" 1 1 1 0
	minsert (0 1 0) "bloko" 1 1 1 0 1 2 1 1
	polyline_2d 2 ((0 1) (1 1))
	polyline_3d 2 ((0 1 0) (1 1 0))
	lwpolyline 2 ((0 1) (1 1))
	arc (0.0 1.0 0.0) 0.5 0.0 3.0
	circle (0.0 1.0 0.0) 0.5
	polyline_pface 5 3 ((0 0 0) (2 0 0) (2 2 0) (1 2 0) (1 1 0)) ((0 1 2 3) (1 2 3 4) (2 3 4 5))
	polyline_mesh 3 2 ((0 0 0) (2 0 0) (2 2 0) (1 2 0) (1 1 0) (0 1 0))
	dimension_aligned (0 0 0) (2 0 0) (2 2 0)
	dimension_ang2ln (0 0 0) (2 0 0) (2 2 0)
	dimension_ang3pt (0 0 0) (2 0 0) (2 1 0) (2 2 0)
	dimension_diameter (0 0 0) (2 0 0) 2
	dimension_ordinate (0 0 0) (2 0 0) 1
	dimension_radius (0 0 0) (2 0 0) 1
	dimension_linear (2 0 0) (2 1 0) (0 0 0) 90
	point (2 0 0)
	3dface (0 0 0) (2 0 0) (2 1 0) (0 2 0)
	solid (0 0 0) (2 0) (2 1) (0 2)
	trace (0 0 0) (2 0) (2 1) (0 2)
	shape "roman.shx" (0 0 0) 2 45
	viewport "Viewport1"
	ellipse (0 0 0) 2.0 0.75
	spline 3 ((0 0 0) (2 0 0) (2 1 0)) (0 2 0) (0 3 0)
	ray (0 0 0) (2 0 0)
	xline (0 0 0) (2 0 0)
	dictionary "ACAD_MATERIAL" "Global" 0
	xrecord dictionary "REFRACTIONTILE"
	mtext (0 1 0) 10 "test\ntext"
	leader 2 ((0 0 0) (0 1 0)) mtext 15
	tolerance "testtekst" (0 0 0) (0 0 1)
	mlinestyle "Double"
	mlinestyle.start_angle = 1.12
	mline 4 ((3.9 1.5 0) (3.2 1.8 0) (4.6 1.0 0) (3.8 1.7 0))
	dimstyle "Dim1"
	dimstyle.DIMSCALE = 2.0
	dimstyle.DIMUPT = 1
	ucs (0 0 0) (1 0 0) (2.5 0 0) "Ucs1"
	ucs.ucs_elevation = 1.0
	layout viewport "Model" "ANSI_A_(8.50_x_11.00_Inches)"
	torus (10 5 0) (0 0 1) 19 2.78
	sphere (10 5 0) (0 0 1) 15
	cylinder (10 5 0) (0 0 1) 15 5 5 5
	cone (10 5 0) (0 0 1) 15 5 5 0
	wedge (10 5 0) (0 0 1) 3.3 2.4 4.8
	box (10 5 0) (0 0 1) 3.3 2.0 2.5
	pyramid (10 5 0) (0 0 1) 4.5 4 2.0 2.5

	So there are variables: viewport
	and field.setters: dimstyle.DIMUPT = 1 with 3 types:
	int, float and utf8 strings.
	you can also set HEADER fields.

2020-12-24  Reini Urban  <rurban@cpan.org>

	dynapi: accept utf8text by default for setters

	dynapi: fail on dwg_obj_generic_to_object errors
	this can have user-input with wrong pointers

	dwgwrite: missing dwg_encode declaration
	this really belongs to dwg.h, but it uses the enriched
	Bit_Chain dat. So we need to use the dwg.c helpers instead.

2020-12-23  Reini Urban  <rurban@cpan.org>

	indxf fuzz: one more HATCH.paths[0].boundary_handles[] 330 fix

2020-12-23  Reini Urban  <rurban@cpan.org>

	indxf fuzz: protect from empty APPID_CONTROL
	on add APPID LibreDWG, when dwg_get_first_object APPID_CONTROL failed.
	we need to set the created ctrl also, for the handle later.

	crashes27.sh, id:169

2020-12-23  Reini Urban  <rurban@cpan.org>

	indxf fuzz: protect setting NULL ltype handle
	eg. ARC.ltype - Continuous where this handle is still NULL.
	crashes27 id:169

	dwg_object_name: restrict to UPPERCASE 7-bit names
	for proper hash lookup. Only needed for fuzzing or wrong API usage.
	Fixes a lot of new indxf fuzzing crashes. The previous in_dwg_object()
	was more stable.

2020-12-23  Reini Urban  <rurban@cpan.org>

	fixup unit-tests: honor make -s silent
	MAKEFLAGS must not start with -s, "s -j3" was also seen

	Also improve check-minimal and check-debug targets.
	check-minimal only builds the minimal tests, not all.

	Repro:  ms -pd -C test/unit-testing/ check check_PROGRAMS=3dface 2>&1 | less

2020-12-23  Reini Urban  <rurban@cpan.org>

	spec: more Constraint subclasses

	add Oda PARTIAL_VIEWING_INDEX
	no dxf. PARTIAL_VIEWING_FILTER not in dwg.

2020-12-23  Reini Urban  <rurban@cpan.org>

	dxfclasses.in: more SCENEOE class fixes
	IBL_BACKGROUND is apparently called RAPIDRTRENDERENVIRONMENT in DXF (in ODA),
	so merge that.

	In ODA GROUND_PLANE_BACKGROUND is called GRADIENT_BACKGROUND in DXF,
	but this looks like an ODA copy & pasta bug.

2020-12-23  Reini Urban  <rurban@cpan.org>

	dxfclasses.inc: clang detected missing commas
	expression which evaluates to zero treated as a null pointer constant of
	type 'const char *const' [-Wnon-literal-null-conversion]

2020-12-22  Reini Urban  <rurban@cpan.org>

	fixup unit-tests: more verbose without silent
	The goal is to speed up local tests during development mostly.
	smokes to run without make -s so far.

	unit-tests: honor make -s silent
	and use LOG_* logging

	Merge branch 'smoke/gh302-split'
	Fixes GH #302,
	completes the add API to be able to write new DXF's
	various gperf auto-generated object and class properties and dxfnames.

	encode: disable add_DUMMY_eed on windows

	mingw32: windows has different alignment/padding
	reserve more room for eed. esp. unsigned foo:1 is uint, not uint16

2020-12-21  Reini Urban  <rurban@cpan.org>

	indxf: fix mingw32 crash with wrong 1002 . "{" type
	the dxf 1002 string needs to be converted to 0 or 1.
	All other OS silently accepted the wrong type!

	Rename the EED field to u.eed_2.close

2020-12-21  Reini Urban  <rurban@cpan.org>

	dxf2dwg is not experimental anymore

	indxf: fix HATCH_Path.boundary_handles
	the root cuase was (unsigned)hdl_idx being -1,
	but I've added next_330_boundary_handles also.

	dynapi: no MPOLYGON.boundary_handles
	this is in the HATCH_Path subclass

	gh actions: split mingw steps

2020-12-21  Reini Urban  <rurban@cpan.org>

	move CLASS_STABILITY from array in classes.c to objects.in hash
	as field there. lookup went from linear to hash constant, but
	some type lookups need now to go via name.
	Since dwg_object_name is public, make the enum public also.

	libredwg.so size went from 79.898.656 to 79.898.920 (+264 byte)
	0.11.1.4011 add_test: todo the failing dxf tests had 78.680.072
	0.11.1 release: 78.886.896

2020-12-21  Reini Urban  <rurban@cpan.org>

	auto-generate classes.c stability arrays
	taken from classes.inc

	spec: promote BLOCKREPRESENTATION to unstable
	lots of new coverage, very same layout as DYNAMICBLOCKPURGEPREVENTER
	just other block handletype and dxf.

	fix tests for --disable-write
	add a @DISABLE_WRITE@ ac macro, not USE_WRITE as for automake and define

	add missing dxfclasses, and POLARGRIPENTITY
	no test yet, to check dxfclasses.in against classes.inc and objects.in.

	AC_CHECK_LIB xml2 probe
	esp. for cross-compilation, i.e -m32.
	probe system libxml2 first, without pkg-config support.
	skip test/xmlsuite then

	json: change EVAL_Node.node[4] repr in JSON
	The second static array for now. This should be generalized.

	bindings: fix -Wdiscarded-qualifiers in dwg.i
	wrong const

	dynapi: fix -Wnull-dereference

	xmlsuite: catch iter() returned non-iterator of type xmlCoreDepthFirstItertor
	caused by libxml2 being not upgraded to python3 __next__ iterators.
	Probably an outdated libxml2 module somewhere in your path.
	For me ~/.local/lib/python3.8/site-packages/libxml2.py
	overriding /usr/lib64/python3.8/site-packages/libxml2.py

	xmlsuite: create xml only for existing xml's
	and skip blocks. This messes up the result.htm comparison.
	and it speeds up the overly slow xmlsuite check.

	reformat xmlsuite python, improve entities
	tabify.
	improve entity support: Thickness, Normal, Spline, ...
	  list of points.
	skip Model/PaperSpace/anon blocks

	free: avoid Wrong UNKNOWN type error
	ERROR: Wrong UNKNOWN_OBJ.type 513 for obj [214]: != ACDBASSOCPERSSUBENTMANAGER
	we free UNKNOWN_OBJ just fine by returning ERR_UNHANDLEDCLASS

	internal: simplify to memBEGINc
	which is the exact equivalent

	classes: auto-generate _dwg_dxfnames_variable[] also
	Too hard to maintain manually.

	silence wrong unit-testing/check-objects.pl TODOs

	spec: split BACKGROUND into 6 objects

	make full-regen-unknown

2020-12-20  Reini Urban  <rurban@cpan.org>

	dynapi: remove duplicate dwg_{entity,object}_names[]
	to save memory and avoid bsearch. use the hash lookup instead.
	This fixes the json importer

	start fixedtype offset at 500 for variable classes
	not 512, i.e. 0x200

	objects.in: sort objects

2020-12-20  Reini Urban  <rurban@cpan.org>

	auto-generate O(1) _dwg_type_names_variable[]
	no linear search anymore: fixedtype -> name.
	also the reverse via the gperf hash: name -> type.

	now only the dxfnames tables in classes.c need to be
	auto-generated from objects.in

2020-12-20  Reini Urban  <rurban@cpan.org>

	split UNDERLAY objects, adjust gen-dynapi for abstract typedefs
	resolve some typedef aliases to structs.
	eg.
	 Dwg_Entity_DWFUNDERLAY => struct _dwg_abstractentity_UNDERLAY

	doc: add add api and strings sections

	regen-dynapi line numbers

	gen-dynapi: keep generated objects.*
	if not changed.

	use dwg_object_name() in in_json
	hash lookup instead of linear search.
	check against proper dxfnames, and change from older json.
	check object/entity types and fail then.

2020-12-19  Reini Urban  <rurban@cpan.org>

	add gperf src/objects.c
	obj->name to dxfname, type and isent, gen-dynapi generated.

2020-12-19  Reini Urban  <rurban@cpan.org>

	dxf2dwg: fix leak on wrong file
	eg. programs/dxf2dwg -y -v3 example_2000.dwg

	ERROR: This is a DWG, not a DXF file: ../td/example_2000.dwg

	READ ERROR 0x800 ../td/example_2000.dwg

	=================================================================
	==1678362==ERROR: LeakSanitizer: detected memory leaks

	Direct leak of 21 byte(s) in 1 object(s) allocated from:
	    #0 0x7f55fa6e7667 in __interceptor_malloc (/lib64/libasan.so.6+0xb0667)
	    #1 0x402eba in suffix ../../programs/suffix.inc:53
	    #2 0x4043d7 in main ../../programs/dxf2dwg.c:299

2020-12-19  Reini Urban  <rurban@cpan.org>

	more proper IS_FROM_TU_DWG checks
	to handle indxf/add variants

	add api: avoid HEADER.unknown_text1 leak

	let dwg_handle_name always return a copy
	to fix json->dxf double-free's with r2007+,
	where the handle name was not converted to TU.

2020-12-19  Reini Urban  <rurban@cpan.org>

	fix dwg_handle_name with BLOCK, remove DIMENSION.blockname
	we overwrote the BLOCK_HEADER obj->name with BLOCK,
	which leads to double-free.

	Don't store a volatile DIMENSON.blockname (DXF-only),
	free immediately after use.

2020-12-19  Reini Urban  <rurban@cpan.org>

	free: fix BLOCK/DIMENSION name double-free
	same pointer, not a copy

2020-12-19  Reini Urban  <rurban@cpan.org>

	more text version fixes
	dynapi: check from_version on getters, version on setters.
	add_u8: check from_version (setter)
	add_XRECORD_string: simplify

	fixes dwgrewrite (no dwg->opts, keep TU strings on decode, convert in encode)

2020-12-19  Reini Urban  <rurban@cpan.org>

	eed, xdata: add is_tu bit
	don't rely on the dwg->opts and version flags.
	simply flag the source encoding.

2020-12-19  Reini Urban  <rurban@cpan.org>

	encode: fix add_DUMMY_eed from TU
	we need to write to the same version of the existing dwg version, not the target
	version.
	fix wrong TU len.

	and adjust the TU/TV eed string layout. same fields.
	changes the ABI.

2020-12-19  Reini Urban  <rurban@cpan.org>

	add api: when importing and using add_OBJECT
	copy the dxfname, and with INJSON even the name. See free.c

	Simplify dwg_obj_generic_dwg, use the add_APPID

	add_test: add dummy dwg_add_WIPEOUTVARIABLES
	to test possible dxfnames off-by-one errors in the static type array

	add api: set proper dxfname, add dwg_type_dxfname
	which can be derived by including classes.inc, but I want to avoid that.
	even if that means maintining two list of dxfnames.
	this is an immediate access array at least. no hash, no linear search.

	add api: set proper dxfname
	which fixes _3DFACE dxf 0 names

	add_test: ok passing tests

	add_test: convert the UTF-8 string args

	extend bit_utf8_to_T{V,U} with cquoted
	and disable unquoting for API inut, only for json strings

2020-12-18  Reini Urban  <rurban@cpan.org>

	add_test: todo the failing dxf tests

2020-12-18  Reini Urban  <rurban@cpan.org>

	WIP add api: start r2004 write support for DXF
	we can write r2018 DXF's, so fill those arrays also, not just the linked lists.

	fix get_first_owned_block() when writing DXF ENTITIES:
	We need to resolve all ref->obj pointers, but don't want to
	resolve all on each dwg_add_*() call, only when dwg_add_object did a realloc.
	We also do that at the first object and entity iterators.

	This commit caused double-free in BLOCK obj->name problems, when
	dxfwrite example_2004.json.

2020-12-18  Reini Urban  <rurban@cpan.org>

	add_test: prepare next testcases and new complex entities
	via temporary DWG_TYPE_ values.
	CHAMFER is not really an entity, but an operation on a 3DSOLID,
	like FILLET.

	add_test: extend to DXF with r2018
	to test the new UTF-8 conversions, back and forth.
	UTF8->TU in add, TU->UTF8 in out_dxf and again UTF-8->TU in_dxf.

	add api: convert the UTF-8 string args
	via dwg_add_u8_input()

	add api: switch to UTF-8 encoding
	as with the dynapi.

	indxf: switch to the fast in_hex2bin variant

	indxf: abstract in_hex2bin
	to get rid of the overly slow sscanf "%2hhX" (120x slower)

	return klass->number from dwg_require_class/add_class

	more field docs

	indxf: fix ERROR: Invalid DXF code 1 for OLE2FRAME
	An oversight, i.e. no dxf testcase for OLE2FRAME

	indxf: fix ERROR: Invalid DXF code 2 for SHAPE
	An oversight, i.e. no dxf testcase for SHAPE

	indxf: fix ERROR: Invalid DXF code 10 for POLYLINE_MESH
	An oversight, i.e. no dxf testcase for PMESH'es

2020-12-17  Reini Urban  <rurban@cpan.org>

	dynapi: enhance common_set_value for ltype
	set some special ltype flags also

2020-12-17  Reini Urban  <rurban@cpan.org>

	dynapi: enhance header_set_value to set FLAGS
	when setting some magic fields, which are encoded as FLAGS.

	adjust #line's

2020-12-17  Reini Urban  <rurban@cpan.org>

	don't convert HEADER.CELWEIGHT from dxf
	only when converting it to the FLAGS value.

	Fixes add_test roundtrips, and keeps the sanified
	add_Document default of -1

2020-12-17  Reini Urban  <rurban@cpan.org>

	add api: outline more 3DSOLID primitives
	and add the missing add 3dsolid methods, nyi

	spec: change CONE args
	same as CYLINDER

	spec: promote ACSH_CONE_CLASS to stable
	We want to properly read and write it, and can easily
	read and write it. AddCone is a documented VBA API.

	.gitignore: more rebase helpers

2020-12-15  Reini Urban  <rurban@cpan.org>

	fix dwg_convert_SAB_to_SAT1 num_blocks
	when splitting encr_sat_data blocks, we need to adjust num_blocks also,
	otherwise we would free them wrong.
	the block_size[] list is ignored there

	add_IMAGE: copy file_path arg

	dxfwrite: huge error to write dxf when file did not exist

2020-12-13  Reini Urban  <rurban@cpan.org>

	add_HATCH segments and polyline paths
	for most supported entities. just not SPLINE, REGION yet.

	also improve the add_test plines, to look properly.

	add add_ent_reactor(), the common entity struct has a different
	layout.

2020-12-13  Reini Urban  <rurban@cpan.org>

	configure: disable -Wswitch-enum at all
	We mostly switch on DWG_TYPE_* which is much too intrusive.

2020-12-13  Reini Urban  <rurban@cpan.org>

	add -Wswitch-enum suppression, sanify CC_DIAG's, _GNUC_VERSION
	simplify the GCC warnings suppressor macros.
	add _GNUC_VERSION number, and adjust clang-specific numbers.

	for the add_HATCH type switch

2020-12-13  Reini Urban  <rurban@cpan.org>

	configure: probe for the GNU sincos() extension

2020-12-12  Reini Urban  <rurban@cpan.org>

	implement dwg_add_MLINE vertex_direction
	miter_direction not yet, but it seems to be the extrusion/normal
	vector for the segment, relative to the start_angle, to calculate
	the rotation matrix.

2020-12-12  Reini Urban  <rurban@cpan.org>

	fix dwg_add_MLINE, dwg_add_MLINESTYLE: set owner and reactor
	Fixes Removed 1 unread objects from entity lists.
	AcDbMlineStyle(27)       Owner Id Is Null               Fix it
	AcDbMlineStyle(27)
	               Dictionary Reactor Missing               Attach it
	AcDbMlineStyle(18)
	Placing AUDIT_E_201210225844-1 in ACAD_MLINESTYLE dictionary
	Total errors found 4 fixed 4

	We already have the Standard MLINESTYLE in the dwg,
	as well as the current HEADER.CMLSTYLE.

	Add missing MLINE fields. TODO some vertex directions.

2020-12-12  Reini Urban  <rurban@cpan.org>

	fix dwg_add_MTEXT defaults
	Fixes mtext, leader:
	AcDbMText(27)                     was repaired.

	improve add_reactor, ensure absolute code 4 handleref

	fix dwg_add_INSERT block_header handlecode 5
	fixes Reading handle 2B object type AcDbBlockReference
	      Error 34 (eWrongObjectType)                       Object discarded
	AcDbBlockTableRecord: "bloko"     Invalid BlockReference id

	add api: create Standard DIMSTYLE on demand
	when we add a new DIMSTYLE, or when we add a DIMENSION

	add api: document more experimental methods
	those which do not work yet

	add api: improve dwg_add_LEADER
	change its API, only accept MTEXT.
	set DIMSTYLE "Annotative" with an associated_annotation.
	add more defaults.

2020-12-12  Reini Urban  <rurban@cpan.org>

	dwg_add_SHAPE: set style_id (the shape no) to 1
	which is wrong, but does not cause an error.
	The ODA description is certainly wrong.

	This fixed the error
	AcDbShape(27)        shape number <= 0                  1
	but not
	AcDbShape(27)         shape index <= 0                  1

2020-12-12  Reini Urban  <rurban@cpan.org>

	fix gperf target
	wrong top_abs_srcdir macro

2020-12-11  Reini Urban  <rurban@cpan.org>

	add api: check illegal ELLIPSE values
	fixes AcDbEllipse(27)      Radius Ratio  > 1.0                set to 1.0
	Also fixes Error 150 (eGeneralModelingFailure) because of wrong sm_axis.z value.

	add api: centralize more entity defaults
	set ent->thickness from HEADER.THICKNESS
	set ent->extrusion.z = 1.0 centrally

	doc: add Sections to the docs
	not yet via dynapi

	add api: check and normalize input values
	doubles can be nan,
	angles can be degrees or not-normalized to -180 .. 180

	add api: add End-of-ACIS-data tag
	which would allow 0 num_records in the header.

	add api: cleanup ACSH_init_evalgraph
	remove unneeded vars and even allocs

	encode: fix block-wise dwg_encrypt_SAT1
	buffer-overflows in encr_sat_data[] blocks.
	only relevent for the new dwg_new_3DSOLID() calls.

	add api: implement add_BOX
	even more points than with the WEDGE

	add api: implement add_WEDGE
	lots of points, and 2 unknown lengths c1, c2.
	TODO: acis_data block splitting seems to be broken

	doc: extend docs. add dynapi, add API

	add api: add ACIS base headers to all ACSH prims
	box, chamfer, pyramid, wedge. Their sat files look pretty big.

2020-12-10  Reini Urban  <rurban@cpan.org>

	add api: fix the ACIS headers

	add api: re-order ACSH objects, add ACSH_init_evalgraph helper
	and fix all the ownerhandle types to relative.
	now just the acis_data is wrong.

	add api: implement add_CONE
	and fix a couple of 3D things:
	EvalGraph.nodes, evalexpr,
	3DSOLID.wireframe_data_present

	fixup EVALUATION_GRAPH BLd and unit-test

2020-12-10  Reini Urban  <rurban@cpan.org>

	add api: remove custom SEQEND prev/next fixups
	just use our in_dxf api, which also handles r2004+.
	fix a PFACE typo (_vtx vs _vtxf), but we still need to fixup
	PFACE links.

	all POLYLINE_* can now be added, without recovery errors.
	But recovery is still triggered, unlike with in_dxf.

2020-12-10  Reini Urban  <rurban@cpan.org>

	add api: simplify SEQEND
	and fix prev/next_entity links, esp. for subents

	add api: fix POLYLINE_* handle types

	add api: add stability warnings to the header

2020-12-10  Reini Urban  <rurban@cpan.org>

	improve gperf targets
	add cmake support (the generated .c still has a different
	header than the automake one)

	add regen-gperf target

2020-12-10  Reini Urban  <rurban@cpan.org>

	gperf: mingw64 fails gperf invocation
	ignore then. we do have the .c file around.

	gperf --output-file dxfclasses.c dxfclasses.in
	dxfclasses.in:62: warning: junk after %% is ignored
	dxfclasses.in:54: warning: junk after %} is ignored
	unsupported language option ANSI-C
	, defaulting to ANSI-C

2020-12-10  Reini Urban  <rurban@cpan.org>

	dxf_test: fix windows -Wpointer-to-int-cast warnings

2020-12-10  Reini Urban  <rurban@cpan.org>

	add api: add 2 mandatory LAYOUTs
	but without the VPORT, or PVIEWPORT handles for now.

	provide proper defaults for VPORT, VIEWPORT, VIEW.

	change dwg_add_DICTIONARY* api. no handlref arg, just the raw absolute_ref.
	Noe there is only one unread object warning remaining.

2020-12-10  Reini Urban  <rurban@cpan.org>

	add api: add missing LAYOUT dicts and objects
	Setting hdr ACAD_LAYOUT dict id.16 error opening *Model_Space's layout.
	Setting layout id to null.
	16 error opening *Paper_Space's layout.
	Setting layout id to null.
	    Salvaged database from drawing.
	Removed 1 unread objects from entity lists.

	add API: fix LTYPE_CONTROL.byblock types
	Now just the mandatory LAYOUT objects are missing.

	add_PLACEHOLDER owner and reactor
	acad complains and fixes it.

	add api: fix add_DICTIONARYWDFLT
	add to NOD if missing

	add_Document: add proper MLINESTYLE.Standard and
	empty ACAD_PLOTSETTINGS dict. Initial LAYOUT.Model still missing

	add api: delete old dwg_require_class

	add api: fix some wrong handle types
	NOD, object entries, entity owners,
	dict owners and reactors.

2020-12-09  Reini Urban  <rurban@cpan.org>

	spec: add EVAL_Edge EVALUATION_GRAPH.edges[]
	list of incoming and outgoing edges.
	now there is not more padding left.

	implement add_CYLINDER

	indxf: support EVALUATION_GRAPH.nodes

	spec: change EVALUATION_GRAPH
	list of EvalExpr nodes, with default edges of -1

	api: add some geometric helpers
	from our SVG geom.c

	prepare empty dwg_normal_to_matrix9
	just using the defaults.
	i.e. rotation not yet supported.

2020-12-09  Reini Urban  <rurban@cpan.org>

	add api: extend ACSH api with normal
	not just a xy rotation. acis needs that.
	but it is optional and defaults to {0,0,1}

	now we need some public arbitray-axis algo helpers:
	  dwg_rot_to_normal(double, *3dpoint)
	  dwg_normal_to_matrix9()

2020-12-09  Reini Urban  <rurban@cpan.org>

	implement dwg_require_class as gperf hash
	add dxfclasses.in. This is now faster and a less unreadable mess as before

2020-12-07  Reini Urban  <rurban@cpan.org>

	log ACSH.history_node.trans[]

	implement add_SPHERE
	with a much simpler ACIS template

	spec: change 3DSOLID_wire.selection_marker from BL to BLd
	signed, just as acis_index. Default: -1

	add_TORUS: simplify
	use an earlier ASM version, which is simplier and can be read by earlier apps.
	Note LibreDWG as generator.

	dwg_add_3DSOLID: set block_size[]

	add api: add NULL checks and fix snprintf size

	add api: fix dwg_add_XRECORD_xdata
	add to the end, don't overwrite the head.

	spec: promote EVALUATION_GRAPH to unstable, fix 2 leaks
	add_Document temp added a BOLOCK_CONTROL.entry, which leaked.
	EVALUATION_GRAPH.evalexpr was added via add_TORUS, but was debugging,
	so leaked.

	fix add_3DSOLID
	wrong encr_sat_data size

	add api: reformat only

	add api: prepare rotation for ACSH solids

	add api: abstract dwg_init_ACSH_CLASS
	add origin_pt to history_node.trans right column
	the rotation not yet

	add api: add more require_classes
	This time with macros. But not all yet, only those we need
	TODO: This really should be done with a gperf hash.

	add api: implement dwg_add_TORUS
	via simple acis template.
	and promote to stable.

	spec: change 3DSOLID_wire.acis_index from BL to BLd (signed)
	There are many -1

	add api: add most ACSH Entities and Classes WIP
	Each entity (a 3DSOLID) has linked EVALUATION_GRAPH, ACSH_HISTORY_CLASS
	and each ACSH_object_CLASS for the original 3DSOLID creation params

2020-12-07  Reini Urban  <rurban@cpan.org>

	add api: add experimental APIs {LAYER,SPATIAL}{FILTER,FILTER}
	just for SPATIAL_FILTER I have coverage

	also PROXY_{ENTITY,OBJECT}

	add IMAGEDEF_REACTOR to IMAGE

2020-12-07  Reini Urban  <rurban@cpan.org>

	configure: improve ASAN detection to CC
	not just CFLAGS

	github-actions: declare ASAN in CFLAGS, not CC
	configure.ac only checks CFLAGS for asan.
	hence doesnt detect it, and fails
	on memory leak checks with the known leaking in_dxf.

	github-actions: asan without bindings
	still does timeout.

2020-12-06  Reini Urban  <rurban@cpan.org>

	spec: RTEXT is Remote Test not ROTATEDTEXT
	DEBUGGING. Fix the DXF subclass name.

	debug: add AcDbAssocActionBody to AcDbAssocAnnotationActionBody

	spec: rename ATEXT to ARCALIGNEDTEXT
	still DEBUGGING

	add api: remove DIMENSION_ALIGNED.def_pt argument

2020-12-06  Reini Urban  <rurban@cpan.org>

	define HAVE_DWG_ADD_<OBJECT> and HAVE_NO_DWG_ADD_<OBJECT>
	to auto-generate APIs, as e.g. for gambas from src/objects.inc
	we don't have yet add api's for all objects, entities.

	The list was autogenerated with one-liners of perl, diff, cut, sort.

2020-12-06  Reini Urban  <rurban@cpan.org>

	api: dwg.h does not define USE_WRITE
	config.h does, but this is not exported. External
	projects may need write support.

2020-12-03  Reini Urban  <rurban@cpan.org>

	msys2: seperate appveyor from gh-actions again
	restore appveyor build-aux/msys2.bat, fix typo.
	gh-actions uses its own recipe.

2020-12-02  Reini Urban  <rurban@cpan.org>

	appveyor: restore build-aux/msys2.bat
	broken by gh-actions

	generated config.h.in
	is reworded

	travis: disable all but --enable-release
	gh-actions are now good enough

	add api: fix TABLE.ownerhandle

2020-12-02  Reini Urban  <rurban@cpan.org>

	add api: fix add_Document
	BLOCK_CONTROL.{model,paper}_space types.

	fix DICTIONARY fields: ownerhandle, reactor, cloning.
	default TABLE.is_xref_ref to 1.

2020-12-02  Reini Urban  <rurban@cpan.org>

	add_test: fix most leaks

	api: improve VBA_PROJECT support
	and add a test.
	WIP: needs a dict, appears still empty in the dwg.

	add api: validate object,entity types

	add api: add VBA_PROJECT, LAYOUT
	and fix MLINESTYLE

	regen-dynapi

	gh actions: skip work/ branches

2020-12-01  Reini Urban  <rurban@cpan.org>

	gh-actions: no cmake matrix
	just the one used for SolveSpace

	cmake: fix *.test perms

2020-12-01  Reini Urban  <rurban@cpan.org>

	--disable-write fixes
	dont install a crippled shared lib with cmake, which is
	mostly use for in-tree cmake variants.
	enable USE_TRACING (for debugging)

	disable the add API with --disable-write

2020-12-01  Reini Urban  <rurban@cpan.org>

	improve gh-actions
	setup-python
	setup-python-libxml2
	add cmake with all options
	run make distcheck only with --enable-release

	note that with --disable-bindings, make distcheck will always fail.

2020-12-01  Reini Urban  <rurban@cpan.org>

	fixup gh-actions
	no sudo
	various quirks

	Add GH actions, as new YAML
	PR #130

	cmake: improve config.h expansion

2020-12-01  Reini Urban  <rurban@cpan.org>

	api: support DISABLE_JSON
	in dwgread, d*write, in_dxf, dwgfuzz, and the testcases.

	move find_numfield from in_json to in_dxf, because it is used there also,
	and we can disable json now.

2020-12-01  Reini Urban  <rurban@cpan.org>

	configure: add --disable-json
	for a very slim library, such as for SolveSpace

2020-12-01  Reini Urban  <rurban@cpan.org>

	Support slimmer cmake builds
	cmake args:
	  -DLIBREDWG_LIBONLY=On
	  -DLIBREDWG_DISABLE_WRITE=On
	  -DLIBREDWG_DISABLE_JSON=On

	Esp. for SolveSpace.
	Also add more tests.
	Fixes GH #299

2020-12-01  Reini Urban  <rurban@cpan.org>

	configure: probe for HAVE_PYTHON_LIBXML2
	only when we have the XML2_LIBS, and not --disable-python.
	just to skip test/xmlsuite

	spec: fix more 32bit type errors
	UNDERLAY.num_clip_inverts BL -> BS
	VISUALSTYLE.face_modifier r2010+ BL -> BS

	spec: fix UCS.num_orthopts from BL to BS

2020-11-26  Reini Urban  <rurban@cpan.org>

	add_test: re-enable DICTIONARYWDFLT
	passes now, after we require the class before.
	60a70c8158ab77db0f0210e64c4d1258fd923100

	api: fix heap-overflow in DWG_GETALL_OBJECT
	oops, this was undertested.

	xmlsuite: improve PYTHON quoting
	esp. for systems with spaces in the python path.
	See 78d1b58d1bf2ef22b746d8a7763ff5ec1202de78

	add api: fixup add_REGION

	add api: fix most INVALIDTYPE errors
	we need to add the class before our variable object.
	otherwise we would need to fixup our type afterwards.

	add_Document: add missing require_class ACDBDICTIONARYWDFLT

	dwg_find_dictionary: -Wnull-dereference

	xmlsuite: add python shebang
	Seokhwan Cho reported /check.py: line 1: import: command not found with python 3.9
	on macOS

	add_test: better LIBREDWG_DEBUG verbosity
	to find out which test to debug.
	skip the 2 broken tests unless debug.
	also set DICTIONARYWDFLT.defaultid, but variable types are still broken.

	add api: copy acis_data also

	add api: support XRECORD values

2020-11-25  Reini Urban  <rurban@cpan.org>

	api: change all dwg_ent|obj_generic* to void*
	so we don't need to cast around.
	for XRECORD find the dict->key to set

	add api: add GROUP, MLINESTYLE to nod
	fix dwg_add_DICTIONARY_item to check if the key already exists.
	add GROUP and MLINESTYLE api and dicts

	add api: cover now all testcases
	well, almost

	add_test: LIBREDWG_DEBUG=cnt controls with single test to run
	and add a couple more tests.
	e.g. LIBREDWG_DEBUG=13 LIBREDWG_TRACE=3

	add api: more add_Document defaults

	c++-compat: warning: excess elements in array initializer

	add api: even more dwg_require_class

2020-11-24  Reini Urban  <rurban@cpan.org>

	add api: more dwg_require_class

	add api: fixup ATTRIB links

	add_test: add SPLINE

	add api: register INSERT in blkhdr->inserts
	and register added obj handles in the hash. otherwise
	we will not be able to find them.

	fixup -Wdiscarded-qualifiers for internal in_postprocess_SEQEND()

	api: add more LOG_ERROR
	and improve unit-testing/add_test.c: need to add the new BLOCK to a new
	BLOCK_HEADER (WIP)

	add api: fix dwg_ref_object resolver
	by fixing the dwg->dirty_refs state. only dirty it when object[] is realloced.
	also pass the dwg->opts loglevel to the decode and dwg modules on add.
	silence the BLOCK_HEADER null warning

	add api: set ENTITY.ownerhandle
	esp. for complex plines.

	add api: remove dwg_dup_handleref
	add helper dwg_obj_generic_handlevalue().
	set mline->mlinestyle (found via nod)

2020-11-24  Reini Urban  <rurban@cpan.org>

	api: fixup add api for pts[]
	esp.  dwg_ent_lwpline_set_points() and the new _add_POLYLINE ones.
	add tests for complex polylines, simple spline.
	add our old importer fixups to link the ents, and provide new style
	vertex/attrib arrays (e.g for r2004+ DXF creation).

	change dwg_add_document to dwg_add_Document and add 2 more args (version and
	loglevel).

2020-11-24  Reini Urban  <rurban@cpan.org>

	api: enhance add for complex entities
	add Attribute to insert (with BLOCK ATTDEF and INSERT ATTRIB).
	change add API to take entities to which to add subents (VERTEX, ATTRIB) to.

	unit-testing add_test enhancements.

2020-11-24  Reini Urban  <rurban@cpan.org>

	api: more add methods
	fix the remaining decls

	unit-testing: extend add_test
	and fix some found const-free bugs.
	support INSERT block names.

	api: remove R_2021 / AC1035
	r2021 still uses the r2018 format

2020-11-23  Reini Urban  <rurban@cpan.org>

	unit-testing: silence add_test warnings

	bump LIBREDWG_SO_VERSION to 0:12:0

	improve unit-testing/add_test.c
	for distcheck

2020-11-22  Reini Urban  <rurban@cpan.org>

	api: fix/stabilize mspace add refs
	take the new ref in the test after reading it in from the dwg
	this fixes add_test

2020-11-22  Reini Urban  <rurban@cpan.org>

	api: add_document fill the dictionaries
	and more details.
	fix some invalid free's on const strings.
	fix BLOCK/ENDBLK links and special cases.

	Checked against an original acad2000 empty dwg for the defaults.
	I cannot read acadiso.dwt still.

2020-11-22  Reini Urban  <rurban@cpan.org>

	api: honor dwg_add_document(metric)
	and minor logging beauty

2020-11-22  Reini Urban  <rurban@cpan.org>

	api: improve add_TABLES
	add new api's: dwg_get_first_object(dwg,type) and
	dwg_get_first_OBJECT(dwg,type), because getall is not really
	suitable for that. We only need to search for the single CONTROL object
	and dont want to scan the whole dwg.

	Fixup Dwg_Object_OBJECT conversion to Dwg_Object.
	Add a dwg->next_hdl hack for holes in dwg_add_document().

2020-11-21  Reini Urban  <rurban@cpan.org>

	api: add tables
	with its control object

	api: more work on dwg_add_document
	first initialization

	unit-testing: add add_test
	to test the basic add API

	NEWS: Describe the latest and planned changes for 0.12

	api: add classes support
	for some objects/entities. plus more entities

	api: more add entity functions
	HATCH has a special AddOuterLoop function. We rather combine that,
	taking some objects and using its handles.

2020-11-20  Reini Urban  <rurban@cpan.org>

	api: add some add_OBJECT functions
	in VBA XRECORD is added to a DICTIONARY

	api: more add functions
	The .so has now 14MB

	api: more add helpers
	dwg_add_to_mspace is not needed anymore.
	add dwg_add_entity_defaults, dwg_dup_handleref and
	dwg_insert_entity to link the blkhdr with the new entity.

	api: improved add functions
	add to the current block (mspace, pspace or block) as in VBA.
	this enables linking the new entity into the block.

	c++: fix basic c++ compatibility
	restrict is __restrict
	__nonnull has a different index, disable it.

	WIP api: add some basic add functions
	for write functionality: SolveSpace, GauchoCAD.
	Just the layout.

	api: disable deprecated dwg_api
	all object-specific field getters and setters.
	re-enable with -DUSE_DEPRECATED_API

2020-11-19  Reini Urban  <rurban@cpan.org>

	cmake: enhance to programs and lto
	fixup the HAVE_PCRE_* defines. need to be undef'ed if not found.

2020-11-18  Reini Urban  <rurban@cpan.org>

	python -no-undefined and LIBS to enable shared
	otherwise the python binding will be static only.
	40MB Windows release .zip's is too much.

	extend dxf-allcvt.lsp for more silent crashes

2020-11-16  Reini Urban  <rurban@cpan.org>

	Release 0.11.1
	See NEWS.
	Mostly out_dxf fixes to enable acad dxfin for most generated DXF (~90%).
	No API changes

	dynapi: adjust line numbers

	unit-testing: fix a SEGV with NULL BLOCKLOOKUPACTION.lut
	in 2010/sun_and_sky_demo

	indxf: make failing dwg_has_subclass check non-fatal
	Several subclasses still missing. Fix them over time.
	For now fixed all stable and unstable classes.
	Fixes GH #295

	dynapi: change _type_subclasses to _name_subclasses
	we cannot yet sort by enum Dwg_Object_type (fixedtype), so we need strings.
	Add more subclasses: AcDbDimension
	Fixup wrong subclasses for LAYOUT, VERTEX_3D, PLOTSETTINGS.
	Fixup fields macros with args. Skip them for DXF/ENT defaults. Fixes
	TABLE_value.data_string
	See GH #295

2020-11-16  Reini Urban  <rurban@cpan.org>

	WIP add has_subclass API
	for the previous indxf fix.
	We need to check if a subclass belongs to a class,
	or which subclasses are valid in a class.
	Parse dwg.spec for all SUBCLASSes and fill in
	a new dwg_type_subclasses[] array, sorted for bsearch.

	We expand more defines now. Also parametric _fields ().
	See GH #295

2020-11-15  Reini Urban  <rurban@cpan.org>

	indxf: check 1 proper DETAILVIEWSTYLE for subclass
	TODO: this needs to be generalized.
	A shorter subclass into a wrong class will overwrite unallocated memory.
	heap-buffer-overflow, such as in crashes29 id 73

	fix oob in bit_convert_TU
	wrong length calculation. e.g. crashes8

	free: fix BLOCK.name double-free <r2007
	== DIMENSION.blockname

2020-11-15  Reini Urban  <rurban@cpan.org>

	dxf sab: max 4096 encr_sat_data block_size
	Split it up into chunks.
	The blocksize should not exceed 4096. Error 30004
	e.g. The 3DSOLID 2E1 in example_20*

	Also keep the End-of-ACIS-Data
	teigha always writes it, and it can be imported.

2020-11-14  Reini Urban  <rurban@cpan.org>

	fixup DIMSTYLE re-order, duplicate DIMTXSTY
	leading to messed up handles and a leak.

2020-11-13  Reini Urban  <rurban@cpan.org>

	dxf: fix read oob in SAB 2 caret expansion

	free 3DSOLID.history_id
	The few history_id (3.0.0) handles still leak though.

2020-11-13  Reini Urban  <rurban@cpan.org>

	dxf: fixup improve dwg_dim_blockname
	r2007+ it is already converted to utf-8.
	don't convert it twice, use FIELD_TV0 instead.

	fixes model-mechanical_from_uloz.to_2013

2020-11-13  Reini Urban  <rurban@cpan.org>

	decode: fix empty classes, e.g. r13c3
	And add -v5,6 logging to r2000 classes
	Fixes GH #294

	fix debugging unit-testing/blockuserparameter
	changed API

	comments: new idea for classes
	the problem is that some r13c3 classes fail to be read.
	See GH #294

	debug: silence MPOLYGON cast warnings

	logs-all.sh: revise
	abstract abs_dwgread,
	longer timeouts,
	adapt to renamed test-old dirs

2020-11-12  Reini Urban  <rurban@cpan.org>

	spec: add DEBUGGING BLOCKREPRESENTATION fields

	dxf: don't skip IDBUFFER r13-r14

	dxf: fix UCS
	misspelled the UCSTableRecord

	dxf: change the T dxf continuation group 1 from 3 to 1
	TODO: investigate which field switches from 1 to 3 for continuations...
	Fixes overlong TEXT.text_value (jis_a0)

	fixup dxf: split overlong 1 strings into groups of 3
	forgot to advance the str, and used a wrong format template.

	dxf: convert shift-jis text \M+1xxxx to \U+xxxx
	but overly simplistic. for just the hiragana and katagana letters,
	not the full cjk range yet.

	dxf: optional DIMENSION.dimstyle
	fixes "Invalid dimension style name."

	dxf: improve dwg_dim_blockname() and dwg_handle_name()
	needed for DXF <r2000 dimensions eg.
	For BLOCK search the BLOCK entities instead.
	The BLOCK_HEADER has only the abbrevated name, but we want "*D30", not "*D".

	dxf: fix duplicate INSERT.scale
	dxf has a wrong IS_PRINT. Thus it called PRINT {} blocks also.
	See GH #275

	fix build-aux/git-version-gen with _dirty

2020-11-12  Reini Urban  <rurban@cpan.org>

	dxf: skip linewt 370 0 for non-lines (SEQEND, VERTEX*)
	when are dxf 370 default?
	with lines 1d (ByLayer) is default, without 1c (0).

	also fix the indxf default linewt.

2020-11-11  Reini Urban  <rurban@cpan.org>

	spec: promote ACSH_HISTORY_CLASS to stable

	spec: work on ACSH_HISTORY_CLASS => unstable
	needed for the previous commit.
	r2007+ 3DSOLIDs need that.
	add fieldnames, no evalexpr nor historynodes.

	dxf: dxf_check_history_id
	r2007+ needs the 350 history_id for the DXF.
	search all our objects and assign the first one

	dxf: remove AcDbShPrimitive from ACSH_CHAMFER_CLASS

	dxf: remove AcDbShPrimitive from ACSH_FILLET,BOOLEAN_CLASS
	e.g. 2007/ATMOS-DC22S_from_cadforum.cz

2020-11-11  Reini Urban  <rurban@cpan.org>

	dxf: avoid nan, only with DEBUG_CLASSES
	fixes BLOCKBASEPOINTPARAMETER in 2007/blocks_and_tables_-_imperial

	which would be a PROXY_OBJECT without AEC.
	Before we avoided nan only for releases.

2020-11-11  Reini Urban  <rurban@cpan.org>

	dxf: hardcode major.minor for EvalExpr and BlockElement
	fixes 2007/blocks_and_tables_-_metric

	dxf: fix AcDbBlockScaleAction BlockAction_ConnectionPts offsets

	dxf: fix some HEADER texttypes
	e.g. $STYLESHEET, $HYPERLINKBASE

	dxf-allcvt.sh: renamed the test-old dirs
	and adjust crashing dxf imports

	dxf: fixup AcDb3dSolid subclass
	with DXF only print 100, 350 if r2007+. e.g. example_2007, 2007/ATMOS-DC22S
	with DWG read 350 only for version 2.
	fixes up 991808b3280aa2034e3177e19efa3f2195dd9d49

2020-11-10  Reini Urban  <rurban@cpan.org>

	dxf: skip final SAB End-of-ACIS-data line
	this is only SAB relevant, but not for the DXF

2020-11-10  Reini Urban  <rurban@cpan.org>

	dxf: split overlong 1 strings into groups of 3
	with max chunk length 255.
	enhance dxf_fixup_string to do the quoting and splitting.

	With SAB->SAT conversion do the splitting in the SAT file already.
	This has no groups 3.

2020-11-10  Reini Urban  <rurban@cpan.org>

	improve dxf-allcvt.lsp
	optional prompt for next,
	optional erasure to avoid Duplicate block warnings
	filter out more crashes

	dxf.in: name the dxf as in log
	for the test-old data. eg.
	Reading DWG file test/test-old/AC1012/from_autocad_r14/overhead.dwg
	Writing DXF file overhead_from_autocad_r14_AC1012.dxf

	dxf: add SAB tag 23 for int64
	see https://github.com/jmplonka/InventorLoader/

	scandir() needs also _NETBSD_SOURCE
	why they dont take just _BSD_SOURCE is beyond my comfort level.
	See https://nxr.netbsd.org/xref/src/include/dirent.h#111
	Thanks to Iain Hibbert for the report and suggestion.

2020-11-08  Reini Urban  <rurban@cpan.org>

	dxf: fix 3DSOLID r2007+
	Add missing 100 . AcDb3dSolid and 350 . history_id
	even for version 1 SAT data.
	Fixes GH #282

2020-11-07  Reini Urban  <rurban@cpan.org>

	add examples/filt_sat.pl, dec_sat.pl
	filt_sat.pl: to compare two decoded sat files.
	dec_sat.pl: decode DXF encrypted sat files.

	e.g.
	rem extract the encrypted 1 groups from a DXF into a seperate file
	for s in "`cat TS1_2000.dxf.encr`"
	do
		./dec_sat.pl "$s" | grep -v "^  n"
	done | ./filt_sat.pl > TS1_2000.dxf.decr

2020-11-07  Reini Urban  <rurban@cpan.org>

	dxf: remove AcDbAlignedDimension.oblique_angle 52 from DXF
	Unexpected DXF group code: 52
	for in_dxf looks like we need to calculate it, but actually
	it's always the default 0.0

	dxf: use ACAD_ prefix for PROXY_{ENTITY,OBJECT}
	not a variable class

2020-11-07  Reini Urban  <rurban@cpan.org>

	SAB: accept tag 21 as enum long constant
	just guessing what the exact format is.
	The enum seems to be the previous identifier.
	e.g. exact_int_cur <21> $0 means the identifier int_cur
	has the value exact and a constant $0 ??

	See GH #291

2020-11-07  Reini Urban  <rurban@cpan.org>

	indxf: accept some invalid color groups
	as acad dxfin does also.
	those dxf's appear in the wild, probably from other dxf exporters.
	Fixes GH #290

2020-11-07  Reini Urban  <rurban@cpan.org>

	dxf: fix 3DSOLID dxf encoding
	Replace all "^" chars by "^ ".
	For the decoding in in_dxf we already do the reverse.

	Fixes GH #283

2020-11-07  Reini Urban  <rurban@cpan.org>

	WIP dxf: SPLINE re-ordering
	provide defaults for tolerances.
	TODO: knots and ctrl_pts with Bezier (scenario 2) for DXF only

	dxf: optional 3DSOLID.acic_ampty 290

	dxf: improve BLOCK groups 70, 1, 4
	when taking the BLOCK_HEADER values.
	esp. fix the groups 70 (hdr flags),
	1 (xref path name) and
	4 the optional description.

2020-11-07  Reini Urban  <rurban@cpan.org>

	dxf: re-order DIMSTYLE
	and many optional values, even CMC0 (color)

	TODO: There are many different default values, not just 0 and 1.
	esp. with DIMSTYLE. The Standard style has no values at all in DXF.
	maybe add FIELD_B_opt (name, dxf, def)

2020-11-07  Reini Urban  <rurban@cpan.org>

	dxf: Move PSPACE entities from BLOCKS to ENTITIES
	Iterate over all ENTITIES not just from model space, but also
	from paper space.
	There would be three variants how to order them.
	We choose to list first all owned mspace, and then all owned pspace
	entities.

	Should fix these DXFIN error messages:
	  * Entities not allowed in *Paper_Space block definition
	  * Error: Block "*Paper_Space" was not defined

	Thanks to @mozman for explaining the problem to me, and coming with the
	nice dxfpp tool with ezdxf.
	Fixes GH #277

2020-11-07  Reini Urban  <rurban@cpan.org>

	dxf: fix STYLE Invalid textstyle name for shapeFile: "SHAPE$0$REF"
	Such names need to be empty in the DXF output, when STYLE.is_shape is set.
	Fixes GH #287

	dxf: fix r13c3 crashes in DICTIONARY with empty text
	also extend dxf-allcvt.sh

2020-11-07  Reini Urban  <rurban@cpan.org>

	fix XRECORD VT_INT64 xdata from BLL to RLL
	for all VT_INT64 xdata values.
	also add the missing INT64 case to out_dxf for XRECORD xdata.

	Fixes #289
	This did not change the public API, only a comment in dwg.h

2020-11-07  Reini Urban  <rurban@cpan.org>

	dxf: fix MLINESTYLE angles
	keep the DWG angles (and hope they are in range)
	but range restrict the rad2deg DXF variants.
	accept 90.0001 or such.

	Don't use FIELD_BD(), this would do rad2deg again.
	The DXFIN fix is: MLINESTYLE Bad mlstyle start angle.

2020-11-07  Reini Urban  <rurban@cpan.org>

	spec: avoid STYLE.flag logging at free
	only needed at en/decode

	fix bit_convert_TU out-of-bounds by 1
	2013/flipped_cleaned at TEXT.text_value

	spec: default TEXT.width_factor = 1.0
	and skip if default on DXF

	dxf: skip LAYER.material 347
	which is an unstable class.
	it would point to an invalid handle.

	dxf_file.pl: improve rounding of all numbers
	honor negative numbers.
	keep only 6 after-comma places.
	do so by rounding float numbers in perl by ourself.

	dxf: fix SPATIAL_FILTER.origin to 11
	SPATIAL_FILTER Error: expected group code 11

	dxf: fix HATCH.scale_spacing 41
	Error: expected group code 41
	41 is not optional if 1.0, with 2013

	dxf: fix Layer name with vertical bar is not marked dependent
	wrong flag 70 mask. Only mask of plotflag and linewt, but not 0x10 (xref dep)

	spec: fix LTYPE with shape_flag 74: 2
	the dashes.text value calc. was wrong.

	dxf: fix PDFUNDERLAY: Unexpected DXF group code: 170
	i.e. num_clip_inverts

	dxf: SPATIAL_INDEX has no ObjectDBX
	but only in DXF

2020-11-07  Reini Urban  <rurban@cpan.org>

	dxf: extend LAYER.plotflag for DEFPOINTS
	extend the special-case of f53d2deb820bf2fb300345c78d1a95fb9d2ff4d5
	to be case-insensitive.
	Fixes Publish_2004.dxf

	Also a typo of the color logs

2020-11-07  Reini Urban  <rurban@cpan.org>

	dxf: re-order MULTILEADER
	failed all over with DXFIN, from r14-2018.
	This crashes now Leader_200{0,4}, but fixed all MULTILEADER errors.

	dxf: fix VERTEX: Bad visibility value 2
	take only bit 0 of ENTITY.invisible => 60 . 1

	dxf: avoid duplicate STYLE eed 1000/1001/1071
	for ttf data

	dxf: re-order LEADER

	dxf: re-order ENTITY.ltype_scale 48
	right after ltype 6

2020-11-07  Reini Urban  <rurban@cpan.org>

	dxf, json: fix DIMENSION_ANG2LN
	Unexpected DXF group code 10

	Fix missing JSON def_pt 10 for most DIMENSION entities.

2020-11-07  Reini Urban  <rurban@cpan.org>

	dxf: fix SUBCLASS version check

	dxf: no 70 in AcDbOrdinateDimension
	Unexpected DXF group code: 70

2020-11-07  Reini Urban  <rurban@cpan.org>

	improve dxf-allcvt.lsp to autoimport all
	now with custom match filter, with logging to file,
	fast (no safety prompt).

	we cannot close the fresh DXFIN tab, as within autolisp it is not.
	and purging the new blocks produces too many lines in the log file.
	so rather keep up with our Duplicate block warnings

2020-11-03  Reini Urban  <rurban@cpan.org>

	dxf: fix ATTDEF for r13-r14

	dxf r13-r14: fix Class separator for class AcDbText expected

	dxf: before r2000 keep only some variable objects
	which should also handle PLACEHOLDER from before

	dxf: skip ACDBPLACEHOLDER before r14
	e.g. r13/RAY
	The following error was encountered while reading in ACDBPLACEHOLDER starting at line 1918:
	Class separator for class AcDbPlaceHolder expected
	Invalid or incomplete DXF input -- drawing discarded.

	dxf: skip 100 . AcDbDimStyleTable before r2000
	Fixes a couple of r14 dxf's.

	dxf: fix STYLE.flag calc from is_vertical and is_shape bits
	the other way round. is_shape is bit 1

	dxf: no $SAVEIMAGES with r14
	only r13/AC1012

	dxf: fix pre-r2000 HEADER starting with $TDCREATE
	if without {}.
	Error 372 in drawing header on line 428

	dxf: remove $DIMSAV from HEADER
	not in DXF at all

2020-11-01  Reini Urban  <rurban@cpan.org>

	dynapi: regen VISUALSTYLE changes
	here we need to take the first decl, not the last one

	prelim NEWS for 0.11.1
	Summarize the fixes so far

	dxf: re-order VISUALSTYLE
	esp for r2013.
	This fixes DXFIN for VISUALSTYLE.

2020-10-31  Reini Urban  <rurban@cpan.org>

	dxf: re-order more common DIMENSION fields
	flip extrusion with ins_scale in DXF.
	move the group around text_rotation 54,51,210,53 to the end.
	there's no ins_scale and 2nd def_pt 10 in DXF.
	blockname 2 is optional

	Fixup 2018/Dynblocks.dwg to be r2018, not r2004.

2020-10-30  Reini Urban  <rurban@cpan.org>

	dxf: skip DIMENSION 72 and 41 defaults of 1
	add BS1 and use BD1 for lspace_style and lspace_factor

	dxf: fix wrong DIMENSION.flag 70 calc
	e.g. flag1 = 11 (LINEAR) should be converted to flag 32 [70]
	untested: inverse indxf conversion flag => flag1

	refactor MPOLYGON analog to HATCH

	refactor HATCH.boundary_handles
	move to paths[].
	This fixes GH #280, dxf.

2020-10-30  Reini Urban  <rurban@cpan.org>

	dxf: re-order HATCH
	move 97 and 330 out of loop.
	330 boundary_handles as vector before 75.
	no gradient_fill if off. move to the very end.
	write SOLID instead of SOLID,_I

	Partial fix for GH #280. see next commit.

2020-10-30  Reini Urban  <rurban@cpan.org>

	appveyor: less cygwin tests
	we constantly run into test timeouts

	dxf: use "%-16.16f" for floats, maxlen 18
	to match acad ascii dxfout better

2020-10-30  Reini Urban  <rurban@cpan.org>

	decode_r2007: repair Invalid string stream data_size
	which happens with type>500 objects on r2007.
	start all 3 streams at the same offset, the obj->address.
	The problem was to assume str->byte == 1 (8 bit offset)
	which was wrong with larger obj->type or obj->size MS sizes.

	avoid duplicate obj_handle_stream()
	Fixes GH #279

2020-10-30  Reini Urban  <rurban@cpan.org>

	dxf: ATTDEF re-ordering

	dxf: honor dxf 0 for points
	some points need to be skipped, e.g. BLOCKSCALEACTION

	dxf: ATTRIB re-ordering

	dxf: always print LAYER.plotflag 290 with Defpoints
	See GH #275

	dxf: ATTRIB defaults

	dxf: re-order TEXT.vert_alignment 73
	must be after SUBCLASS (AcDbText).
	And fix ATTRIB.vert_alignment to group 74.

	dxf: flip lineweight sign
	use BSd not RC, which represented 140 as -116.
	See GH #275. Tested all lineweights.

	dxf: re-order VIEWPORT

	fix bit_convert_TU for 128-255
	wrong UCS-2 to UTF-8 conversion for the chars 128-255

	skip more DXF defaults: 290, 284
	ENTITY.shadow_flags 284 is optional
	LAYER.plotflag 290 also.

	fix DXF 10<=>30 for TEXT
	the elevation is after the ins_pt 10,20 of course.
	Also fix DXF for 11 and 210.
	Thanks to GH #275.

2020-10-30  Reini Urban  <rurban@cpan.org>

	summaryinfo: fix types T to TU16
	The length is RS prefixed.

	fix HYPERLINKBASE default:
	when encoding to later versions, we might need to convert the type

	This fixes the 2007/colorwh dxf part for the SummaryInfo section,
	GH #275

2020-10-30  Reini Urban  <rurban@cpan.org>

	dxf: fixup TU strings
	convert \r\n to ^M^J for ASCII dxf. See GH #275 with 2007/colorwh,
	an AutoDesk example dwg

2020-10-28  Reini Urban  <rurban@cpan.org>

	Fix out_geojson with r2007+
	Text must be converted from UTF-16 to UTF-8
	for MTEXT, TEXT and GEOPOSITIONMARKER.
	Thanks to @chensscode, GH #271

2020-10-22  Matthew Broadway  <matthew.broadway@navenio.com>

	fixed dockerfile

2020-10-09  Reini Urban  <rurban@cpan.org>

	in_dxf: fix one wrong BLOCKALIGNMENTPARAMETER.prop_states type
	we allocated for double but need only BITCODE_BL.
	harmless bug, but found when looking at hardened -Wincompatible-pointer-types

	c++: more c++ compat

	revert some c++ compat casts
	from 6d0295d60b1a3ea589ed44c5290fb07c3f38894b.
	Avoid -Wincompatible-pointer-types with DWG_ENTITY and ADD_TABLE_IF

2020-10-08  Reini Urban  <rurban@cpan.org>

	msys2: fix broken msys2 mirror
	update to latest image VS 2019, which does not need a complete update.

2020-09-18  Reini Urban  <rurban@cpan.org>

	c++: more c++ compat
	at least for some private headers also.

	cmake: add basic library support
	Only for external cmake apps, like for the solvespace integration.
	Only the lib, no programs yet.

2020-09-14  Reini Urban  <rurban@cpan.org>

	.gitignore: support clangd/lsp server
	hint: make clean; bear make

2020-09-05  Reini Urban  <rurban@cpan.org>

	fixup {en,de}code VALUE types
	for -Wformat with int immediates, such as
	VALUE_BS (1, 70), where int i must be cast to unsigned short.

2020-09-04  Reini Urban  <rurban@cpan.org>

	perl: enable tests out-of-tree

	perl: drop unneeded LibreDWG.xs
	swig creates the .c for us

	fix latest -Wformat-truncation=
	which thinks that %lX can be 2-17 byte long

	dxf_test: skip 2018/Helix inside docker
	Closes GH #268

2020-09-04  Reini Urban  <rurban@cpan.org>

	Dockerfile: get latest release via tar
	add another Dockerfile-master for testing git master.

	add a check-docker target to test the current state, which needs
	a distdir build-arg.

2020-09-02  Reini Urban  <rurban@cpan.org>

	Improve Dockerfile (GH #268)
	add pcre2 dep.
	pass DOCKER=1 to make check to skip testing unstable objects

	Workaround bogus -Warray-bounds

2020-08-22  Reini Urban  <rurban@cpan.org>

	fix dwg_rgb_palette_index
	detected by gcc-10.2 -Warray-bounds

2020-08-10  Reini Urban  <rurban@cpan.org>

	dat_read_file: protect fileno

2020-08-07  Reini Urban  <rurban@cpan.org>

        spec: post-release fixup

2020-08-07  Reini Urban  <rurban@cpan.org>

	Release 0.11
	See NEWS.
	Many new features, esp. json, dwgfilter, dxfwrite,
	all sections, ACIS v2 support, assoc and constraint objects,
	many bugfixes.
	Also minor breaking API changes.

	decode: fix dwg->object leak
	when the very first object[0] is invalid.
	Detected by fuzzing hangs35 id:000034,src:001498,time:242855345,op:its,rep:32

	free: fix acis_sab_hdl leaks
	Detected by fuzzing crashes35 id:000034,src:001498,time:242855345,op:its,rep:32

2020-08-05  Reini Urban  <rurban@cpan.org>

	spec: add comments for alternate MESH field names
	from dxfgrabber/blender

2020-08-04  Reini Urban  <rurban@cpan.org>

	decode: protect from illegal ACDS.segidx_offset
	to avoid out of memory calloc

	decode: -Wmaybe-uninitialized r2007 pages_map

	decode: add another read_R2004_section_info out of range check
	we already check ptr overflow for all num_sections before, but
	somehow this fuzzing case bypassed that.
	Fixes GH #265 by @seviezhou

	api: VT_BOOL clashes with mingw64 wtypes.h
	Thanks to @ZalivahaAM GH #264

	spec: fixup wrong FIELD_2DD used with DXF only
	no idea what drove me there. Thanks to @ZalivahaAM GH #264

	decode: fix obj_string_stream overflow handling
	to avoid heap overflows, such as in fuzzing GH #262.
	Fixup not only str_dat to avoid wrong bounds,
	but also the culprit, obj->bitsize.

2020-08-03  Reini Urban  <rurban@cpan.org>

	decode_r2007: prevent from read_sections_map overflows
	wrong file_header.pages_map_size_comp or sections_map_size_comp
	or repeat_count.

2020-08-02  Reini Urban  <rurban@cpan.org>

	msys2: another pacman update attempt

	decode: protect empty r2004_header.section_map_address
	Found by fuzzing GH #260 by @seviezhou

	decode: protect from invalid ACDS.num_segidx
	Fixes fuzzing GH #259 by @seviezhou

	fixup LTYPE.dashes overflows
	4b99edb0ea26 as fix for GH #255 was wrong by *2, the offset is wide.
	Also apply the same boundschecks to the ASCII case pre-r2007,
	via strnlen.
	Fixes fuzzing GH #258 by @seviezhou

	free: fix HANDSEED double-free
	with dxf --minimal. It really is a global ref now.
	Found via fuzzing GH #257 by @seviezhou

2020-08-01  Reini Urban  <rurban@cpan.org>

	unit-testing: improve MATERIAL
	and re-arrange the field decl a bit, for properly aligned BD*

	spec: fix MATERIAL.map
	the 2nd mapper transmatrix was wrong, we need a texture here.
	This caused a double-free if map.source == 2.
	Only found via fuzzing GH #256 by @seviezhou.

2020-08-01  Reini Urban  <rurban@cpan.org>

	probe for wcsnlen et al
	to use the native wchar funcs on windows/aix/solaris,
	also for wcsnlen

	fixup wcs2*len decl to POSIX compat.
	use POSIX compat decl, which broke cygwin.
	cygwin declared both, and reported the mismatch.

2020-07-31  Reini Urban  <rurban@cpan.org>

	decode: protect LTYPE.dash_i from overflowing 512
	Add bit_wcs2nlen with maxlen. Fixes fuzzing GH #255 by @seviezhou

	decode: prevent thumbnail overflows
	the thumbnail size may not be negative.
	Fixes fuzzing GH #253 by @seviezhou

2020-07-31  Reini Urban  <rurban@cpan.org>

	decode: improve appinfo is_teigha check
	with corrupt APPINFO.version string shorter than 6 chars.
	e.g. by fuzzing. Fixes GH #252 fuzzing by @seviezhou

	Also extract 2 more common fields upfront.

2020-07-31  Reini Urban  <rurban@cpan.org>

	decode: fix check_POLYLINE_handles NULL deref
	detected by @seviezhou via fuzzing. Fixes GH #251

2020-07-30  Reini Urban  <rurban@cpan.org>

	unit-testing: enable BLOCK_CONTROL
	which needs a different loop. selected at run-time!

	disable 2 yet unneeded functions
	only needed when we can write 2004/ resp. turn off the importer
	string hacks

	dxf: fix MINSERT / AcDbMInsertBlock
	upgrade INSERT to MINSERT on indxf.
	the 0 . dxfname is just INSERT

	indxf: -Wuninitialized with -O

	spec: replace OBJECTCONTEXTDATA by ANNOTSCALEOBJECTCONTEXTDATA
	OBJECTCONTEXTDATA is apparently only a subclass,
	but ANNOTSCALEOBJECTCONTEXTDATA does exist as DXF . 0

	encode: fixup EED for indxf ACAD.BLOCK_HEADER
	"DesignCenter Data" EED crashes ACAD with r2000-r2004.
	Closes GH #244

	encode: disable some indxf EED blocks
	otherwise ACAD import crashes, see blocking GH #244

	unit-testing: fix dynapi_test for evalexpr.value.text1
	this pointer is only valid for some evalexpr types.
	which is already checked by a full evalexpr memcmp

2020-07-30  Reini Urban  <rurban@cpan.org>

	appveyor: import msys packager keys
	See https://www.msys2.org/news/

	"Alexey is stepping down from his role as the main packager and two new
	packagers have been appointed in his place:

	  David Macek with signing key 0x9078f532
	  Christoph Reiter with signing key 0xa0aa7f57

	You can see the keys in full without relying on keyservers in the
	msys2-keyring GitHub repository.

	We have released a new msys2-keyring package from that source (and a
	new installer that includes them) and we are waiting for a bit before
	uploading new databases and packages to give people time to update."

2020-07-30  Reini Urban  <rurban@cpan.org>

	dynapi: re-add UNHANDLED names
	and add COMPOUNDOBJECT subclass (we guessed two fields already)

	free: add _private API
	needed for type conversions.
	not exported, but to free.h so that it can be used by encode.
	dispatch only by type, not dxfname.

2020-07-30  Reini Urban  <rurban@cpan.org>

	encode: skip unstable objs WIPEOUT and TABLEGEOMETRY
	which will crash/hang acad open.
	See GH #244.

	We rather dont skip them at import (indxf/injson), because it might be
	dxfwrite.

2020-07-30  Reini Urban  <rurban@cpan.org>

	demote WIPEOUT to unstable
	looks stable (even after bitwise comparison), but causes
	acad import to crash on redraw, See GH #244.
	Now dxf-check with example_2000 works again.
	Fixes GH #244

2020-07-29  Reini Urban  <rurban@cpan.org>

	travis: extend distcheck timeout to 30
	from the default 20m for make distcheck

	indxf: fixup HATCH.boundary_handles
	use a seperate counter, realloc with path[1].

	spec: fix AcDbBlockAction.deps handle code

	dwg.in: support --big and overlarge input files
	and skip timeout then.
	No extra TIMEOUT_50 needed.

	encode: fix bit_copy_chain for huge hdl_dat
	For large handle buffers we might need to allocate more than one
	CHAIN_BLOCK. Fixes crashes in Dynblocks BLOCKVISIBILITYPARAMATER
	at "Flush handle stream of size 28488 (@3561.0) to @429.0"

	spec: BlockVisibilityParameter and BLOCKGRIPLOCATIONCOMPONENT fixups
	wrong handle and dxf codes

	spec: add EvalExpr to DYNAMICBLOCKPROXYNODE

	dxf: fixup AcDbBlockMoveAction
	same natural DXF order as AcDbBlockStretchAction

	demote BLOCKSTRETCHACTION back to debugging
	definit. wrong DXF

	dxf: fixup AcDbBlockStretchAction
	this has the natural DXF BlockAction_ConnectionPt order

	indxf: minor DYNBLOCK fixups
	fix BLOCKLINEARPARAMETER.distance DXF code
	add BLOCKPARAMVALUESET logging

2020-07-29  Reini Urban  <rurban@cpan.org>

	indxf: add_AcDbBlockRotationParameter
	esp. for the 1011 pt, which should not be EED

	simplify the else_do_strict_subclass dispatch

2020-07-29  Reini Urban  <rurban@cpan.org>

	indxf: AcDbBlockActionWithBasePt and AcDbBlockRotationAction
	promote BLOCKROTATEACTION to stable

2020-07-29  Reini Urban  <rurban@cpan.org>

	spec: refactor BlockAction_ConnectionPts
	use an array afterall.
	DXF uses a different vector layout, not array of structs.

	represent the key in dynapi without the [n] size, as there are different sizes
	per objects.

2020-07-27  Reini Urban  <rurban@cpan.org>

	add BLOCK{FLIP,MOVE,STRETCH}ACTION

	indxf: improve FIELD_3BD

	indxf: add_AcDbBlockAction

	indxf: add_AcDbBlockVisibilityParameter

	indxf: add_AcDbBlock1PtParameter

	indxf: add_AcDbBlock2PtParameter and add_BlockParam_PropInfo

	indxf: fix ASSOCACTION.actionbody
	already fixed in the spec, but forgot in indxf.

	dxf: fixup AcDbSectionViewStyle.identifier_position order
	and few more minor indxf fixes

	indxf: read AcDbBlockParamValueSet values
	needed for stable dynblocks

	promote to unstable: BLOCKALIGNMENT{GRIP,PARAMETER}
	and BLOCKROTATE{ACTION,GRIP}, which can be promoted to stable with indxf

2020-07-27  Reini Urban  <rurban@cpan.org>

	promote most unstable DYNBLOCKS to stable
	BLOCKVISIBILITYPARAMETER: one minor error
	BLOCKLOOKUPGRIP, BLOCKXYPARAMETER: no coverage

	re-arrange coverage blocks. The first occurance must
	have coverage, else it will fail (for stable objects).

2020-07-27  Reini Urban  <rurban@cpan.org>

	add TIMEOUT_50 for dwg
	in_dxf nees some more time than others.
	e.g. indxf Dynblocks with asan needs 35sec on my fastest CPU

	indxf: fix MTEXT.column_heights to 46

	indxf: BLOCK.filename 4
	in some DXFs

	indxf: add AcDbBlockElement, AcDbBlockgrip support
	and FIELD_3BD, COMMON.ltype_scale

	indxf: fix HATCH CHK_polyline_paths
	wrong check.

	free SUB_FIELD_VECTOR
	fixes acds leaks

	test-data: add Dynblocks.dwg
	for dynblocks coverage.
	from test-old, which is not distributed.
	so that many dynblocks can be promoted to stable. (just indxf missing yet)

2020-07-24  Reini Urban  <rurban@cpan.org>

	promote to unstable: BLOCK{FLIP,LINEAR,LOOKUP}GRIP

2020-07-23  Reini Urban  <rurban@cpan.org>

	indxf: convert common ENTITY 370 linewt

	spec: fixup some BlockGrip fields
	the first bg_version is rather some state, like bl92.
	the dxf code for combined_state was wrong

	spec: add AcDbBlockElement to AcDbBlockGrip subclass

	promote to unstable: BLOCKSTRETCHACTION

2020-07-22  Reini Urban  <rurban@cpan.org>

	promote to unstable: BLOCKFLIPACTION

	unit-tests: improve BLOCKSTRETCHACTION
	add CHK_ENTITY_2DPOINTS

	promote to unstable: BLOCKSCALEACTION

	docs: fixup classes for its stability

	promote to unstable: BLOCKVISIBILITYPARAMETER

	dwggrep: add new objects

	promote to unstable: BLOCKBASEPOINTPARAMETER, ...
	and BLOCKFLIPPARAMETER, BLOCKMOVEACTION, BLOCKROTATIONPARAMETER

	spec: fix BLOCKUSERPARAMETER AcDbEvalVariant NULL = -9999
	we cannot decide on a not read value

	promote BLOCKXYPARAMETER to unstable
	just indxf missing, analog to BLOCKLINEARPARAMETER

	promote BLOCKLINEARPARAMETER to unstable
	just indxf missing

	unit-tests: fix BlockParamValueSet subclass checks

	decode: fix AcDbBlockParamValueSet
	SUB_FIELD_VECTOR did not allocate BD* valuelist

	dynapi: add BLOCKPARAMETER_* subclasses
	missed a _ prefix.
	Fixes the BLOCKPARAMETER_PropInfo unit-test failures (DEBUGGING only)

	dynapi: fixup line #

	fix DEBUGGING unit-tests
	some renamed fields

2020-07-20  Reini Urban  <rurban@cpan.org>

	indxf: more ent->nolinks fixups
	reset nolinks if any prev or next_entity is empty.

	convert_SAB_to_SAT1: use CAN_ACIS_* feature macros

	convert_SAB_to_SAT1: skip history lines r2013+
	We cannot deal with them yet, preventing 3DSOLID's
	to be imported at all.

	convert_SAB_to_SAT1: for old-style DXF fixup the End-of-ASM-data line
	adjust the ACIS data for the DXF according to the target version.
	Just not the history lines yet

2020-07-20  Reini Urban  <rurban@cpan.org>

	indxf: handle truecolors
	set the correct index on c3 colors. Fixes LAYER colors

	dxf: convert colors across r2004

	postprocess_SEQEND: log links
	from dxf or json, when converting linked list from/to vector
	unset nolinks when needed. (first or last vertex)

	dxf: fix POLYLINE_* flag values
	always set the type flag and the elevation pt
	POLYLINE_3D.curve_type 75 is optional

2020-07-20  Reini Urban  <rurban@cpan.org>

	indxf: fix LWPOLYLINE.num_bulges
	always write const_width 43
	set bulges flag.

	Fixes dxf roundtrip error with example_2013 on LWPOLYLINE 156

2020-07-20  Reini Urban  <rurban@cpan.org>

	decode: log computed revision_guid

	encode: fix add_LibreDWG_APPID error handling
	critical errors should not add PLACEHOLDERs.
	Like Out of memory, control not found, and such.

	spec: -Wunused-variable

	encode: add missing initializers

	encode: compute HANDSEED
	the next available handle from dwg->object_refs

	encode: simplify xdata strings a bit

2020-07-19  Reini Urban  <rurban@cpan.org>

	injson: disable wstring
	always import as TV/UTF8

	bits: add IS_FROM_TU(dat) macro
	to have the importer hack logic for strings in one place

2020-07-19  Reini Urban  <rurban@cpan.org>

	undo parts of the importer hack
	keep a proper dat->from_version, synced to dwg->header.from_version

	rather check all encode write_T (fields, eed, xdata) if it came from an
	imported string (indxf or injson), which would be UTF8, never TU.
	This way we can keep all the right structure checks PRE (R_*)...
	and only checks strings if imported from UTF8 or not.

2020-07-19  Reini Urban  <rurban@cpan.org>

	indxf/json: fixup in_postprocess_SEQEND code 3 => 4
	r2000 linked attribs/vertices need to be handle code 4, but the vector
	is code 3. fix that

	encode: downconvert CMC colors
	from r2004+ to r2000

	decode: protect r2007 empty system_page map
	Check file_header.sections_map_correction and
	file_header.sections_map_size_comp params.
	Found via fuzzing by @yangjiageng, GH #248.

	dwgwrite: windows fopen fixups
	we need to open the infile rb, otherwise
	dat_read_file will read less than the filesize
	(collapsing \r\n to \n).
	and the error message was never printed.

2020-07-18  Reini Urban  <rurban@cpan.org>

	dxf: LAYER.plotflag 290 not optional
	It is with ODA, but ACAD complains when it's missing.

	spec: silence -Wduplicated-branches warning
	with print and free

	dxf: fix missing ENTITY.preview_size
	the bug that was worked around in the previous commit.
	DXF has IS_PRINT

	indxf: support ENTITY.preview without preview_size code 92/160
	realloc it along.
	Fixes MULTILEADER.preview in example_2000.dxf, though technically
	it is illegal and an OUTDXF bug omitting the code 92 . preview_size

	injson: importer hack for xdata strings

	indxf: protect in_postprocess_SEQEND from !owned
	but the bug/regression must be happened before

	programs: more importers hacks faking dat->from_version
	reset to R_2000 (no unicode stored) when importing from DXF or JSON
	for now we check the structure with dwg->header.version and TU with
	dat->from_version

	injson: unquote \\ back to \
	e.g. in viewlabel_pattern like
	%<\AcVar ViewDetailId>% (%<\AcVar ViewScale \f "%sn">%)
	which had two \\
	but every ordinary test also.

	encode: fix XRECORD.num_xdata
	off by one. repro with example_r14 json-roundtrips.

	write to r13-r14, not just r2000
	this is a target version hack, until we can write all versions.
	the helpers wrote only r2000

	injson: keep target dat.version at R_2000
	fixes unicode EED strings

	change TU logging to UTF-8

	decode xdata: avoid wrong xdata_size warning

	dxf: fixup GEODATA dxf fields

	dxf: simplify ENTITY.ltype_scale spec
	to BD1, as with the scale vector.
	and more such scale/x_factor fields.

	dxf: fixup BLOCK 67 . 1 is_paperspace DXF-only flag
	it is already in common_entity_handle_data.spec
	entity previews exist only since r13

	api: rename DICTIONARYVAR .intval => schema, .str => strvalue

2020-07-18  Reini Urban  <rurban@cpan.org>

	dxf: optional INSERT fields
	and some re-ordering, 66 before 2.

	TODO: extrusion in R12 dwgs?

2020-07-15  Reini Urban  <rurban@cpan.org>

	indxfb: some B=>RS fixups, generalize VALUE_INT out_dxfb
	out_dxfb fields should all look at the resbuf type width, not just RC => RS.
	in_dxf unfortunately has some exceptions, with 280 DWG being B, but DXF being RS,
	and such. This needs to be adjusted in the spec.

	we can now read and write until TABLES (HEADER and CLASSES), until the first objects.

2020-07-15  Reini Urban  <rurban@cpan.org>

	indxfb: support RC, B types
	before we only read RS for RC/B

	dxf: BLOCk entity comments

	dxfb: generalize VALUE_RC for all objects
	we really need to check the dwg_resbuf_value_type for the width
	with DXFB, not the DWG RC/RS/B suffix.

	dxbf: minor simplifications
	no changes but VPORT.render_mode to RS in dxfb

2020-07-14  Reini Urban  <rurban@cpan.org>

	dxfb: start fixing OBJECTS
	harmonize with out_dxf

	api: change eed[].u.eed_5.entity from RLL to unsigned long

	add dxfb-check and check-dxfb target
	analog to dxf-check, just no proper roundtrip checks yet,
	instead of that we try teigha for out_dxfb and in_dxf

	dxfb: fix TABLES version-specifics
	and 1 wrong APPID type

	dxfb: fix CLASSES types
	wrong RL and RS

	in_dxfb: fix dxf_read_string
	dxfb strings are not len-prefixed, just ordinary ASCIIZ strings (like handles).

	dxfb: fix handles
	They are just %lX strings.

	dxfb: more HEADER DXFB improvements
	more version checks, more type fixes.
	consistent bracketing to allow if() HEADER_ groups

2020-07-13  Reini Urban  <rurban@cpan.org>

	dxfb: fix HEADER_RC types to RS
	2 bytes short, not 1

	./dxf: fix bashism, check for dash
	and use awk for substrings then

	dxfb: let dxf support dxfb and -o
	to override the output file with -b/dxfb, like $base_bin.dxf
	our old dxfb example was r2018, not r2000.

	dxfb: fix $ACADMAINTVER type to RS/RL
	2/4 byte, not 1

	dxfb: fix TU strings, no 999 comments
	The documentation says 999 comments are not supported.
	Unicode strings need to be converted to UTF8, as in Ascii DXF

	add dat_read_size, a fast bulk file read
	dat_read_stream was a bit slow.
	later we need to switch to mmap anyway

	indxfb: major fixes in dwgwrite: fill dat, ...

2020-07-12  Reini Urban  <rurban@cpan.org>

	indxf: change the experimental warning messages
	works now mostly, but still can cause crashes or misses some tricky entities

	indxf: add VISUALSTYLE.props, more version hacks
	props needed for r2013+
	handle FIELD_CMC with optional 420 pairs

2020-07-12  Reini Urban  <rurban@cpan.org>

	indxf: help dwg_fixup_BLOCKS_entities by creating entities[]
	without a list of block entities we cannot create a linked list.

	The helper add_to_BLOCK_HEADER is only used with ENTITES (adding to mspace)
	but not the BLOCKS entities yet.

2020-07-12  Reini Urban  <rurban@cpan.org>

	indxf: dwg_fixup_BLOCKS_entities for adjacent refs
	nolinks must be set for all adjacent refs, to skip 8.0.0, 6.0.0 links

2020-07-12  Reini Urban  <rurban@cpan.org>

	dxf: more version hacks for strings
	treat DXF like JSON, only decoding to TV (R_2000 alike)
	and then when encoding use a fake dat->from_version.

	dat->from_version is fake with INJSON and INDXF,
	dwg->header.from_version is real.
	use the dwg->version for structural checks.

2020-07-12  Reini Urban  <rurban@cpan.org>

	dwgwrite: simplify dwg_version default

	add bit_eq_T, support r2007+ *Paper_Space checks...
	looks like the last r2007 indxf limitation is now fixed

	indxf: fixup BLOCK_HEADER.{first,last}_entity
	relying on the new_object &i was too fragile.

2020-07-11  Reini Urban  <rurban@cpan.org>

	encode: create r2004+ entity vector in SEQEND
	when upconverting r2000 linked lists to the attribs/vertex vector

	also adjust the versions logic, while we dont set the target version yet
	in the importer. so we have to provide variants for all possible versions.
	(just not unicode strings yet)

2020-07-11  Reini Urban  <rurban@cpan.org>

	encode: create r2000 linked entity list in SEQEND
	in_postprocess_SEQEND needs to link the vertex[] or attribs[] entities
	when downconverting.
	This is normally done in in_postprcess_handles, but prevented from
	entmode=0 there.

	with indxf this is not yet enabled, because dwg->header.version
	is higher than R_2000 on downconvert. it is not yet set to the target version,
	dat neither.

2020-07-11  Reini Urban  <rurban@cpan.org>

	api: rename field attrib_handles back to attribs
	was renamed for TABLE, but also used in INSERT.
	This is much more consistent with the POLYLINE*.vertex[] vector

	indxf: fix owned vertex[]/attrib[] handle types
	POLYLINE/BLOCKS own entities via handle code 3, not 4.
	dxf_postprocess_SEQEND (See also #138)

2020-07-11  Reini Urban  <rurban@cpan.org>

	encode: fix r2004+ incompatible version error
	Acad import failed to import r2004+ versions (saved as r2000),
	because of dwg->header.zero_one_or_three being 0.
	Adjust the header versions (dwg_version/maint_version being the
	version of the app writing it).

	This bypasses now the "Drawing file created by an incompatible version."
	error and crashes later with an original r2004 dxf2dwg when importing
	the mspace block. Converted r2007+ DXF's do work fine though.
	JSON imported r2004 DWGs (as r2000) can be ACAD opened also, just indxf not.

2020-07-10  Reini Urban  <rurban@cpan.org>

	clang-format -i in_dxf.c
	reformat only

	indxf: start simplifying FIELDs

	promote DETAILVIEWSTYLE SECTIONVIEWSTYLE to stable
	implement indxf importer.
	They are needed for the NOD (Named Object Dictionary)
	and were easy enough to implement. The spec was stable for some time

2020-07-09  Reini Urban  <rurban@cpan.org>

	dxf: defer in_postprocess_handles to after entmode
	we cannot find the prev entity when we haven't set ent->entmode yet.
	This fixes r2000 next_entity linking when there's a obj between to skip, like
	a GROUP.

	Fixup relative handles for all entities (prev/next chains).
	indxf: Fixup HATCH.boundary_handles code.

2020-07-09  Reini Urban  <rurban@cpan.org>

	dxf: optional common_entity_handle_data fields
	6 . ByLayer
	62 . 256

2020-07-09  Reini Urban  <rurban@cpan.org>

	dxf: fixup BLOCK_RECORD 70
	not optional. actually not printed at all

	harmonize DXFB with DXF

2020-07-09  Reini Urban  <rurban@cpan.org>

	dxf: fix FIELD_BINARY
	it repeated the first 310 block all over, oops

	api: rename VPORT_ENTITY_HEADER => VX_TABLE_RECORD, VPORT_ENTITY_CONTROL
	to VX_CONTROL.
	rename SECTION_VPORT_ENTITY to SECTION_VX.
	As in DXF (But there only VX_TABLE_RECORD)

2020-07-09  Reini Urban  <rurban@cpan.org>

	dxf: enable VBA_PROJECT
	310 blob.

	This now can import dxf-check DWGs as first for a long time.

2020-07-09  Reini Urban  <rurban@cpan.org>

	dxf: add missing BLOCK_HEADER 310, 102
	preview was missing and also {BLKREFS 331 }

	dxf: re-order XDICOBJHANDLE for tables
	after the handle, before the ownerhandle.

	dxf: re-order BLOCK_RECORD
	1st mspace, 2nd pspace, and then the rest.
	flag 70 is optional there.

2020-07-08  Reini Urban  <rurban@cpan.org>

	dxf: fix TIMEBLL ms value
	ms, not seconds

	json: fix HATCH.boundary_handles
	path.num_boundary_handles was ignored on injson,
	leading to empty boundary_handles in the DWG export

2020-07-08  Reini Urban  <rurban@cpan.org>

	api: BlockReference renames insertion_pt, data_flags
	harmonize all insertion_pt to ins_pt,
	TABLE.data_flags to TABLE.scale_flag

	also fix JSON export/import for most scale fields.
	This fixes Acad Zero scale warnings on such imported blocks.

2020-07-08  Reini Urban  <rurban@cpan.org>

	indxf: fix VISUALSTYLE.color 62/420
	ignore those, always index 5

	indxf: implement add_ASSOCNETWORK
	analog to ASSOCACTION

	indxf: implement ASSOCACTION VALUEPARAM and EVALVARIANT
	imports.

	api: promote TABLEGEOMETRY back to stable
	Was stable in 0.10.1
	There is one unknown geom field 95

	indxf: fix TABLEGEOMETRY.tablegeometry handle code from 5 to 4

	rename TABLEGEOMETRY num_rows/cols to numrows/numcols for json
	json ignores all num_ fields, because the can be computed from the array.
	but those two are not bound to the cells array, only num_cells.
	This broke TableGeometry JSON roundtrips when importing into acad, with empty
	values for both.
	This fix could push TABLEGEOMETRY from unstable to stable.

2020-07-08  Reini Urban  <rurban@cpan.org>

	spec: ASSOCACTION add VALUEPARAM *values
	acad can now read them properly, but values are still missing
	to be imported from DXF.

	fix more DXF and Handle codes.

2020-07-08  Reini Urban  <rurban@cpan.org>

	spec: fix ASSOCNETWORK AcDbAssocAction
	ASSOCNETWORK was too small, caused by missing AcDbAssocAction fields.
	We really should be able to call ASSOCACTION_private already.
	For now duplicate the fields into its macro.

	Also fix the handle eWrongObjectType codes.
	Fixes the ASSOCNETWORK acad dwgin errors, can be promoted to stable.

2020-07-08  Reini Urban  <rurban@cpan.org>

	spec: fix _3DFACE
	didn't read the spec properly, the invis_flag is absent on has_no_flags.
	Fixes acad dwgin of 3DFACE entities.

	encode: fix eed handles
	we did write the wrong handles without raw (e.g injson, indxf)

	encode: fix START_HANDLE_STREAM for entities
	dump the common entity handles same as common object handles,
	before writing the specific handles.
	interestingly only broke WIPEOUT and a few r2000 prev/next chains

	dynapi: fix CMC imports
	CMC is an inlined struct, not indirect. Also the r2000 shortcut to
	copy only the short index is wrong for all truecolor colors even with r2000.
	such as CELLSTYLEMAP bg_color with 0xc8000000 colors (none) all over.

	indxf: fixup color.method and color.rgb
	esp. with method c8 None.
	But also with injson and encode.

	spec: analog add all missing HANDLE_STREAM markers
	some entities even had wrong END markers

	spec: fix SCALE streams
	json roundtrips (encode) missed the SCALE std streams:
	ownerhandle, reactors, xdicobjhandle

	spec: demote DIMASSOC back to DEBUGGING
	acad dwgin fails with DIMASSOC, as encoded by json.

	dxf: ENTITY.thickness 39 is optional

2020-07-08  Reini Urban  <rurban@cpan.org>

	dxf: fix ENTITY.preview_size dxf code
	<r2010: 92
	r2010+: 160 (new BLL type)

	It's not related to the zombie flag, just the new type.

2020-07-08  Reini Urban  <rurban@cpan.org>

	dxf: *_CONTROL.num_entries 70 is already correct
	do not subtract the default entries.

	indxf: fix first BLOCK_HEADER.entry
	when we move out an ctrl.entry of the list, destructively change the
	entry index in the caller. Otherwise we get the next one at 1,
	even we just deleted index 0.

	encode: fix eed_data size calc.
	byte size, not bitsize

	downgrade TABLEGEOMETRY to unstable
	it breaks acad dwg open. as unstable dwgin works now

	indxf: SET_CTRL_BIT from flag
	set the various extra table control bits from flag 70
	doing it in encode in the dwg.spec is not good enough.

	dxf: mask off loaded bit 6 from COMMON_TABLE_FLAGS
	no 70 . 64

	dxf: optional DIMSTYLE fields
	3, 4 and 40 are optional.
	re-DXFOUT example_2000.dxf from r2018. It had many different
	handles from the DWG, and it used as reference.

	indxf: improve postponed eed APPID logging
	print which object had a postponed EED APPID handle

	dxf: re-order LAYER 290, 370, 390
	put plotflag 290, linewt 370 and plotstyle 390 after ltype 6.
	mask off linewt and plotstyle from LAYER.flag 70

2020-07-08  Khaled  <Khaled.Reguieg@gmail.com>

	Update README, Fix typo in install instructions

2020-07-05  Reini Urban  <rurban@cpan.org>

	encode: fix add_LibreDWG_APPID use-after-free
	set dirty_refs when we move the objects around.
	crashes 33, id: 0, when adding the LibreDWG_APPID
	triggered a realloc

	dxf: minor fixes
	wider format of group 90-99
	fixup class->dxfname DATATABLE
	fix USCVP code to 65 (ODA bug, documented as 71)

	spec: fix r2000 MEASUREMENT section value
	RL_LE == 256 for 1
	was wrong for dxf, decode and encode.

	dxf: optional PICKSTYLE, set TEMPLATE.MEASUREMENT
	from HEADER

	dxf: limit printed double precision
	similar to AutoCAD DXF Ascii output.
	At all 17 or 18 chars (18 if negative)

        dxf: handle color method c8 (none) => 257

	travis: ASAN switch from clang to gcc (7.4)

	travis: switch from xenial to bionic

	travis: another ASAN try
	failed weirdly

	encode: fix fixup_BLOCKS_entities NULL deref
	with an Illegal BLOCK_HEADER.entities[]
	reset num_owned if wrong.

	fuzzer: crashes 32, id: 0

2020-07-05  Reini Urban  <rurban@cpan.org>

	EXPORT 4 major functions for dwgfuzz
	dwg_decode, dwg_encode, dat_read_stream and dat_read_file.
	They cannot be moved to dwg.h because of the internal Bit_Chain*,
	but are essential enough to be exported, and needed for dwgfuzz.

	Silence initialization warning for dwgfuzz mode. Exit if uninit

2020-07-04  Reini Urban  <rurban@cpan.org>

	add dwgfuzz check target

	dwgfuzz: add man page
	but not installed

	doc: add dwgfuzz item to examples

	improve dat_read_file
	fp must be open for fread already, but now
	we need not know the size before.
	if dat->size is empty, it is now filled.

	new examples/dwgfuzz
	for easier fuzzing, and debugging the
	three afl-clang-fuzz strategies: INMEM, STDIN or FILE.
	~10x faster. STDIN fails still.

	dxf: add HEADER_RC0 for two optional header fields
	DIMFIT, DIMUNIT

2020-07-04  Reini Urban  <rurban@cpan.org>

	fuzz: improve to persistent shared-mem mode
	for dwgwrite with injson hardcoded (json import + dwg export),
	for dxf2dwg with indxf hardcoded,
	for dwgrewrite with dwg hardcoded.

	They ignore args now.

2020-07-03  Reini Urban  <rurban@cpan.org>

	indxf: forgot one add_TABLEGEOMETRY_Cell assert
	fuzzer 30, id:18

2020-07-02  Reini Urban  <rurban@cpan.org>

	api: rename DICTIONARY*.hard_owner
	to is_hardowner

	dxf: reorder and default VERTEX_2D

	dxf: reorder TEXT r2000+

	dxf: reorder TEXT r13-r2000

2020-07-02  Reini Urban  <rurban@cpan.org>

	indxf: improve BL CONTROL overlarge num_entries fixup
	adjust wrong num_entries faster, which avoids DDOS attacks on overlarge
	numbers. esp. with BL types (layer, block, ...)

	Fixes fuzzer 29, id: 12, 29, 69, 80 hangs.

2020-07-02  Reini Urban  <rurban@cpan.org>

	indxf: protect from APPID_CONTROL....num_entries BS overflow
	several CONTROL tables have only BS num_entries, which lead
	to import hangs on overlarge (fuzzed) numbers.

	fuzzer 28, id:4, 6 hangs

2020-07-02  Reini Urban  <rurban@cpan.org>

	dynapi: add missing D2T support
	needed for indxf ATEXT
	fuzzer 28, id: 7

2020-07-02  Reini Urban  <rurban@cpan.org>

	indxf: Invalid ASSOCACTION.*param_names handle vectors
	and invalid num fields

	fuzzer 28, id:71

2020-07-02  Reini Urban  <rurban@cpan.org>

	indxf: Skip invalid postponed eed APPID
	check resolve_postponed_eed_ref field and code.
	fuzzer 28, id:3

	indxf: fix wrong EED without matching 1000 pair
	fuzzer 30, id:0
	(this is the new afl++ 2.65d with CFG instrumentation)

	indxf: fix 101 !Embedded Object hang
	handle 101 which is not Embedded Object
	hanged fuzzer 28, id:0

2020-07-02  Reini Urban  <rurban@cpan.org>

	indxf: fix AcDbEvalExpr hang on false pair
	need to seperate success from fail otherwise
	it will hand going into add_AcDbEvalExpr endlessly

	fuzzer 27, id:0 and probably many more.

2020-07-02  Reini Urban  <rurban@cpan.org>

	indxf: Invalid ASSOCACTION.deps[%d].is_soft DXF code
	fuzzer 29. id:75

2020-07-01  Reini Urban  <rurban@cpan.org>

	dxfwrite: INJSON unicode hack
	in_json is the only importer which still writes all strings as TV, not TU.
	(for valid perfofmance reasons, which we can only write r2000)
	dxfwrite is currently the only which tries to write TU,
	which came up with the new empty CUSTOMPROPERTY strings, which is
	only one byte long, not two.

	support version macros in the section specs

2020-07-01  Reini Urban  <rurban@cpan.org>

	dxf: add CUSTOMPROPERTY
	in DXF header from SummaryInfo. Rename key to tag.

	add HEADER_VALUE_TU0 helper (not if empty)

2020-07-01  Reini Urban  <rurban@cpan.org>

	add Auxheader support for r2004+
	change AUXHEADER.maint_version* from RS to RL.
	changed with r2017

2020-06-30  Reini Urban  <rurban@cpan.org>

	finish AcDbPointCloudObj

	more AcDbPointCloudObj objects

	add debuging POINTCLOUD

	doc: LibreDWG.info too large
	was automatically split into two

2020-06-30  Reini Urban  <rurban@cpan.org>

	decode: protect r2000 last_handle
	as with r2004. dwg_decode_add_object could have failed,
	so 0-1 would be invalid

	fuzzer 15, id:149

2020-06-30  Reini Urban  <rurban@cpan.org>

	logging: avoid fprintf overflow on non terminated buffer
	FIELD_TFF on acis_data does nto guarantee NULL-termination
	in its logger.

	fuzzer 15, id:110

2020-06-29  Reini Urban  <rurban@cpan.org>

	decode: skip INVALIDTYPE objects
	which don't have a name nor dxfname.
	Dont add those.
	Fixes fuzzer 14, id: 217

2020-06-29  Reini Urban  <rurban@cpan.org>

	indxf: dont accept DXF 0 fields
	which would be parent 0, and setting parent
	to some random value is certainly wrong.

	fuzzer 27, id: 476

2020-06-29  Reini Urban  <rurban@cpan.org>

	regen-dynapi: fixup #line's

	indxf: protect wrong 3dsolid again
	now the 350 history_id.
	fuzzer 27, id: 469

	indexf: protect empty 2 name
	skip it then
	fuzzer 27, id: 463

	indxf: check empty 3DSOLID 1 encr lines
	fuzzer 27, id: 447

	indxf: add generic CHK_array()
	should cover all array access now

	indxf: oops, forgot more asserts

	indxf: protect from invalid 3DSOLID
	fuzzer 27, id: 417

	gen-dynapi: normalize topdir
	without inspecting it.

	indxf: exit AcDbEvalExpr with code 0
	fuzzer 27, id: 415

	indxf: more NULL deref protections
	fuzzer 27, id: 394, 408, 418

	afl-fuzz: add some funcs
	dwgwrite needs some api functions which are excluded from
	afl-fuzz.

	NEWS for the 0.11 release

	indxf: protected all asserts
	Fixes GH #187
	All asserts (array bounds checks) are now protected by
	explicit range and NULL checks.

2020-06-29  Reini Urban  <rurban@cpan.org>

	bits overflow: bisect mingw64 failure
	mingw64 started failing between

	decode: error earlier on wrong obj->size
	some fuzzing cases at 6 are just unrepairable.
	0.10.1.3507
	smoke/dxf 431a9826
	https://ci.appveyor.com/project/rurban/libredwg/builds/33538209

	decode: error earlier on overflow
	when obj->size is too large
	some fuzzing cases at 6 are just inrepairable.
	0.10.1.3506
	smoke/dxf 40c2cb70

	which is only the added overflow checks in bits.

2020-06-29  Reini Urban  <rurban@cpan.org>

	indxf: CELLSTYLE NULL deref
	fuzzer crashes27, id:424

	indxf: remove more asserts
	MULTILEADER_leaders, MULTILEADER_lines. More bounds checks.
	fuzzer crashes27, id:417

	indxf: remove more asserts
	HATCH, MLINE. More bounds checks.
	the fuzzer likes to crash on those asserts.
	crashes27, id:349

	indxf: fix plotsettings.2dpt crash
	when fuzzing 27, id 348

	travis: asan is now at 16min, re-add check-minimal and programs
	and fix the check-minimal syntax

2020-06-28  Reini Urban  <rurban@cpan.org>

	Merge branch 'dynblocks'

	finish BLOCK*PARAMETER fields

	add missing BLOCK*GRIP fields

	apply changed BLOCKPARAMETER_PropInfo
	and add BLOCKXYPARAMETER fields

	refactor BLOCK*PTPARAMETER subclasses

2020-06-27  Reini Urban  <rurban@cpan.org>

	fix BlockAction DWG order
	compared to DXF

	forgot about BlockActionWithBasePt
	for BLOCKSCALEACTION and BLOCKROTATEACTION.
	This explains the conn_pts offsets

	unit-testing: fix CHK_ENTITY_HV
	for NULL hdls. such as in BLOCKSTRETCHACTION

	rename AcDbBlockAction.ba_pt to display_location

	more BLOCKSTRETCHACTION
	but not yet done

	refactor Block*Action fields
	use 1-6 connection points

	add some Block*Action fields and tests
	also add a nice unit-testing check-debug target

	unit-testing: add some test files
	for the new dynblocks

	spec; disable broken SCALE Embedded Object for now
	see the work/impl branch

	spec: add BLOCKFLIPPARAMETER fields

	spec: BLOCKBASEPOINTPARAMETER fields

	travis: even longer asan timeouts
	add make -C test/unit-testing check-minimal

	Change some ConstraintParameter field names

	unit-testing: update-ignorance

	promote BLOCKGRIPLOCATIONCOMPONENT, BLOCKVISIBILITYGRIP
	to unstable

	BlockGrip fields

2020-06-26  Reini Urban  <rurban@cpan.org>

	bits: avoid wrong unknown buffer overflow warning

	fix BLOCKGRIPLOCATIONCOMPONENT crash

	Add a couple new dynblock objects
	generated unit-tests with a small perl script

	spec: promote VISIBILITYGRIPENTITY, VISIBILITYPARAMETERENTITY
	to DEBUGGING

	api: auto-generate dwg.h entity and object unions

	api: auto-generate the dwg_setup_NAME functions also
	in dwg.h. Closes GH #239

	api: move dwg_setup_PERSUBENTMGR to debugging
	this broke the freecad python bindings. See #239
	But we really should autogenerate these setup functions as the others.
	And let's move them to dwg_api.h

	rename AcDbObjectContextData in_dwg to has_xdic

	dxf: fix MTEXTOBJECTCONTEXTDATA rect_height order

	decode: add MTEXTOBJECTCONTEXTDATA.columns_type
	out of bounds check. some examples are corrupt, but long before.
	already with the points.

	unknown: fixup double-free
	rather leak some g[j].bytes

	make regen-unknown

	full-regen-unknown

	examples: update bd-unknown.inc

	examples: add EMPTY_CHAIN initializer
	I switched the fields around recently, which broke unknown.

2020-06-26  Reini Urban  <rurban@cpan.org>

	spec: improve HELIX
	also rename num_turns to turns, so that it shows up in JSON.
	It's a double, not just full turns.

	Update from SPLINE (could use define or subclass, but not so far)

2020-06-26  Reini Urban  <rurban@cpan.org>

	dxf: reorder IMAGEDEF

	spec: add UNDERLAY.clip_inverts
	improve DXF for WIPEOUT a bit. order of clip_mode and handles.

	spec: add INDEX object
	seen registered as App, even if I only seen that as subclass for
	LAYER_INDEX and SPATIAL_INDEX.

	api: add more Dwg_Version_Type enums
	These are all the versions ODA detects.
	Dont know for sure the Release names, but the 4byte magic are certain

	spec: add LARGE_RADIAL_DIMENSION

	spec: NURBSURFACE fields
	fails in the 3DSOLID part (missing AcDs SAB)

	spec: NAVISWORKSMODEL add flags

	spec: NAVISWORKSMODELDEF add flags

	api: MTEXT.is_not_annotative
	and fix some DXF fields: extents_*

2020-06-24  Reini Urban  <rurban@cpan.org>

	spec: harmonize MTEXTOBJECTCONTEXTDATA with MTEXT
	esp. its Embedded object spec

	spec: MTEXTATTRIBUTEOBJECTCONTEXTDATA fields
	analog to GEOPOSITIONMARKER

	dxf: missed the 70 invis_flag

	dxf: improve VERTEX_PFACE_FACE dxf values

	fix GEOPOSITIONMARKER DXF detector
	improve DXF, add the 101 marker.
	rename type to class_version (always 0)

	api: rename MTEXT.annotative to is_annotative
	and unknown_bit to unknown_b0 (always 0)
	fix the is_annotative r2018+ logic and the DXF codes.

	api: rename MTEXT.drawing_dir to flow_dir

	unit-test: disable ACSH_HISTORY_CLASS history_node
	it crashes there

2020-06-24  Reini Urban  <rurban@cpan.org>

	spec: more Constraints
	objects:
	ASSOCDIMDEPENDENCYBODY
	ASSOCPOINTREFACTIONPARAM,
	ASSOCEDGECHAMFERACTIONBODY,
	ASSOCEDGEFILLETACTIONBODY,
	ASSOCDIMDEPENDENCYBODY,

	subclasses:
	ASSOCEDGEPERSSUBENTID
	ASSOCINDEXPERSSUBENTID

2020-06-24  Reini Urban  <rurban@cpan.org>

	spec: add 4 missing ASSOCARRAYPARAMETERS objects
	all with the same structure, so should be typedef'ed such as
	REGION/BODY/3DSOLID, but I hate those exceptions.

	dxf: move MULTILEADER.ctx around
	in dxf before the leader.
	also fix dxf_CMC colors for 90+

2020-06-23  Reini Urban  <rurban@cpan.org>

	indxf: wrong WIPEOUT.num_* overflow 12 > 12 ERROR

	indxf: TABLESTYLE asserts => errors

	geojson: normalize_polygon_orient
	for RFC7946. Polygons should follow the right-hand rule

	unit-tests: fix darwin scandir
	DT_DIR is only defined unless _POSIX_C_SOURCE or _DARWIN_C_SOURCE

2020-06-23  Reini Urban  <rurban@cpan.org>

	geojson: improve color support
	rgb truecolor strings now with '#' prefix,
	only with entity and truecolor methods.

	skip ByLayer, ByBlock colors.

2020-06-23  Reini Urban  <rurban@cpan.org>

	doc: Describe our GeoJSON format

2020-06-23  Reini Urban  <rurban@cpan.org>

	geojson: Dummy, fix the linters
	the last Dummy feature MUST have a geometry object, which MAY be null.
	https://tools.ietf.org/html/rfc7946#section-3.2

	While we are here also make the properties object empty.

2020-06-23  Reini Urban  <rurban@cpan.org>

	geojson: fix Point arrays
	MTEXT, TEXT, INSERT elements had wrong Point arrays

	geojson: optional z in coordinates
	See https://tools.ietf.org/html/rfc7946#section-3.1.1
	Altitude or elevation MAY be included as an optional third
	element.

	geojson: closed Polygon also for POLYLINE_2D
	MulitLineString was wrong.
	Either LineString if open, or Polygon if closed.
	MultiLineString would be for MLINE.

	geojson: skip Dummy?
	write last Dummy Feature only if we did not write a single feature
	before.
	Nope, this breaks JSON compat, as we need to known the last feature to
	end without comma.

	geojson: add support for closed Polygon

2020-06-23  Reini Urban  <rurban@cpan.org>

	geojson: move id to Feature, skip color ByLayer
	https://tools.ietf.org/html/rfc7946#section-3.2
	If a Feature has a commonly used identifier, that identifier
	SHOULD be included as a member of the Feature object with the name
	"id", and the value of this member is either a JSON string or
	number.

	Keep property.EntityHandle value for the lastcomma quirks.

2020-06-23  Reini Urban  <rurban@cpan.org>

	add 2nd geojson-validation linter support
	as fallback for mapbox/geojsonhint

	add geojsonhint check
	which detected various errors in our geojson output

2020-06-22  Reini Urban  <rurban@cpan.org>

	dynapi: fix shadow warnings

	spec: whitespace only

	indxf: fix ASSOCACTION, ASSOCDEPENDENCY, PERSUBENTMGR fields

	indxf: protect from illegal ASSOCACTION.num_deps
	fuzzer 27, id:142

	2007: defatalize some missing optional sections
	analog to r2004. Thanks to @zhengf312 with GH #236

	api: add dwg_get_OBJECT
	and handle the few aliases (REGSION, BODY, XLINE, ...)
	also handle the lowercase shortened names.
	do if DEBUG indentation

	api: generate dwg_api.h lists automatically
	_3DFACE still manually, as the entity_name for these is without _

	api: generate dwg_api.c lists automatically

	api: add missing _3DFACE, _3DSOLID
	api functions. Move Dwg_Entity_PROXY_LWPOLYLINE to a subclass.
	The entity is PROXY_ENTITY

	dynapi: simplify dwg.i generation
	abstract into out_clases, because we want to do the same for
	more files.

	bindings: fix list of classes in dwg.i

2020-06-21  Reini Urban  <rurban@cpan.org>

	Merge branch 'smoke/dxf'
	Most Constraints objects are now in. Just the final
	ASSOC2DCONSTRAINTGROUP misses the subent curve code.

	Some WIP commits in this branch broke compilation.

2020-06-21  Reini Urban  <rurban@cpan.org>

	add BLOCKPARAMDEPENDENCYBODY

	add more action params and bodies
	ARRAYITEMLOCATOR subclass,
	ASSOCACTIONPARAM, ASSOCVALUEDEPENDENCY, ASSOCARRAYACTIONBODY, ASSOCARRAYMODIFYACTIONBODY
	and a few more AC*CONSTRAINT subclasses

	add ASSOCRESTOREENTITYSTATEACTIONBODY
	demote failung ASSOCSWEPTSURFACEACTIONBODY

2020-06-20  Reini Urban  <rurban@cpan.org>

	add ASSOCMLEADERACTIONBODY

	add ASSOCEXTENDSURFACEACTIONBODY
	forgot one more

	refactor ASSOC2DCONSTRAINTGROUP
	with AcConstraintGroupNode

	add missing ASSOC*SURFACEACTIONBODY
	OFFSET and TRIM

	spec: add remaining ASSOC*DIMACTIONBODY

	spec: add ASSOCOBJECTACTIONPARAM

	spec: add ASSOCNETWORKSURFACEACTIONBODY
	like ASSOCPATCHSURFACEACTIONBODY

	promote ASSOCNETWORK to unstable

	spec: fix ASSOCNETWORK
	almost the same as ASSOCACTION, just a bit smaller.

	spec: fix AcDbAssocSurfaceActionBody
	it uses ASSOCACTIONBODY, not ASSOCACTIONPARAM, as the name already says.
	rename most ASSOCSURFACEACTIONBODY fields, now a subclass.

	api: export dwg_resbuf_value_type
	renamed from get_base_value_type.
	needed for dwggrep, because it is used in some public datatype
	AcDbEvalVariant.

	spec: promote ASSOCGEOMDEPENDENCY, ASSOCACTION to unstable
	actually it is stable already, just need to test in_dxf.
	assocaligneddimactionbody looks stable, but crashes.

	fix EvalVariant values
	dispatch on the DXF code

	AcDbValueParam protections
	but still crashes

2020-06-20  Reini Urban  <rurban@cpan.org>

	add ASSOCCOMPOUNDACTIONPARAM
	which is mostly a subclass for Path and OsnapRef,
	but exists as class also.

	and fix more unit-tests

2020-06-19  Reini Urban  <rurban@cpan.org>

	add ASSOCASMBODYACTIONPARAM

	fix new debug classes

	ASSOCACTIONPARAM et al unit-tests
	esp. ASSOCPARAMBASEDACTIONBODY macro

	add ASSOCFILLETSURFACEACTIONBODY and more refactoring
	add framework for AssocArrays

	spec: finish ASSOCACTIONPARAM refactor

	wip more ASSOCACTIONPARAM work

2020-06-18  Reini Urban  <rurban@cpan.org>

	spec: WIP more ASSOCACTION subclasses
	more embedded structs, which we need for indxf

	wip: some more assoc actions

	simplify ASSOCPATHBASEDSURFACEACTIONBODY
	all those have the same struct

	indxf: fixup ASSOCACTION (renames)

	indxf: fix empty 1001 code
	new fuzzer 26 testcase id:439

	rename some ASSOCDEPENDENCY fields
	minor refactoring

2020-06-17  Reini Urban  <rurban@cpan.org>

	spec: add ASSOCVARIABLE debugging
	lots of assoc subclasses missing

	api: rename RASTERVARIABLES.display_* to image_*

	dxf: image re-orderings (minor)
	 IMAGEDEF_REACTOR has a double 330 ownerhandle in out_dxf

	add more covered DXF names
	but just the class declarations, no objects unfortunat.
	looks like most are not filed to DWG.

	add missing unhandled decls
	VISIBILITYGRIPENTITY, VISIBILITYPARAMETERENTITY
	and re-sort

	api: promote ACSH_BOOLEAN_CLASS to stable
	enough coverage

	unit-tests: log stability

	adjust tests for --enable-debug
	dxf.test and json.test are now stable with --enable-debug
	Just acsh_history_class crashes

	indxf: support TABLESTYLE.sty.cellstyle
	and fix TABLESTYLE.name (not sty.name).
	Fixes DEBUG_CLASSES assertions on indxf

	spec: add debugging MPOLYGON
	which is a hatch plus boundary

	api: rename XRECORD.cloning_flags to cloning
	as with DICTIONARY. Add docs.

	dxf: VIEW r12 dxf order

	spec: replace PLOTVIEW table lookup by VIEW (6)
	There is no PLOTVIEW table, but the VIEW table. This was an oversight.

	unit-tests: fixup CHK_SUBCLASS_VECTOR_TYPE typos

	more C++ compat
	now just the in_dxf.h ADD_OBJECT/ENTITY calloc assignment is wrong.

	indxf: mingw gcc 9.2 -Wmaybe-uninitialized warning

	indxf: detect for more DWG magic
	earlier versions

	indxf: ioerror on too small input file
	fixes a new fuzzing crash, 26 id:299

	indxf: fix unicode EED strings likewise
	but here we need to operate on the real string length,
	after conversion from UTF8 to UCS2.
	Also acccount the size for the added padding.

	injson: fix importing empty EED strings
	heap-overflow with memcpy on len=0

	decode: fix EED unicode strings byte-swapped
	also add a padding byte to the eed_data struct, to match
	the ASCIIZ string, but esp. to allow reading unaligned
	2byte values with ubsan. now it's aligned.

	injson: fix from_version mishmash

	extract importer version macros to importer.h
	there we need to look at from_version.
	for export (encoder, out_*) we need the target version

	dxf: fix 3DSOLID DXF output and encrypt_SAT1
	wrong dxf codes for acis_empty/has_revison_guid
	wrong num_blocks
	wrong encryption.

	decode: fix invalid bitsize also r2007+
	which did caused std_dat overflows in fuzzing 7, id:90

	bits: add earlier read_CMC overflow checks
	some fuzzing 7 testcase id:90 keeps overflowing

	json: fix printing unicode EED strings
	off-by-one, missing the first character, and then byte swapped.

	decode: error earlier on wrong obj->size
	some fuzzing cases at 6 are just unrepairable.

	bits: more overflow protections
	for some special fuzzing cases with wrong obj->size.
	better check before some cases, to return earlier.

	decode: don't forget DWG_ERR_VALUEOUTOFBOUNDS
	when size overflowed, but was adjusted.

	indxf: ACSH.history_node.trans followed by 0
	detected by fuzzing, crashes6, id 459

	indxf: fix hang on wrong 2 CLASSES
	not followed by 0 CLASS. Fixes 2 crashes26 hangs
	error early

	indxf: protect CellStyle.orders[grid] overflow
	detected by fuzzing round 26. fixes all 7 crashes26

	free: classes even with 0 num_classes
	fuzzer 26 indxf leaks

	simplify object_alias for ACDB_*OBJECTCONTEXTDATA_CLASS

	fix OCD_Dimension unit-tests

	add {DM,ORD,RA}DIMOBJECTCONTEXTDATA

	.gitignore: two more private dirs

	add ANGDIMOBJECTCONTEXTDATA

	spec: add AcDbDimensionObjectContextData and RADIMLGOBJECTCONTEXTDATA
	for large Radial Dimension ObjectContextData

2020-06-15  Reini Urban  <rurban@cpan.org>

	indxf: add_AcDbEvalExpr

	dxf: ACSH_HISTORY_CLASS different DXF order

	indxf: fix lshift problem with temp int
	keep the long type to be able to represent 0xc2 << 18
	src/in_dxf.c:7457:37: runtime error: left shift of 194 by 24 places cannot be represented in type 'int'

	spec: 3DSOLID.revision_guid off-by-one
	not large enough. strlen is 38, not 37

	indxf: 3DSOLID.revision_guid DXF 2 for r2013+

2020-06-14  Reini Urban  <rurban@cpan.org>

	importer: abstract decode_BACKGROUND_type
	for decode, in_json, in_dxf.

	docs: more stability fixups

	spec: promote BACKGROUND to unstable

	spec: more BACKGROUND changes
	set type by dxfname on decode/import,
	add object_alias.
	looks even stable now

	spec: more seperate structs, enable BACKGROUND
	AcDbBlockGripExpr, BLOCKGRIPLOCATIONCOMPONENT
	BACKGROUND subclasses, now promoted to debugging

	spec: make a seperate evalexpr struct
	same as with history_node, to be able seperate the same DXF codes in in_dxf.

	dxf: added more 3DSOLID dxf codes
	to regen-dynapi.

	indxf: AcDbShHistoryNode support
	but AcDbEvalExpr really should be a struct/subclass, not inlined

2020-06-13  Reini Urban  <rurban@cpan.org>

	dwg.h: harmonize SWEEPOPTIONS_fields macro
	SweepOptions_FIELDS is different to all other header macros.
	_fields needs to be all lowercase, and to seperate it from the
	specs macros make the name all UPPERCASE.

	unit-testing: simplify test_code call

	travis: shorter asan
	skip unit-tests, always reaching the 50min hard limit now

	api: stabilize most ACSH classes
	just 5 are unfinished, and 6 are a bit unstable.
	TODO: indxf of the trans vector_n1,
	and some subclass specifics

2020-06-12  Reini Urban  <rurban@cpan.org>

	test-data: add coverage dwg for some ACSH classes
	to be able to put them into stable.

	unit-testing: improve CHK_ACSH_HISTORYNODE trans matrix

	spec: a bit AcDbEvalExpr
	comments and rename one field. This is a single node
	in the EVALUATION_GRAPH

	spec: more ASSOCPERSUBENTMANAGER
	but not much. still missing the subent structure.

	spec: more ACSH subtypes
	finish material and color acis subclasses.
	yet unused.

	spec: add ACSH_CONE and CYLINDER classes
	this should be all ACIS History_Node classes now, I think

2020-06-12  Reini Urban  <rurban@cpan.org>

	spec: add ACSH_BOOLEAN_CLASS
	and rename EvalExpr.ee_class_version to ee_int

	the default is -1, a signed int32. Not in DXF.
	It could be a nodeid, but then it would be in DXF.

2020-06-12  Reini Urban  <rurban@cpan.org>

	spec: ACSH classes major/minor, fix unit-tests
	abstract EvalExpr and HistoryNode subclasses

	spec: add AcDbShHistory to ACSH_HISTORY_CLASS

2020-06-12  Reini Urban  <rurban@cpan.org>

	Unify 3DSOLID layout, extend AcDbEvalExpr
	ensure all 3DSOLID objects have the same layout (one is an object, not an entity).
	implement the AcDbEvalExpr fields, and use it.
	Not as extra struct as history_node, just inline it.
	A history_node is an seldom used extension, the evalexpr is a major feature
	(and already used)

	AcDbEvalExpr really should have the values as union, but does not work yet.
	Try later.

2020-06-12  Reini Urban  <rurban@cpan.org>

	add dwg_add_handleref_free
	for non-global free'able handlerefs

2020-06-12  Reini Urban  <rurban@cpan.org>

	ACIS 2: fix order of applied entities
	we need to shift from the beginning, not from the end.
	we need to use the same order of entities and SAB streams.

	also clear acis_empty on converted acds acis_data, otherwise it
	will be skipped.

2020-06-12  Reini Urban  <rurban@cpan.org>

	ACIS 2: Fix SAB stream detection r2013+
	r2013+ uses a new End-of-ASM-data marker, deviating from ACIS.
	They forked it to ShapeManager afterall.
	This new marker is only used in AcDs streams

	ACIS 2: assign r2013+ 3DSOLID sab data
	store the handles when seeing them globally,
	in acds.spec assigne them directly one after the other,
	assuming the order is the same in both.

	fix one -Wformat - nonliteral

	fix memmem decl
	freebsd and macos fail on memmem calls, probably due
	to a missing decl. relying on _GNU_SOURCE is fragile
	for a non-GNU libc header.
	The only regression is a -Wdedundant-decl warning.
	We really should check the header for it, not just the library.

	api: export dwg_encrypt_SAT1, dwg_convert_SAB_to_SAT1
	Better this way.
	Move dwg_encrypt_SAT1 to a place not affected by --disable-write,
	as it is now also needed by out_dxf for r2013+ 3DSOLIDs.

	api: add dwg_obj_is_3dsolid
	which is needed when we read the AcDs section after
	the OBJECTS, and need to assign the acis_sab_data[] to 3dsolid
	entities.

	ACIS 2: scan the AcDs data for ACIS
	and store them globally, to be picked up later.

	ACIS 2: change v2 to num_blocks = 1 only
	rather add newlines, not now blocks for each line.
	This is counterprodutive and different to the v1 format

2020-06-12  Reini Urban  <rurban@cpan.org>

	ACIS 2: class-specific boolean strings
	finally found some 1996 ACIS documentation,
	which I collected then (as ps).
	add and fix some tags, this is now almost complete,
	just enums not yet

	also fix a couple of overflows, allocate enough.

2020-06-12  Reini Urban  <rurban@cpan.org>

	ACIS 2: final encryption for the DXF v1

	ACIS 2: convert_SAB_to_encrypted_SAT abstractions
	No errors anymore.

2020-06-10  Reini Urban  <rurban@cpan.org>

	WIP ACIS 2: convert_SAB_to_encrypted_SAT with Bit_Chain
	This way all the underflow checks are done automatically.
	And we can use the simplier bit_read/write functions, instead of sprintf.

	Found a couple new opcodes, and a documentation for the header and indices.
	No opcode docs yet.

2020-06-10  Reini Urban  <rurban@cpan.org>

	WIP ACIS 2: dxf needs convert_SAB_to_encrypted_SAT
	dxf without AcDs just converts the SAB to an encrypted ASCII SAT.
	SAB looks pretty easy to decipher. A very primitive format,
	and I even found my own stdlib documentation which I wrote 1998.

	spec: add ACSH_BREP_CLASS
	A simple AcDbShPrimitive with 3DSOLID

	Prepare NEWS for 0.11

2020-06-09  Reini Urban  <rurban@cpan.org>

	extend 3dsolid unit-tests

	travis: start the slowest tests first
	so that the overall time goes down

	ACIS 2: add encode and json support
	split the acis_data lines into 2. first the readable
	magic to identify it, the rest as binary (hex)

2020-06-08  Reini Urban  <rurban@cpan.org>

	add HAVE_MEMMEM, implement workaround
	A naive O(n^2) variant, but good enough for us

	ACIS 2: read the whole SAB
	and then try to find the "End of ACIS data" marker for the
	size. This is without has_ds_data, e.g. 2004.

2020-06-08  Reini Urban  <rurban@cpan.org>

	api: minor MULTILEADER B renames
	neg_textdir, text_extended -> is_ prefix
	abstract CMLContent_fields common fields for the Content union
	add calc. type field to check at run-time.

	.h formatting (clang-format)

2020-06-08  Reini Urban  <rurban@cpan.org>

	unit-tests: simplify some checks
	more vector macros, applied to multileader.
	catch more nan's

2020-06-07  Reini Urban  <rurban@cpan.org>

	automake distcleancheck for the info came back
	despite info-in-builddir

	add FCFOBJECTCONTEXTDATA decls

	fix more debugging unit-tests

	fix arc_dimension unit-test
	looks stable now. need to check the importers still.

	add CONTEXTDATAMANAGER class
	and re-enable OBJECTCONTEXTDATA

	api: rename VIEW.pspace_flag to is_pspace

2020-06-07  Reini Urban  <rurban@cpan.org>

	fix CALL_SUBENT types
	but still disabled. dynamic dispatch on an entity

	changed to hold a handleref, not an object

2020-06-07  Reini Urban  <rurban@cpan.org>

	ACSH unit-tests

	new ACSH decls

	spec: more ACSH entities
	TODO: need CALL_ENTITY by dynamic int type, not
	static by NAME. Some kind of dwg_##action##_dispatch_private().

2020-06-06  Reini Urban  <rurban@cpan.org>

	regen-dynapi: fix RTEXT.extrusion dxf

	json: fix PROXY_OBJECT
	binary data and data_size

	json: add missing PROXY_OBJECT
	which fixes the empty json object {}.
	esp. for r13, which has many such proxies

	STYLE: comments only

	swig: silence wrong swig cpp parser error warning 305
	"DWG_TYPE_POLYLINE_2D = 0x0f,"
	is a valid enum line, and not a #define bla = num statement

	api: next is a perl keyword
	rename ResBuf.next to nextrb

	indxf: fix -Wmaybe-uninitialized mode warning
	in add_CellStyle

	api: from is a python keyword
	rename MESH.edges.from to idxfrom, "to" to idxto

	api: self is a python keyword
	rename MATERIAL.gentextures.self to material

	C++: template is a C++ keyword

	MLEADER_Content union changed: fix unit-test

2020-06-06  Reini Urban  <rurban@cpan.org>

	Enable C++ compat
	To compile with g++/clang++
	reserved keywords, inner structs, malloc casts, ...

	Needed for some bindings in C++

2020-06-06  Reini Urban  <rurban@cpan.org>

	deocde: fix preR13 TABLE offsets
	can read now again older files, partially

	.gitignore: add bindings/gambas/
	will be a submodule eventually
	needs to be compiled in the gambas sourcetree, not here.
	i.e. copy it over, not symlink.

2020-06-06  Reini Urban  <rurban@cpan.org>

	spec: fix whitespace
	add comments of broken fields.

	fix RTEXT.extrusion dxf detection.
	lost the 210, needs to be on a seperate line.
	Fixes a 5645c0ce00b120491c9bf6c771d3de87b119cb9d regression

2020-06-05  Reini Urban  <rurban@cpan.org>

	unit-testing: rm duplicate tests

	spec: aesthetics

	indxf: support point vectors, get array numfields
	allocate and set point vectors generically.
	only dxf 10-19

	indxf: PLOTSETTINGS indentation only

2020-06-05  Reini Urban  <rurban@cpan.org>

	fix gen-dynapi for spec define _fields
	copy the DXF and ENT fields over. got many missing dynapi DXF values.

	improve EXTRUDEDSURFACE more (dxf vs dwg)

2020-06-05  Reini Urban  <rurban@cpan.org>

	spec: abstract common SweepOptions

	more NULL ptr protections
	failing with the new testcase LiveSection1.
	NULL blk->name

	add 2018/LiveSection1.dwg for livesection coverage
	in the unit-tests

	promote DETAILVIEWSTYLE to unstable
	just indxf missing

	spec: fix DETAILVIEWSTYLE
	analog to SECTIONVIEWSTYLE

	promote SECTIONVIEWSTYLE to unstable
	indxf missing

	spec: fix SECTIONVIEWSTYLE
	looks stable, just indxf is missing.

	SECTION_SETTINGS: promote to unstable
	add to the unit-test

	spec: more SECTION_SETTINGS
	default hatch_pattern to SOLID (if empty)
	add bit_set_T api to convert from ASCII to T.
	fixup the unit test

2020-06-04  Reini Urban  <rurban@cpan.org>

	SECTION_SETTINGS refactor
	multiple types and geometry settings in fact.
	for all max 4 types, if activated (2d, 3d, and for both live on/off)

2020-06-03  Reini Urban  <rurban@cpan.org>

	indxf: fix DIMASSOC crash

	unit-testing: dont test DEBUG_CLASSES
	to speed up asan testing mostly

	SECTIONOBJECT: promote to stable

	SECTION_MANAGER: promote to stable
	fix and add DXF codes

	encode: fix -Wmaybe-uninitialized warning

	SECTIONOBJECT: fix alpha type, rename settings handle

	ASSOCPERSSUBENTMANAGER: try the BL vectors

2020-06-03  Reini Urban  <rurban@cpan.org>

	api: move PERSUBENTMGR back to debugging
	totally unstable. need to find out about CALL_SUBENTITY first

	(dispatch_private via objects.inc-like list or a functable)

2020-06-03  Reini Urban  <rurban@cpan.org>

	spec: even more PERSUBENTMGR
	this is a frozen repr of ASSOCPERSSUBENTMANAGER
	with two BL vectors

	spec: more PERSUBENTMGR
	the last BL is an array of BL

2020-06-02  Reini Urban  <rurban@cpan.org>

	dxf: some DICTIONARY keys are always hard 360
	ACAD_SORTENTS, ACAD_FILTER and SPATIAL are always hard.
	also fix the RC hard_owner version checks, starts already with r13c3.

	travis: 2x asan make check timeout (10 -> 20 min)

	encode: add bit_chain_init_dat helper
	to set opts and versions.
	move fh to the end of the struct, used the least.

	encode: refactor dwg_encode_eed, part 3
	fix the flush logic a bit.
	there are mult. data lines for each handle/size.

	optimize bit_copy_chain
	do memcpy on byte-aligned target.

2020-06-01  Reini Urban  <rurban@cpan.org>

	encode: refactor dwg_encode_eed, part 2
	add bit_copy_chain.
	remove size checks, we write the size at the end

	encode: refactor dwg_encode_eed
	on need_recalc split the out stream into two,
	let _data return the size, and copy the 2nd data stream.

2020-05-31  Reini Urban  <rurban@cpan.org>

	travis: -fno-var-tracking for asan
	it is expensive, maybe it helps

	Revert "travis: try gcc for asan"
	This reverts commit 96233ad611e752efa7efa24ece3a8039206e033e.
	gcc 5.4 asan does not obey env ASAN_OPTIONS (indxf leaks)

	bit_embed_TU_size: support UBSAN
	and fix the len argument, which was offbyone

	encode: convert EED strings
	from/to unicode

	free: fix in_json created_by leak
	we dont currently store that string in the Dwg_Data struct.
	gcc on travis detected that leak, my gcc 9.3 not (it's static
	so not really a leak), travis clang neither.

	travis: try gcc for asan
	clang is extremely slow

2020-05-30  Reini Urban  <rurban@cpan.org>

	api: harmonize VIEW fields with VPORT/VIEWPORT
	s,target,view_target,
	s,center,VIEWCTR,
	s,width,view_width,
	s,height,VIEWSIZE,

	harmonize entity VIEWPORT SNAPANG r2006 logic with
	object VPORT

2020-05-30  Reini Urban  <rurban@cpan.org>

	api: even more VIEW/VIEWPORT changes
	all the HEADER value overrides in its special *Active tables:

	s,ucs_per_viewport,UCSVP
	s,ucs_orthoview_type,UCSORTHOVIEW,
	s,grid_spacing,GRIDUNIT,
	s,snap_spacing,SNAPUNIT,
	s,snap_angle,SNAPANG,
	s,snap_base,SNAPBASE,
	s,view_height,VIEWSIZE,

2020-05-30  Reini Urban  <rurban@cpan.org>

	api: more VIEW/VIEWPORT changes
	s,view_direction,VIEWDIR,
	s,view_center,VIEWCTR,
	s,view_twist,twist_angle,
	s,{front,back}_clip{,_dist},\1_clip_z,

	also SPATIAL_FILTER.*_clip_z

2020-05-30  Reini Urban  <rurban@cpan.org>

	api: VPORT changes
	check for R_2006/AC1020 just for VPORT.SNAPANG
	only in this version VPORT is different.

	rename VPORT.viewwidth to view_width
	fixup the DXF order a bit.

2020-05-29  Reini Urban  <rurban@cpan.org>

	major api changes for UCS, VIEWPORT, VIEW
	another mass rename, for consistency:

	s,orthographic_view_type,ucs_orthoview_type,
	s,ucs_ortho_view_type,ucs_orthoview_type,
	s,ucs_orthografic_type,ucs_orthoview_type,
	s,ucs_origin,ucsorg,
	s,ucs_x_axis,ucsxdir,
	s,ucs_y_axis,ucsydir,

	VIEW.camera_plottable => VIEW.is_camera_plottable
	{VIEW,UCS}.x_direction => ucsxdir
	{VIEW,UCS}.x_direction => ucsxdir
	{VIEW,UCS}.elevation => ucs_elevation

2020-05-29  Reini Urban  <rurban@cpan.org>

	spec: minor

	dxf: sort LAYOUT dxf fields

	dxf: XRECORD.cloning_flags 280 are optional

	api: add two more versions, R_2_4 and R13c3
	for which we have now DWGs.
	encode: fix some wrong old header.dwg_version values (also see common.c)

	logs-all.sh: add test/test-old files
	with two nested dirs

	spec: refactor VPORT_ENTITY_HEADER
	thanks to the old dwgs

	dxf: UCS some optional fields

	spec: fix STYLE
	no direct ttf_ fields, just in xdata.
	might need some kind of xdata stream handler:
	  FIELD_XDATA_CLASS ("ACAD", 1001)
	  FIELD_XDATA (ttf_typeface, T, 1000)
	  FIELD_XDATA (ttf_flags, RL, 1071)

	add 2013/gh44-error.dwg for SPATIAL_FILTER coverage
	otherwise it cannot be stable

	spec: SPATIAL_INDEX is unstable
	refactor

	api: SPATIAL_FILTER changes
	rename some fields.
	add and fix unit-test

	spec: improve SORTENTSTABLE
	dxf has pairs of handles, not 2 vectors.
	dwg seperates the two streams.

	spec: simplify SCALE

	travis: make check also times out with ASAN

2020-05-28  Reini Urban  <rurban@cpan.org>

	dxf: APPID simplify, use FIELD_RC0
	undocumented, not in ODA, but as DXF 71 in the wild, for ADE_PROJECTION

	injson: support embedded entity classes, not just subclasses
	for PLOTSETTINGS, embedded into LAYOUT.

	indxf: add generic subclass code
	only used for LAYOUT.plotsettings for now, but is generic enough for
	all subclasses.

	embed PLOTSETTINGS into LAYOUT
	it is the very same. promote PLOTSETTINGS to stable
	remove PLOTSETTINGS.page_setup_name, it was a mixup.

2020-05-27  Reini Urban  <rurban@cpan.org>

	LAYOUT, PLOTSETTINGS: api changes
	rename a lot of fields.
	PLOTSETTINGS really is a parent of LAYOUT.

	indxf: more derefered handles
	like our layer handles, which are not read yet, if in DXF by name.
	TODO: check VIEW, VIEWPORT handles.

	LAYER: add visualstyle field r2013+

	travis: asan times out again at unit-testing
	add a unit-testing check-prep target
	and add a seperate timeout for that.

2020-05-26  Reini Urban  <rurban@cpan.org>

	spec: promote CELLSTYLEMAP to stable

	indxf: more add_CellStyle fields
	CELLSTYLEMAP becomes now a stable candidate,
	joining TABLEGEOMETRY

	log: extend to test-old files
	which are two dirs deep

	indxf: use add_CellStyle for CELLSTYLEMAP
	not for the other TABLE objects yet

	spec: promote LAYERFILTER to stable

	spec: promote LAYERFILTER to unstable
	found an example

2020-05-25  Reini Urban  <rurban@cpan.org>

	GEODATA: promote to stable, add indxf code
	indxf catched GEODATA before checking the dxf codes, so we can intercept
	the arrays to allocate them. If not belonging to the 2 arrays, pass the pair
	along to the generic search.

	spec: more GEODATA improvements
	2d points are generally 2RD, not 2BD.
	looks stable now

2020-05-24  Reini Urban  <rurban@cpan.org>

	indxf: fix MLINE segparms and areafillparms
	make it independent on the order of the 72 and 73 DXF fields.

	indxf: 4 more HATCH gradient fields

	unit-testing: fix a visualstyle signedness

	dynapi_test: skip wrong ovr.name test
	ovr.name is not a known fields, we would need to test for
	the subclass instead, as in the unit-test. so skip it.
	crashes on travis, but not at home

	MLEADERSTYLE fails dynapi_test
	via decode class_version is 2, but via dynapi_test it is 0
	on example_2018. The reason is that we picked up a wrong
	./example_2018.dwg

	spec: whitespace only

2020-05-23  Reini Urban  <rurban@cpan.org>

	DIMASSOC: minor changes
	intsectobj[] is a H*. Still WIP.
	Also fix json SUB_HANDLE_VECTOR

2020-05-22  Reini Urban  <rurban@cpan.org>

	make VISUALSTYLE.display_brightness_bl signed
	apparently there is a double value of -50.0

	VISUALSTYLE: fix ubsan error
	-50 is outside the range of representable values of type unsigned int,
	for the double->uint conversion of display_brightness

	indxf: fix null deref, Out of memory checks

	fix free for lt. union
	since 1d2f5c7b5d3e1becc8b5b499632b6ef6cf0120ce
	we follow both version branches, so the MLINESTYLE.lt.ltype union
	has a wrong pointer, which crashes on free when following it.
	seperate the values.

	injson: add more Out of memory checks
	facebook infer complains. also it found some dead assignments

	bits: add more Out of memory checks
	facebook infer complains. It is right

	injson: refactor _set_struct_field
	search keys at first, then process the result.
	remove dead code now handled in _set_struct_field.

2020-05-21  Reini Urban  <rurban@cpan.org>

	injson: search all keys for valid embedded structs
	not just the very first.

	injson: trace the current subclass (name)
	not just the key, ie fieldname.
	the name is now also used for subclass field lookup for embedded structs,
	so fixup the MLEADER subclass names also.

	injson: skip wrong Out of memory error
	when the binary string is just empty "".
	also log add the name.key, esp for recursive subclasses.

	json: fix FIELD_2RD_VECTOR indentation
	e.g. clip_verts

	.gitignore: vscode, more tests

	dynapi: fix TABLESTYLE.ovr.name
	ovr.name is an invalid C variable name. use ovr_name instead.

	spec: add SUB_FIELD_HANDLE0 for TABLE.cell.text_style
	optional handle 344

	injson: support primitive inlined structs
	as CellStyle, MATERIAL_color and such.
	When the key was not found, check for the . and recurse into the remainder.

2020-05-20  Reini Urban  <rurban@cpan.org>

	TABLE unit-test fixups

	TABLE_value fixups

	spec: TABLE_AttrDef*

	spec: more work on TABLE. add SUB_FIELD_CAST

2020-05-19  Reini Urban  <rurban@cpan.org>

	TABLECONTENT: more dxf markers
	and one more truecolor field: indicator_color

	ditto CMTC for TABLESTYLE <r2004

	support <r2004 CELLSTYLEMAP/... FIELD_CMTC
	Support truecolor colors also earlier, as they appear as such
	in CellStyle.

	free: fix more TABLESTYLE leaks on dwgrewrite downconverts
	override all version check macros, not just SINCE.
	This is now a proper general solution.

	SCALE: no unknown_bits, it is stable

	TABLESTYLE: use hex format for flags

	injson: support more cellstyle subclasses
	for now special-cased cellstyle

	CellStyle: add unit-testing in TABLESTYLE

	CellStyle: more fixes, start in_dxf
	start with in_dxf support. yet unused.

	TABLESTYLE: revert debugging

2020-05-18  Reini Urban  <rurban@cpan.org>

	move TABLESTYLE back to debugging
	r2010+ is wrong still

	TABLESTYLE: add overrides r2010+
	just an idea, but fixes the leaks

	injson: improve json_binary
	no extra str allocation, no unicode quote detection and conversion

	injson: please valgrind
	Uninitialized memory in stack strings.

	comments only

	json: strip key[rcount*] from CMC
	CELLSTYLEMAP.cells[rcount1].cellstyle.bg_color

	CELLSTYLEMAP: enable, promote to unstable

2020-05-16  Reini Urban  <rurban@cpan.org>

	TABLESTYLE: more 2010 work
	and rename some more fields

	api: rename some TABLESTYLE structs
	more according to the DXF subclasses.
	TABLESTYLE_Cell => TABLESTYLE_CellStyle
	BorderStyle => GridFormat

	spec: TABLESTYLE, merge with CELLSTYLEMAP
	support for r2007+, add sty.cellstyle

	unknown: regen with B::cstring quote
	for illegal strings in the C .inc files, caused by foreign encodings
	(ANSI_1251 e.g.). We'd really need to decode these properly.

2020-05-15  Reini Urban  <rurban@cpan.org>

	api: add R_1_3 version
	see the file magic database

	spec: fix MLEADERSTYLE.class_version 2
	no extra is_new_format field, just class_version 1 (not in DWG) or 2.
	it is the code 70 value from EED ACAD_MLEADERVER.
	One new fields text_angle_type is class_version 2 only

	dynapi_test_all.sh: fix test-data dir

2020-05-15  Michal Josef Špaček  <michal.josef.spacek@gmail.com>

	Fix 1.4 version
	DWG magic for this version is "AC1.40", not "AC1.4".

2020-05-14  Reini Urban  <rurban@cpan.org>

	configure: missed a comma
	broken with -fno-common

	spec: normalize_BE HATCH.extrusion.z
	and for indxf LWPOLYLINE.extrusion

2020-05-14  Reini Urban  <rurban@cpan.org>

	spec: work on HATCH
	rename some fields:
	type_status => curve_type
	solid_fill => is_solid_fill
	annotative => is_annotative

	the bitvalues of HATCH.paths.flag

2020-05-14  Reini Urban  <rurban@cpan.org>

	bits: normalize extrusion.z, fix write_BT for <=R_14
	the extrusion vector needs to be normalized.
	early thickness has no B (default bit)

	extend 3DSOLID unit-tests

	spec: 3DSOLID.wires.color is BL r2004* not BS

	spec: add 3DSOLID r2013+ revision guid
	in DXF as 2 {} guid
	in DWG as BL, BS, BS and TFFx 8

2020-05-13  Reini Urban  <rurban@cpan.org>

	spec: add 3DSOLID r2007+ materials

	dxf-check: MULTILEADER is now stable

2020-05-13  Reini Urban  <rurban@cpan.org>

	unit-testing: final manual CHK_ fixups
	api: rename all insertion_point to insertion_pt, also
	TABLE fields and dwg_api funcs.

	rename all dwg_api 3DSOLID num_isolines functions to isolines

2020-05-13  Reini Urban  <rurban@cpan.org>

	unit-testing: simplify CHK_ENTITY_H and 23RD
	perl -i -p -e's/CHK_(.+), (\w+), \2\);/CHK_\1, \2);/' test/unit-testing/*.c

	unit-testing: simplify CHK_ENTITY_TYPE
	perl has backtracking regexp, elisp not.
	perl -i -p -e's/CHK_(.+), (\w+), ([A-Z0-3]+), \2\);/CHK_\1, \2, \3);/' test/unit-testing/*.c

	unit-testing: simplify CHK macros
	dedup the value arg

	DIMENSION_ANG2LN: fix def_pt
	keep the type as 3BD, but read/write only 2D.
	Just json (and dxf) needs the real type. DXF with z.

	dxf_test: ARC_DIMENSION fixes
	wrong names in the .inc file

	ditto for DIMENSION_ANG2LN
	merge arc_def_pt with def_pt

2020-05-12  Reini Urban  <rurban@cpan.org>

	ARC_DIMENSION: merge arc_pt with def_pt 10
	only use the default name

	spec: promote MULTILEADER to stable

	spec: stabilize MULTILEADER
	wrong arrowheads.is_default type
	rename attach_type to text_aligment, the prev. text_alignment is the angletype

	indxf: rename cur_vstyle var to prev_vstyle

	unit-tests: add SINCE/PRE version macros
	some versions have wider types

	spec: promote VISUALSTYLE to stable

2020-05-11  Reini Urban  <rurban@cpan.org>

	indxf: support r2010+ VISUALSTYLE group 176 fields

	Revert "spec: remove LAYER_TABLE_FLAGS special-case"
	This reverts commit a51939c7bba5d91f8f1f724845b800f7bee94a8c.

	unit-testing: RS flag
	use RC instead (the layer exception)

2020-05-11  Reini Urban  <rurban@cpan.org>

	spec: VISUALSTYLE r2013+ support
	rename some fields (again)
	flip some wrong fields

	add r2013+ version 3 layout with its 58 props
	(yet unknown field names)

2020-05-11  Reini Urban  <rurban@cpan.org>

	spec: MLEADERSTYLE add r2013+
	and rename some B fields

	spec: add FCFOBJECTCONTEXTDATA
	debugging

2020-05-10  Reini Urban  <rurban@cpan.org>

	api: rename DIMENSION_ANG3PT.first_arc_pt to center_pt

	bits: fix TIMEBLL julian fraction
	calculation. it's millisecs since midnight, not secs.

	api: rename LAYER_INDEX.timestamp to last_updated
	it is a cache

	indxf: add TIMEBLL support
	for LAYER_INDEX.timestamp

	spec: re-add LAYER_INDEX.timestamp
	reverts 39ff601a7b261eb74182b04255802e56bd82c41a
	add LAYER_entry support to indxf.

	indxf: change to DIMENSION_LINEAR on 50 also
	dim_rotation has the subclass marker after 50, not before.

	outdxf: bulges are optional
	fix assert

	spec: promote VBA_PROJECT from debugging to stable
	2 fields only

	write2004: limit compression to MIN_COMPRESSED_SECTION size of 19
	and assert it. switch the compressed flag before.

	write2004: more compress_R2004_section work
	more work on it, the lz77-like encoder.
	the reverse part of the decompressor.
	enable now all functions.

2020-05-09  Reini Urban  <rurban@cpan.org>

	free: fix CMC double-free from injson
	CMC was static there, keeping the previous name/book_names
	pointers.

	encode: trace SUB_FIELD_CMC values

	dxfb: add optional BL0, ... variants

	dxf: add FIELD_T0
	optional text, only print to DXF if not empty

	free: fix TABLESTYLE leaks

2020-05-09  Reini Urban  <rurban@cpan.org>

	CMC: improve in_dxf and in_json
	detect book_name from $, otherwise set only the name,
	plus its proper flag.

	TODO alpha/alpha_type only for ENC.
	Maybe seperate CMC from ENC (different flag, alpha)

2020-05-09  Reini Urban  <rurban@cpan.org>

	CMC: fixup color.index by palette lookup
	needed for DXF. for the DWG we need to write 0 as index for
	truecolors

	CMC: better diagnostics
	print dwg_color_method_name of the known methods

	bit_read_CMC: add more snaity checks
	fixup invalid method, invalid flag

	actions: add more _private functions
	with the end goal to also call free on them

	gcc10: add -fno-common explicitly
	we are safe due to windows compat already.
	but for older compilers ensure it.

	spec: more DIMASSOC_Ref work

	TABLESTYLE r2010+ support

	spec: avoid -Wduplicate-branches warning
	on non-dxf actions both bodies are empty, leading to this warning.

	regen-unknown
	with updated field names

2020-05-09  Reini Urban  <rurban@cpan.org>

	api: rename ext_line_rotation and _13,14_pt
	in TEXT,ATTDEF,ATTRIB,STYLE
	and DIMENSION_ALIGNED, DIMENSION_LINEAR, DIMENSION_ANG3PT

	oblique => oblique_angle
	oblique_ang => oblique_angle
	ext_line_rotation => oblique_angle
	_13_pt => xline1_pt
	_14_pt => xline2_pt

2020-05-08  Reini Urban  <rurban@cpan.org>

	spec: use calling _private: GEOPOSITIONMARKER -> MTEXT
	and some more.
	fix DIMASSOC spec types.
	more GEOMPOSITIONMARKER fixes.
	add unhandled COMPOUNDOBJECT.

2020-05-07  Reini Urban  <rurban@cpan.org>

	spec: DATATABLE spec
	WIP. roughly, but looks good.

	spec: use callable subclass for MAT_TEXTURE
	WIP

	spec: callable subclasses
	embed the calling of subclasses into a function wrapper,
	so that it can call itself or others.
	needed for recursive procedural MATERIAL.MAT_TEXTURE calls.

	2004: fix some -Wnull-dereference in encode
	detected by the new gcc with -O2

	dxf: improve CMC truecolors
	always set method 0xc2 when reading rgb 420.
	allow a hypothetical truecolor DIMSTYLE.DIMTFILL.
	don't write non 0xc2 truecolors with DXF, just the index 62.
	fix in_json leaks, we do assign the color names now.

	dxf: CMC.color optional
	esp. to skip DIMSTYLE.DIMTFILL 428 0 and such.
	TODO: with method c2 we should emit truecolor black nevertheless

2020-05-07  Reini Urban  <rurban@cpan.org>

	dxf: const some read-only args
	add const dwg to common_entity_handle_data.spec
	const the dxf ent and _obj args for the common_entity_*data.spec
	output must not change the objects.

	protect those write areas with ifdef's, DECODER {} is not good enough.
	the compiler shouts, rightfully so.

2020-05-07  Reini Urban  <rurban@cpan.org>

	dxf: oops, enforce -y
	we rather ignored it

	dxf.test: fix roundtrip tests
	skip all unstable entities

	dxf.test: improve check_subentity diagnostics
	when the hardowner 330 value changed, display it with the code, not
	just the changed value. otherwise we won't know which field changed.

	spec: add BLOCKVISIBILITYGRIP
	move BLOCKGRIPLOCATIONCOMPONENT to debugging
	I am having a rough idea

	fixup debugging unit-tests

2020-05-07  Reini Urban  <rurban@cpan.org>

	spec: add BLOCKVISIBILITYPARAMETER and friends
	BLOCKVISIBILITYPARAMETER as debugging,

	BLOCKGRIPLOCATIONCOMPONENT, VISIBILITYGRIPENTITY, VISIBILITYPARAMETERENTITY
	unhandled.

2020-05-07  Reini Urban  <rurban@cpan.org>

	spec: improve DIMENSION_ANG2LN
	fix the spec
	rename pt fields (not in the old dwg_api)

	spec: more DATALINK fields

	examples: update unstable.pm status

	ARC_DIMENSION: promote to unstable
	fields do look good now

	spec: add ARC_DIMENSION
	still debugging

	encode: improve add_LibreDWG_APPID error handling

	spec: DBCOLOR
	is just a normal CMC color

	spec: BLKREFOBJECTCONTEXTDATA

	spec: more permissive CMC colors

2020-05-07  Reini Urban  <rurban@cpan.org>

	spec: rewrite CMC colors
	the first byte of the rgb is some method/flag.
	0xc0 for ByLayer
	0xc2 for entities, with names with an additional name flag RC,
	0xc3 for truecolor, 0xc5 for foreground color, ...

	fix DWG and DXF methods.
	the 2nd dxf2 is not needed, it is always the same offset from 420.

2020-05-05  Reini Urban  <rurban@cpan.org>

	injson: fix wrong overflow at very last json_binary
	padding in AcDs

	spec: add CELLSTYLE dxf hints
	and fix some logic. some structs are optional.

	dynapi: fix set CMC <r2004
	when writing a CMC color <r2004 we are only writing the color.index, which is a BS.
	not the whole struct.

	injson: support embedded structs (TABLESTYLE.data_rowstyle)

	injson: minor embedded struct optim
	dont call strchr twice

	alive.test: shorter log names
	strip the dwg2 and dwg prefix

	alive.test: add --as=rNNNN tests
	for the new experimental write2004 feature.
	still disabled.

2020-05-05  Reini Urban  <rurban@cpan.org>

	injson: improve overflow error handling
	dont return, provide label targets

	so we can fix dwg->num_objects, to strip later objects, but keep the good ones.
	excess objects lead to invalid Handleoffset 0, sorted to the front,
	leading to early dwgread errors.

2020-05-05  Reini Urban  <rurban@cpan.org>

	decode r2010+: avoid bogus bit_advance_position warnings
	when we have no strings, and set the size to 0

	first advance and then restrict

2020-05-05  Reini Urban  <rurban@cpan.org>

	spec: change COMMON_TABLE xref layout
	for r2007+. cross-tested with examples which do import xrefs.
	a major change.

	UCS: add orthopts
	undocumented, but in DXF and DWG

	api,spec: rename xref COMMON_TABLE_FLAGS, null_handle => xref
	rename SymbolTableRecord with xref
	  xrefref => is_xref_ref
	  xrefindex_plus1 => is_xref_resolved
	  xrefdep => is_xref_dep
	  extref and null_handle => xref

	spec: remove LAYER_TABLE_FLAGS special-case
	which is only relevant pre-r13 also

	spec: cosmetics

	api: rename OBJECT.xdic_missing_flag to is_xdic_missing

	get_bmp: there is a 3rd PNG type
	TODO: dwgbmp: add a flag to extract WMF and PNG

2020-05-05  Reini Urban  <rurban@cpan.org>

	API: rename most fields in STYLE, add 2 new
	rename fixed_height to text_size.
	*font_name to font_file. (it includes the extension)
	shape_file to is_shape (SHX)
	vertical to is_vertical

	add 2 BL fields; ttf_flags, typeface

2020-05-05  Reini Urban  <rurban@cpan.org>

	promote MATERIAL back to unstable
	importers are missing

	fixup layer_index.c unit-test

	fixup ATEXT.color_index => color

	dxf: skip if 0: BL0, BD0

	injson: ignore MATERIAL.num_transmatrix error
	it does not exist

2020-05-02  Reini Urban  <rurban@cpan.org>

	MATERIAL: use structs
	for color, mapper and textures.
	This works now fine for all <r2007 materials.
	TODO: gen-dynapi and importers

	more MATERAL work

	spec: improve MATERIAL
	with some fieldname changes

	improve VISUALSTYLE
	refactor the versions, it became too complicated. esp. with DXF mixed around.
	fixed the pre2010 instabilities.

	VISUALSTYLE: error on wrong edge_crease_angle
	before we skipped that without DEBUG_CLASSES, but
	now we are confident to have it fixed soon.
	The wrong edge_color.name leaked

	injson: fix wrong invalid R2004_Header.file_ID_string error

	spec: start work on ASSOCACTION
	dependent on class_version 1 or 2 (r2013+)

	spec: fixup LAYER_INDEX
	remove the fantasy timestamp fields

	fixup SUN

	api: finish text_string rename

2020-05-02  Reini Urban  <rurban@cpan.org>

	add RTEXT
	also expresstools ent, DEBUGGING so far,
	but looks ok

	also change TOLERANCE.text_string and TABLE_Cell.text_string to text_value.

2020-05-01  Reini Urban  <rurban@cpan.org>

	finish ATEXT, promote to debugging
	the fields do look ok

	spec: start with ATEXT WIP

	spec: improve GEODATA, LIGHT
	clean up GEODATA a bit.
	enable PhotoMetric LIGHT (web IES specs)
	abstract OBJECTCONTEXTDATA and ANNOTSCALEOBJECTCONTEXTDATA subclasses.

	spec: fixup PLOTSETTINGS
	some type changes. esp. 2 handles are text.
	rename PLOTSETTINGS.plot_layout to flags (i.e. a bitmask)

	add RENDERENTRY and unhandled BACKGROUND
	I know the various BACKGROUND types, but not yet
	how to select them

	fix CURVEPATH, add POINTPATH

	promote the 3 *RENDERSETTINGS to unstable
	found most field names, fix the remaining type withs.

	SUN: now unstable
	add CURVEPATH object
	minor VISYALSTYLE type improvements

2020-05-01  Reini Urban  <rurban@cpan.org>

	api: rename dwg_find_dicthandle
	it really does something else. rename to dwg_find_dicthandle_objname
	improve dwg_variable_dict to use the new dwg_find_dicthandle,
	finding a dicthandle by name.

	add unused wcs2cmp to compare two wcs2 strings.
	cache the value of LIGHTINGUNITS for the LIGHTS.is_photometric check

2020-05-01  Reini Urban  <rurban@cpan.org>

	spec: fixup LIGHT, LIGHTLIST, 3DSOLID, add 3 more
	add MOTIONPATH, RENDERSETTINGS and TVDEVICEPROPERTIES halfway debugging.
	rename has_ds_binary_data to has_ds_data.
	simplify LAYER_INDEX, add handle to struct.

	add str_dat to CMC color, WIP

2020-04-27  Reini Urban  <rurban@cpan.org>

	LIGHTLIST: promote to unstable

	LIGHTLIST: use a struct

	LIGHTSLIST: the text-handle vector
	but it really is a DICTIONARY

	add NURBSURFACE entity DEBUGGING only
	no coverage

2020-04-25  Reini Urban  <rurban@cpan.org>

	write2004: more compression work
	fix write_long_compression_offset

	write2004: move R2004_Header to last
	we need to set some values, and it is encrypted.

	write2004: set System Map section[].address

2020-04-25  Reini Urban  <rurban@cpan.org>

	write2004: needed to add section_info_rebuild
	when we invalidate all info->sections pointers by realloc

	Delete duplicate "empty R2004 slack" and unneeded
	Unknown Section 128-256: it is the encrypted R2004_Header section.

2020-04-25  Reini Urban  <rurban@cpan.org>

	write2004: rename back to SECTION_UNKNOWN
	fix SECTION_INFO SECTION_SYSTEM_MAP order, we missed SECTION_INFO.
	Init both. Reformat
	fixup the r2044_header info_id and map_id indices. we already added
	those to the sections.

	UNKNOWN[0] is compressed, not encrypted.

2020-04-24  Reini Urban  <rurban@cpan.org>

	write2004: write info and system_map sections before.
	Also into temp sec_dat buffers. They are compressed.
	Handle them as all other sections, so move some code around.

	write2004: add more type checks

	write2004: pre-alloc sections and info
	info->num_sections is easily calculated.
	so there is no need for realloc in the loop

	write2004: cleanup the sections a bit
	wrong types, indices.
	init sections before, analog to r2000

2020-04-23  Reini Urban  <rurban@cpan.org>

	bits: much smaller initial dat sizes
	from file or stream we set it in d*_read_file/stream already.
	for encode we mostly have small streams and only one big one.

	write2004: re-sort the sections
	EMPTY is now at 0 (as in the stream).
	type the sections to catch evtl. missing ones.

	writes2004: encrypt the sections
	as we already do with the R2004_Header.

	write2004: sort the section maps
	They have another sort order. Not by type, and not by stream order.

	api: rename FILEHEADER.rl_28_80 to r2004_header_address
	and dump some empty slack bytes for verification

	write2004: the section info map
	WIP

	move section_max_decomp_size to decode
	decode_test complains, as usual

	write2004: start with compress_R2004_section
	a simple LZ77 variant

	write2004: start writing the sections
	in stream_order. WIP

	decode: fix wrong Skip section %s with max decompression size
	with 2007-2010 Preview eg.

	write2004: add more section map helpers
	dwg_section_name (dwg, id)
	_max_decomp_size (which is version specific)
	section_compressed

	write2004: work on compress_R2004_section
	wrote 2 of 3 write helpers, the reverse of the read funcs

	HATCH comments for type_status/edge_type

2020-04-21  Reini Urban  <rurban@cpan.org>

	write2004: disable some wrong asserts
	r2004 starts writing with fresh streams.

	write2004: add bit_chain_set_version
	initialize the section streams. did have dat->version R_INVALID

	write2004: write Section Page Map at last
	WIP

	write2004: init the sections

	bits: add missing bit_write_TU?{16,32} funcs
	for the additional sections

	encode the r2004 sections WIP

	dwgrewrite: keep reading partially written files
	when using --as=r2004 and failing with SECTIONNOTFOUND in encode,
	i.e. halfway written files in the write2004 work

	rw: support --as=r2004
	as the others. here we actually need it.

	write2004: add uncompressed compress_R2004_section (unused)
	we'll leave compression to later

2020-04-21  Reini Urban  <rurban@cpan.org>

	r2004_header: revert field_ID_string back to string
	part of 9169fae084413a28b535b0477c0e7e4aabf18e8f
	strings are easier to check than hex.

	encode the system sections map (no info yet)

2020-04-21  Reini Urban  <rurban@cpan.org>

	dwg_bmp: fix overwriting into r2004_header
	setting thumbnail->version wrote into the next struct r2004_header.
	A thumbnail was only a dwg.h Dwg_Chain without those Bit_Chain version
	fields.
	Change dwg_bmp to copy the contents of thumbnail into a proper Bit_Chain,
	without destructive sideffects.

	This really fixes the problems encountered in the previous commit.

2020-04-21  Reini Urban  <rurban@cpan.org>

	r2004_header: change file_ID_string and padding to binary
	avoid \uxxxx encoding issues with fixed size buffers.

	write2004: simplify dwg->r2004_header access

2020-04-20  Reini Urban  <rurban@cpan.org>

	ename R2004_Header.num_ fields
	injson skips num_, so rename them to num

	extract Dwg_R2004_Header for pack(1)

	clang -Wdouble-promotion

	dwg.in: enable --as=r2004
	to test encode as r2004. analog to dxf

	check r2004_file_header encryption error
	against known AcFssFcA file_ID_string

2020-04-20  Reini Urban  <rurban@cpan.org>

	share and simplify decrypt_R2004_header
	its symetric, so can be reused for encode also.

	add a pack(1) to the struct Dwg_R2004_Header, analog to eed.
	it is easier to caclculate the crc32 this way. No need to write
	the R2004 File Header temporarily.

2020-04-20  Reini Urban  <rurban@cpan.org>

	encode: fix r2004 File Header crc32
	calculation. wrong algo, wrong size.
	also log the encrypted header, to check the encyption encoder.
	looks right, as it's only xor with some one-time pad.

	write2004: encrypt r2004_file_header

	dwg_section_page_checksum implemented
	calculated section_checksum seed/offset/size
	by brute-force.

	WIP dwg_section_page_checksum

	add r2004_file_header.crc32 check (TODO)

	move dwg_section_page_checksum to decode
	testcases/decode_test failed with clang

	section: add dwg_section_page_checksum check
	for the first r2004_header.checksum, according to ODA p.27
	Section page checksum of the System section page.
	TODO

	windows: move exported functions from common to dwg
	public functions need to be public, not private, esp. for windows.
	the problem is mostly decode_test, including common.lo for some private
	functions, clashing with these ones.

2020-04-19  Reini Urban  <rurban@cpan.org>

	api: remove unused header.is_tu
	we encode everything to TU on version >= r2007+ now

	doc: 2007 EED string
	has no codepage.

	more programs documentation

	export dwg_version_type
	useful for all sort of helpers

	dwg.c: resolve refs in iterators
	not always do we have ref->obj, eg. on in_dxf or in_json

	out_dxf: handle class T types

	dxf.in:  handle non-dwg extensions
	thats why we have dxfwrite

	in_dxf: handle class T types

	encode: handle class T types
	dxfname is always there though

	injson: more wstring cases
	classes, eed (WIP).

	fixup version handling
	See GH #230.
	So far we only targetted DWG r2000, but we also need to write DXF,
	and there we can create all versions.
	So remove various hardcoded version = R_2000 assignments,
	and handle the from_version/version when reading it from the FILEHEADER
	(dwg, dxf, json).
	json has json_wstring, but use it consistently: classes, xdata, eed.

	dwg_block_control: create dwg->block_control copy
	if not existing. E.g. when importing from JSON
	and exporting to DXF.

	dxfwrite: simplify

	injson: less unneeded overflow checks
	esp. it errored on the very last FIELD_RL zero_8

2020-04-19  Reini Urban  <rurban@cpan.org>

	add programs dxfwrite
	create DXF from DWG, JSON or other DXF (or binary).
	Highly experimental.

	I wanted to create debugging SECTIONOBJECT's and such
	by myself easier, via JSON and then to DXF. Needs some work still.

2020-04-19  Reini Urban  <rurban@cpan.org>

	dxf.in: enhance to more input formats
	not just dwg. also json, dxf, dxfb.
	analog to the dwg helper.

	on intermediate dwg format we need to pass --as=rxxxx

2020-04-17  Reini Urban  <rurban@cpan.org>

	encode: enhance more OVERFLOW_CHECKs
	on array <-> size mismatches

	MESH: 3DPOINT* is handled by in_json
	3BD* not.
	the vertex numfield was num_owned, special-case that.
	Fix encode OVERFLOW_NULL_CHECK_LV for empty array
	only error when the num_field was not empty. Emoty 3DPOINT
	arrays are allowed.

	promote MESH to stable
	enabling it as DXF entity
	all dxf_test's pass

	MESH: promote to unstable
	works for all my examples, and simple enough.

	decode: fix FIELD_3DPOINT_VECTOR for 0 points
	0 point vectors are valid

	spec: fix some COMMON_3DSOLID parent warnings
	cast to the base parent type.
	for now only with -DDEBUG_CLASSES with the *SURFACE subtypes

	MESH: fix some types

	test-dxf.sh: adjust for one-level outoftree builddir

	tail -n2 log in helpers
	harmonize dwgread with dwgwrite to display the error status lines
	at the very end, not before free. Let the helpers display it.

2020-04-16  Reini Urban  <rurban@cpan.org>

	injson: reject old json format for DICTIONARY
	it is too much of a hassle to synch both arrays.
	most fuzzing errors and crashes are only because of this.

	json: simplify DICTIONARY.items map
	See GH #228

	indxf: fixup DIMSTYLE.flag and
	similar for LWPOLYLINE and VPORT_ENTITY_HEADER.
	The other LWPOLYLINE.flag settings are done in new_LWPOLYLINE.

	json,dxf: enhance timeout to 30s
	testing larger drawings

	rename PLOTSETTINGS.shade_plot_id to shadeplot
	DEBUGGING only

2020-04-16  Reini Urban  <rurban@cpan.org>

	add missing VIEWPORT handles
	detected by cmp-objs.pl

	add more in_dxf handle codes to write if different to a soft
	pointer 5.

2020-04-15  Reini Urban  <rurban@cpan.org>

	encode: don't recalc bitsize for UNKNOWN bits
	even for INJSON. We rather dump the unknown_bits asis.

	MLEADRSTYLE: preserve is_new_format for indxf and json
	fixes MLEADERSTYLE dxf errors.

	formatting

	unit-testing: skip next_entity traversal
	got broken somehow, looping

	stabilize VPORT_ENTITY_HEADER
	2000/plan.dwg e.g. had an viewports overflow.
	check for it beforehand.

	bits: improve wcs2* for ubsan and HAVE_ALIGNED_ACCESS_REQUIRED
	even if such processors don't exist anymore. ubsan is too picky.

	bits: improve wcs2* for NATIVE_WCHAR2 (Windows)
	where we can use the native libc.

2020-04-15  Reini Urban  <rurban@cpan.org>

	spec: change VPORT_ENTITY_HEADER.viewport to H* viewports
	we have a null-delimited list (delim by 5.0.0).

	This is still not binary eq as the original. The original stores
	5.0.0 asis, we store it now as NULL HDL. But Teigha does the same.

2020-04-15  Reini Urban  <rurban@cpan.org>

	spec: rename VPORT_ENTITY_HEADER.vport_entity to .viewport
	it links to a VIEWPORT entity afterall

	spec: add extref to VPORT_ENTITY_HEADER

	fix dxf and dxfb 3dsolid also
	analog to encode and json in 9f45b00f08f03eae4844ac2847bff279c5ef05c4

	fix encode and injson 3dsolid
	we forgot to write the last block_size[1] of 0.
	Abstract COMMON_3DSOLID, which was missing for all actions but decode and free.

	json: rename 3DSOLID.num_isolines to isolines
	it is not a REPEAT counter, it needs to be preserved in json.
	it looks like it is calculated from the acis_data. TODO DXF

2020-04-14  Reini Urban  <rurban@cpan.org>

	spec: found subclass for VPORT_ENTITY, VX it is
	relevant only for out_dxf

2020-04-14  Reini Urban  <rurban@cpan.org>

	fix bit_read_RC and bit_advance_position overflow checks
	when reading the very last byte of a stream, as e.g. in LTYPE.extref
	it incorrectly and silently returned 0, where it should be allowed
	to set the new position at the very end. Just subsequent reads should fail.

	Fixes the LTYPE import error from #225, detected with the new
	cmp-objs.pl
	No fuzzer regressions.

2020-04-14  Reini Urban  <rurban@cpan.org>

	json: fix xdicobjhandle, reactors for CONTROL objects

	add cmp-objs.pl: compare binaries via xxd
	check all binary differences of all objects,
	from the original logfile to the created logfile.
	e.g. after dxf-check or json-check

2020-04-13  Reini Urban  <rurban@cpan.org>

	dxf: fix 1002 and 1000 EED codes
	1002 is either { or }
	1000 needs to check if TU

2020-04-13  Reini Urban  <rurban@cpan.org>

	dxf: fix LTYPE.dashes.text 9 types
	pointing into the strings_area for the text to be repeated.

	Also avoid NULL text fields to be printed as "(null)".

2020-04-13  Reini Urban  <rurban@cpan.org>

	dxf: fix LTYPE order for 40 and dashes

	api: rename dwg_add_OBJECT to dwg_setup_OBJECT
	and setup its type if static. The variable type from the class
	is currently setup seperately. See dwg_encode_get_class

2020-04-13  Reini Urban  <rurban@cpan.org>

	encode: fix UNKNOWN_OBJ hdlpos
	certain versions (json 2000, dwg 2000) do write the UNKNOWN_OBJ
	asis. ensure that we don't write the comon handles twice.
	See DWG_OBJECT_END

	Also ensure that UNKNOWN_ENT doesn't overwrite a good bitsize.

2020-04-13  Reini Urban  <rurban@cpan.org>

	dwg: only one env ASAN_OPTIONS=detect_leaks=0
	if you convert many DXFs

	more encode_unknown_as_dummy fixups
	set_handle_size of the generated APPID
	fix free problems by improving the dwg_add_OBJECT API
	accounting for imported objects (INJSON, INDXF)

2020-04-12  Reini Urban  <rurban@cpan.org>

	encode: refactor ENCODE_UNKNOWN_AS_DUMMY, do it upfront
	because we need to change APPID_CONTROL, which was already
	written by then.
	We also fixup the NOD earlier, before we have written anything.

	encode: use PLACEHOLDER if exists for UNKNOWN_OBJ
	and prepare APPID.LibreDWG (not yet enabled)

	DIMSTYLE: rename extref_handle to extref
	for consistency

2020-04-12  Reini Urban  <rurban@cpan.org>

	encode LTYPE: fix ownerhandle, xdicobjhandle. obj_flush_hdlstream
	1st problem was in the Flush handle stream logic.
	We need to save first the COMMON handles, like ownerhandle, ...
	and then afterwards the accumulated hdl_dat special handles.

	2nd problems was that we didn't reset the hdl stream to write into dat.

	Fixes the LTYPE part of GH #225

	Also fix the bitsize calc logging to be relative to obj.

2020-04-12  Reini Urban  <rurban@cpan.org>

	LTYPE: rename and move extref_handle
	with dashes.style extref needs to be before.
	There are still some unhandled non-bull bytes at the end

2020-04-11  Reini Urban  <rurban@cpan.org>

	encode: rather remove_NOD_item
	ACAD even complains with a NOD item linking to a DICT,
	which has no link to a disabled object.
	ACAD removes this item, so do we.

	encode: add fixup_NOD
	to disable links to not-existing (unstable) objects/styles

	api: rename PERSSUBENTMANAGER to PERSUBENTMGR
	this is the name used in the NOD (named object dictionary)

	indxf: fix more ownerhandle abs vs rel issues
	less exceptions: All entities are relative.

	indxf: fix BLOCK_HEADER.first_entity eWrongObjectType
	Fixes this from GH #225
	  Reading handle 1F object type AcDbBlockTableRecord
	      Error 34 (eWrongObjectType)                       Object discarded

	indxf: fix DIMSTYLE.morehandles type
	Fixes this
	  Reading handle A object type AcDbDimStyleTable
	      Error 34 (eWrongObjectType)                       Object discarded
	  Missing AcDbDimStyleTable
	from GH #225

2020-04-10  Reini Urban  <rurban@cpan.org>

	add_DUMMY_eed: add unknown_bits
	as chunks of code 4, which has a maxlen of 255

2020-04-10  Reini Urban  <rurban@cpan.org>

	encode: add_DUMMY_eed
	when importing from a different version,
	save the old name in the DUMMY/POINT eed as code 0.

	Maybe save under a new LibreDWG APPID, and save the unknown_bits
	also.

2020-04-10  Reini Urban  <rurban@cpan.org>

	bits_test: align the strings at bit 0
	so we can check and print it directly

2020-04-10  Reini Urban  <rurban@cpan.org>

	encode: xdata twice on size mismatch
	Closes GH #224. Teigha throws no XRecord errors anymore.

	We could also try to just patch the xdata_size BL, but this is easiest
	and does not much harm.
	There are no other side-effects than encode was re-using the space
	for converted texts. don't do that anymore.

2020-04-10  Reini Urban  <rurban@cpan.org>

	encode: calculate xdata_size on imports
	On imports we cannot trust the xdata_size,
	or we dont even have it. Remaining problem is that we already wrote
	the xdata_size BL before.
	See GH #224.

	log: use a bashism to support log file overrides
	e.g. ./log -lexample_2000.log.orig example_2000

	dxf: change CMC with 90-99 dxf codes
	then emit/parse only the rgb part, not the index (which is 0 or 256)
	see e.g. MULTILEADER colors.

	unknown: fix field names regression
	@avail was exhausted via find_name().
	re-fill it for every object, to find again names for
	all subsequent objects.
	which is needed for dxf_test and picat

2020-04-09  Reini Urban  <rurban@cpan.org>

	indxf: overflow checks also in json_fixed_key
	fuzzing 24: id 22

	stable LIGHT, remove OBJECTCONTEXTDATA
	OBJECTCONTEXTDATA is only a subclass.
	LIGHT loooks good now, and there are a couple of examples.
	It's also an entity, and we don't want them to converted to a POINT.

	dxf_test: fix degrees (deg2rad)
	e.g. LIGHT

	stabilize LIGHT
	fixed now all examples.
	all unit-tests pass, just not DXF color.index. but this is
	broken for all CMC.

	bindings: update dwg.i (manually)

	rename DOCUMENTOPTIONS back to CSACDOCUMENTOPTIONS
	but still debugging

	delete all ACDSSCOPE comments
	it was ACMESCOPE afterall

	promote SECTION_MANAGER to unstable
	and sort the api decls

	add SECTION_MANAGER and SECTION_SETTINGS objects

	change SECTIONOBJECT to unstable
	looks good

	api: rename SECTION to SECTIONOBJECT
	and document some fields

2020-04-08  Reini Urban  <rurban@cpan.org>

	add unhandled ACSH_PYRAMID_CLASS

2020-04-08  Reini Urban  <rurban@cpan.org>

	dwg_free_variable_no_class switch
	make it a function jumptable.
	so we won't stump onto more optimizer bugs with extensive if (type) stmnts:
	MESH, SECTION, NAVISWORKSMODEL not defined as free.

	At least dwg_free_MESH.isra.0 appears now in `nm free.o`

2020-04-08  Reini Urban  <rurban@cpan.org>

	spec: remove duplicate DWG_ENTITY (SECTION)
	but harmless, was in #if 0

	distcheck: clean LibreDWG.info and .pdf
	now that we build it properly

	encode: fix injson obj->size
	and also its CRC. The size starts after the size
	and ends before the CRC.

	dwg_bmp: reset dat->byte
	we advance dwg->thumbnail.byte to the start of the bmp,
	skipping the header.
	But when re-reading or writing it, we need to reset it.
	Fixes esp. dwgrewrite.

	travis: enhance make encode.lo also
	runs into a timeout also.

	add rw helper: dwgrewrite

2020-04-08  Reini Urban  <rurban@cpan.org>

	distcheck: failed to write to info
	don't know how to enable am__skip_mode_fix.
	but info-in-builddir works now. let's see if it breaks bsd make.
	requires automake 1.14 though.

	it might fix GH #211

2020-04-08  Reini Urban  <rurban@cpan.org>

	SECTION: rename geomsetting handle
	and add unit-test vector macros

	extend .gitignore
	I am missing too many new files. lets be stricter
	and sort it better.

	regen-unknown with new testcase LiveSection_2018
	but no new entities yet. will try again later.

	acds: found another freesp segment type
	in the wild

	add NAVISWORKSMODEL, DEBUGGING only
	no coverage, only detected in the DXF documentation.
	undocumented in the ODA.
	In DXF as COORDINATION_MODEL

	add SECTION entity, DEBUGGING only
	no coverage, only detected in the DXF documentation.
	undocumented in the ODA.
	It might be ptr of VIEW.livesection 334

2020-04-07  Reini Urban  <rurban@cpan.org>

	bits: add more overflow checks
	with a macro.
	Fixes fuzzing crashes15, id 121

	indxf: special r14 PROXY_ENTITY dxf groups
	a bit different

	VIEW: wrong center dxf code 20
	it is 10,20

	indxf: skip more unhandled DXF fields
	esp. with 2018, for stable objects

	indxf: LAYER misses color 420 in its fields
	do it manually

	indxf: fatalize ERROR: Unknown DXF for stable objects
	to abort on structurally broken DXF's, as with fuzzing.
	Before we ignored indxf errors.

	AcDs: protect from empty num_segidx
	fuzzers doing their thing

2020-04-06  Reini Urban  <rurban@cpan.org>

	indxf: error on Unknown DXF code on stable objects
	but not fatal so far, just complain loudly.

	SPLINE: let indxf create points
	not fitting the scenario. They are ignored.
	TODO free them, but we are having leaks in indxf all over.

	indxf: protect SPLINE array ptrs
	regressions: indxf-crashes4: id 95, 5: 40, 3: 101

	add precise bit_read_bits
	to protect from rare heap-overflows in decode_unknown, when reading the very
	last byte.  now we read the avail. bits precisely.
	Fixes a fuzzer regression with a new object.

	afl-fuzz: disable LOG at all
	afl-fuzz: avoid costly branch checks by disabling logging centrally

	encode: fix heap overflow on overlage size memmove
	fuzzing crashes24, id 13

	encode: fix some NULL ptr derefs
	fixes fuzzing crashes24: 0-8
	and 2 regressions at crashes18 at the same location.
	also the 23 regression.

	injson: more JSON_TOKENS_CHECK_OVERFLOW_ERR
	fixes fuzzing regressions
	  20: id 182, 328
	  23: id 79
	but not the new cases 24.

	json: fix shellcheck violation

	protect from redefining FORMAT_BD by in_dxf.h
	affected was only dwg.c, in_dxf_.c, dwgwrite.c

	appveyor: copy libssp-0.dll to zip
	See GH #220, #218, #103, #166

	json.test: shellcheck wants some {} grouping, na

	dxf_test: add --big
	only test slow test-big/ DWGs with --big
	not via make check, needs too much time.

	sortentstable: ents[i] may be NULL

2020-04-06  Reini Urban  <rurban@cpan.org>

	move fixup_BLOCK_HEADER to decode.c
	in in_dxf.c it was skipped for --disable-write
	but used in several read-only programs (e.g. dwgread).

	rename from-postprocess_entity_linkedlist to dwg_fixup_BLOCKS_entities.
	thanks to .travis.yml first task, finding linker errors with --disable-write

	also fix -Wmaybe-uninitialized warnings for rcount3.

2020-04-05  Reini Urban  <rurban@cpan.org>

	encode: enable ENCODE_UNKNOWN_AS_DUMMY
	to check both features, old and new

	PROXY: fix data_numbits for r14 and encode from DXF
	r14 has no restricted dat stream yet,
	DXF has no numbits field, so align it. Which is ok,
	because we control the stream start, and set bitsize accordingly.

	injson: fix json_advance_unknown
	once again. looks good now though

	injson: add json_vector helper, array of primitives

	encode: disabling POINT/DUMMY does not help neither

	work on PROXY OBJECT/ENTITY
	also fix bit_read_H is_global, and stabilize it on overflows.
	detected with the new PROXY loop in unit tests with certain DWGs

	encode: convert UNKNOWN_ENT to POINT
	To preserve the next_entity chain
	on unhandled entities, like LIGHT, HELIX, MULTILEADER, TABLE,
	SURFACE, ARC_DIMENSION, GEOPOSITIONMAKRKER, MESH.

2020-04-05  Reini Urban  <rurban@cpan.org>

	encode: convert UNKNOWN_* to DUMMY
	when the version differs. Then we cannot use the unknown_bits.
	maybe we should add an EED with the previous data then (type, bits)

	The biggest problem with this breaking the next_entity chain
	on unhandled entities, like LIGHT, HELIX, MULTILEADER, TABLE,
	SURFACE, ARC_DIMENSION, GEOPOSITIONMAKRKER, MESH, RTEXT.
	Maybe convert there to a POINT or PROXY_ENTITY instead.

2020-04-05  Reini Urban  <rurban@cpan.org>

	3DSOLID: add missing COMMON_ENTITY_HANDLE_DATA
	which mostly was missing xdicobjhandle on encode

	injson: fix json_advance_unknown
	an object has an additional key upfront

	dxf: postpone linewt 370 to after ltype 6
	which is in a different file, common_entity_handle_data.spec

	dxf: skip duplicate color 62
	first for the index (if 0 ByBlock)
	second for the RGB flag, which is wrong

	dxf: entmode 67 1 when in paperspace

	dxf: skip duplicate TABLE ownerhandle 330
	appeared twice for LAYER.
	Already done in DWG_OBJECT.
	Ditto for _XDICOBJHANDLE, but this was a wrong comment only.

2020-04-05  Reini Urban  <rurban@cpan.org>

	indxf: add_to_BLOCK_HEADER
	instead of postprocess_BLOCK_HEADER, we do it for every new entity
	adding it to entities, and setting the 4 handles.
	Now only out_dxf is wrong

	Closes GH #222

2020-04-05  Reini Urban  <rurban@cpan.org>

	postprocess_entity_linkedlist: log unicode BLOCK_HEADER names

	injson, indxf: always set the hashmap
	on the initial code 0 handles. This helps with subsequent handle searches

	dwg: default to .json and .dxf, not .dwg

	dwg,dxf: default to -y
	it is annoying, and we always overwrite while testing

	refactor Handle, add is_global flag
	greatly simplifies free, avoids leaks and double-frees

	add postprocess_entity_linkedlist GH #221
	targetting r2000, our only write format, we need to convert all entity
	arrays (like BLOCK_HEADER) to a linked list of entities, via prev and
	next_entity.

2020-04-05  Reini Urban  <rurban@cpan.org>

	decode: loosen invalid handlemap offset fixup
	With a lot of deleted objects the "Invalid handleoff" warning might be bogus,
	max_handle (hash size) might be too small yet.
	Plus the offset fixup relied on a wrong calculation of the previous size.
	The CRC is included in the size.

	While we are here, just warn and dont fixup the offset, in my case from a
	good value to a broken one.
	Fixes example_2007-2010 json roundtrip

2020-04-05  Reini Urban  <rurban@cpan.org>

	encode: fix FIELD_VECTOR_T
	on unicode conversion boundaries. Use bit_write_T
	for down and up conversion.
	e.g. DICTIONARY.texts[]

	encode: convert xdata TU/TV
	so far we only converted FIELD_T types, xdata had a length (like TF)
	but really are strings

	dwg: skip msan leaks with dwg (to dwg)
	GH #151

	dxf/json.test: harden the roundtrip checks
	with json also check the number of objects (Unstable ignored in dxf).
	improve the helpers and diagnostics

2020-04-05  Reini Urban  <rurban@cpan.org>

	dxf: fix SPLINE.flag from scenario
	write proper DXF 70 flag.
	indxf scenario from this flag (mask 32).

	improve DSYMUTIL on non-macOS

2020-04-05  Reini Urban  <rurban@cpan.org>

	dxf: fix SPLINE flags
	1024 does not describe the scenario, only if
	there are fit_pts does.

2020-04-05  Reini Urban  <rurban@cpan.org>

	encode: loose write_DD eq-check
	check for fabs < 1e-12, so that some
	strtold dxf values are suddenly as equal as native.

	Fixes the example_2000/2004 LWPOLYLINE size overflow problem,
	which needed to memmove the whole object by 2 to make room
	for a 2nd MS RS.

2020-04-05  Reini Urban  <rurban@cpan.org>

	dwggrep: add --tables, search objects, refactor
	previously we only search BLOCK_HEADER and its entities.
	now also search all objects.
	Support --tables (only table names)
	Support --blocks (all block deifnitions)
	Add many missing objects

	dwg2SVG: support -m --mspace
	default to paperspace and count the printed entities there.
	if none are printed, fall back to modelspace.
	With -m ignore paperspace.

	dxf: use get_next_owned_block_entity for ENTITIES
	to keep the same linked-list order for <=r2000

	api: add dwg_next_entity
	on r2000 follow the next_entity handle linked list.
	This may jump around in some cases.

2020-04-05  Reini Urban  <rurban@cpan.org>

	dxf: more r2000 BLOCKS fixes WIP
	revert most of c18a040e960e301c2afd3c0c1a3cc05f934c6814
	the r2000 logic was wrong, last_entity may be far behind the endblk_entity.
	rather follow the next_entity chain until the last_entity.

	change get_next_owned_block_entity from inserts to entites (r2004+). oops.

	missing:
	one LWPOLYLINE MS size overflow
	one wrong SPLINE scenario.

2020-04-05  Reini Urban  <rurban@cpan.org>

	dxf.test: make roundtrip failures fatal
	fix the dxf.test roundtrip test: Unstable entities are skipped on out_dxf,
	we cannot count them. (LIGHT|MULTILEADER|UNKNOWN_ENT)

	the last remaining errors are:
	* wrong DIMENSION types, the previous change did more damage than good.
	* one LWPOLYLINE MS size overflow,
	* one wrong SPLINE scenario.

	See GH #219

2020-04-05  Reini Urban  <rurban@cpan.org>

	encode: fix overlarge size memmove before bit_write_MS
	an overlarge obj->size writes two RS instead of one.
	so move by 2, and enlarge the 2 sizes by two bytes.
	Same for the other direction, if an overlarge entity becomes smaller.

	See entity LWPOLYLINE 75A with 3695 points in example_2000

2020-04-03  Reini Urban  <rurban@cpan.org>

	AcDs: json fixes

2020-04-02  Reini Urban  <rurban@cpan.org>

	add/fix AcDs_SchemaData

	AcDs: more DXF prep

	AcDsProtype => AcDS as in DXF
	we need to keep those names for long, so go with the
	proper names. DXF already uses ACDS* not prototype.
	It is also shorter

	AcDsProtoype: harmonize the names a bit
	but not more. It will be eventually be AcDs aka datastorage,
	and the protype will be gone. let's what happens in r2021.

	extend AcDsProtoype.segments
	with all the subclass decls. but not parsed yet

2020-04-02  Reini Urban  <rurban@cpan.org>

	start with optional r2004+ AcDsProtoype_1b datastorage section
	which does contain the ACIS SAB v2 data.
	See ODA p.252, 24 Section AcDb:AcDsPrototype_1b (DataStorage)

	The Signature section is unfortunately not documented

2020-04-02  Reini Urban  <rurban@cpan.org>

	improve common_entity_data.spec ENC + proxy
	add Dwg_Color.raw to seperate to computed index and flag (used only internally).
	Seperate between preview graphics 160 or proxydata 92.
	Add computed entity.preview_is_proxy to reflect that.
	Add obj->klass for each variable obj (to check for klass->is_zombie for now)

	We dont want to seperate ENC into its own type, as done in the savekov patch,
	because this does not scale. We do have spec files to support all our actions at once
	in one place.

2020-04-02  Reini Urban  <rurban@cpan.org>

	gen-dynapi: abstract embedded_struct
	also support embedded structs for ldata, tdata and fdata

	dxf: fix FIELDLIST subclass and num_fields 90

	formatting only

	gen-dynapi: improve MULTILEADER and more embedded structs
	find more DXF codes for these. Detect the . in fields. . is no \w

	dxf-check: harmonize .dxf.err path
	to check for teigha errors.
	defer cat to last.

	cleanup resolve_postponed_object_refs
	diagnostics only, and remove dead (duplicate) code.

	travis: improve asan timeouts

	dxf: fixup ATTRIB, ATTDEF order
	cross tested against ACAD

	dxf: log table names on out_dxf

2020-04-02  Reini Urban  <rurban@cpan.org>

	dxf: more r2000 BLOCKS fixes WIP
	With r2000 some BLOCK_HEADER.first_entity and last_entity are
	unreliable, at least for the very last BLOCK.
	The first can be before, e.g. right the next after BLOCK_HEADER, and
	the real last can be far behind the last_entity. Rather check the
	ownerhandle of all entities.

	Change get_first_owned_entity and get_next_owned_block_entity to
	compare the ownerhandles with r13-r2000.

	See GH #219

2020-04-02  Reini Urban  <rurban@cpan.org>

	dxf: fix r2000 BLOCKS
	emit until last_entity, and dont skip ATTDEF and such.
	Fixes lost entities on dxf roundtrips

	add is_type_unstable_all, is_type_stable

	add --enable-release to distcheck
	and therefore the uploaded nightly tarball.
	fix an uninit error in unit-testing/dimension_linear

	travis: extend travis_wait for ASAN build
	complation of in_json.o needs longer than 10m

	distcheck: one more distcheck-hook attempt
	GH #211 still not fixed

	dxf.test: print missing rountrip entities
	quite a surprise

	no helper script timeouts with --enable-debug

	TODO/SKIP some failing --enable-debug tests
	dwgwrite -Ojson crashes with DEBUG_CLASSES still.
	failing at TABLECONTENT and CELLSTYLEMAP subclasses, in in_json.
	crashing with r2010+ at encode.

	add MENTALRAYRENDERSETTINGS to debugging
	I recently added unknown support for some test-big files,
	and therefore added coverage for MENTALRAYRENDERSETTINGS
	(2004/double_free_example).

	document DIMENSION.flag 70

	indxf: revert DIMENSION type earlier
	It is wrong, just print the potention flag type

2020-03-30  Reini Urban  <rurban@cpan.org>

	indxf: fix DIMENSION type earlier
	via the flag 70, not the subclass, which might be too late.
	plus it is only optional.

	no dxf code for DIMENSION.ins_scale, fixes lspace_factor

	The subclass checker looks now obsolete (possible dead code),
	but for now leave it in. maybe check later with asserts.
	the testdata only shows flag 128, which is suspicious.

2020-03-30  Reini Urban  <rurban@cpan.org>

	DIMASSOC: document and unit test updates

2020-03-30  Reini Urban  <rurban@cpan.org>

	improve regen-unknown
	log not found $obj $hdl in $dxf when already past it (sorted by hex value)
	and skip the dxf. ~2x faster.

	and we missed out all directly subsequent objects. this fixes that.

2020-03-29  Reini Urban  <rurban@cpan.org>

	gcc-9.3.1 tested ok on fc31 x86_64
	sudo dnf --enablerepo=updates-testing update gcc
	so adjust the compile-time warning.

	Not ok over at cperl XSConfig still, so let's be sceptical and alert.

2020-03-29  Reini Urban  <rurban@cpan.org>

	unknown: sort alldwg.inc by handle
	otherwise we cannot find previous handles in log_unknown_dxf.pl
	which skipped many interesting objects.

	bd-unknown.inc: skip uniq checks for the comments (GNU only?)
	  only sort by some initial characters (with fixed width).
	skip imprecise (cut) results. rather check only precise found doubles,
	but check for RD and BD.

2020-03-29  Reini Urban  <rurban@cpan.org>

	make regen-unkown with added 2000/plan.dxf
	for the previous DIMASSOC change

2020-03-28  Reini Urban  <rurban@cpan.org>

	DIMASSOC: handle main_subent_type: 0
	found some examples with main_subent_type 0
	which does not have some subsequent fields.
	fixes 2000/plan and 2004/double_free_example

	encode: refactor and fix HANDLE_STREAM processing
	only flush when necessary, reset hdl_dat to ref of dat.
	copy only needed for the small buffer for DIMASSOC, ACAD_TABLE handles before.
	refactor and unify LOG_POS logging

	injson: read 3DSOLID fields

	json: split acis_data at newlines, as ARRAY

	json: write 3DSOLID fields
	TODO: split acis_data at newlines, as ARRAY.

	encode: fix obj->size, off by 2
	we haven't written the CRC yet

	DEBUG_HERE_OBJ: avoid overflow
	at the end of the stream, with -v5

	encode: seperate hdl_dat stream earlier
	as in decode, almost:
	write the common handles later on START_OBJECT_HANDLE_STREAM
	or when that is missing at DWG_OBJECT_END.
	no special cases for CONTROL objs needed here

2020-03-27  Reini Urban  <rurban@cpan.org>

	encode: allow writing bigger dat chunks
	allocate in a while loop, with abort()

	injson: skip useless DICTIONARY warnings
	Warning: Skip some itemhandles, only accept 21 of 21

	indxf: add TABLEGEOMETRY support
	indxf is still a big bull of mud. dxf_test would be
	the proper way, like the generic in_json.
	But as we still don't have that many subclass loops to support,
	we can still tolerate it.

	promote TABLEGEOMETRY to stable
	found complicated coverage files, all ok.
	TODO in_dxf

	json: fix FileDepList end of object indices
	it's a mischmasch, but now it works with multiple array entries.
	at the end of each array loop advance the end-of-object index,
	at the end of each object advance it,
	at the end of each section back off.

	encode: decide between critical or skipping section errors
	on section address or size overflows only error critically
	on critical sections, not just some AcDb:Template error. set to 0 then

	json: fix structure error fatality
	if in some unimportant section like FileDepList a structure error
	occurs, dont fail critically with INVALIDDWG, just INVALIDTYPE.

	json: fix DIMASSOC hack
	and SORTENTSTABLE in some examples

2020-03-26  Reini Urban  <rurban@cpan.org>

	promote TABLEGEOMETRY to unstable
	doc ok, coverage fair, no errors so far

	unit-testing: improve TABLE

	improve TABLEGEOMETRY
	harmonize with TABLECONTENT.
	The main problem was an ODA bug for geometry.unknown 95

	doc: update classes status

	make regen-unknown
	and split off a full-regen-unknown.
	mostly we can re-use the existing alldwg.inc,
	when we just change some fields in some objects

	add ASSOCGEOMDEPENDENCY fields

	add remaining unknown objects
	all those with dxf coverage:
	ACMECOMMANDHISTORY
	ACMESCOPE
	ACMESTATEMGR
	ACSH_HISTORY_CLASS
	ASSOCGEOMDEPENDENCY
	ASSOCOSNAPPOINTREFACTIONPARAM
	ASSOCVERTEXACTIONPARAM
	DOCUMENTOPTIONS
	RAPIDRTRENDERSETTINGS

2020-03-26  Reini Urban  <rurban@cpan.org>

	improve regen-unknown perf to 1m
	Don't linear search each handle in each dxf from the beginning again.
	In each dxf per obj the handles are sorted, just continue.
	time went down to 1m5s

	also remove a lof of unsorted handles, unneeded.

2020-03-26  Reini Urban  <rurban@cpan.org>

	improve LEADEROBJECTCONTEXTDATA
	more fields

	add 2 more debuging classes
	LAYERFILTER, LAYOUTPRINTCONFIG with poor coverage

	unknown: split up alldxf_1 by dxfname
	for easier editor handling. One big became just too big.
	add more MATERIAL fields to unknown to increase matching accuracy.

2020-03-25  Reini Urban  <rurban@cpan.org>

	add Dockerfile to EXTRA_DIST
	and add minor improvements:

	--enable-trace is default

	--enable-release is needed for production services using
	a git checkout, and not a release tarball.
	It skips invalid nan fields, ...

2020-03-25  yossefazoulay  <azoulayos@protonmail.com>

	Dockerfile for libredwg with python3 base image for build and test

	Dockerfile for libredwg created CodeFactor validate

	Dockerfile for libredwg created

	Dockerfile for libredwg created

2020-03-25  Reini Urban  <rurban@cpan.org>

	json: change NOCOMMA logic to first
	special-case the first entry of an array/hash, as this is what we
	known beforehand.
	the first field prints no ",\n" at the start, all others do.

	This was an out-json.c TODO
	Closes GH #75

2020-03-25  Reini Urban  <rurban@cpan.org>

	WIP fix NOCOMMA hack also for json
	but here we need to use nested ISLAST/SETLAST/CLEARLAST checks.
	refactor VECTOR and REPEAT blocks for json.

	But with this attempt we'd need to mark all last fields, in each
	DWG_OBJECT. Better try the initial idea, as outlined in the comment:
	ISFIRST, ...

2020-03-25  Reini Urban  <rurban@cpan.org>

	fix json NOCOMMA hack for simple geojson
	when writing to stdout or a pipe.
	In this trivial case check all paths for is_last.
	For json we would need a flag in dat->opts.

	See GH #75, and an attempt at PR #213

2020-03-24  Reini Urban  <rurban@cpan.org>

	even more unknown fields
	we can now detect more switched fields of the same type.

	add more unknown fields
	with empty field text, unknown and dxf_test will not work

	add debugging SECTIONVIEWSTYLE
	very similar to DETAILVIEWSTYLE

	re-enable LAYERFILTER (unhandled)
	it does appear in DXF and DWG. Use this name, as it appears in the
	named object dict as ACAD_LAYERFILTER.

	add debugging DETAILVIEWSTYLE
	best .pi coverage > 90%
	and known fieldnames

	make regen-unknown
	The previous GH #214 init handles changes fixed
	DICTIONARYWDFLT handles and some DIMASSOC objects.
	No known regressions so far.

	CONTROL_HANDLE_STREAM: honor the r2007+ has_strings bit
	wrong HANDLE_STREAM overflow check, without honoring it.
	likewise in CONTROL_HANDLE_STREAM we cannot overwrite hdl_dat,
	which honored it.
	Fixes r2007+ issues with *_CONTROL objects, and related MLEADERSTYLE
	has_new_format logic, with off-by-one bit

2020-03-23  Reini Urban  <rurban@cpan.org>

	unit-testing: add NULL checks

	add CONTROL_HANDLE_STREAM exception
	there num_entries is before the handles, because
	with r14 we cannot init hdl_dat that early

	dxf: add eed
	the dxf_format logic is not correct for code - 1000.

	decode: extract common_object_handle_data.spec

	decode: init handle_stream earlier <r2007 also
	unify hdl_dat init, now also pre-r2007.
	call dwg_decode_common_entity_handle_data and START_OBJECT_HANDLE_STREAM earlier

	DIMASSOC: more referred handle stuff WIP
	we really need to init hdl_dat earlier pre-r2007

2020-03-23  Reini Urban  <rurban@cpan.org>

	dxf_test: support subclass fields
	either extra malloced vectors (_obj->field[i]), or embedded with simple _obj offset

	also fix the dxf_test -a flag

2020-03-23  Reini Urban  <rurban@cpan.org>

	DIMASSOC: add num_mainobjs BS for mainobjs SUB_HANDLE_VECTOR
	not a single one.

2020-03-22  Reini Urban  <rurban@cpan.org>

	move DIMASSOC.ref.rotated_type 71 to DIMASSOC
	and the previous BS slot looks like a type or num_mainobjs

2020-03-21  Reini Urban  <rurban@cpan.org>

	dxf_test: handle wrong dxf codes
	check against the dynapi type on known mismatches

	restore DIMASSOC (is unstable)

	unknown: set some DIMASSOC field type hints
	where the dxf code is wrong, eg BS instead of B, and such.

	unknown: split pi files into chunks of max 50 goals
	otherwise we get nasty PICAT timeouts or even out-of-memory

	make regen-unknown for added UNKNOWN_BITS via LOG_TRACE_TF

	fix LOG_TRACE_TF, esp. for DECODE_UNKNOWN_BITS
	unknown did not catch most unknown_bits TF

	more DIMASSOC

	make regen-unknown for DIMASSOC

	dynapi: support SUB_FIELD_HANDLE dxf code

	extend DIMASSOC

	dwg.spec: REPEAT_BLOCK indent 4

	harmonize some ASSOCACTION fields

	unit-testing: observed higher angles
	so angles are obviously not normalized when filed to DWG.
	some end_angles exceed 2*pi, so use 4*pi instead.

2020-03-20  Reini Urban  <rurban@cpan.org>

	unit-testing: silence some warnings
	when iterating over NULLHDL block entries e.g.

	unit-testing: fix subdir recursion
	big oops

2020-03-20  Reini Urban  <rurban@cpan.org>

	unit-testing: support -a and -an
	to show all results. for unit_testing_all.sh.

	fix LTEXEC path in unit_testing_all.sh, parallelize the initial make.

2020-03-20  Reini Urban  <rurban@cpan.org>

	make regen-unkown

	add debugging DATALINK
	almost good

	replace ANNOTSCALEOBJECTCONTEXTDATA with subtypes
	new BLKREF*, LEADER*, MLEADER*, MTEXT*, MTEXTATTRIBUTE*,
	TESTOBJECTCONTEXTDATA objects

	unit-testing: 50% dxf_test ok logging
	display only the first 6 objects per file.
	size went from 2924419 to 1315383. still mostly VISUALSTYLE

	configure: add -fno-semantic-interposition
	with gcc and --enable-shared (default).
	This disallows many LD_PRELOAD tricks.

2020-03-20  Reini Urban  <rurban@cpan.org>

	limit the travis log size
	The 4th distcheck failed because of it.

	Only log max 10 objects for dxf_test ok(),
	and max 6 objects with the individual unit tests.
	This shortened the unit-testing make check log size from
	3771627 to 3678755.
	The complete log size was 6184698, mostly consisting of
	dxf_test VISUALSTYLE logging.

	Leave out make check with distcheck.

2020-03-20  Reini Urban  <rurban@cpan.org>

	add extra object ALDIMOBJECTCONTEXTDATA
	which has more fields than ANNOTSCALEOBJECTCONTEXTDATA
	(to which it previously resolved to)

	fix make regen-unknown
	more fixes for out-of-tree builds.
	skip all overlarge num_bits > 30000 (out of memory in picat).
	added a lot of new objects, detected a lot of more BD/RD values.

	add missing ASSOC*SURFACEACTIONBODY objects
	They could be just one object, but so far seperate them.
	They are so in DXF and as class, even if it looks like
	that they have the same fields.

	fix make regen-unknown
	dont trigger it by dependency with distcheck

	api: remove SURFACE type
	it is most likely either just a PLANESURFACE,
	or a generic type a la DIMENSION.

	rename unhandled (not persistent) LAYER_FILTER to LAYERFILTER
	and remove it as unhandled type, because it very likely not persistent to a DWG.
	maybe it is even LAYERFILTERS as in the central DICTIONARY_NAMED_OBJECT.

	fix unit-testing/check-objects.pl failures

2020-03-20  Reini Urban  <rurban@cpan.org>

	add unit-testing/check-objects.pl
	to check if all known objects have unit-tests.
	against generated src/objects.inc (make regen-dynapi)

	hereby we can ensure all the necessary dwg_api declarations and
	functions are not absent.

2020-03-19  Reini Urban  <rurban@cpan.org>

	minor LTYPE.dash spec rearrangement

	unit-testing: add all missing objects
	and the missing dwg_api types and funcs

	unit-test: limit ok() to max 10 objects
	else just be silent. In some DWG's we just have too many objects,
	like LINE, XRECORD, ...

	unit-testing: fix debugging surface
	--enable-debug only

2020-03-18  Reini Urban  <rurban@cpan.org>

	fix dxf_test unusual points
	some points do have DXF 46, ..., such as PLOTSETTINGS.plot_origin.
	Check our dynapi type instead

	api: fix missing EXPORT dwg_obj_mlinestyle_get_flag
	detected by the new unit tests

	unstable MULTILEADER: skip if wrong

	dxf_test: allow NULL strings

	fix examples/alldxf_0.inc paths
	for dxf_test.

	dynapi: fix NULL strings
	NULL converted to utf8 is also NULL, not an error.
	Fixes a couple of unit-tests.
	Also initialize the old API for wide strings.
	And add old API checks for some objects

	unit-tests: support obj with old API, and unicode text tests

	api: rename unimplemented dwg_obj_polyline_pface_get_points
	to dwg_ent_polyline_pface_get_points. deprecated, use the dynapi instead

	WIP SCALE.name r2007 problem
	This object has no has_strings bit.
	detected with the new unit-tests.

	unit-testing: revise coverage logic
	only process a new file, if:
	* there is no coverage yet, or
	* if the file is r2007 or r2018 (crossing unicode or latest)
	  starting with 2000.

	Update test-data/example_2000.dwg with VIEW
	store a VIEW, to get unit-testing coverage

	unit-testing: improve coverage warning
	VIEW has no coverage

2020-03-17  Reini Urban  <rurban@cpan.org>

	unit-testing: add missing debugging objects

	unit-testing: add missing stable objects

	unit-testing: add unstable PERSSUBENTMANAGER

	add 2004/Surface.dwg/dxf, check dynapi unstable
	for ASSOCPERSSUBENTMANAGER coverage.

	dwg_getall_*: skip unneeded init

	unit-testing: add dimassoc (unstable)

	unit-testing: add assocperssubentmanager DEBUGGING

	unit-testing: add assocplanesurfaceactionbody

	promote ASSOCALIGNEDDIMACTIONBODY to unstable
	add unit-test

	unit-testing: add unstable assocdependency

	add classes.c/unknown.pm stability helpers
	get unstable/debugging/unhandled per name or type.
	convert type to name (e.g. for logging)
	strip dxf_test dependencies, move funcs around a bit

	move PLOTSETTINGS to unstable
	regen-unknown, with MULTILEADER added back.

	dynapi_test: relax unstable VISUALSTYLE
	lot of nan's

	dxf_test: support points
	e.g LIGHT

2020-03-16  Reini Urban  <rurban@cpan.org>

	free: avoid double dwg_free
	dxf_test: support env LIBREDWG_TRACE tracing.
	avoid double-free and use-after-free on broken DWGs

	dxf_test: fix dwgfile leak

	dxf_test: support CMC types
	ptr vs value

	dxf_test: add --class, --file args
	and don't calc the name alias twice

	unit-testing: add dbcolor
	which crashes in dxf_test

	disable dxf_test on --disable-write or -dxf

	unit-testing: TODO ARC_DIMENSION.user_text

	dxf_test: add needed objects

	unit-testing: add dxf_test
	compare against examples/alldxf_1.inc values from unknown.
	See GH #212

	improve PLOTSETTINGS
	but only got coverage for 2013

	improve VISUALSTYLE for r2010+

	regen-unknown for changed API

	unit-testing: add max angle checks
	2*pi for radians

2020-03-15  Reini Urban  <rurban@cpan.org>

	api: rename desc to description, ...
	VISUALSTYLE fixes for r2018, add and rename fields.
	add mlinestyle unit test

	json: fix CMC output in REPEAT loops
	i.e. CELLSTYLEMAP cells[rcount1].style.background_color

	spec: improve VISUALSTYLE
	some more stable fields without DEBUG_CLASSES

2020-03-14  Reini Urban  <rurban@cpan.org>

	rm AC_PROG_RANLIB
	rendered obsolete with LT_INIT

	indxf: check SPLINE.scenario

	in_dxf: fix strdup(dxfname) leaks

	autoscan, check for HAVE_SCANDIR
	add proper autoconf probes

	scan-build: fix dead assignments

	scan-build: store in srcdir

	fix dwg_find_dicthandle NULL deref
	found via scan-build

	unit-testing: extend mline, fix leak

2020-03-14  Reini Urban  <rurban@cpan.org>

	unit-testing: support a dir arg
	scan all DWGs in all subdirs.
	speeds up unit_testing_all.sh.

	But not on mingw, as there's no scandir(). Too lazy to port that for
	now. You can test it via cygwin though.

2020-03-13  Reini Urban  <rurban@cpan.org>

	unit-testing: fix leaks

	add 2010/gh209_1.dwg testcase for GEODATA
	See GH #209

2020-03-12  Reini Urban  <rurban@cpan.org>

	unit_testing_all: add -n (coverage) argument
	to all unit-tests. to silence coverage warnings, and more messages,
	when being run with an INPUT env arg.

	so only errors are printed.

2020-03-12  Reini Urban  <rurban@cpan.org>

	add unit_testing_all.sh.in
	test all DWGs with all unit-testing/dynapi tests
	(but not for all objects yet)

	add PLOTSETTINGS coverage test-data

	api: layout+plotsettings harmonization
	same fields, same names. add unit-tests.

	unit-testing: add unstable HELIX
	copied from SPLINE

	configure: add --enable-release
	to test IS_RELEASE features with a .git subdir

	no nan doubles in exports, GH #210
	IN_RELEASE replace with 0.0

	more distcheck: DISTCLEANFILES examples/alldxf*
	when regen-unknown is triggered

2020-03-12  Reini Urban  <rurban@cpan.org>

	fix automake distcheck bug GH #211
	We could avoid building LibreDWG.info in srcdir, but I don't know how.
	For now we allow creating the backupdir in $srcdir/doc.

	We also disable distcheck the bindings, if the builddir has the
	bindings disabled.

2020-03-12  Reini Urban  <rurban@cpan.org>

	unit-testing: fixup geodata coverage

2020-03-11  Reini Urban  <rurban@cpan.org>

	GEODATA: fix typo, extend
	found the bug via unknown, north_dir is a 2RD.
	add missing class v1 fields

	debug GEODATA, with unknown

	make regen-unknown for GEODATA

	debug GEODATA. add UNKNOWN

	fix dwgread fmt outout with corrupt dwg
	error earlier. Fixes GH #209

	fix geojson for GEODATA object
	we dont know geometry fields yet, so skip it.
	Thanks to @yossefaz for a testcase with GEODATA.
	Fixes GH #209 case 1

	unit-testing: add unstable geodata
	without any coverage

	unit-testing: add unstable light, debugging table

	unit-testing: add underlaydefinition

	unit-testing: add unstable visualstyle

	add test/unit-testing/tablestyl.c
	an unstable OBJECT
	change dwg_api for TABLESTYLE to unstable.

	unit-testing: handle vectors can be NULL
	esp. with objects

	unit-testing: CHK_SUBCLASS in hatch

	unit-testing: TODO unstable objects

	unit-testing: stricter multileader checks
	check for valid value ranges (alignment, flags, ...).
	Found interesting bugs

	unit-testing: simplify CHK_SUBCLASS_*
	use the subclass API for all fields.

2020-03-10  Reini Urban  <rurban@cpan.org>

	add dwg_dynapi_subclass_value, more unit-testing multileader
	add subclass dynapi checks, as needed in in_json.

	unit-testing: add gradient HATCH coverage

	unit-testing: add CHK_ENTITY_CMC

	add test/unit-testing/multileader.c WIP

	add test/unit-testing/leader

	unit-testing: fix CHK_ENTITY_H leak

	add test/unit-testing/viewport.c

	add test-data/2004/Underlay.dwg
	needed for underlay coverage

	add test/unit-testing/underlay.c

	fixup test/unit-testing/ preview_size
	BLL since r2010 already.
	Detected by asan overflow with new wipeout coverage.

	add test/unit-testing/wipeout.c

	fixup encode FIELD_VECTOR_T -Wincompatible-pointer-types
	we added the T type argument, so a unicode cast is not needed anymore.
	T texts vs TU

2020-03-09  Reini Urban  <rurban@cpan.org>

	fix TU32 type for r2007+, either UCS-2 or UCS-4
	I suspect this is either a Teigha or AutoCAD bug.
	But the TU32 feature strings can be either 4 or 2 byte.

	add TU32 type for FileDepList.features
	on r2007+

	injson: fix eed 1005 size to 8
	and error on wrong FileDepList_Files type.
	testcase: 2007/Leader

2020-03-08  Reini Urban  <rurban@cpan.org>

	injson: fix xdata_size calculation with BINARY
	causing encode overflows on overlarge xdata_size

	injson: also set eed.size correctly
	realloc and count

	injson: count eed.size correctly
	realloc data precisely, but don't yet set the size.

	injson: fix Unknown HATCH num_polyline_paths field
	and wrong "polyline_paths[rcount2],point" key

	injson: protect from NULL dwg_dynapi_subclass_name
	or empty dwg_dynapi_subclass_fields results.
	Found via fuzzing, with e.g. a json field like "name.: "..."

	json: fix json_thumbnail_write
	skip the sentinel, which is included in the thumbnail.chain,
	when being read from a R_2004+ SECTION_PREVIEW. There it has
	an dat->byte = 16 offset, but the dat->byte position is advanced
	by dwg_bmp() in decode to the real BMP offset.

2020-03-07  Reini Urban  <rurban@cpan.org>

	injson: ignore R2004_Header.padding
	This is done by encode (eventually)

	unit-testing: silence gnu_printf warnings
	only without __USE_MINGW_ANSI_STDIO use ms_printf,
	else gnu_printf.

2020-03-06  Reini Urban  <rurban@cpan.org>

	fix dwg_dynapi_common_value for preview_size <r2010
	wrong size. Fixes unit-testing/image crash

	unit-testing: more coverage

	add test/unit-testing/image.c (uncovered)

	add test/unit-testing/camera.c (uncovered)
	fix the type chooser, always use fixedtype
	for the variale-typed entities.

	api: support ARC_DIMENSION, add unit-testing arc_dimension
	But note that this type is still in DEBUGGING => UNKNOWN_ENT

	api: fix dwg_ent_3dface_* api to 3d
	add dwg_object_to__3DFACE().
	add a unit-test for 3dface

	add test/unit-testing/spline.c

	more test/unit-testing/hatch

	unit-testing: fix dwg_dynapi_handle_name leak
	with unicode texts.
	declare dwg and version for our macros.

	add test/unit-testing/hatch.c

2020-03-05  Reini Urban  <rurban@cpan.org>

	in_json: more DICTIONARY.numitems mismatches
	crashes at free with fuzzing (again).
	add more checks

	dwg: support -Ijson for testing fuzzing results
	which have no json or dxf extension

2020-03-05  Reini Urban  <rurban@cpan.org>

	encode: support overlarge objects size > 0x7fff
	only for wrongly calculated sizes. mostly not in_json.

	when bit_write_MS (obj->size) needs more than one word,
	but we wrote only one word for it.

2020-03-05  Reini Urban  <rurban@cpan.org>

	api: add dwg_dynapi_subclass_field
	linear search in the subclass.
	used in in_json, for keys like value.data_type,
	embedded structs. call _set_struct_field() then recursively.
	This fixes all the remaining embdedded structs, like TABLE_value, ...

	We still need the MULTILEADER.ctx.* exception, because this is a union.
	Note: Just some such . fields have no seperate subclass, like
	color.index or lt.index.

2020-03-04  Reini Urban  <rurban@cpan.org>

	fixup {dxf,json}-check
	overwrite.
	use correct b
	dxf: support -y

2020-03-03  Reini Urban  <rurban@cpan.org>

	fixup echo 2\>

	svg: improve RAY/XLINE
	check intersections if out of bounds.
	avoid div by zero

	svg: echo the jing validation cmdline

	svg: add experimental RAY/XLINE

	svg: honor invisible, comment entity types

	README: document new optional checkers

	programs/*test: simplify

	tests: support LTEXEC with nested builddirs
	replace hardcoded ../libtool --mode=execute with LTEXEC.
	Allow empty PROGS and DATADIR in tests

	svg.test: added to run jing
	formal SVG validation via make check (to catch regressions)

	dwg2SGV: list TODOs

	bsd: declare strcasestr
	FreeBSD doesn't honor _POSIX_C_SOURCE for strcasestr,
	only __BSD_VISIBLE.

	cirrus: freebsd-12-1-snap fails
	better use the stable, or the upcoming 13-0-snap

	even more shell scripts in top_srcdir
	to test with shellcheck, and fix quoting and other issues.

	add {dxf,json}-check shellchecks
	with bashisms

	fix programs shell scripts against shellcheck

	fix all root shell scripts against shellcheck

2020-03-02  Reini Urban  <rurban@cpan.org>

	add shellcheck tests
	but cannot be used together with the rpmlint test.
	only with the autoconf parallel-tests option,
	but this does not work with srcdir/TESTS.

	fix dwg/dxf/... scripts for shared lib
	LTEXEC requires top_builddir (which is always .)

	dwgfilter: shellcheck fixes

	dxf: shellcheck fixes

	dwg: shellcheck fixes

	json: shellcheck fixes

	svg: shellcheck fixes

	fix configure dash/sh Syntax error: Unterminated quoted string
	e.g. as on freebsd

2020-03-01  Reini Urban  <rurban@cpan.org>

	LaTeXML has broken relaxng svg11-basic.rng
	See https://github.com/brucemiller/LaTeXML/issues/1237
	Probe for our, or a fixed LaTeXML one.
	There is none in any fedora repo.
	Maybe debian has a working svg schema somewhere.

	svg: probe for jinq and LaTeXML svg validator
	for svg.in

	decode: accept optional empty sections
	don't fail fataly then. e.g. with Teigha DWG's

	add check-svg target, via ./svg
	by adding a validator to the svg, like
	        jing svg11/svg11-basic.rng $out
	we can catch all svg errors also.

	svg-validator: fatal: The string "--" is not permitted within comments

	svg: don't group the *Model_Space entities

	decode_test: fix leak
	improve when to realloc the bit chain.
	avoid excessive realloc from 1 to 40k.

2020-03-01  Reini Urban  <rurban@cpan.org>

	refactor dwg_rgb_palette, fix odr_violation
	Define every object only once: ODR (One-Definition-Rule).
	Use a functional accessor, not a global.
	Failed only as shared lib on clang with asan.

	Fixup for 2592a4c8ea081649f0d63a5007834c5660fd92d8

2020-02-29  Reini Urban  <rurban@cpan.org>

	add dwg_rgb_palette[256], support svg rgb/true colors
	more colors than just 0-8,256.
	The palette struct is from my old site xarch.tu-graz.ac.at acadrgb.txt

	svg: add common_entity with color
	static color indices 0-8 first only, no rgb or higher palette colors yet

2020-02-29  Reini Urban  <rurban@cpan.org>

	programs: free on asan only without detect_leaks=0
	don't free with asan and detect_leaks=0.
	In all other cases the leak detector is on.

	Add some missing --force-free options.

2020-02-29  Reini Urban  <rurban@cpan.org>

	svg: add --force-free option
	skip free on large DWGs (performance)

	svg: add 3DFACE

	svg: add SOLID (as filled polygon)

	svg: use viewBox, add ELLIPSE (partially)

2020-02-28  Reini Urban  <rurban@cpan.org>

	svg: add helper and POINT
	a POINT is represented as CIRCLE with radius 0.1 (TODO relative to extends)

	print Ignored ENTITY name to stderr.

2020-02-28  Reini Urban  <rurban@cpan.org>

	dwg2SVG: add lweight to some entities

2020-02-27  Reini Urban  <rurban@cpan.org>

	indxf: fix *_CONTROL.entites[] NULL hdl regression #204
	We fill the num_entries at the i-th index

2020-02-25  Reini Urban  <rurban@cpan.org>

	json: enable DECODER_OR_ENCODER
	e.g. needed for DIMENSION*.def_pt, POLYLINE_2D, ...
	it just means NOT_DXF {}

	injson: add RevHistory, ObjFreeSpace sections

	json: add Security section

	json: add section AppInfoHistory
	which is not decodable yet. just binary unknown_bits

	injson: fix one more DICTIONARY.numitems case
	fixes .fuzz-out21/crashes/id:000001,sig:06,src:001316,time:68072970+001732,op:MOpt_core_splice,rep:2

2020-02-21  Reini Urban  <rurban@cpan.org>

	Minor free inconsistencies
	pointed out by @ManSoSec. Totally harmless.
	Closes GH #206

	injson: protect Illegal CLASS [0] check
	NULL deref

	configure.ac: bump Copyright year

	free: fix 2PT_TRACE artefacts
	from FIELD_DD in LINE

2020-02-21  Reini Urban  <rurban@cpan.org>

	encode: init hdl_dat stream earlier #205
	add obj_flush_hdlstream to START_HANDLE_STREAM.
	initially handles are written to a fresh hdl stream.
	When we reach START_HANDLE_STREAM (entity and object) we flush this to dat.
	On encode we usually don't know obj->bitsize and obj->hdlpos beforehand.

	This greatly simplifies the dwg.spec, avoiding 2nd loops just for
	the handles, and avoiding free problems.

2020-02-19  Reini Urban  <rurban@cpan.org>

	encode: fix bit_write_DD
	check the first 2 or 4 byte of the double for eq

2020-02-19  Reini Urban  <rurban@cpan.org>

	injson: recalc eed.size on wstrings
	if does_cross_unicode_datversion, i.e. from r2007+ to r2000
	we need to shorten the eed size of the size frame.
	encode does not do that for us, we need to do that in the importers.
	in_dxf already did that by necessity.
	The XRECORD.xdata_size and obj->size,bitsize are always calculated.

	No more INVALIDEED check-json errors in all samples.

2020-02-19  Reini Urban  <rurban@cpan.org>

	encode: finally fix eed sizes
	and warn about overflows.
	we cannot write eed data with size=0, take
	the previous size from the proper size frame then.

2020-02-18  Reini Urban  <rurban@cpan.org>

	injson: set XRECORD.xdata_size

2020-02-18  Reini Urban  <rurban@cpan.org>

	injson: DD bitsizes can vary
	read/write via json can change double values,
	which can influence if a DD value is code 2 or 3,
	which changes the whole element bitsize.

	DXF also, but there we don't store the bitsize.

2020-02-18  Reini Urban  <rurban@cpan.org>

	injson: fix eed encoding
	write data not only when no raw was written anymore.
	with in_json we dont have raw at all.
	This writes now all non-starting eed data, and fixes
	many INVALIDEED encoding errors.

	fixup TIMEBLL calculation in all modules
	julian dates: date->ms are seconds (86400 per day)
	problematic is only DXF which persists reading TIMEBLL
	as 40 from double. we could speccial-case that, but we don't.

	simplify LINE ENCODER
	There is still a bug in LINE.end.x in some cases (bit 2) I think

	injson: fix ENTITY.linewt roundtrips
	only convert to mm for DXF, not print nor json

2020-02-18  Reini Urban  <rurban@cpan.org>

	injson: change DICTIONARY.numitems logic
	always keep the lower number, but not 0, because
	this entry might not have existed yet.
	texts come before itemhandles, so only fixup itemhandles.
	This still might fail on illegal json with itemhandles before texts,
	so ignore those texts.

	Better leak superflouos handles or texts, than a buffer-overflow.

2020-02-18  Reini Urban  <rurban@cpan.org>

	injson: skip illegal CLASSES
	same as illegal OBJECTS

	Change development version formats for rpm, no -
	fix git-version-gen.
	rpm versions may not contain a -, just _.
	=> like 0.5.0.1093.1_967f

2020-02-17  Reini Urban  <rurban@cpan.org>

	injson: more JSON_TOKENS_CHECK_OVERFLOW_ERR
	this time in the _set_struct_field loops.
	fixes a fuzzing case, one remaining.

	injson: fix bit_utf8_to_TV overflow
	add a final check, when the last \0 cannot be written.
	Found via fuzzing

	add rpmlint libredwg.spec check-TESTS
	This variant works with serial-tests only. When switching to
	parallel-testing use the commented SPEC_LOG_COMPILER instead.

	in_dxf: remove exit() on out of mem
	handle differently

	injson: fix SummaryInfo.props, add AppInfo

2020-02-17  Reini Urban  <rurban@cpan.org>

	injson: JSON_TOKENS_CHECK_OVERFLOW
	found via fuzzing.
	Almost proper error handling now.
	But still a few void functions which could overflow the parser tokens.

	ignore Template.desc, but handle it

2020-02-17  Reini Urban  <rurban@cpan.org>

	spec: add pslib

2020-02-16  Reini Urban  <rurban@cpan.org>

	injson: fix Required %s. missing, skipped
	we set the previous object, but later we still check for [i].*
	so we need to fixup both loop vars to properly skip it.

	Found via a new injson fuzzing round 20

2020-02-16  Reini Urban  <rurban@cpan.org>

	add doc_DIST targets
	found from rpm spec errors

	no libredwg.spec.in
	the git test builders require a .spec beforehand, e.g. copr

	support --with-perl-install=vendor
	needed for packaging

	Integrate and improve libredwg.spec

2020-02-15  Reini Urban  <rurban@cpan.org>

	add rpm libredwg.spec
	targetting fedora core 31.
	just libps-devel is not yet packaged there.
	jq for 0.11

	fix arm cross-compilation
	which defaults to MB_LEN_MAX 1.
	include wchar.h in a single place for the needed fixup

2020-02-14  Reini Urban  <rurban@cpan.org>

	dxf: fixup previous commit, no double cast loss
	casting a double to intptr_t could loose half of the bits on 32bit, 8 => 4
	rather seperate the remaining test value macros.

	dxf: simplify printing doubles
	use only dxf_print_rd, no duplicate code

	cirrus: fails with pkg install git...
	it has a pre-installed go=git instead.

	indxf: LAYOUT needs absolute ownerhandle
	and with DICTIONARY it varies.

	dxf: enhance static REPEAT limit from 0x7ff to 20000
	example_2000 LWPOLYLINE has 3695 points, which failed.

	dxf: strip ending .00 also in VALUE_RD
	not just the generic VALUE macro

	dxf-check: cosmetics
	convert to test as DXF, to check reading the created DWG.
	Keeps our DXF in ., creates the audit in test/*.dxf.err
	Can be check against the Teigha DXF if successful.

2020-02-14  Reini Urban  <rurban@cpan.org>

	json: add DIMENSION.flag (dxf 70) and _subclass
	just for commenting and to compare against DXF.
	"_subclass" with a _ prefix to denote that it's not stored in a field.
	flag is stored, but computed.

	Note: _subclass is a duplicate key in an json object, which some json
	parsers ignore. jq uses the last (as most).

2020-02-14  Reini Urban  <rurban@cpan.org>

	decode DIMENSION: fixup flag
	don't clear the set bits, which we set before.
	Thanks to Lyubomir Savekov

	dxf: simplify INSERT
	harmonize dxfb

	dxf: fix SUB_FIELD_BD
	which is special-cased for DXF angles (rad2deg).
	Fixes HATCH angles 50, 51, and LTYPE.dashes.rotation 50 in out_dxf

	indxf: import HATCH.boundary_handles 330

	log: trace TF, not just insane
	just set a length limit to avoid overlarge binary data (ole2frame, preview) on -v3.
	emit json LTYPE.strings_area only if has_strings_area.

	api: refactor LTYPE
	move style [H*] into dashes, same as in DXF (code 340 in the dashes loop)
	simplify R_13 loop
	still need 2 loops for non-handles and hanldes at the end, beware of free.
	fixup wrong DXF codes for complex_shapecode and shape_flag, mixed up.
	fixup wrong shape_flag check for has_strings_area
	rename LTYPE.text_area_is_present to LTYPE.has_strings_area
	implement LTYPE.style 340 import in in_dxf

2020-02-13  Reini Urban  <rurban@cpan.org>

	add dwgfilter shell script
	Closes GH #64
	Need a few good examples still.

	add dwgfilter (WIP #64)
	custom query and search/replace filters on all objects.
	probably in a XPath-like expr language.
	(or maybe just jsonpath dot notation, but XPath has much more features)
	idea: just pass it through jq https://stedolan.github.io/jq/manual/ via json.

	dynapi: regen => LAYER.linewt 370

	json: added to DXF_OR_PRINT
	minus one special case: LAYER.linewt untranslated.
	Now LINE points showing up.

	json: use bit_utf8_to_TV

	api: add bit_utf8_to_TV (untested, needs dest buffer)
	to undo json_cquote

2020-02-12  Reini Urban  <rurban@cpan.org>

	indxf: better xcalloc
	check wrong value before calloc() call.
	fuzzer indxf6 regression.

	json: fix json_wstring
	need an ending delimiter, just overwrite the ending " of the string.
	Ideally we should restore the " after the utf8 conversion, but we don't
	need the json later. so leave it.

	json: parse json_FileDepList_Files()
	as array of objects

	out_dxf,_json: improve ending .x00 stripper
	Only msvcrt has this sprintf feature, POSIX not.
	Do it manually.
	Now for all numbers, not just a few.

	json.test: fatalize json roundtrip errors
	when entities get lost.
	Fixed with the previous commit

	encode: fix [MS] obj->size > 0x7fff
	mixed up the order of RS.
	This fixes json roundtrips with large objects, e.g. with size 0xd1c9

	json: strip ending excessive .0000000000 as in dxf

	out_json: increase %f precision as in DXF
	we still have a floating-point roundtrip precision loss in PEXTMIN,
	causing the HEADER.crc to be different.

	auxheader: unknown_5rl defaults

	add FIELD_VECTOR_INL
	pre-allocated inlined vectors of a type, with const size,
	like RC name[5]
	Turn back AuxHeader.aux_intro into an array of 3

	auxheader: change RC unknown_20rc[20] to RL unknown_5rl[5]
	and use TFFx (binary) for JSON, arrays for the rest.
	TODO: create an inlined vector without malloc:
	FIELD_VECTOR_INL (nam, type, size, dxf)

	encode: remove dat->byte -= 6 fixup
	dont write empty strings ending \0 byte on length 0.
	roundtrips do match now.
	add @bitpos to -v5 insane loggings to find out about
	the wrong TV encoding on empty strings.

2020-02-11  Reini Urban  <rurban@cpan.org>

	json: fix TIMEBLL repr
	with the single float value we always the lost two digits.
	represent it as array of 2 BLs, as in the DWG

	in_json: protect wrong supertypes
	with assert, since it's fatal and not fixable.
	It comes from a wrong mixup of name, dxfname and/or type.
	Here from a wrong dxfname.

	encode: fixup header_variables size
	wrong patchup size logic, needs -6.
	checked via json-check

	api: add auxheader to json
	rename some fields, add RCx type.
	num_saves would be suppressed by json, rename to numsaves

	decode: fix the example_2000 3dsolid leak
	improve the decoding a bit, check bounds.
	The leak was an improperly read encr_sat_data

	alive.test: TODO more failing tests
	dwgrewrite leaks with example_2000 3DSOLID
	dwgwrite crashes on cygwin
	dwgrewrite crashes on mingw

	{dxf,json}-check: support handy td symlink
	for test/test-data

	json: change xdata to ARRAY [ type, value ]

	harmonize xdata tracing
	TV strings, not TF.
	convert to TU strings in json if targetting TU (not yet)

2020-02-10  Reini Urban  <rurban@cpan.org>

	dwg_add_handle: allow actual relative handle codes
	from json.
	not just the theoretical code types from the spec.
	Fixes the json handle inconsistencies, and we could do now
	2 handle values only again. but we rather keep it precise.

	json: add a 2nd HANDLE repr
	array of 2 [code, absref] or array of 4 [code, size, value, absref]
	to overcome problem with reverse relative offset calculation in dwg_add_handle

	free: skip entity color.rgb tracing messages

	free: skip entity bitsize tracing messages
	for r13 and r14

	encode: fixup wrong comment

	json: avoid null TU strings
	TV never prints null, just ""

	dwggrep: AM_CFLAGS before CFLAGS
	In case we added -I/usr/local/include to CFLAGS, and had an older
	libredwg dwg.h installed there, we would pick up the wrong header.

2020-02-10  Reini Urban  <rurban@cpan.org>

	encode: no bitsize re-calculation with handles
	Already calculated at HANDLE_STREAM, but them overridden again
	at the very end, with INJSON only (which does have size and
	bitsize keys, just unreliable, when down-converting)

	Avoid that when we have handles. No "bitsize calc from address (no handle)".
	Fixes acad import/teigha conversion of DICTIONARY et al.

2020-02-09  Reini Urban  <rurban@cpan.org>

	import: generalize in_postprocess_SEQEND/handles
	for dxf and json.
	Create the list of owner children from each SEQEND, esp.
	when converting r2004+ down to r2000 (with only first/list pairs).

	Also create common_entity handles when downconverting, taken from in_dxf:
	prev_/next_entity handles, nolinks flag,
	xdicobjhandle.

2020-02-09  Reini Urban  <rurban@cpan.org>

	out_json: fix -Wformat eed.code type

	encode: undo CRC pos fixup on Wrong object size
	Fixes import Teigha error for DICTIONARYVAR 1A2

	harmonize decode T logging

	{dxf,json}-check: fix some r calc
	error: r=test-data which failed on Teigha

	harmonize encode TV with TU logging
	See a810101b168da4a954d539c82708da46c0eb3136

2020-02-08  Reini Urban  <rurban@cpan.org>

	comment formatting only

	fix -Wsign-compare from mingw

	fix remaining injson leaks for r14
	See GH #197

	alive.test: no TODO for dwgwrite
	all tests must pass, just indxf leaks are allowed.
	dwgrewrite still fails on mingw64

	alive.test: dwgwrite with json does not leak anymore
	See GH #197
	Just example_r14.json and invalid fuzzing json's leak still (TODO)

	free: fix MLINESTYLE.lines leak
	again. wrong logic, we need to check against dat->from_version

	harmonize decode TV with TU logging
	with quotes and add the type/dxf,
	for easier json-check roundtrip checks.

	encode: Imported json sizes are unreliable when changing versions
	set dat->from_version and dwg->header.from_version differently
	on in_json. dat->from_version should be R_2000 to keep strings asis,
	only keep the dwg from_version as proper.

2020-02-08  Reini Urban  <rurban@cpan.org>

	encode: keep dat.from_version
	undo the previous minimal DXF import hack.

	process higher versions on free, because there we need from_version also.
	(HATCH_gradientfill)

2020-02-08  Reini Urban  <rurban@cpan.org>

	in_json: fixup invalid DIMASSOC_Ref elems if != 4
	don't crash on invalid free of an unallocated ref.
	Always allocate at least 4, and handle only 4.
	This new error came up when free of DIMASSOC was enabled.

	api: simplified new DWG_OPTS_IN
	infxf or injson

2020-02-08  Reini Urban  <rurban@cpan.org>

	free: add dwg_free_variable_no_class
	for leaks with the error-case on a missing class.

	define all declared classes to be DEBUGGING, because
	they show up in objects.inc, and can be imported
	by DXF or JSON, even if we have not defined any order of
	fields yet. we've just declared them, which is enough.

2020-02-08  Reini Urban  <rurban@cpan.org>

	in_json: fix version specific HANDLE_VECTOR leaks
	esp. the 2004 entity lists, which are allocated by an importer,
	but not encoded nor freed.

	in_json: fix MLINE.verts/num_lines leak
	the spec sets MLINE.num_lines from verts[].num_lines,
	so we need to set in in the importer

	in_json: fix HEADER.unknown_text1 leak
	of the IF_ENCODE_FROM_EARLIER_OR_DXF strdup("m")

	dynapi: add missing VERTEX_3D aliases
	VERTEX_MESH VERTEX_PFACE.
	Fixes json roundtrips

	fatal roundtrip tests on 0 entities
	only allow some missing entities for now

	suppress dsymutil echo
	in some helper tools

	check-json: fix make -jN jobserver warning
	See https://www.gnu.org/software/make/manual/html_node/Options_002fRecursion.html

	out_json: fix SPLINE_control_point
	to be compatible with dynapi, and in_json

	in_json: revise invalid object error handling
	no DUMMY, ignore and free it.

2020-02-08  Reini Urban  <rurban@cpan.org>

	in_json: improve invalid object error handling
	set type to DUMMY, don't skip it.
	set supertype, parent, index.

	if inside the object, read all the remaining keys to start at the next.

2020-02-08  Reini Urban  <rurban@cpan.org>

	in_json: valgrind cosmetics
	avoid 0 byte leak stats

	in_json: better fixup numfield logging
	show ignored value, show assignment.

2020-02-07  Reini Urban  <rurban@cpan.org>

	stable DYNAMICBLOCKPURGEPREVENTER
	now fixed

	examples: update bd-unknown.inc and fix target
	when in builddir

	in_json: protect from wrong LTYPE.strings_area length
	Found via GH #197 fuzzing

	in_json: stricter object+entity check
	to avoid mismatches with wrong supertypes, heap-overflows
	on common_data access and such.
	Found by fuzzing GH #197

	unknown: add more objects/field names

	update unknown
	use-after-free, convert to TU, double-free, ...

	add more ANNOTSCALEOBJECTCONTEXTDATA types
	unhandled

	add some AcDbSh DEBUG_CLASSES

	add more unhandled classes with DXF counterparts
	from the JW testcase. GH #200

	add 3 new unhandled ACME classes
	AutoCAD Mechanical.
	from the JW testcase, GH #200

	unknown: regen and fixup for builddir

2020-02-07  Reini Urban  <rurban@cpan.org>

	json: fix filedeplist and FIELD path keys
	key only, without obj[rcount1].
	use FIELD_VECTOR for filedeplist (much easier than a REPEAT block).
	Thanks to Vimal Pillai for his testcase in GH #200

	Now the features array is always present, an empty files array not.

2020-02-06  Reini Urban  <rurban@cpan.org>

	in_json: add BL* support
	for LWPOLYLINE.vertexids r2010+.
	Thanks to Vimal Pillai for his testcase in GH #200

	check programs: display roundtrip fail (TODO)

	fixed unit-testing/ole2frame
	now with proper TF support

	more TF -Wpointer-sign fixes from clang

2020-02-05  Reini Urban  <rurban@cpan.org>

	wrong loop, detected by latest clang
	 -Wfor-loop-analysis

	TF unsigned char*: fix out_json %02X for char > 127
	set BITCODE_TF as unsigned, avoiding printing FIELD_BINARY/FIELD_TF
	as FFFFFFxx (negative sign extended to -int)
	Fixes GH #199

	dynapi: ent->preview TF not just char*
	but the fields already had it.

	harmonize FIELD_TF loggins
	%02X not %02x, to be easier comparable to FIELD_BINARY
	output with JSON and DXF

2020-02-05  Reini Urban  <rurban@cpan.org>

	add dynapi_test_all.sh
	for all test-data DWGs. Higher coverage, lot's of nan's

	Improve *clean rules a bit.

2020-02-03  Reini Urban  <rurban@cpan.org>

	check: add json and dxf roundtrip checks
	still TODO. count the number of created entities, how many are lost

	in_json: fix more string leaks
	they are allocated fresh in the dynapi

	in_json: fix eed string leaks
	they are copied into data.
	See GH #198

2020-02-03  Reini Urban  <rurban@cpan.org>

	dwgwrite: free on critical importer errors
	to avoid leaks.

	Also tune the in_json object_map hash.

2020-02-03  Reini Urban  <rurban@cpan.org>

	make json-check -v3 easier comparable
	absolute offsets only with LOG_HANDLE -v4

	in_json: type the missing names

	api: rename XRECORD.num_databytes to xdata_size
	it is a size after all, not a num_

	in_json: add missing XRECORD.xdata
	Closes GH #198

	out_json: add missing XRECORD.xdata
	See GH #198

	in_json: fix Unknown CLASS key
	proper error handling, fixing a fuzzing heap-overflow GH #197

	in_json: Improve fatal error on required keys
	check on next object also.
	Fixed all but one GH #197 fuzzing crashes.

	in_json: Fatal error on missing OBJECTS type
	though theoretically we could search for the type, as
	we do for our internal fixedtype.
	Fixes GH #178 fuzzing crashes

	in_json: fatal error if OBJECTS handle is missing
	Fixes GH #178 fuzzing crashes

2020-02-03  Reini Urban  <rurban@cpan.org>

	in_json: ignore OBJECTS index field
	we really need to use our own for an reliable objid.
	It is treated just as a comment.

	Also fixup TableCellContent_Attr.index subclass field.
	Fixes GH #178 fuzzing crashes

2020-02-03  Reini Urban  <rurban@cpan.org>

	in_json: log empty arrays, key: [ ]

	in_json: read eed[]
	See GH #198, fixes the EED part.

	out_json: add eed array of objects
	some with size and handle, the others only code and value.
	See GH #198

	in_json: wrong DICTIONARY.numitems fixup

2020-02-02  Reini Urban  <rurban@cpan.org>

	in_json: fix heap-overflow on parser errmsg
	fix another head overflow to the right side this time.
	Found by the 2nd fuzzing round GH #179

	encode: fix null deref with empty klass->dxfname
	Fixed now all fuzzing crashes GH #197 (for now)

	in_json: ignore DICTIONARY.numitems also
	we still have a wrong Inconsistent warning though

	in_json: set target version to R_2000
	to avoid unnecessary widestring back and forth conversions,
	because we can only write R_2000 for now. Later turn it back on.

	in_json: add wstring and FileDepList

	in_json: clang-format

	in_json: error on duplicate OBJECTS or CLASSES arrays

	in_json: !obj->dxfname error case
	when it is not a string, set a default.
	Fixes a double-free, GH #197

	in_json: add json_binary helper

	out_json: workaround FileDepList NOCOMMA hack
	on empty content. we dont emit the num_ fields anymore, and here
	no empty arrays neither.

2020-02-01  Reini Urban  <rurban@cpan.org>

	in_json: set all num_ and _size fields from the ARRAY
	and skip it's explicit keys.

	out_json: skip all num_ fields
	to avoid in_json array mismatches

	{json,dxf}-check: fixup r for teigha

	in_json: fix object/entity name stack overflows
	See GH #197

	in_json: support Template section
	which is actually used by r2000 encode

	in_json: support SummaryInfo section
	with some parsing problems

	in_json: support R2004_Header section
	even if it's yet unused for R2000 encode

	fixup in_json: protect from NULL json_HANDLE
	Don't get the hdl[] twice.
	And log the H* index
	See GH #197

	in_json: handle all 310 strings as FIELD_BINARY
	i.e. TF
	See GH #197

2020-02-01  Reini Urban  <rurban@cpan.org>

	api: harmonize _size suffix for FIELD_BINARY
	all FIELD_TF/FIELD_BINARY (310) fields, get an
	associated name_size field (not _length, ...).

	And don't emit it on out_json, rather emit the binary string only.

2020-02-01  Reini Urban  <rurban@cpan.org>

	in_json: initialize dwg->object_map
	Needed for dwg_add_handle()
	See GH #197

	in_json: add json_update_sizefield
	fixup a wrong preview_size field, (and later maybe more)
	TODO: remove those redundant sizefields, and rather encode
	the binary string properly "\000\000...."
	See GH #197

	in_json: Improve fixup of Invalid type
	fixedtype is calc. from the name (which is our stromgest assertion).
	Fixup any wrong type < 500, or fixedtype <= OLE2FRAME (above can be a class)
	See GH #197

2020-02-01  Reini Urban  <rurban@cpan.org>

	in_json: fixup DICTIONARY.numitems which is used for 2 arrays
	keep the smaller numfield of the two arrays itemhandles[] and texts[].
	Also for DICTIONARYWDFLT.

	Also add missing H* and TV* logging.
	See GH #197

2020-01-31  Reini Urban  <rurban@cpan.org>

	in_json: check Invalid type
	when the name and the type do not match.
	Fixes fuzzer crashes

	in_json: protect from NULL json_HANDLE

	forgot one NULL klass->dxfname check
	detected by in_json fuzzing.

	in_json: change num_tokens to signed
	to detect parse errors.

	in_json: fix stack-overflow on parser error

	dwgwrite: disable llvm_mode persistent mode
	The loop crashes. Don't know why yet, works fine with dwgrewrite.

	dwgread: support reading from stdin
	when no optional infile argument was given.
	print a notice to stderr on -v1.
	Analog to dwgwrite to support pipes

	dwgwrite: support -y -o /dev/null for fuzzing
	much faster fuzzing

2020-01-30  Reini Urban  <rurban@cpan.org>

	fix last clang -Wtautological-constant-out-of-range-compare
	Do a compile-time range check.

	Note: The taylor-series approximation for log2 does not help here.
	we only have 7 values to check against, and we want to avoid -lm.
	__clz would be better, but our current check is better.

2020-01-30  Reini Urban  <rurban@cpan.org>

	in_json: wrong version comparison, always false

	out_json: remove IS_PRINT
	for DXF_OR_PRINT: don't do the DXF conversions, just do the mundane
	simplier FIELD_* instead. E.g. linewt not converted (0x1d/29, not -3)

	in_json: no relative handles for reactors
	observe the original code, if >=6 for relative or not.

	change check-dxf and add check-json targets
	check roundtrips for all our test DWG's,
	if the re-created DWG is valid (via Teigha).
	See GH #195

	json-check: new checker analog to dxf-check
	check proper roundtrips, if the dwg generated from a json
	can be read by Teigha

	dxf: improve dxf analog to dwg
	and fix a typo

	dwgwrite: add --force-free
	for leakage testing

	dwg: add JSON support, not just DXF
	and rather use dwgwrite, not dxf2dwg

	in_json: check and update numfield
	for all objects arrays. Fixes GH #169

2020-01-29  Reini Urban  <rurban@cpan.org>

	dwgwrite: add afl-clang-fast support

	api: change num_unknown_bits from ulong to RL
	was problematic on 32bit, uint32_t is enough

	cirrus: autogen.sh requires now git

	in_dxf: warn -> trace Misleading num_entries
	see comment and GH #195. It is not a problem.

2020-01-29  Reini Urban  <rurban@cpan.org>

	in_json leaks: add DWG_OPTS_INJSON
	where even obj->name is dynamic, and needs to be freed.
	Free the temp. obj->unknown_bits.

	leaks in_dxf: 533 (mostly strings)
	      in_json: 1884 (strings)

2020-01-28  Reini Urban  <rurban@cpan.org>

	in_json: fix the biggest leaks
	and fix wrong tokens->tokens++, it is tokens->index++!
	Otherwise we cannot free it.
	66k remaining, mostly the unknown_bits strings.

	doc: Update manual

	in_json: fix HANDLE double-frees analog to in_dxf
	dwgwrite: support JSON now officially.
	many large leaks remaining (1MB per example_2004)

	doc: FreeCAD uses now LibreDWG
	See GH #195

	in_json: fixup subclass elem[] index
	it is a char* pointer only

	dynapi: fixup T types
	esp. needed for TF and TFF types.
	TF, TV, TU, T or even TFF. BINARY is TF.

	in_json: special-case LTYPE.strings_area TF (256/512)
	otherwise we get a heap-overflow in encode

	json,encode: add num_unknown_bits
	to avoid overflows on encode.
	actually encode the bits.

2020-01-27  Reini Urban  <rurban@cpan.org>

	json: rename unknown to unknown_bits
	and encode it. The size may overflow on writing.
	TODO eed, common_size to calculate num_unknown_bits. Or emit it

	-Wmaybe-uninitialized with older compilers

	in_json: parse unhandled sections

	in_json: harmonize error messages
	and delete dead code.

	in_json: support the 3 known static arrays
	and add a symetric dwg_dynapi_field_get_value (no text yet needed)

	in_json: fixup MULTILEADER.ctx.content
	with new dynapi union keys.
	Closes #194

	dynapi: support unions and inlined structs
	MULTILEADER.ctx not yet, but MLEADER_Content.txt.default_text.
	The idea is to support both, inlined and extra.
	See #194

	json: fix MLEADERSTYLE.block_scale to 3DPOINT
	so that it can be easily read via the dynapi

	fixup dynapi.c #line
	for debugging only

	in_json: delete dead exporter code
	We will need FIELD_TV and more strings later, for the other
	sections. Maybe even VECTOR and REPEAT.

	in_json: set obj->fixedtype
	via linear search in objects.inc,
	not in CLASSES. CLASSES only have the real dynamic type,
	not our fixed enum.

	in_json: add unknown bits (binary)

	json: add unknown bits (binary)

	fix bits_test
	make it fail,
	adjust offsets

2020-01-27  Reini Urban  <rurban@cpan.org>

	dynapi: fix dwg_dynapi_fields_size
	add size for each struct.
	add helpers _find_entity and _find_subclass,
	add exported dwg_dynapi_entity_size() and dwg_dynapi_subclass_size()

	fix dynapi_test for test_sizes (just cygwin got it right)
	TODO one missing PROXY_LWPOLYLINE size/fields entry in dynapi.

2020-01-27  Reini Urban  <rurban@cpan.org>

	in_json: start handling inlined MULTILEADER structs
	and unions. TODO: add the keys with . to the dynapi,
	like ctx.has_content_txt and ctx.content.txt.default_text
	See GH #194

	json: disable HANDLES section
	it is not really the HANDLES section omap, which
	would be relative in both. And it is not needed
	to encode, it is created only from the objects[] there

2020-01-26  Reini Urban  <rurban@cpan.org>

	dynapi: test sizes
	if the sum of all fields equals the builtin sizeof(struct)

	dynapi: fix dwg_dynapi_fields_size
	for something like VERTEX_PFACE (VERTEX_3D alias)

	dynapi: fix DIMASSOC_ref => DIMASSOC_Ref
	find the subclass

	json: fix _names, like _3DFACE
	strip the _ prefix then. These names are not exported,
	the dynapi accepts only names without

	json: fix duplicate object key with classes
	on dwg_json_variable_type success don't jump to invalid_type:,
	adding all object keys again.

	in_json: fix json_advance_unknown
	for objects and arrays. Improve duplicate objetc/entity check,
	e.g. DICTIONARYDFLT with mult. object, index, ...
	Handles this out_json bug correctly.

	dynapi: add union support
	add recursive out_declarator(),
	for MLINESTYLE_liine.lt.{index,ltype}
	Closes #194

	in_json: enable _obj->size
	skip obj->size if already done. and other
	similar fields.
	Fixes WIPEOUT.size

	in_json: improve FILEHEADER
	add HANDLES, but ignored. encode creates a new omap on the fly.
	TODO lt.index is not in dynapi, and a wrong field name

	json: improve color fields
	CMC can be index alone with <r2004, not an OBJECT {}.
	use field_cmc for common entity->color also, to
	fix unknown color.flag in out_json. either index alone or object.

	in_json: support BINARY strings (dxf 310)
	and add more, faster json type checks

	out_json: fixup fields for nested struct paths
	only print the field name, not the full path with "[rcount1]." included.
	Needed for in_json

2020-01-26  Reini Urban  <rurban@cpan.org>

	api: change Dwg_SPLINE_point* to BITCODE_3DPOINT*
	Use an ordinary 3DPOINT vector fit_pts, without parent.
	We use that type for LEADER.points also.

	The problem appeared in in_json

2020-01-26  Reini Urban  <rurban@cpan.org>

	in_json: fix array of subclasses
	Add entity types: BT, 2RD*, BD*

2020-01-26  Reini Urban  <rurban@cpan.org>

	dynapi: add dwg_dynapi_field_set_value()
	set field value in arbitray struct, if entity, object, common or subclass.
	Needed for in_json, the very generic way.

	api: const some handle api args.
	in_json:
	  add _set_struct_field() using dwg_dynapi_field_set_value()
	    recursively (for subclasses).
	    use it for all kind of structs.
	  add missing obj->parent dwg's

2020-01-26  Reini Urban  <rurban@cpan.org>

	dynapi: add internal dwg_dynapi_subclass_name
	to get the subclass name from the f->type. To get the size of the
	struct

	in_json: more OBJECTS: arrays H*,TV*,...
	fixup cfields (common overwriting specific fields)

	api: protect from empty obj->parent or objid
	with in_json even the first BLOCK_HEADER objid = 0 will be used
	with the dynapi to set the ownerhandle, ...
	Allow objid 0 there.

	in_json: add OBJECTS, and dwg_dynapi_fields_size()
	to avoid the objects.inc linear search. We just need to dynamic
	size to allocate the object-specific _obj, no static typing needed.
	Much simpler than in the DXF importer.

	in_json: parse POINTS, CLASSES

	in_json: parse TIMEBLL, CMC, HANDLE types

	in_json: start working on it
	parents not needed. only different from i-1 for primitives
	(keys, array members).

2020-01-26  Reini Urban  <rurban@cpan.org>

	Update jsmn: modernized
	no jsmn.c anymore, just a single header.

	tune the importer for the new jsmn header,
	esp. use JSMN_STATIC. we only need it once, in in_json.c

2020-01-26  Reini Urban  <rurban@cpan.org>

	add in_json with MIT jsmn WIP
	as a submodule

2020-01-18  Reini Urban  <rurban@cpan.org>

	preR13: fix logical PREP_TABLE error
	always returned an error, missing braces (Ouch)

2020-01-18  Reini Urban  <rurban@cpan.org>

	fix leak in 2nd HANDLE loops
	e.g. MLINESTYLE.lines or LEADER.arrowheads.
	On FREE don't free the array after the first loop,
	otherwise we cannot free the handles from the 2nd
	handlestream loop later.

	Closes GH #191. Only preR13 leaks in fuzzed DWG's remaining,
	all other fuzzed test DWG's (>1000) don't leak on decode anymore.

2020-01-18  Reini Urban  <rurban@cpan.org>

	fix XRECORD.objid_handles leak
	on num_objid_handles == 0.
	See GH #161

	free: fix minimal encoded HEADER.HANDSEED leak
	See GH #191

2020-01-17  Reini Urban  <rurban@cpan.org>

	free all NULL handles
	just not with INDXF.
	Fixes more handleref leaks, see GH #191

	free: fix DICTIONARYWDFLT.texts[] leak
	on overflow errors.
	don't reset numitems to 0 in the 2nd VECTOR using the same
	numitems. We still need to free the first VECTOR_T.
	This was already fixed for DICTIONARY.texts[]
	See GH #191

	free: fix entity 2007+ color.handle leak
	See GH #191

	free: fix entity color.*name leaks
	fixup flags, so that the mask matches.
	See GH #191

	decode: fix 2007 class section leak
	on error Invalid max class number.
	See GH #191

	MLINE: fix leaks with invalid num_* fields
	FIELD_VECTOR overflows apparently dont free all fields
	See GH #191

	free: fix MLINESTYLE color leaks
	esp. wrongly allocated names.
	See GH #191

	spec: change RC NUM_* to RCu
	no hex logging for num_ fields

	free: fix UNKNOWN_OBJ leak on ERROR: Wrong TABLECONTENT.type
	for obj != TABLE. Some dxfname mixup should not be fatal
	for free. Check the types.
	See GH #191

	decode: fix 2007 system page leaks
	on ERROR: Invalid section->pages[0].*size and similar early aborts.
	See GH #191

	remove .gitlab-ci.yml
	it is not free, you have to find a runner by yourself.
	(or use some limited Google Cloud runner)
	The gnu gitlab instance recently started to annoy with CI errors,
	because there was no runner configured

	decode: fix 2007 data_page leak on errors
	On the OUTOFMEM decode_rs() error.
	See GH #191

	decode: fix EED leaks on ERROR No EED[%d].handle
	See GH #191

	decode: fix class leak with Invalid max class number
	See GH #191

2020-01-17  Reini Urban  <rurban@cpan.org>

	decode: skip EED parsing on illegal bitsize
	Also fail early on invalid owner handles (not 0.x.x).
	TODO: We might try to reconstruct the handle (previous plus one, with known
	handleoffset) and search for it, to re-align the lost position.

	It's next to impossible that with an illegal size/bitsize, EED can be parsed
	correctly, which is then subsequently leaked.  Try at least the other Common
	EED Handles then.
	Fixes fuzzed dwgrewrite leaks of EED.
	See GH #191

2020-01-17  Reini Urban  <rurban@cpan.org>

	fix FUNDING.yml format for patreon

	Create github FUNDING.yml

	logs-all.sh: larger timeout for test-big

2020-01-16  Reini Urban  <rurban@cpan.org>

	README: list more supported optional tools

	decode: section info types and formats

	decode: protect overlarge section sizes
	> 2GB. Fixes crashes7, id 1
	Also protect the right side of dat->chain and decomp.
	Fixes the remaining GH #188 case, id 168.

	indxf: more NULL ptr protections
	and illegal MLINE asserts.
	Closes GH #189 and GH #190

	dynapi: allow setting NULL ptr
	to a string.
	Fixes case null_pointer29 of GH #189

	indxf: protect from uninitialized object
	undo NEW_OBJECT when unknown.
	Fixes null_pointer25 of GH #189

	indxf: protect from invalid DXF 0 null (EOF and ENDSEC checks)
	Fixes 16 GH #189 cases

	indxf: fix 3x NULL pair SEGV
	Fixes GH #186, and 2 cases of GH #189

	decode: re-add one more sections check
	Fixing id 31 of GH #188.
	check for NULL sections (Template), and info->size overflow

	decode: fix section size check for TEMPLATE 0 bug
	with Teigha.
	Fixes e.g. 2004/dbcolor.dwg

2020-01-16  Reini Urban  <rurban@cpan.org>

	decode: fix uncompressed section overflow
	for the last block, the size may be smaller. only read this then.

	Fixes all but 2 id's of GH #188: id's: 6,15,31,91

2020-01-16  Reini Urban  <rurban@cpan.org>

	decode: check section sizes
	skip section on outofbounds sizes: max_decomp_size (block size) > 0x8000
	or impossible overall size. Also, with mult. blocks the size
	must exceed the size of the first block.

	in case of errors calc the true sec_dat->size to avoid heap overflows.

	Fixes id's 0,4,8,9,16,34,36,46,171,203 of GH #188

2020-01-16  Reini Urban  <rurban@cpan.org>

	dwgbmp: protect against BMP size overflow
	do the same dwgbmp checks as in decode.
	"Invalid thumbnail data" on overflow.
	Fixes Case 2, id 203 of GH #188

2020-01-15  Reini Urban  <rurban@cpan.org>

	strings: add FIELD_T conversion tests, NEWS
	Closes GH #185

	indxf: ditto from_version and TU conversions

2020-01-15  Reini Urban  <rurban@cpan.org>

	encode: add bit_write_T, clarify from_version <=> version
	do the necessary up and down conversions TF <=> TU.

	reading always stores in the from_version format,
	writing always writes in the version format.
	but reading does not seperate the both yet, only
	when writing dat->version/dwg->header.version is set.

	This e.g. fixes reading EED wstrings from
	-EED[0] code: 0 [RC], wstring: len=24 [RS] "䄀挀䐀戀匀愀瘀攀搀䈀礀伀戀樀攀挀琀嘀攀爀猀椀漀渀" [TU]
	+EED[0] code: 0 [RC], wstring: len=24 [RS] "AcDbSavedByObjectVersion" [TU]

	and all the dwgrewrite to r2000 strings.

2020-01-14  Reini Urban  <rurban@cpan.org>

	silence wrong -Wuninitialized
	with older compilers.

	fix test/unit-testing/hash_test leak

	indxf: more NULL pair protections
	Fixes GH #186

	json: fix NULL deref of obj->dxfname

	json_cquote: fix Invalid characters in \uXXXX escape
	add a hex helper and fix a off-by-one bug, resulting
	in \u000:

	add json helper analog to dxf,dwg,log

2020-01-13  Reini Urban  <rurban@cpan.org>

	add make regen-dynapi target
	and remove the automatic dynapi generation,
	which was problematic with git and dwg.h updates.
	See GH #184

	json: fix cquoting for text vectors
	and convert \U+xxxx to \uxxxx notation. E.g. with ASCII
	strings (<r2007) storing unicode chars

	json: stabilize json output
	esp. for unknown/invalid objects

	decode: improve empty sections checks

	json: add sections

	improve RevHistory.spec, add section sizes
	guess some RevHistory field names.

	read_R2004_section_info: fixup Teigha TEMPLATE.num_sections: 0
	to 1, a Teigha bug.
	Also fixup the section size to info->size, the actual size. not max_decomp_size

	api: rename AppInfo.unknown_rl to num_strings
	and add a few example values

	fixup mandatory Template section
	Teigha 4.3.2 saved 2018/PolyLine3D.dwg does not have this section,
	so relax the error level. Just report it.

	fixup read_2004_compressed_section overflow check
	For 2018/PolyLine3D.dwg from Teigha 4.3.2

2020-01-13  Reini Urban  <rurban@cpan.org>

	api: add dwg_obj_layer_set_name
	And add type checks.
	For all other objects this kind of API is deprecated, hmm.
	We should really use the dynapi for this.

	Closes GH #74

2020-01-13  Reini Urban  <rurban@cpan.org>

	document section changes in NEWS

	read_2004_compressed_section: adjust for empty sections
	Add a seperate writer index j for the info->size chunks being written.
	Fix the uncompressed write overflow check.
	Fixes GH #183 (fuzzed)

2020-01-12  Reini Urban  <rurban@cpan.org>

	add template and objfreespace sections
	template is the 2000 MEASUREMENT section (maybe rename the old one),

	free the new sections
	no new decode leaks

	decode: fix read_2004_compressed_section overflow
	with uncompressed pages, for the rest of the last page.
	don't overwrite the next malloc via memcpy.
	e.g. DS_Libereco_R2004.dwg for AcDb::AppInfo[1]

	decode: improve 2004 section type search
	add fixedtype, the static enum DWG_SECTION_TYPE
	as resolved by name to search for. Not the type id as
	read from. Helps in searching dynamic types, such as FILEDEPLIST
	or APPINFO which types do vary

	decode: set all section->type
	for all 2004-style sections

	api: rename dwg_section_type to dwg_section_wtype
	have seperate functions for char* and wchar*, later
	needed for 2004 decode to search for dynamic types from name
	as with 2007. to get rid of our section_*_type hack.

	decode: add unknown RevHistory, AppInfoHistory sections

	decode: add unknown VBAProject section

2020-01-12  Reini Urban  <rurban@cpan.org>

	decode AppInfo, FileDepList, Security sections, T16, T32 types
	Add T16/TU16, T32 string types (different length encoding)
	TODO encode, free.
	Maybe use an array for the variable types.

	The Security section is yet untested.

	dwg.h: re-sort Dwg_Data, most used first

2020-01-10  Reini Urban  <rurban@cpan.org>

	Release 0.10.1
	de/encode: protect more class overflows and NULL
	reset num_classes with r2007. check NULL dwg.
	check NULL dwg->classes.
	found via fuzzing

	remove outdated dejagnu deps
	we dont depend on it anymore for some time already

	cirrus: add p5-Convert-Binary-C

	switch cirrus to freebsd-12-1-snap
	See https://cirrus-ci.org/guide/FreeBSD/
	They are using Google Cloud Compute images:
	13-0-snap, 12-1-snap (stable), 12-1 (release)
	12-0, 11-3-snap and 11-3. Not our old image anymore,
	hence the python problems

	switch cirrus to py37
	py36-libxml2 does not exist anymore

	dwg2SVG: protect from wrong style
	id's 144 and 109 of GH #182
	Closes GH #182

	htmslescape: fix off-by-one and overflow
	ditto.
	Fixes GH #182

	htmlescape: fix off-by-one and overflow
	need \0 termination to do strcat.
	don't skip the very first char.
	Fixes GH #182

	dwg2SVG: skip nan values

	dwg2SVG: skip NULL text_value
	Fixes Case 1 of GH #182

2020-01-09  Reini Urban  <rurban@cpan.org>

	add reedsolomon.h
	we will use it soon

	reedsolomon: missing config.h
	needed for HAVE_MALLOC_H

	consistent logging handlers, no fprintf, stderr in the lib
	library users want to catch fprintf and/or stderr.
	Closes GH #181

	indxf: silence clang -Wdouble-promotion
	use (double)NAN, as it's apparently only float there,
	__builtin_nanf().

	decode eed: accept raw with unknown codes
	For dwgrewrite passes it through, and let data be empty.
	And fixes a EED raw leak with such unknown codes.

2020-01-08  Reini Urban  <rurban@cpan.org>

	dwgrewrite: fix leaks on early errors

2020-01-08  Reini Urban  <rurban@cpan.org>

	Release 0.10
	Major bugfixes:
	  * Improved building the perl5 binding, proper dependencies.
	    Set proper -I and -L paths, create LibreDWG.c not swig_perl.c
	  * Harmonized INDXFB with INDXF, removed extra src/in_dxfb.c (#134).
	    Slimmed the .so size by 260Kb. Still untested though.
	  * Fixed encoding of added r2000 AUXHEADER address (broken since 0.9)
	  * Fixed EED encoding from dwgrewrite (a dxf2dwg regression from 0.9) (#180)
	See NEWS and ChangeLog

        decode: protect xdata overflows
        reset the lengths when stopped reading invalig xdata,
        which would overflow later.

	api: rename BLOCK_HEADER.preview_data to preview
	analog to the entities. In the headers called PreviewIcon.

	encode: fix LOG_TF crash on null field

	encode: fix EED writing
	which was broken with indxf. don't write raw
	plus data (from the next indices), when a previous
	raw already covered it.
	Fixes GH #180

2020-01-07  Reini Urban  <rurban@cpan.org>

	encode: enable TF logging
	-v3 or -v5

	decode: disable -v5 object_map printing
	printing the whole object for the handle (again) makes no sense.
	maybe later print the object name of the handle

	encode: eed entity formatting logging

	fix endless loop in 2004 decompression
	on dat overflow.
	This fixes all remaining fuzzed dwgrewrite hangs

	indxf: fix endless MULTILEADER loop
	with unknown DXF groups.
	This fixes all fuzzed indxf hangs.

	decode: fix a -Wsign-compare
	and some -Wformat

	protect strncpy from truncation
	without ending \0

	fix TIMEOUT_30 duplicate
	remove the automake hack

	decode: fix bytes_left calc. in decompress_R2004_section
	and add various counterchecks. missed the final lit_length

2020-01-07  Reini Urban  <rurban@cpan.org>

	hangs: protect from overlarge mallocs
	when using user-provided section sizes.
	max_decomp_size, decomp_data_size, ... max ~790Mb per compressed section

	Fixes a few fuzzer hangs.

2020-01-07  Reini Urban  <rurban@cpan.org>

	indxf: add only full classes
	with all names and mandatory DXF fields

2020-01-06  Reini Urban  <rurban@cpan.org>

	dwg: enhance the dxf2dwg timeout to 30
	larger DXF need longer

	indxf: skip setting buffers twice,
	with the exception of 310 previews, as in PROXY_ENTITY
	and Surfaces.

	indxf: avoid hang when reading illegal numbers
	advance the ptr before erroring out

	indxf: fix CLASSES hang
	2 CLASSES must be followed by 0 CLASS, else
	it might realloc constantly, leading to DOS/hang.

	faster aligned bit_read_fixed, bit_write_TF
	when aligned use memcpy, esp. for large data blocks

	indxf: fix double entity.preview write
	which would corrupt the previous preview, not matching
	the preview_size. we dont append, we rather ERROR

	protect bit_utf8_to_TU from invalid UTF-8
	count len, not to overflow the utf8 string.
	e.g. "4è^C"

	indxf: stabilize adding BLOCK_CONTROL.entries
	fuzzed DXF could lead to heap overflows (wrong i)

	indxf: protect SUMMARY header fields
	by checking NULL and the code 1

2020-01-06  Reini Urban  <rurban@cpan.org>

	indxf: fix invalid free of static obj->dxfname
	when dxfname came from dwg_encode_get_class() ->
	dxf_encode_alias() returning a static string.

	This should fix all the remaining fuzzing crashes. (for now)

2020-01-06  Reini Urban  <rurban@cpan.org>

	decode_r2007: protect from section overflow
	when reading invalid section pages

	decode: protect from empty dat sections r2007+
	e.g. wrong summaryinfo, objects or handles.
	some of these dont return a critical error

	protect xdata overflows
	in encode and decode. proper error handling, esp. with fuzzed wrong data.

	Update docs for 2020

	encode: add LOG_INSANE_TF EED logging
	still broken. GH #180

	Bump Copyright years to 2020
	of all changed files so far, with more than a few lines

	encode: add LOG_TF from decode
	fixes xdata[] binary logging

2020-01-06  Reini Urban  <rurban@cpan.org>

	Add AFL_COMPILER persistent llvm_mode support to dwgrewrite
	Instrument overly long functions as such.
	Support persistent llvm_mode, via afl-clang-fast for dwgrewrite.

	export AFL_PATH=/usr/local/lib/afl
	PERL=cperl5.30.0-nt \
	CC="afl-clang-fast" \
	CFLAGS="-O2 -g -fsanitize=address,undefined -fno-omit-frame-pointer" \
	    ../configure --disable-shared --disable-dxf --disable-bindings

	export ASAN_OPTIONS="abort_on_error=1:detect_leaks=0:symbolize=0:allocator_may_return_null=1"

	AFL_USE_ASAN=1 make -j4 -s -C src
	AFL_USE_ASAN=1 make -j4 -s -C programs dwgrewrite

	AFL_SKIP_CPUFREQ=1 afl-fuzz $@ -m none -i ../.fuzz-in -o .fuzz-out programs/dwgrewrite -v0 @@ /dev/null

2020-01-06  Reini Urban  <rurban@cpan.org>

	decode: eed logging
	searching EED leaks with fuzzed DWGs.
	let the last invalid EED[idx] leak in this case

	init bit_read_TF
	when bit_read_fixed failed earlier with overflows,
	set the bits to 0. valgrind with fuzzing

2020-01-06  Reini Urban  <rurban@cpan.org>

	api: add int *isnew param to all dynapi _utf8text functions
	we really need to know exactly if the returned string is freshly
	malloced (from a r2007+ wide string), or the original string,
	which may NOT be freed.

	Fixes the remaining fuzzing double-free's, where the dwg/obj
	version or string TF type might disagree. Tried hard to avoid this.

2020-01-06  Reini Urban  <rurban@cpan.org>

	dwg_find_dictionary: add NULL ptr protections

	indxf: add xcalloc, exit on Out of Memory

	indxf: protect invalid double DOS
	advance endptr, with nums like 28ABC....

	indxf: protect invalid DIMASSOC_Ref index

	indxf: protect DIMSTYLE_CONTROL.morehandles[j]
	gracefully

	fixup check bytes_left for decompress_R2004_section 32bit
	the overflow check does not work with 32bit, only 64.
	Fixes up 80d17da65507ca1242c48ffe3b31afa48a0859aa

2020-01-05  Reini Urban  <rurban@cpan.org>

	Update NEWS

	dxf_read_file: properly end DXF
	with a final \n and \0 for libc strtol/strtod readers,
	to avoid internal errors on truncated files we cannot avoid.

	indxf: more truncated DXF protections
	but not exhaustive. We really need to add a final \n to the read chain

	indxf: stricter MLEADER subclasses
	On unknown DXF code break the loop, and continue
	with the main MLEADER loop. Add a few more array index asserts.
	Fixes a few fuzzing cases.

	indxf: protect from MLEADER blk/txt mixup
	a union

2020-01-04  Reini Urban  <rurban@cpan.org>

	indxf: fix truncated dxf
	gracefully end on EOF or invalid ctrl object.
	prevent indxf buf and most dat overflows.

	indxf: fix double-free of BLOCK_HEADER.*Model_Space
	when reusing it. Check if not already done before

	fix dwgrewrite for preR13 with VPORT_ENTITY table
	yet unsupported, dont add its num_objects to the table.

	auxheader: protect from NULL HEADER.HANDSEED
	usually with encode

	encode: protect from NULL obj->parent
	when erroring out early

	decode_r2007: add decode_rs src overflow check
	add the size of the src, to overvoid reading past it.
	and use the actual computed src_size args, not the user-provided ones.

	improve r2007 copy_compressed_bytes check
	check for overflows before the loop. better than
	c893d847716aa6d64c2ff25834c80b43c4806f9b

	check bytes_left for decompress_R2004_section
	Fixes heap overflows with fuzzed section values

	fix bit_read_fixed overflow

	fix bit_search_sentinel overflow
	with empty dat chain

	indxf: add_SPLINE cosmetics

	indxf: set WIPEOUT.clip_verts[]
	num_clip_verts got reset every pair

	indxf: dxf sources are always utf8
	for dynapi. without is_utf we assume the source is already TU.
	no changes <r2007.

	indxf: convert *Model_Space name to TU earlier
	when $ACADVER is read.

	more dwg_find_tablehandle protections
	and some cosmetics.
	analyzing a r2007 *Model_Space use-after-free
	where BLOCK_HEADER.name stays the initial <r2007, due
	to DXF errors.

	indxf: protect from some NULL _obj->name
	Fixes a few fuzzing cases

	encode: fix 2NDHEADER address
	needs to be recomputed, even with dwgrewrite.
	Fixes section[3] address or size overflow with r2000 DWGs

	encode: detect section address or size overflow
	already in encode, not just later in decode.
	i.e. only with r2000 DWGs

	encode: always set 2ndheader section addresses
	even with dwgrewrite.

	dwgrewrite: fix filename_out leaks
	use a var when suffix is used.

	dxf2dwg, dwg2dxf: allow /dev/null sinks

	dwg_write_file: allow /dev/null sink

2020-01-03  Reini Urban  <rurban@cpan.org>

	indxf: fix TABLESTYLE rowstyles init

	indxf: more NULL pair protections

	dwg2svg2: protect from empty BLOCK_HEADERs
	name is not really needed

	add r2007 Page out of bounds check
	Fixes case 1 of GH #179

	fix bit_search_sentinel out of range check
	off by 16, the sentinel length. Fixes case 2 of GH #179

	fix read_R2004_section_info out of range check
	forgot 32. Fixes case 3 of GH #179

	protect r2007 section.num_pages overflow
	skip section when >0xf0000. Fixes case 4 if GH #179

	protect r2007 decode compression length
	length is a user value, add src_end. Fixes GH #179, case 5

	Fix NULL ptr deref in get_next_owned_entity
	Fixes case 6 in GH #179

	dwg2svg2: fail on NULL _hdr
	Fixes GH #179, id:000026 (case 7)

	dwg: add missing dynapi.h
	code added with 0.9,
	commit 359502ac86b389b248a9080c9ba8462aff1058ee
	relevant only for --disable-dxf

	indxf: more NULL pair protections

2020-01-03  Reini Urban  <rurban@cpan.org>

	api: move 2 DIMENSION handles to DIMENSION_COMMON
	with in_dxf when changing the type this would change the
	offset of DIMENSION.block and DIMENSION.dimstyle, leading
	to invalid pointers. found via fuzzing, fixes 3 cases.

	TODO: block has still DXF code 0, maybe indxf read DXF 2 into that.
	Need a testcase for that.

2020-01-03  Reini Urban  <rurban@cpan.org>

	encode: add OVERFLOW_NULL_CHECK_LV
	to check the ptr before loops

2020-01-03  Reini Urban  <rurban@cpan.org>

	indxf: skip creating empty invalid objects
	rather dont create them than leaving them without type or name.
	not unknown, but DWG_TYPE_UNUSED.
	We dont want to check all object[i] loops.

	Reverts the previous commit for a fuzzing testcase.

2020-01-03  Reini Urban  <rurban@cpan.org>

	dwg_find_table_control: protect from NULL object.name
	which might happen somehow via fuzzing.

	indxf: LEADER.points array protections
	with asserts

	indxf: replace IMAGE.clip_verts asserts
	with graceful logic. Actually failed in the good tests,
	not just with fuzzing

	indxf: IMAGE.clip_verts array protections
	with asserts

	indxf: add_HATCH array protections
	with asserts

	indxf: add_SPLINE array protections
	but here do it gracefully, no asserts

	indxf: more eed point protections

	indxf: add new_LWPOLYLINE asserts
	on illegal array accesses. Here we rather abort.

	indxf: NULL pair protections in new_LWPOLYLINE
	fixes a few fuzzing cases

	fix bit_write_CRC* overflows
	analog to read, fixes some fuzzing cases

	dwg2dxf: fix leaks on section overflow error

2020-01-02  Reini Urban  <rurban@cpan.org>

	indxf: protect eed points with wrong codes
	found via fuzzing

	indxf: some more ptr protections

	fix strange dwg_class_is_entity miscompilation
	where it returned wrong results.
	(comparing a short field with an const int, without zeroing the previous short)
	Add various measures.

	indxf: fix postprocess_SEQEND use-after-free
	the owner handles are used, they are not copied.

2020-01-02  Reini Urban  <rurban@cpan.org>

	fix write-as leaks
	In free check from_version in the spec, not
	the version we were last using (writing to).

	Fixes most dwgrewrite leaks, just one eed leak remaining,
	from the 2nd r2000 read.

2020-01-02  Reini Urban  <rurban@cpan.org>

	bits: avoid uninitialized reads on bit realloc
	in bit_calc_CRC

	encode: Fix -Wpointer-bool-conversion
	address of data->u.eed_0.string is always true

	encode: fix Too many sections
	when down-converting from r2004+ to r2000, with
	typically 10-30 num_sections.

	enable dwgrewrite with --disable-dxf
	for fuzzing

	api: Add LIBREDWG_VERSION et al to include/dwg.h

	api: renamed CLASS.wasazombie to is_zombie
	i.e. was_proxy, or class not loaded

	indxf: is_entity logging for CLASS 281

	adjust dynapi_test for LAYER_INDEX
	layer_entries was renamed with e3374397f386fd1b38b8d732a6ef601ddf7ec592
	(0.9) and then later again.

	adjust dynapi_test for SORTENTSTABLE
	sort_handles was renamed with e3374397f386fd1b38b8d732a6ef601ddf7ec592
	(0.9)

	dynapi: add nan checks TODO

	add DEBUGGING_CLASS_CPP
	and use it for TABLECONTENT.
	This is more stable than CLASS_DXF in cases when
	TABLE is mixed up with TABLECONTENT. See e.g.
	GH #178, where it fixes the heap_overflow2 case.

	prepare 0.10 NEWS

2020-01-01  Reini Urban  <rurban@cpan.org>

	decode ERROR cosmetics

	api: remove DWG_SUPERTYPE_UNKNOWN fully
	we now have only entity or object, unknown_bits
	are parts of these.

	xmlsuite: proper add_helix

	indxf: fix num_entries/i underflow
	for the i = -1 case. (Fuzzing)

	free: fix invalid dwg_free_LAYOUT

	dynapi: remove UNKNOWN tests
	as the obj->name does not fit the fixedtype anymore
	for partially handled classes, like TABLE or ARC_DIMENSION

2019-12-31  Reini Urban  <rurban@cpan.org>

	cleanup tio.unknown
	not needed anymore, we only have UNKNOWN_OBJ or UNKNOWN_ENT with full common
	entity_data.
	Fixes GH #178 heap_overflow2

	encode: object.size overflow
	decode fails when it overflows, but encode does not
	know its final dat->size, so introduce a sensible limit.
	Fixes the dos testcase of GH #178

	decode: protect from preR13 section size overflow
	More fuzzing testcase in GH #176 with some broken
	sections

	decode: protect from section size/address overflow
	There is one fuzzing testcase in GH #176 with some broken
	sections

	dwg_free_object: avoid uninitialized is_entity warning
	even if logically impossible.

	encode: protect dwg_encode_eed_data overflows

	encode: protect NULL eed string

	indxf: more NULL ptr protections
	fixes more fuzzer testcases

	free: protect freeing obj->dxfname
	dont set INDXF when HANDSEED is missing.
	e.g. GH #178 null_pointer2 testcase

	indxf: fix rootcause for prev. commit
	Fail on duplicate CLASS groups, i.e. when O CLASS is replaced
	by 2 CLASS.

	free: fail on Wrong DATATABLE.type 529
	for obj [index]: != MULTILEADER.
	wrong class, maybe a dwg_encode_get_class() failure.
	Fixes several fuzzing crashes.

	encode: fix empty FIELD_2DD_VECTOR
	Fixes GH #178 null_pointer1 case

	encode: protect from stack under-flow
	From GH #178 fuzzing

	encode: protect some NULL pointers
	Fixes some GH #178 fuzzing

2019-12-30  Reini Urban  <rurban@cpan.org>

	indxf: fix r2007+ dwg_find_tablehandle() leaks
	dwg_find_tablehandle searches by name, dwg_dynapi_entity_utf8text creates
	fresh utf8 names, which were not freed.

	This fixed now most of the indxf leaks, GH #151

2019-12-30  Reini Urban  <rurban@cpan.org>

	free: fix more indxf leaks
	the underlying cause is that indxf already adds
	DEBUGGING classes, for which no dwg_free_OBJECT code exists.
	i.e. TABLE.preview (common entity data), or TABLE colors.
	Let dwg_free_UNKNOWN_ENT handle that and leak the rest

	classes.inc: formatting only

2019-12-30  Reini Urban  <rurban@cpan.org>

	fixup indxf, wrong NULL pair check
	at dwg_read_dxf the initial pair is NULL,
	so empty DWGs were produced.

	also harmonize dat opts with dwg opts

2019-12-30  Reini Urban  <rurban@cpan.org>

	programs leaks comments

	indxf: fix name "*Model_Space" free
	must not be constant. broken with
	27a4380702667391668d4693ea7bdfdc9cf823c7

	indxf: more pair NULL protections
	found via fuzzing

	indxf: protect types in dxf_blocks_read
	when reading mspace or pspace BLOCK's, its owners are
	not a BLOCK_HEADER, but BLOCK_CONTROL.
	Found via fuzzing

2019-12-29  Reini Urban  <rurban@cpan.org>

	more free indxf fuzzing fixes
	skip color names, not assigned yet, and failing.
	only free unknown if type is UNKNOWN, otherwise
	it will free illegal reactors, ...

	indxf: protect NULL pair
	this time in dxf_classes_read. Fixes some fuzzer cases

	in_dxf: improve new_object speed by 2x
	make ADD_OBJECT/ADD_ENTITY linear search 2x faster, by aborting
	on found.

	improve dwg_encode_get_class
	require more than one invalid klass->dxfname to switch
	over to search by index, and never do it with indxf, because
	there we do have the proper name already, and we just need the dynamic type

	Fix off-by-one class indices

	encode: protect from NULL klass->dxfname
	only relevant with fuzzed dxf data.

	rm .build-asan/dxf-check
	accidently added

	decode, dwg.h: add more restrict

2019-12-29  Reini Urban  <rurban@cpan.org>

	indxf: protect NULL pair
	in dxf_header_read on overflowed values.
	try a 2nd time then.

	Fixes ERROR: dxf_read_rs: RS overflow 860276 (at 314)
	ERROR: Invalid DXF group code: 8308
	Segmentation fault (core dumped)

2019-12-29  Reini Urban  <rurban@cpan.org>

	indxf: protect null-dereference in dxf_fixup_header
	found by fuzzing dxf2dwg

	define 2 pline api funcs for afl-fuzz
	needed by dwg2ps.

	fix outdxf cquote buffer-overflow
	stack or heap, detected by fuzzing. using for cquote 2*len+1 is enough,
	but also protect from stack-overflow in cquote and json_cquote.

	encode: add missing restrict

	dxf <=> dwg helper
	harmonize helpers, analog to log.
	log creates a dwgread log file.
	dxf should create a dxf from dwg,
	dwg should create a dwg from dxf.

	free: enable indxf VALUE_HANDLE logic
	actually set dat->opts to detect global HULL handles,
	which may not be double-freed

2019-12-29  Reini Urban  <rurban@cpan.org>

	alive.test: skip dxf2dwg leak test
	this helps under asan/lsan when custom ASAN_OPTIONS are set.

	writers do not hang anymore.

2019-12-29  Reini Urban  <rurban@cpan.org>

	indxf: clear realloced buffers
	avoid uninitialized data and pointers, esp. for free
	and valgrind.

	indxf move_out_BLOCK_CONTROL: fix for j>1
	when pspace is at entry 2 we need to avoid a classic heap-overflow

	XDICOBJHANDLE
	when add xdicobjhandle ref failed, set xdic_missing_flag

	dxf: support --force-free
	as dxf2dwg does. needed for leak debugging

	harmonize some ACIS ERROR newlines

	make: extract VALGRIND_OPTS for check-dwg-valgrind
	it is now overridable

	add LTEXEC for --enable-shared (the default)
	for some top test targets

	add dwg helper for dwg2dxf analog to dxf
	Maybe the name is a bit unfortunate, but it is only
	an internal helper

	free: omit Free object pointer
	so that all logs are diffable

	fix MULTILEADER.ctx.lline[] handles <r2010+
	unlike ODA I dont see them in the wild, only r2010+.
	the logs do make sense now.

	fix SummaryInfo leak
	when summaryinfo.spec fails in one field
	we forgot to restore dat (harmless), also to free
	the decomp chain. E.g. DS_libereco_R2010.dwg

	fix entity.ownerhandle leak
	the double-free from #43 was fixed with 38bc21c643451c2e31af0cc631cc7d651b310e54.
	ownerhandles are not really stored in the ref vector.

	outdxf: fix null-dereference in dxf_process_INSERT
	detected via dwg2dxf fuzzing

	*.spec formatting
	space after (
	but beware of gen-dynapi.c: no wrapping in REPEAT or FIELD

	common_entity_handle_data.spec formatting
	space after (

	fix eed leaks with UNKNOWN objects
	when the overflowed early.
	Found via fuzzing.

2019-12-29  Reini Urban  <rurban@cpan.org>

	Support SHAPE.style_id for DXF as name [2]
	renamed from SHAPE.shape_no (changed API).
	for out_dxf look up the name from the STYLE index,
	for in_dxf still ignored.

	BTW: We still don't have a testcase for SHAPE, but the afl
	fuzzer was nice to create a proper one to detect this case!

2019-12-29  Reini Urban  <rurban@cpan.org>

	free: fix VALUE_HANDLE for INDXF
	NULLIFY ref only if really freed. Fixes a few leaks and double-frees.

	make -C src .ic: keep a physical backup, not just in git

2019-12-28  Reini Urban  <rurban@cpan.org>

	free: fix the dxf pair leaks
	before each new_object.
	The INDXF obj->dxfname is heap allocated, the obj->name const.

	Biggest part of #151
	Now leftovers are mostly some dynamic dynapi strings and SPLINE callocs.

2019-12-28  Reini Urban  <rurban@cpan.org>

	free: more indxf leaks
	free pair on DXF_CHECK_EOF, DXF_RETURN_EOF. GH #151

	free: work on indxf leaks
	Keep the first BLOCK_HEADER name static, as all the others.
	See GH #151

	adjust gen-dynapi.pl line numbers +1 not -1

2019-12-27  Reini Urban  <rurban@cpan.org>

	dxf2dwg: add experimental --force-free option
	to be able to debug into dwg_free leaks, as found by
	valgrind

	outdxf: protect from NULL HATCH.boundary_handles
	found via fuzzing

	outdxf: fix some dxf_tables_write null-dereferences
	leading to fuzzing crashes

	outdxf: fix 1 dxf_classes_write null-dereferences
	leading to fuzzing crashes

	outdxf: fix 3 header null-dereferences
	leading to fuzzing crashes

	No -Wformat-truncation warnings anymore.
	Add an assert. The old code ran out of var-tracking size,
	but the assert now makes it clear.

	indxf: fix some nonnull warnings

	Fix some -Wunused-but-set-variable
	detected by clang-analyzer

	Avoid -Wformat-truncation, add RETURNS_NONNULL attribute
	mark dxf_format() and dxf_codepage() as __attribute__((returns_nonnull)),
	avoiding clang warnings warning: null format string [-Wformat-truncation=]
	       snprintf (buf, 255, _fmt, value);

	indxfb: fix dxf_read_rd
	copy pasta

	indxf: fix -Wformat with 32bit

2019-12-26  Reini Urban  <rurban@cpan.org>

	indxf: init MLEADER counts
	in REPEAT check num_vars before accessing the array,
	which might still be NULL. esp. with indxf

	indxf: fix DXF_*_EOF logic
	treat NULL pair as EOF, and return immediately

	indxf: support 3DSOLID.history_id
	and for all its children (AcDb3dSolid). r2007+

	indxf: fix color.alpha
	at least since r2007 alpha is seperately at 440

	indxf: dxf_read_pair() pair leak

	indxf: dxf_thumbnail_read pair leak

	indxf dxf_expect_code: use-after-free
	and -Wnull-dereference

	fix decomp leak in read_2004_compressed_section
	with empty sections

	fix preR13 PREP_TABLE memory leak

	fix dwg2dxf filename_out memory leak

	fix some dwg_api point memory leaks

	refactor perl5 bindings
	set proper -I and -L paths, create LibreDWG.c not swig_perl.c

	fix dwgwrite outfile memory leak

	fix 2 dwgrewrite filename_out memory leaks

	indxf: fix postprocess_SEQEND memory leak

	indxf new_object: -Wnull-dereference
	(the last one)

	indxf new_LWPOLYLINE: fix 91 vertexids type
	detected by scan-build

	in_dxf add_MULTILEADER_leaders: fix -Wnull-dereference

	Harmonize out_dxfb.c with out_dxf.c
	Fixes GH #173, esp. add the new mspace improvements.

	in_dxf add_MULTILEADER_lines: fix -Wnull-dereference

	dxf_header_read: add a strlen nonnull check

	dxf_tables_read: -Wnull-dereference

	abstract DWG_OPTS for dat->opts and dwg->opts
	use constants

2019-12-26  Reini Urban  <rurban@cpan.org>

	remove in_dxfb.c GH #134
	add some is_binary logic to in_dxf.c
	use dat->opts flag 0x20 for DXFB

	reduced size of the .so from 30521368 - 30260552 = 260816 byte.
	It should be a bit slower though, but many indxf funcs are now static,
	and there are no silly code duplicates anymore.

	Closes GH #134

2019-12-26  Reini Urban  <rurban@cpan.org>

	in_dxfb.c: merge with in_dxf.c
	add all the missing logic.

	See GH #134, we really wanted to avoid that code duplication.

2019-12-26  Reini Urban  <rurban@cpan.org>

	in_dxf: pair->value.s nonnull as version
	Argument with 'nonnull' attribute passed null

	in_dxf: STRADD pair->value.s nonnull
	Argument with 'nonnull' attribute passed null
	STRADD with NULL pair->value.s

	sec_dat.chain nonnull
	Argument with 'nonnull' attribute passed null
	Harmonize read_2004_section_preview with r2007 variant,
	sec_dat.chain could be NULL

	Type casting inconsistency #174
	Avoid overflows by casting to the larger type, zero-extended

2019-12-25  Reini Urban  <rurban@cpan.org>

	examples: add unknown.pi to EXTRA_DIST
	make unknown didnt work in checkouts with picat

	Makefile: refman-pdf is not a prime-target
	and does not work

2019-12-25  Reini Urban  <rurban@cpan.org>

	Release 0.9.3

2019-12-25  Reini Urban  <rurban@cpan.org>

	enable ax_restrict
	re-format docs: autoconf-archive is pretty strict
	gcc-9.2 on fedora has it fixed.

	enable it.  we do have several small inlined functions with loops on arrays,
	so it might affects us. See GH #141

2019-12-25  Reini Urban  <rurban@cpan.org>

	fix -Wcpp warning with AX_ADD_FORTIFY_SOURCE

	protect from invalid preR13 table numbers
	various int overflows. Fixes GH #176, case 8.

	add more preR13 error handling.
	Fixes the remaining GH #176 case 9

	more illegal preR13 protections
	and optional byte overflow counter to abort >200
	errors. Helpful in fuzzing, but not really useful for
	libs, the program must install a SIGABRT handler then.
	Fixes part of the remaining GH #176 case 9 (id:000024)

2019-12-24  Reini Urban  <rurban@cpan.org>

	fix REPEAT overflow check for <r2004
	earlier DWGs can also be broken to include wrong REPEAT counts.
	Fixes Case 3 of GH #176

	fix ref double-free on error
	Let the ref loop in dwg_free() free those refs.
	Fixes case 5 of GH #176.

	fix illegal SPLINE scenarios
	from fuzzed DWGs, See GH #176, case 1

2019-12-20  Reini Urban  <rurban@cpan.org>

	fix dwg_find_table_extname -Wnull-dereference

	use format(ms_printf) only on _WIN32
	silences a few warnings

	fix theoretical strncpy truncations
	gcc-9 warns too much to my taste.

2019-11-07  Reini Urban  <rurban@cpan.org>

	geom: fix transform_OCS
	normalized the wrong vector, ax => az typo,
	worked with random stack values.

	fix PROXY_ENTITY.ownerhandle leak
	found in example r13 DWGs

	extnames: add documentation
	Closes GH #167

	dwg_find_table_extname improved
	find more ACAD_XREC_ROUNDTRIP, not only at the first index.
	find the correct XRECORD via the xdic itemhandles[], no need to search
	the next or all XRECORDs

	extnames: only for r13-r14
	EXTNAMES do not exist since r2000. just ignore it
	and return the normal layer name

	extnames: abstract is_extnames_xrecord
	and xdata_string_match, which catches now
	linked xrecs, which are not EXTNAMES

	DICTIONARY.itemhandles always
	i.e. also for r13 and r14, where it is needed for XRECORD
	EXTNAMES

	implement dwg_find_table_extname
	See GH #167

2019-11-06  Reini Urban  <rurban@cpan.org>

	extnames: use dwg_find_table_extname
	to be implemented yet

	prepare dwglayers --extnames
	see GH #167

2019-11-05  Reini Urban  <rurban@cpan.org>

	fixup gen-dynapi.pl for HANDLE_VECTOR_N
	to generate the same docs (dxf 331)

2019-11-05  Reini Urban  <rurban@cpan.org>

	fix SORTENTSTABLE leak
	HANDLE_VECTOR does an overflow check, with resetting the
	num_ents field. Which does not free the sort_ents then anymore.

	Note that SORTENTSTABLE.ents can be empty in some dwgs. They are
	filled with NULLs then.

2019-11-05  Reini Urban  <rurban@cpan.org>

	fixup dwglayers, add asserts
	and flush each layer line. It can error during the loop.

	fix dwglayers
	on empty layer_control.entries.
	Closes GH #166, thanks to @fpmalard for the testcase

	fflush (stdout) before dwg_free
	on programs printing to stdout. They might fail there.
	See GH #166, thanks to @fpmalard.

2019-10-31  Reini Urban  <rurban@cpan.org>

	update TODO

2019-10-30  Reini Urban  <rurban@cpan.org>

	rm README-alpha
	already beta since 0.9

	more geom.h use
	use M_PI

	change extrusion types from 3DPOINT,3BD to BE

2019-10-30  Reini Urban  <rurban@cpan.org>

	dwg2SVG: add POLYLINE_2D and LWPOLYLINE
	basic lines only. no arcs (bulges), no other curve_types (spline, bezier)
	no widths.

	Closes GH #137

2019-10-30  Reini Urban  <rurban@cpan.org>

	fix geom normalize div by zero

	add programs/geom.c utilities
	for dwg2SVG and dwg2ps

	dwg2SVG: add transform_OCS
	See #165

	add OCS doc Closes #165

2019-10-29  Reini Urban  <rurban@cpan.org>

	add FIELD_BE logging to decode
	some .x values are flipped when extrusion.z is -1.0. see GH #165

	more fixup illegal bitsizes

	document codepage names

2019-10-28  Reini Urban  <rurban@cpan.org>

	set aligned_access_required on ubsan

	fail with illegal section_info num_desc2
	with a fuzzed dwg. cannot continue then

	fix bit_read_RC overflow
	found when fuzzing on 32bit.
	fixup illegal bitsize's.

2019-10-28  Reini Urban  <rurban@cpan.org>

	Release 0.9.1

	Implement ALIGNED_ACCESS_REQUIRED bit_convert_TU
	when the wstr pointer is unaligned. E.g. for ubsan

	check for ALIGNED_ACCESS_REQUIRED
	stricter risc machines, like sparc, alpha.
	but also settable for intel or with ubsan.

2019-10-27  Reini Urban  <rurban@cpan.org>

	fix r2007 Invalid section->pages[%d].*size
	via fuzzing. skip invalid sections. replace assert
	with proper error

	fix xdata hang
	on buf overflow. check for advance

	fix info->sections[0] NULL deref
	found by fuzzing

	fix xdata hangs
	error with wrong xdata types

	fix decode_R13_R2000 stack-overflow
	with too many sections (i.e. 8)

2019-10-26  Reini Urban  <rurban@cpan.org>

	fix VECTOR_CHKCOUNT overflow
	e.g. with num_owned = 2147483899 * unsigned, overflowing to a low int (512)

	fix divide by zero in VPORT.aspect_ratio

	fix ub in bit_reset_chain overflow
	ubsan runtime error: addition of unsigned offset to 0x00010a401800
	overflowed to 0x00010a4014c1, asan fuzzing.

	fix decode_3DSOLID VECTOR_CHKCOUNT
	where obj->nam may be realloced but not cleared, resulting
	in an invalid free

2019-10-25  Reini Urban  <rurban@cpan.org>

	fail with VALUEOUTOFBOUNDS ent num_reactors
	usually only found when fuzzing

	fix #162 decompression DOS
	check while loops for exhaustion.

	fix #163 header.section[SECTION_HEADER_R13].size - 34
	overflow, with empty size. Illegal fuzzed dwg only.

	fix #162 Null pointer dereference in check_POLYLINE_handles
	fuzzed DWG only, not a real one

2019-10-24  Reini Urban  <rurban@cpan.org>

	skip test with x86_64-mingw-w64 gcc-9.2.0 miscompilation
	in bit_read_H with val[i]: (%rbx) being dat+1.
	Previous compilers are fine.
	similar errors also in other packages.

	warn about this problem, to use an older working compiler.

2019-10-24  Reini Urban  <rurban@cpan.org>

	fix section[].size overflow
	Fixes GH #160

	fix Overflow section_array_size dos
	Only allow a certain amount of overflows, to repair it later.
	Fixes GH #161

	fix decode 2004 literal_length overflow
	Fixes GH #159.
	Check the initial literal_length also, not only in the loop

	fix Null pointer dereference in decode_R13_R2000 #158

	unit-testing: fix -Wunused-function warning
	ok is unused in dynapi_test.c

	probe for attribute format(ms_printf)

2019-10-23  Reini Urban  <rurban@cpan.org>

	decode: fix more leaks on DWG_ERR_VALUEOUTOFBOUNDS
	found by e.g. GH #156 fuzzing testcases, bailing out early
	on REPEAT_CHKCOUNT

	decode: fix thumbnail sentinel mismatch leak
	detected by GH #156

	bits_test: fix Conditional jump or move depends on uninitialised value
	bitchain.opts was left uninitialized on the stack, needed for LOG_TRACE

	probe for attribute format(gnu_printf)

	bits_test: more leaks
	all now

	bits_test: fix leaks

	fix bit_read_4BITS
	off-by-one for the first bit.
	Only detected by mingw-w64-x86_64

2019-10-22  Reini Urban  <rurban@cpan.org>

	fix win32 multiple definition of `dwg_version_type
	in test/unit-testing/decode_test

	add dwg_version_type()
	a printable release version string

	_FORTIFY_SOURCE: and add -fstack-protector
	on mingw32-w64 for broken _FORTIFY_SOURCE.
	This adds -lssp (needed for _FORTIFY_SOURCE)
	and is useful in its own acount.

2019-10-19  Reini Urban  <rurban@cpan.org>

	fixup prev. ax_add_fortify_source
	[] needs to be quoted. use something else.

2019-10-19  Reini Urban  <rurban@cpan.org>

	fix AX_ADD_FORTIFY_SOURCE for msys2
	msys2 bug with headers-git-7.0.0.5546.d200317d-1
	either add -fstack-protector for -lssp to be added,
	or omit adding -D_FORTIFY_SOURCE=2 to CPPFLAGS.
	See https://github.com/msys2/MINGW-packages/issues/5868

	actually try to link it, to catch it

2019-10-18  Reini Urban  <rurban@cpan.org>

	fix REPEAT -Wtype-limits checks
	uint32_t has only 4 byte. check for signedness overflow.

	indxf: protect NULL derefs
	detected by mingw gcc only

	fix win32 decode logging
	eed wstring

2019-10-18  Reini Urban  <rurban@cpan.org>

	dwg2SVG: honor TTF font styles => Verdana or Courier.
	Translate font-styles to svg font-families.
	Use Courier for all non-ttf fonts, and Arial or Verdana for ttf fonts.
	There's no SIMPLEX or COMPLEX in svg imho.

	Closes #156

2019-10-18  Reini Urban  <rurban@cpan.org>

	fix leak in r2007+ dwg_ref_tblname logging
	a temp. utf8 handle ref name

2019-10-08  Reini Urban  <rurban@cpan.org>

	spec: LIGHT.shadow_map_size
	see unknown LIGHT.pi

	unknown: minor fixes

2019-10-06  Reini Urban  <rurban@cpan.org>

	Release 0.9

2019-10-05  Reini Urban  <rurban@cpan.org>

	indxf: fix VIEW_CONTROL 70 -1
	which appears in the wild.

	fix get_next_owned_entity
	esp needed for dwg2dxf, which missed the very last
	block entity. Fixes GH #143, thanks to @soundd1

	dxf: fix BLOCK.base_pt
	take it from the BLOCK_HEADER. see GH #143

	fix bit_convert_TU for >U+0800
	a major blunder. wrong order of bytes AND wrong numbers.
	thanks to some chinese examples with chinese application names,
	esp. GH #109 and #143

2019-10-04  Reini Urban  <rurban@cpan.org>

	fix int overflows
	detected by lgtm

	dxf: VALUEOUTOFBOUNDS CellStyle.num_borders
	overflow with gh143/testBlock

	regen broken 2000/TS1.dxf example
	it could not even be loaded by acad

	dxf: fix FIELD_BSd formatting
	%6i, not %d.
	E.g. $DIMLWE

	bindings: add dynapi

2019-10-04  lorenz  <looooo@users.noreply.github.com>

	swig: swig4 needs  "stdint.i" to be included (PR #153)

2019-10-02  Reini Urban  <rurban@cpan.org>

	dxf: encode all r2007+ strings as utf-8
	see e.g. GH #109 and #143

	dxf-check: we start with dxf not dwg

	dynapi: add dxf for VISUALSTYLE.unknown_float45
	even if unused in DWG

	indxf: add_LTYPE_dashes

	spec: restrict POLYLINE_MESH to max 100000 vertices
	alloc failure with 32bit fuzzing there

	dwg2SVG: ignore empty pspaces
	We also assume all refs are resolved already.
	Fixes GH #109

	decode: fix more -Wsign-compare
	and -Wtype-limits

	decode: fix a -Wsign-compare

	fuzz: skip corrupt classes
	avoid strcmp on NULL

	fuzz: fail on corrupt es.fields.address
	protect from overflow segv, found via fuzzing.
	Turn asserts into an error

	fuzz: more section repair protection
	segv on i = 0 with [i - 1]

2019-10-02  Reini Urban  <rurban@cpan.org>

	fuzz: protect from dat overflow
	ERROR: bit_read_RC buffer overflow at 18446744073709549374
	bits.c:103:14: runtime error: addition of unsigned offset to 0x7ff41c4a9800 overflowed
	undefined-behavior

	dont advance already overflowed pointer

2019-10-02  Reini Urban  <rurban@cpan.org>

	decode: fix NULL strcmp
	found via fuzzing, with corrupt input

	decode: fix double-free
	with corrupt compressed sections.
	Found via fuzzing

	fixup htmlescape in src/out_json.h
	this is not library specific, just for helper programs.
	moved to programs/escape.h

2019-10-01  Reini Urban  <rurban@cpan.org>

	new programs/escape.c,h
	extract from out_json, because we dont want
	to add these to the API

2019-10-01  Reini Urban  <rurban@cpan.org>

	dwg2SVG: htmlescape strings and names
	and for widestrings escape to hex.
	Also protect from a few NULL strings.

	Closes GH #149

2019-10-01  Reini Urban  <rurban@cpan.org>

	spec: splice TABLECONTENT into TABLE r2010+
	as macro, not to duplicate it.

	spec: merge TABLECONTENT into TABLE r2010+
	a call will not work. TABLECONTENT is only an object, not an entity
	and has totally different offsets.
	Either put it into a macro or duplicate it.

2019-10-01  Reini Urban  <rurban@cpan.org>

	indxf: resolve_postponed_object_refs
	some TABLE/BLOCK/OBJECT field handles neeed to be resolved
	at the end, when the blocks and tables are all read.
	e.g. INSERT.block_header and various layer or other entity names

	Fixes GH #150, INSERT.block_header missing

2019-10-01  Reini Urban  <rurban@cpan.org>

	encode: fix VPORT.VIEWMODE
	bit_write_4BITS was broken, and the indxf calculation was missing.
	simplify the 4BITS reader and writer, add proper bit logging.

	indxf: set UCSFOLLOW and VIEWMODE

2019-10-01  Reini Urban  <rurban@cpan.org>

	decode: better pt logging
	print the proper point types, not just RD or BD

	indxf: fix VPORT.aspect_ratio
	r13+ aspect_ratio is calculated, the internal field
	really is VPORT.viewwidth. added to the API.
	calculate both.

	indxf: more default points values
	e.g. VPORT.view_target.z (GH #150)

2019-09-30  Reini Urban  <rurban@cpan.org>

	indxf: fix default points values
	e.g. WIPEOUT.uvec  (GH #150)

	indxf: IMAGE,WIPEOUT.imagedefreactor is code 3
	not 5.

2019-09-30  Reini Urban  <rurban@cpan.org>

	change DIMASSOC, indxf: add_DIMASSOC
	change the spec a bit.
	H 331 seems to be repeated with main_subent_type 73,
	H 332 with intsect_subent_type 74

	The other handles seem to be superfluous.
	Change the order of order of some fields to allow proper dxf
	roundtrips.
	(just rotated_type fails still)

	Only the indices with the bit set in associativity are filled. (no change)

2019-09-30  Reini Urban  <rurban@cpan.org>

	indxf: add_PERSSUBENTMANAGER, add_ASSOCDEPENDENCY
	but some of them are not yet encoded.

	encode: implement encode_3dsolid
	for most cases no encryption needed.
	decode has it already, indxf also

	indxf: add postprocess_TEXTlike and MTEXT defaults
	to minimize defaults to dataflags,
	and set default style handle.

2019-09-29  Reini Urban  <rurban@cpan.org>

	json: work on TABLE segv
	when it errored on decode TABLE after num_owned.

	Don't decode a r2010+ TABLE/CONTENT object header twice, only
	process the fields, because it's an entity afterall, not an object.

	But now we need to share the struct fields somehow.

2019-09-29  Reini Urban  <rurban@cpan.org>

	indxf: add_TABLESTYLE
	for the subfields.

	We need a seperate Dwg_TABELSTYLE_border from Dwg_BorderStyle
	because of two major differences: BL visible vs B invisible, and
	BL vs BS linewt.

2019-09-29  Reini Urban  <rurban@cpan.org>

	harmonize REPEAT names
	  _ adds idx
	  C does no checks
	  N does constant times (else _obj->times)
	    (and cannot reset times to 0 on error)
	  F does not calloc/free

	spec: VALUEOUTOFBOUNDS TABLEGEOMETRY cell.num_geom_data
	as it happens in example_r13.dwg

	more DEBUG: unstable TABLESTYLE
	promote TABLESTYLE from debugging-only to unstable (just r2010+ is unhandled).

2019-09-28  Reini Urban  <rurban@cpan.org>

	more DEBUG: check CELLSTYLEMAP overflow
	samples with too small CELLSTYLEMAP survive now roundtrips.
	fix MATERIAL color types

	decode: check for bits string overflows

	encode: better point logging

	indxf: fix new_LWPOLYLINE
	no bulges unless needed.
	properly encode flags from dxf, honor defaults.
	e.g. no const_width if 0.0.

2019-09-28  Reini Urban  <rurban@cpan.org>

	spec: add TABLESTYLE
	at least until r2010.

	reformat wrong dwg_api.
	also fix a few minor ASSOCACTION decl problems.

2019-09-27  Reini Urban  <rurban@cpan.org>

	DOCUMENTOPTIONS is alias for CSACDOCUMENTOPTIONS

	dxf, log: shorter make

2019-09-27  Reini Urban  <rurban@cpan.org>

	encode: fix entity bitsize calculation
	set START_HANDLE_STREAM for entities in COMMON_ENTITY_HANDLE_DATA.

	Fixes GH #142, the very first version which imports most entities.

2019-09-27  Reini Urban  <rurban@cpan.org>

	indxf: comments, logging only

	dxf-check for 2000/TS1
	use the proper basename

	indxf: encode OLE2FRAME.data 310

2019-09-27  Reini Urban  <rurban@cpan.org>

	indxf: fix new_MLINESTYLE_lines
	forgot to set MLINESTYLE.num_lines

	also improve some obj->type checks. by int, not by name

2019-09-27  Reini Urban  <rurban@cpan.org>

	api: add dwg_find_dicthandle
	fixes dwg_find_tablehandle for dicts.
	We need to search for the name in the dict given by the first NOD search.
	Not just returning this dict. With MLSTYLE we need to return the
	MLINESTYLE object ref.

	Also use the absolute refs, even if dict handles are code 2, not 4.

2019-09-27  Reini Urban  <rurban@cpan.org>

	indxf: cosmetics only
	HEADER.CMLSTYLE is still pointing to the wrong
	MLEADERSTYLE object, not MLINESTYLE.

	decode: more stable eed decoder
	with overflow, e.g. when dat does not advance error earlier.
	avoid endless loops on eed decoding errors.

	indxf: more eed size fixes
	the final string \0 does not count. It is just allocated
	for better logging.

	indxf: add DIMSTYLE defaults

2019-09-27  Reini Urban  <rurban@cpan.org>

	indxf: fix LAYOUT subclass conflicts
	groups 70 and 1 are in both subclasses.

	rename two LAYOUT fields:
	  pspace_block_record => block_header,
	  last_viewport => active_viewport.

	fix setting mspace_block_header and active_viewport from dxf.

2019-09-26  Reini Urban  <rurban@cpan.org>

	log BLOCK_HEADER.num_inserts
	for de,encode consistently

	indxf: fix BLOCK_HEADER first|last_entity to abs
	Fixes Reading handle 1F object type AcDbBlockTableRecord
	Error 34 (eWrongObjectType) Object discarded

	indxf: nolinks = 0 for BLOCK
	always add r2000 prev_entity + next_entity BLOCK, even
	if 0

	decode eed: fix data decoding
	dont jump to a wrong end pos

	encode eed: no codepage r2007+
	and add a bunch of LOG_POS dat->byte locations for debugging.

	indxf: collect eed sizes
	only add a new EED size block with a new handle.
	else add size to previous block

	encode: fix encode_eed
	always write the handle after each new sized data block.
	not just the first

	add dwg_find_tablehandle_silent
	and use it in in_dxf.
	not exported for now.

	encode: fix -Wtautological-constant-out-of-range-compare
	warnings. case size to long to compare same types

	doc: fix ENTITIES summary line

	doc: add Structures for EED and XDATA.
	Maybe more special structs later

	indxf: add postprocess_BLOCK_HEADER
	Closes GH #146

	encode: - logging prefix
	for patched sizes

2019-09-25  Reini Urban  <rurban@cpan.org>

	indxf: more abs/rel ownerhandle logic
	dwg_add_handleref: when searching for existing refs,
	DICTIONARY, XRECORD or class may need to be relative.
	skip the search for existing absolute ref then.

	< GROUP needs to be abs, MLINESTYLE e.g. not, is rel.

2019-09-25  Reini Urban  <rurban@cpan.org>

	indxf: resolve class types earlier
	via dwg_encode_get_class, from encode.
	improve the abs/rel ownerhandle logic for DICTIONARY and XRECORD

	sample_2000.dxf: add THUMBNAILIMAGE section

2019-09-24  Reini Urban  <rurban@cpan.org>

	indxf: ownerhandle abs logic
	abs for all old-style types < 500
	rel for all classes
	WIP dwg_encode_get_class

	indxf: WIP skip eed[0].size for handles
	still wrong though

	indxf: preserve eed[0] handle
	and size.
	handle is unfortunately stored at eed[0], and was
	cleared by the first non-handle value at eed[0].

	indxf: no SEQEND nor ENDBLK prev entities

	indxf: no 2x XRECORD.ownerhandle
	xdata then

	encode: prefer class->number over old type
	When a class with the same type exists, such as
	ACDBPLACEHOLDER or OLE2FRAME, prefer the varies type (>500),
	over the fixed type.
	Fixes Error 34 (eWrongObjectType)

	indxf: better entity defaults
	entities bordering to SEQEND, ENDBLK have nolinks.
	set ltype defaults

	indxf: fixup BLOCK_CONTROL[0].entries[0]
	wrong num_entries

	indxf: flip logging type code

	indxf: fix duplicate handle for BLOCK_HEADER.*Model_Space
	it is allocated at objid 0 for minimal DXFs. Reuse the pre-allocated
	object then.

2019-09-23  Reini Urban  <rurban@cpan.org>

	dxf: fix wrong INSERT.block_header 2 (name)
	Thanks to @soundd1 detecting this bug.
	Closes GH #143

	dxf: fix wrong COLOR.byblock GH #143
	index 256 == bylayer
	index 0 == byblock
	skip bylayer for dxf, and index & 255 turned bylayer into byblock.
	Thanks to @soundd1 detecting this bug

	decode: try to repair the section_info_id WIP
	See GH #144

2019-09-23  Reini Urban  <rurban@cpan.org>

	WIP decode: more r2004 section map checks
	try to fix GH #144.
	allow negative Dwg_Section.size ??

	ignore overlarge Section id > last_section_id.
	added various consistency checks and a section_map_address repair.

2019-09-23  Reini Urban  <rurban@cpan.org>

	json: no 0x%x numeric formats
	they cannot be parsed

	api: change Dwg_Section address to uint64_t
	It is read as such. see GH #144 for a testcase

	dwgwrite: fix -y overwrite
	write the dwg then

	alive.test: timeout 10s
	fails on my mac air with asan and 2 larger dwgs, example_2013
	and example2018 with dxf2dwg

	indxf: set entities entmode
	2 for mspace (default)

	indxf: set entity codes 6, 390, 347
	BB ltype_flags, plotstyle_flags, material_flags

2019-09-22  Reini Urban  <rurban@cpan.org>

	indxf: fix init of points
	with extrusion setting pt.z to 1.0, i.e. LINE start.z

	indxf: fix EED for points and handle
	add proper logging

	indxf: but leave room for one active entry

	indxf: fixup entries vs num_entries
	no NULL entries[] allowed. esp. VIEW_CONTROL entries
	are mostly NULL.

	encode LTYPE.strings_area if empty
	All TF, TFF strings must be dumped, even if NULL.
	Fixes Reading handle 14 object type AcDbLinetypeTableRecord
	Error 67 (eDwgObjectImproperlyRead) Object discarded

	encode: no NULL handles, always with code
	Fixes Recover: error eWrongObjectType reading Header.

	spec: fixup LTYPE_CONTROL.bylayer and byblock
	mixed up.

2019-09-22  Reini Urban  <rurban@cpan.org>

	indxf: fixup HEADER.CMLSTYLE
	MLINESTYLE, not MLEADERSTYLE.

	Also don't change existing ref.code to 5, recreate if not 5 already

2019-09-22  Reini Urban  <rurban@cpan.org>

	indxf: fixup HEADER.HANDSEED->code = 0

	indxf: no NULL ownerhandle, 4.0.0 then
	encode all ownerhandles. do relative offsets only for valid absref
	targets.

	indxf: encode HEADER.FLAGS and CELWEIGHT
	add reverse dxf_revcvt_lweight(), add more HEADER defaults
	which dont appear in most DXFs

2019-09-21  Reini Urban  <rurban@cpan.org>

	silence FIELD_HANDLE names
	add 2 new API funcs: dwg_ref_object_silent,
	dwg_resolve_handle_silent (was static)

2019-09-20  Reini Urban  <rurban@cpan.org>

	dxf: fix xdata 3DPOINT DXF
	fixes XRECORD:
	10 group not followed by 20 group

	dxf: fix DICTIONARY bug
	with dupl. itemhandles

	dxf: skip dupl. 330 ownerhandle
	already via common_entity_handle_data now

2019-09-20  Reini Urban  <rurban@cpan.org>

	decode: log bwd handleref names
	to log fwd handles we would need to scan all object
	types in advance, and then a 2nd time for its fields

	This might catch at least some wrong H refs.

2019-09-20  Reini Urban  <rurban@cpan.org>

	decode: macro aesthetics
	shorten a few vars. add clang-format directives

	example_2000.dxf: add THUMBNAILIMAGE
	to have closer numbers in the generated DWG

	dxf: ATTDEF.prompt 3 is DXF mandatory
	not just SINCE (R_2010)

2019-09-19  Reini Urban  <rurban@cpan.org>

	abstract set_handle_size
	for longer handles

	indxf: reactors[] always absolute,
	but the others, esp. ownrhandle always relative

	XRECORD logging spec
	free aesthetics

2019-09-19  Reini Urban  <rurban@cpan.org>

	GH #85: COMMON_ENTITY_HANDLE_DATA earlier
	Since r2007 we have a seperate hdl stream, which we can call at the
	beginning already.
	This enables the removal of the extra handles loops in the spec.
	But just r2007+, before those handles are still after the normal
	fields. Needs a special free logic there, not to delete ctx.leaders
	before the 2nd loop.

	free: combine common_entity_data with common_entity_handle_data,
	just call them in series.

2019-09-19  Reini Urban  <rurban@cpan.org>

	fix MULTILEADER leak
	in 2nd REPEAT loop for the handles, when
	the leaders field was already removed by the 1st loop.
	This will be properly fixed later, when we seperate the
	hdl_dat stream earlier from the obj stream, to process both at once.
	The text stream str_dat also. See GH #85, branch work/gh85-common

2019-09-18  Reini Urban  <rurban@cpan.org>

	encode: set xdicobjhandle to (3.0.0) not NULL
	when empty on r13-r2000

	decode refs not as NULL handle
	To store the original handle.code on encode.

	more logging aesthetics

	dwg_bmp: better BMP offset logging

	decode: fix FIELD_RSx logging

	encode: fixup type with dwg_encode_variable_type
	need the proper class id.
	Fixes ACAD eNoClassId and eWrongObjectType

	decode preR13: strncpy overflow
	tbl->name has only 64 byte

	fix dwgrewrite leaks

	encode: Thumbnail even with empty HEADER.thumbnail_address
	The address may be computed.

	parse the thumbnail data
	mostly for logging

	dwgrewrite: overwrite existing -rewrite.dwg

	log more types
	each read and write should be logged ideally.
	not yet for eed, xdata, sentinels, class.

2019-09-17  Reini Urban  <rurban@cpan.org>

	indxf HEADER strings
	they disappeared in encode FIELD_TV
	with IF_ENCODE_FROM_EARLIER.

	indxf: log HEADER dxf codes also.

2019-09-17  Reini Urban  <rurban@cpan.org>

	add proper FORMAT_RLx ditto

	add RSx type

	encode header: set is_maint defaults

	decode: Clearer Handles logging

	encode: fix Handles CRC_LE
	The little-endian variant, not BE.

	indxf: reformat prev.

	indxf: dwg_find_tablehandle is already case-insensitive
	since 7222ec07edb48ab298a3d90f66f5bcb23c1ef245

	indxf: seperate LTYPE bylayer/byblock
	into its own fields in LTYPE_CONTROL. Like with BLOCK_CONTROL
	model/paper_space before

	encode: fix bitsize calculation

	indxf: set tablerecord->xrefref = 1 as default

	encode: fix object CRC
	fix bitsize_pos logging,
	fix object address for the size calculation (dxf only).

2019-09-16  Reini Urban  <rurban@cpan.org>

	log the CRC sizes also

	encode: fix bit_write_CRC logging
	off-by-2

	dxf: add dxf-check
	similar to dxf-roundtrip.sh via TeighaFileConverter, but
	the other way round, for dxf2dwg.

	indxf: seperate {model,paper}_space into its own fields
	set the proper BLOCK_CONTROL fields.

	encode: fixup encode_patch_RLsize
	the size doesn't contain itself.

	indx: set klass->number, fixup ACDBDATATABLE
	in DXF DATATABLE is ACDBDATATABLE, in DWG not.
	fixup dwg->num_classes, to fix writing the last class.

	indxf: fix HEADER points
	and add some more defaults

	dxf: add all the missing codepages
	and its names

2019-09-15  Reini Urban  <rurban@cpan.org>

	dwg_find_tablehandle: find in DICTIONARY
	when the ctrl object is a DICTIONARY. Finds HEADER.CMLSTYLE

	indxf: find more HEADER DICTIONARYs
	LAYOUT, PLOTSETTINGS, PLOTSTYLENAME, ... with an ACAD_ prefix
	in the NOD

	indxf: resolve more header handles
	resolve_postponed_header_refs also had a bug.
	search names case-insensitive.
	need DICTIONARY objects for CMLSTYLE.

	indxf: add IF_ENCODE_FROM_EARLIER_OR_DXF
	set dwg->opts 0x20 on indxf, and 0x30 on minimal DXF,
	to set defaults which are not defined in a DXF

	decode: fix FIELD_NUM_INSERTS
	when num_inserts RC > 1, let it count.
	fixes GH #44 to accept one inserts[vcount][0] entity.
	compared to gh44-error.dxf: there's only on num_inserts BLKREF there, so
	it looks correct now.

	encode: better minimal DXF support
	set dat->from_version lower to trigger IF_ENCODE_FROM_EARLIER defaults.
	set empty header.dwg_version, app_dwg_version, codepage, and
	empty HANDSEED.
	skip AuxHeader then.

2019-09-15  Reini Urban  <rurban@cpan.org>

	dynapi: BE is a 3DPOINT also
	It could be renamed to 3BE, but that would change the API too much.

	This fixes heap-overflows when importing r12 DXFs, on the first 210 line.

2019-09-14  Reini Urban  <rurban@cpan.org>

	api: change handle sizes to long

	support handle sizes > 4, up to 8 byte on 64bit.
	as demonstrated in GH #143 they can be as large as D485E5D6 or even
	FD485E65F.
	Fixes GH #143

	rename SECTION_OBJECTS_R13 => SECTION_HANDLES_R13
	and dont recover offsets for illegal handleoff values yet

2019-09-14  Reini Urban  <rurban@cpan.org>

	decode: recover from invalid HANDLES
	either wrong handleoff UMC or offset [MC], which come in pairs.
	default to the next objects then.
	See testcase in GH #143.

	set r2000 section names (for logging).

2019-09-14  Reini Urban  <rurban@cpan.org>

	bit_read_UMC: default illegal handleoff to 1
	not 0, and the offset from the previous size, to read the next
	object.
	But the root problem remains in bit_read_UMC. See testcase in GH #143

	free: fix double-free of late added refs
	They were added by dxf_block_write - get_last_owned_block.
	This added endblk_entity is not a new ref, it already exists.
	It get's freed by dwg_free.

	free: advoid wrong warnings
	and skip bounds check exits. we want to free all fields

	common.h: fix memBEGIN, unused
	because broken

	move rad2deg to common.h
	define only at one place, not 3

	memmem not used anymore
	was replaced by membits

	build-aux/clang-format-all

2019-09-13  Reini Urban  <rurban@cpan.org>

	indxf: ENDBLK,SEQEND NULL prev_entity,next_entity
	See GH #142

	indxf: default color.index = 256 ByLayer
	and log CMC

	spec: reformat XRECORD
	misleading identation

	encode: xdata forgot the type RS

	encode: log more fields

2019-09-13  Reini Urban  <rurban@cpan.org>

	encode/indxf: NULL HANDLE is NULL
	and not a ref to 0.

	harmonize logging of it.

2019-09-13  Reini Urban  <rurban@cpan.org>

	indxf: reverse XRECORD.xdata order
	push to end of list, not front

	encode: log XRECORD xdata

2019-09-12  Reini Urban  <rurban@cpan.org>

	dynapi: regen doc

	spec: many more VALUEOUTOFBOUNDS checks
	and esp. reset the wrong num_ fields.

	indxf: set prev_entity, next_entity
	now common_entity_handle_data is complete

2019-09-12  Reini Urban  <rurban@cpan.org>

	fix -Wnull-dereference, add SAFEDXFNAME
	e.g. when logging HEADER or SUMMARY there is no obj.
	also for r2007 strings, there is no obj->has_strings there

	Only detected by gcc -O2.

2019-09-12  Reini Urban  <rurban@cpan.org>

	indxf: reset entmode for each block
	otherwise all ents end up in Paperspace.

	unify object-map logging
	log the Handleoff properly

	encode: fix the Object-Map
	Handleoff is the offset from the previous handle, default: 1,
	the next handle. With deleted objects there are holes.
	Use the proper types: UMC (unsigned) and MC.

	encode: rename loop indices to i

2019-09-11  Reini Urban  <rurban@cpan.org>

	encode: fix omap sorting
	use a proper insertion sort, add an init pass

	indxf: init BLOCK_HEADER *Model_Space .1F

	log: print section addresses as decimal, not hex

	encode: add AuxHeader, minor improvements
	abstract encode_patch_RLsize(),
	add auxheader defaults
	fix header.section[0].size calculation (not in dwg_encode_header_variables)

	indxf: calc. XRECORD.num_databytes
	acad complained about missing XRECORD data:
	Error 151 (eOutOfRange) Object discarded

2019-09-10  Reini Urban  <rurban@cpan.org>

	dxf2dwg: overwrite existing files

	-Wincompatible-pointer-types-discards-qualifiers

	indxf: resolve_objectrefs
	the object_map handles.
	TODO There are still many holes and duplicates in there

	improve dwg_model_space_object
	and fail when it fails, mostly with dxf2dwg dwgs

	dxf: write to versioned dwgs

2019-09-10  Reini Urban  <rurban@cpan.org>

	indxf: pass dxfname through
	so we don't need to resolve klassnames later.
	This dxfname is from the 0 NAME section in the dxf.

	Also update dxfb_blocks_read from ascii

2019-09-10  Reini Urban  <rurban@cpan.org>

	encode: support dwg_encode_get_class aliases
	though it's still very stupid to do it twice.
	classes.inc should be enough for a linear search for dxfnames.
	set the proper obj->dxfname.

	Avoid writing to dat->chain[0] on empty obj->bitsize_pos

2019-09-10  Reini Urban  <rurban@cpan.org>

	encode: fixup padded obj->size
	Fixes off-by-one Wrong object size warnings

	encode: no 2x object CRC, add asserts
	TODO: someone is still writing to dat->chain[0]

2019-09-10  Reini Urban  <rurban@cpan.org>

	restrict OFFSETOBJHANDLE code to 4
	create relative offsets only for code 4.

	support code 10 and 12 with offsets < 256, size 1.

2019-09-10  Reini Urban  <rurban@cpan.org>

	encode: minor improvements
	avoid wrong Expected a CODE 3 handle, got a 6
	warnings. Allow relativ offsets (TODO: only 4)

2019-09-10  Reini Urban  <rurban@cpan.org>

	indxf: read BLOCKS
	The previous TABLES section already has the BLOCK_HEADER.entries.
	Link it to the block_entity, endblk_entity, first_entity,
	last_entity.
	Set entmode (mspace, pspace) for all the block entities.

	Fix dwg_ref_object for relative refs, when ref->absolute_ref is known.
	Fix dwg_ref_object to don't set ref->obj on dirty_refs (as in the importer).

	Closes GH #133

2019-09-10  Reini Urban  <rurban@cpan.org>

	indxf: fix Invalid entity type BLOCK_HEADER, wanted BLOCK_RECORD
	dxf calls the BLOCK_HEADER BLOCK_RECORD. use the proper obj->name
	in {BLKREFS

	dxf: minor POLYLINE/VERTEX field fixups
	add COMMON_ENTITY_POLYLINE.has_vertex 66,
	add VERTEX_PFACE_FACE.flag 70,
	print and accept more DXF POLYLINE_* elevation points.

	indxf: search SEQEND.owner with <r13
	but dont store the list of handles there

2019-09-09  Reini Urban  <rurban@cpan.org>

	indxf: fix postprocess SEQEND
	was pretty broken.
	Closes GH #138

	indxf: store owner handle in map
	which fixes postprocess_SEQEND, because we can now
	find the owner

	indxf: fix num_reactors
	improve add NULL handleref
	always set xdic_missing_flag

	indxf: set NULL xdicobjhandle for r2000

	indxf: set xdic_missing_flag needed to avoid accessing the NULL xdicobjhandle

	encode: add 2013+ has_ds_binary_data
	yet unused.
	set calc. bitsize

2019-09-09  Reini Urban  <rurban@cpan.org>

	indxf: postprocess SEQEND
	and its owner. set the owned[] handles.
	Fix setting ownerhandle, reactors and xdicobjhandle
	for entities.

	See GH #138
	WIP owner->ownerhandle

2019-09-09  Reini Urban  <rurban@cpan.org>

	preview is embedded in sentinels

	dwgbmp: support optional 2nd arg bmpfile
	as documented

	dwgbmp: fix for 64bit
	on 64bit long is wrong, need BITCODE_RL sizes.

	decode Preview section to dwg->thumbnail
	with some consistency checks (failing still).
	This enables dwgbmp for all 2004+ dwgs.

	2004+ resort sections: classes before handles,
	and summary after header.
	similar to 2000

	free DICTIONARY FIELD_VECTOR_T aesthetics only

2019-09-09  Reini Urban  <rurban@cpan.org>

	fix obj_handle_stream and VECTOR_CHKCOUNT
	the streams are already restricted from 0 to size, independent of
	obj->address.
	pass the right stream to AVAIL_BITS.

	Fixes many overflow checks, esp. GH #132 08.dwg

2019-09-09  Reini Urban  <rurban@cpan.org>

	read_2004_section_handles: fix oldpos
	wrong check. we advance hdl_dat.byte for the handles, not dat.

	also check GROUP.num_groups overflow (#132 08.dwg)

2019-09-09  Reini Urban  <rurban@cpan.org>

	decode: fix R2004_section_map int overflow
	causing bytes_remaining switch from +8 to -8 but unsigned.
	Fixes the crash from #132 with 00.dwg
	Closes #93

	needs int64_t, but we already required that earlier (RLL, BLL types, ...)

2019-09-08  Reini Urban  <rurban@cpan.org>

	probe for broken restrict
	new AX_RESTRICT probe.
	rust reports gcc broken from 5 - 10, but I can only confirm
	clang 6-8 failing. gcc should not be used since 9 for other reasons.
	Disabled since we don't have short restrict loops yet.

	Closes GH #141

2019-09-08  Reini Urban  <rurban@cpan.org>

	indxf: fix Invalid UNDERLAY field scale_flag error
	check of this field exists, without silencing the loglevel

	indxf: avoid Unknown DXF code 71 for DIMSTYLE_CONTROL
	warning. for the default DIMSTYLE_CONTROL.num_morehandles = 0 case

	indxf: more HATCH 97, 330 boundary_handles
	also for polyline_paths

	indxf: accept r13 SAVEIMAGES
	is present in some r13 DXFs

	indxf: fix MTEXT crash with empty num_column_heights
	with LCAD_libereco_R2000.dxf

2019-09-08  Reini Urban  <rurban@cpan.org>

	indxf: fix add_MULTILEADER_lines i++
	fixes heap-buffer-overflow on wrong line.color.
	bump for each new point.

	Also support rgb colors.

2019-09-08  Reini Urban  <rurban@cpan.org>

	indxf: skip yet unsupported minimal DXF

	indxf: fix dxf_expect_code heap-use-after-free

	indxf: skip ASSOC2DCONSTRAINTGROUP
	stack-buffer-overflow on unsupported fields

2019-09-07  Reini Urban  <rurban@cpan.org>

	indxf: simplify the summaryinfo texts

	indxf: set the summaryinfo texts

	abstract ASSOCACTION
	from subclass AcDbAssocAction for three ASSOC objects:
	ASSOC2DCONSTRAINTGROUP, ASSOCNETWORK, ASSOCACTION

	dynapi: more subclass structs and DXF values
	parse the stacked .spec REPEAT blocks and defines also.
	renamed some subclass structs to match the types.

2019-09-06  Reini Urban  <rurban@cpan.org>

	dynapi: all subclasses + summaryinfo

	more 2004 section stuff
	rename vba_proj_address to vbaproj_address.

	shorten dwg_find_tablehandle

	free: fix summaryinfo leaks

	dxf: move last 4 HEADER vars to summaryinfo

2019-09-05  Reini Urban  <rurban@cpan.org>

	decode_2007: support uncompressed sections
	add summaryinfo

	decode: support uncompressed sections
	summaryinfo.
	rename dwg->header.summary_info_address to summaryinfo_address
	rename dwg->header.thumbnail_addr to thumbnail_address.

	api: add TIMERLL type
	raw, unencoded 2xRL julian date, for summaryinfo

	decode: add AcDb:SummaryInfo
	for the 4 new HEADER variables

2019-09-04  Reini Urban  <rurban@cpan.org>

	debug: add 4 new HEADER texts, fix some DEBUGGING classes
	TITLE, SUBJECT, AUTHOR, KEYWORDS are at least set by DXF, but we have
	no location for them in the DWG yet

	doc: dxf2dwg default writes to r2000 now
	later when encode supports all versions, it will be the DXF version

	indxf: resolve_header_dicts
	and fix an utf8 bug in dwg_find_dictionary (r2007+)

	api: harmonize DICTIONARY_NAMED_OBJECT names
	LAYOUTS => LAYOUT, PLOTSTYLES => PLOTSTYLENAME, MATERIALS => MATERIAL,
	COLORS => COLOR.

2019-09-04  Reini Urban  <rurban@cpan.org>

	api: fix Empty header_vars table LAYER...
	Search and set HEADER.*_CONTROL_OBJECTs, via added
	dwg_find_table_control() and dwg_find_dictionary().
	These return only a ref, not the object, as the objects are
	still moving. (used only during encode/import)

	Export add_handle and add_handleref with dwg_ prefix.

	Trace the DICTIONARY texts

2019-09-03  Reini Urban  <rurban@cpan.org>

	api: add ANNOTSCALEOBJECTCONTEXTDATA object
	for the various ACDB_nameOBJECTCONTEXTDATA_CLASS DXF objects.
	They all seem to be based on the AcDbObjectContextData
	and AcDbAnnotScaleObjectContextData subclass, but some seem to
	have more. WIP

	indxf: simplify DXF_RETURN_ENDSEC and 0 loops
	DXF_RETURN_ENDSEC ends with an if block, we can do an else here
	break the inner 0 loop for unhandled objects.

	indxf: support more LWPOLYLINE fields
	and don't report common found handles (e.g ltype) as not found.

	indxf: search existing handlerefs
	with the same code and value. dont create fresh refs for everything
	only for new owners, not refs

	indxf: improve dxf_objects_read
	add object_alias (for all known object names)

2019-09-03  Reini Urban  <rurban@cpan.org>

	api: rename all linetype* fields to ltype
	make MLINESTYLE_line.ltindex a union of index|ltype handle
	and have type BSd (values SHRT_MAX still: 32767, 32766)

	indxf: resolve MLINESTYLE.lines[%d].lt.ltype name

2019-09-02  Reini Urban  <rurban@cpan.org>

	indxf: fix HEADER._3DDWFPREC
	need a special name rule here. invalid identifier

	api: HEADER.TIMEZONE BL => BLd (signed)
	change the type.
	e.g. -8000 is a typical value

	indxf: fix $XCLIPFRAME type error
	ERROR: skipping HEADER: 9 $XCLIPFRAME, wrong type code 290 <=> field RC.
	XCLIPFRAME is 280 RC or 290 B in dynapi. Set is as a byte (RC).

	indxf: more subfield checks and fixes

2019-09-02  Reini Urban  <rurban@cpan.org>

	indxf: resolve_postponed_eed_refs
	to fill in eed.handle refs to APPID entries,
	when APPID is not yet read.

	Also free all the postponed arrays of hdls.

2019-09-01  Reini Urban  <rurban@cpan.org>

	indxf: check UPPERCASE table names also
	for the few standard names, when setting the header vars:
	BYLAYER, BYBLOCK, CONTINUOUS

	indxf: fix UAF with ctrl TABLE
	dwg->object[] might move. use the ctrl objid index instead.

	indxf: fix Not yet implemented EED.code 1005

	indxf: add defaults
	before reading an object: scale, extrusion, scale_flag
	and after: _3DFACE.has_no_flags

	indxf: support scale 3DD points (with defaults)
	and 3DFACE.z_is_zero

2019-08-31  Reini Urban  <rurban@cpan.org>

	dxf: fix LEADER.dimstyle to DXF 3
	ODA bug, documented there as DXF 2.
	also handle LEADER.points[] [10 3BD*]

	indxf: support MTEXT.column_heights[] [50 BD*]

	indxf: fix UNDERLAY and clip_verts
	Accept PDFUNDERLAY from dxf, fix WIPEOUT rect mode,
	handle realloced clip_verts, there is no num_clip_verts there, but set it.

2019-08-31  Reini Urban  <rurban@cpan.org>

	api: remove boundary_pt{0,1} fields
	indxf: handle IMAGE|WIPEOUT|UNDERLAY.clip_verts 2RD*
	WIPEOUT todo

	for images use just clip_verts[0,1] instead.
	set num_clip_verts = 2 then.

2019-08-30  Reini Urban  <rurban@cpan.org>

	indxf: add flag 4 on width.start 40
	DXF does not set the flag 70 & 4 (const_width) correctly

	indxf: handle alt. color codes
	and dont print them twice

	indxf: MLEADERSTYLE.block_scale special case
	weird DXF codes

	indxf: handle DBCOLOR color and names
	DXF: fix a 430 memleak in out_dxf.

	indxf: rename add_dictionary_handle to add_dictionary_itemhandles

	docs

2019-08-30  Reini Urban  <rurban@cpan.org>

	add MESH entity, indxf transform matrix
	MEDSH with --enable-debug, but always with indxf.
	Unknown fields, untested.
	But we have a 2004/Surface.dxf and we do the indxf import for it.

	Support the fixed size transform matrix BD[16] and one BD[12] for
	indxf.
	Fix DXF 92 preview size for all class proxy vector data.

2019-08-29  Reini Urban  <rurban@cpan.org>

	indxf: add_3DSOLID_encr
	only ACIS version 1.
	version 2 with 290: 1 and 2: {000...} not yet.

	The DXF variant has a special quoting case for '^ ' => 'A',
	not in the DWG.

	also missing:
	wireframe_data_present, point_present, point, num_isolines,
	isoline_present, wires, silhouettes.

2019-08-29  Reini Urban  <rurban@cpan.org>

	api: new type BL linewt => BLd linewt (signed)
	to represent -1 [BLd] (ByLayer), and -2

	indxf: more MULTILEADER defenses
	some more asserts and checks

2019-08-29  Reini Urban  <rurban@cpan.org>

	api: rename 2 MULTILEADER has_content* fields
	MULTILEADER.ctx.has_content 290 => ctx.has_content_txt
	and .ctx.has_content_block 296 => ctx.has_content_blk

	They must be outside, because content is a union of either txt or blk.

2019-08-29  Reini Urban  <rurban@cpan.org>

	dxf: add dxf 296 for MLEADER.has_content_block

	indxf: simplify LOG_ERROR
	save space

	indxf: add_MULTILEADER
	only missing: ctx.296

2019-08-28  Reini Urban  <rurban@cpan.org>

	indxf: add color.rgb fields
	manually. SUB fields not yet (TABLE)

	add dxf tool (for indxf only yet)

	indxf: add_HATCH

	indxf: add_MLINE
	Abstract away the MLINE logic.
	Either break (2), next_pair (1) or search_field (0).

	indxf: add_SPLINE
	Abstract away the SPLINE logic.
	Either the field is handled or not.

2019-08-28  Reini Urban  <rurban@cpan.org>

	decode: fix Header Section[0] CRC mismatch error
	always failed on r13 and r14, because of missing slack
	(unknown header vars).

	Remove HEADER.crc field, it really belongs to the section logic.
	Set the proper crc position, and check the slack (padding).

	Add the 4 final HEADER.unknown_54 - 57 fields to r13 also.
	Always 65535. An ODA bug, which says r14+ (maybe its R13C3?).

2019-08-26  Reini Urban  <rurban@cpan.org>

	bit_check_CRC: fix wrong buffer overflow check

	bits: where did a buffer overflow occur
	Note: at bit_check_CRC with r13 objects

	add example_r13.{dwg,dxf}
	created via Teigha from example_2000.dwg

2019-08-26  Reini Urban  <rurban@cpan.org>

	decode r13-2000: simplify CRC
	Clarify calculation of the header CRC, which is wrongly described
	in the ODA. There is no need for an xor, dependent on the num_sections.

	Use the simpler bit_check_CRC over bit_calc_CRC, which ensures
	that we don't include the CRC into our calculation (striking it out).

2019-08-26  Reini Urban  <rurban@cpan.org>

	api: remove HEADER.SAVEIMAGES, rename vport_entity_header
	SAVEIMAGES is only dumped for R13.dxf, calculate it.

	HEADER.vport_entity_header refers to the VPORT_ENTITY_HEADER handle.
	Rename it.

2019-08-23  Reini Urban  <rurban@cpan.org>

	indxf: upgrade POLYLINE_2D and VERTEX_2D
	to the appropriate subclass/ENTITY.

	dynapi: fix DIMENSION_common dxf

2019-08-23  Reini Urban  <rurban@cpan.org>

	dynapi: add 100 subclass to dwg_list_subclasses
	but only 2 subclasses are actually code 100 in the dxf related to
	our subclasses. some are enclosed into 300 NAME{ groups instead.

	use symbolic DWG_TYPE_* for dwg_name_types, more readable.
	list some more aliases and subclasses, not yet used.

2019-08-23  Reini Urban  <rurban@cpan.org>

	dynapi: more DIMENSION_common dxf
	_ORDINATE went missing. needed to add manually

	indxf: special-case DIMENSION
	first handle it as DIMENSION_ANG2LN, the largest, then
	change type to the actual subclass.

	dynapi: add subclass API
	to get the fields of the named subclass.
	Note that DIMENSION_common is implemented as
	subclass, not parent class.

2019-08-21  Reini Urban  <rurban@cpan.org>

	indxf: accept dxfname aliases
	but we dont upgrade POLYLINE to POLYLINE_3D, ... or DIMENSION_*
	objects yet.
	add missing entity aliases to dynapi

	dynapi: forgot regen for visualstyle DXF 348

2019-08-20  Reini Urban  <rurban@cpan.org>

	spec: harmonize FIELD_BINARY fields
	esp. the 310 fields.
	FIELD_BINARY falls back to FIELD_TF elsewhere,
	and is needed for dxf *and* json. json cannot print \0.

	json: add common_entity_data, HANDLE now a list
	layers, ...
	make handle a list of [code, value].
	The code changes (owner, pointer, soft, hard),
	but the absolute value is the same. easier to parse.

	dwgwrite: fail earlier on missing input

2019-08-20  Reini Urban  <rurban@cpan.org>

	indxf: fix wrong MULTILEADER add_ent_preview
	when being the text_color 92. check the subclass.
	The 92 RGB value leads to Out of memory on 32bit.

	Also protect from various other strcpy stack overflows.

2019-08-19  Reini Urban  <rurban@cpan.org>

	indxf: BINARY comment
	why we convert to hex later, not already in read_pair

	dwgwrite: support -y --overwrite

	dwgwrite: support dxf from stdin

2019-08-19  Reini Urban  <rurban@cpan.org>

	dwgread/dwgwrite: -v logging
	we should support reading from stdin, therefore be silent on default,
	print only to stderr.

	also resolve error numbers to strings

2019-08-19  Reini Urban  <rurban@cpan.org>

	out_json: fix NULL handle output

	dwg_encode_eed: simplify

	add dwg_encode_eed_data, needed for indxf
	write encoded EED.data, not just the raw bits

2019-08-19  Reini Urban  <rurban@cpan.org>

	stabilize dwg_encode_eed
	with dxf data, where we might have no data, and certainly no raw.
	TODO encode from data only.

	This fixes writing DWGs from r12 DXFs

2019-08-19  Reini Urban  <rurban@cpan.org>

	simplify dwg_resolve_handle usage
	we silently return NULL now

	silently disallow hash_get 0

2019-08-19  Reini Urban  <rurban@cpan.org>

	dwg_find_tablehandle: always compute ref->obj (indxf)
	we are still constructing the objects, which move (realloc dwg->objects[]),
	so we cannot rely on any ref->obj. don't even set them.
	only compute them temporarily.

	This fixes now the many indxf use-after-free failures.

2019-08-19  Reini Urban  <rurban@cpan.org>

	indxf: support eed points and r2007 strings

2019-08-18  Reini Urban  <rurban@cpan.org>

	indxf: search APPID for eed.1001
	but this still fails if the TABLEs are not yet added

	indxf: implement binary EED 1004

	indxf: strdup the color.name
	it was never allocated.
	protect add_eed a bit more. memcpy is safer than strcpy.

	indxf: check obj/ent in add_eed
	theoretically they should have the same layout
	but some compiles do crash there.

	dwg: move dwg->measurement to HEADER.MEASUREMENT
	as header var. It is read from DXF as HEADER.
	This fixes indxf for it most elegantly.
	But we need to store it as BS, not RL, otherwise
	in_dxf will complain:
	ERROR: skipping HEADER: 9 $MEASUREMENT, wrong type code 70 <=> field RL

	api: rename dwg->preview to thumbnail
	for better seperation of the global THUMBNAIL dxf section,
	vs the entity preview fields.
	A thumbnail may contain multiple pictures, as BMP or WMF.
	An entity preview BMP or proxy graphics vector data.

	api: rename picture to preview
	A dwg preview may contain multiple pictures, BMP or WMF.
	An old entity may contain under 160 a bitmap.
	A new class-based variable-type entity may contain under 92
	PROXY GRAPHICS vector data, to be displayed under older apps.

	indxf: more add_ent_picture
	for more variable entities (class-based).
	They store their PROXY GRAPHIS vector data under DXF code 92,
	not 160, but at the same DWG field.

2019-08-17  Reini Urban  <rurban@cpan.org>

	dxf2dwg: skip lsan leak checks, and dwg_free failures
	for now. TODO

	indxf: fix invalid free_3dsolid
	for empty encr_sat_data

2019-08-17  Reini Urban  <rurban@cpan.org>

	indxf: fix write exhaustion, skip lsan leak
	with lsan call dwg_free, but dont check leaks yet.
	extend the chain on object writes.
	fixes a valgrind problem.

	there are still a couple of dxf_read_pair leaks:
	6363 bytes on example_2013.dxf

2019-08-17  Reini Urban  <rurban@cpan.org>

	dwg_write_file: set dat->opts
	even if loglevel is set by dwg->opts. it is used by bits at least

2019-08-17  Reini Urban  <rurban@cpan.org>

	dxf2dwg,dwg2dxf: check write permissions
	change error message on symlink.
	we refuse to overwrite a symlink, even with --overwrite
	for security reasons. ditto for -w files.

	we now also check for write perms, and refuse to write to non-files.

2019-08-17  Reini Urban  <rurban@cpan.org>

	indxf: fix eed double-free
	eed might be realloced, but was not set.

	indxf: fix find_tablehandle double-free
	always create a fresh new table ref, don't reuse one.
	we need to seperate owners from pointers.
	the table control is the owner, the referenced handle is a pointer.

2019-08-17  Reini Urban  <rurban@cpan.org>

	api: rename all table control handles to entries
	e.g.
	LAYER_CONTROL.layers => entries,
	APPID_CONTROL.apps => entries,
	BLOCK_CONTROL.block_headers => entries,
	DIMSTYLE_CONTROL.dimstyles => entries,
	...

	remove all ctrl_hdlv[] special-cases, depending on different names.
	esp. in indxf.

2019-08-17  Reini Urban  <rurban@cpan.org>

	bits: add bit_(read.write)_T api
	switching on the version automatically.
	simplifies the types, if TV, TU or T.

2019-08-17  Reini Urban  <rurban@cpan.org>

	api: strip _handle suffix, ...
	from all handle fields but null_handle.

	harmonize some names:
	GROUP.num_handles => num_groups
	GROUP.group_entries => groups
	BLOCK_HEADER.insert_handles => inserts,
	FIELDLIST.field_handles => fields,
	SORTENTSTABLE.sort_handles => sort_ents
	LAYER_INDEX.layer => layername
	LAYER_INDEX.entry_handles => layers

	visual_style => visualstyle,
	live_section_handle => livesection,
	cell_style => cellstyle,
	dict_handle => dictionary,
	dict => dictionary

2019-08-17  Reini Urban  <rurban@cpan.org>

	dynapi: adjust #line

	indxf: support bll, add dxf_read_long
	but not really used yet. most picture sizes are just
	4G, unsigned long. (dat->size)

	document dwg->measurement
	(0 English/1 Metric)

	encode: add 2NDHEADER defaults
	but yet unused. handles[] missing

	api: add BSd type
	for some DIMSTYLE/HEADER vars, which need to be signed

	json: protect from empty parent->layout_number

	indxf: silence Unknown DXF code for BLOCK warnings
	These are DXF artifacts, not in the DWG

	add test-data/example_r14.dxf
	needed for alive.test with dxf2dwg.
	This version does not support ACDBPERSSUBENTMANAGER nor
	ACDBASSOCDEPENDENCY so skip these dxf tests there.

	alive.test: disable TODO for dxf2dwg
	should not crash anymore.

	indxf: support common CMC [62,420,430]

	indxf: add_block_picture (analog)
	and log BLOCK_HEADER.insert_handles[]

	indxf: add_ent_picture
	the entity.picture, not the dwg thumbnail

2019-08-16  Reini Urban  <rurban@cpan.org>

	indxf: re-arm Warning: Ignore VECTOR
	Only 375 warnings now with examples_2013.dxf

	indxf: add GROUP.group_entries [340 H*]
	and set GROUP.num_handles

	indxf: new_LWPOLYLINE
	all vectors do have the same size

	dynapi: add 2BD_1 types
	needed in indxf for some objects, like LAYOUT.window_max.y, ...
	Improve VECTOR detection

	indxf: skip .z of 2D points
	like with SOLID

	dxf2dwg: adjust limitation warnings

	indxf: read MLINE entity
	with its various subentities. dynapi does not have its dxf values,
	which does not make sense here

	add DXF 46 to MTEXT.rect_height
	was missing. ODA specifies it

	indxf: read SPLINE entity
	at least the Bezier spline, scenario 2

	dynapi: fix setting r2007+ wchar strings
	T types are just TV, just check for TF or 2007.
	find_tablehandle: check against the utf8, not the wide name.

	dwg_find_tablehandle: use a better temp. type
	just to check the _obj->name earlier

	indxf: protect NULL hdlv[i] in dwg_find_tablehandle
	some handle vector entries might still be NULL

	indxf: fix some handleref double-free's
	need to make a copy of refs. But not all yet.

	programs: add -y --overwrite
	dont overwrite existing files per default with
	the dxf converters.
	regen the manual, adjust the docs

	encode: patchup obj size and bitsize
	for DXF, to fix overflows.
	Many dxf2dwg dwg's can now be read.

	encode: use SECTION enums
	and calc the section[0] address and size.

2019-08-16  Reini Urban  <rurban@cpan.org>

	indxf: dxf_fixup_header
	fixup some values, like table or block refs (with proper code),
	and values not in the DXF.

	make LOG_* a block to be more useful in if () else statements.

2019-08-15  Reini Urban  <rurban@cpan.org>

	api: rename ACDBNAVISWORKSMODELDEF to NAVISWORKSMODELDEF

2019-08-15  Reini Urban  <rurban@cpan.org>

	indxf: add dxf_preview_read
	read the hex THUMBNAILIMAGE.

	also abstract away new_MLINESTYLE_lines()

2019-08-15  Reini Urban  <rurban@cpan.org>

	dxf2dwg: set dwg.header.from_version

	dxf2dwg: disable free under asan for now
	should be enabled to test for leaks when encode is stable enough

	indxf: MLINESTYLE.lines[]

	indxf: add LAYER.linewt, flag logic

	indxf: resolve VT_HANDLE handles
	by ref, not by name (i.e. all code > 300)

	dwg_encode_add_object: lookup class by name
	same as in dwg_encode_variable_type().
	This fixes DEBUGGING objects, like CELLSTYLEMAP.

	indxf: add hex2bin for VT_BINARY hex string
	e.g. handle XRECORD 311 values

	dwg_encode_variable_type: lookup class by name
	indxf has a different class order, which breaks lookup by type/class[i].
	either fixup the obj->type then (now), or resort the classes, when
	being read from DXF.

	indxf: fix classes_read logging
	wrong num_instances copy&pasta

	indxf: resolve ENTITY.layer
	special-case.
	also excempt DICTIONARYVAR from DICTIONARY* cases.

	fix deg2rad
	wrong calculation!, prev. only used in unknown/bd

	indxf: deg2rad angles
	convert angles from degree to radian

	indxf: fix add_dictionary_handle
	and simplify without using the dynapi.
	But the problem was setting texts [3 TV*] before to TV

2019-08-14  Reini Urban  <rurban@cpan.org>

	api: sync struct DICTIONARY with DICTIONARYWDFLT
	use the same names and offsets, for easier in_dxf.
	rename DICTIONARY*.text => texts,
	DICTIONARY.unknown_r14 => cloning_r14
	DICTIONARYWDFLT.cloning_rl => cloning_r14

	indxf: add text to add_dictionary_handle

	perl: fix out-of-tree
	make distcheck
	No rule to make target 'perl/LibreDWG.xs', needed by 'all-am'

	dynapi: add HANDLE_VECTOR dxf values

	bits: -Wmaybe-uninitialized b in bit_write_hexbits
	Clearly an optimizer problem, but no big deal.

	indxf: sync in_dxf to in_dxfb

	indxf: fixup add_xdata
	may free the original pair, avoid double-free and leak

	indxf: add_dictionary_handle

2019-08-06  Reini Urban  <rurban@cpan.org>

	indxf: XRECORD add_xdata
	all unknown XRECORD fields are xdata

	suffix: also strip other known extensions
	e.g. dxf2dwg would create a .dwg, not a .dxf.dwg

	dxf2dwg: sync with dwg2dxf
	allow multiple input files,
	silently overwrite existing dwg files
	in the current dir.

	workaround old darwin makeinfo
	need the texi2any version for @indentedblock

	Merge branch 'indxf' [GH #129]
	Not yet fully finished but ready for master

	dxf2dwg: more stability
	dwg_find_tablehandle can find a NULL hdlname
	free can run into NULL _obj->eed
	resolve_postponed_header_refs can run into an empty string pair

	indxf: add BLOCK_CONTROL.insert_handles 331

	indxf: add resolve_postponed_header_refs
	array_push: need the code also
	to get to the right table

	indxf: fill dwg->object_ref[] via
	dwg_decode_add_object_ref()

	indxf: more object_map, HEADER handles, ...
	Can now write most of the entities.
	set the object_map from the handles,
	fix reading HEADER handles,
	rename dxf_find_tablehandle to dwg_find_tablehandle. It is not just
	DXF-only

	indxf: support 3DFACE and 3DSOLID names

	indxf: start testing dxf2dwg
	for now just the alive.text. not a functional test

	indxf: dxf_find_tablehandle
	resolve table names to handle

2019-08-05  Reini Urban  <rurban@cpan.org>

	index: finished reading all sections
	start writing the dwg

	index: WIP OBJECTS and ENTITIES

	indxf: check common_entity_fields
	for entities. fixes e.g. BLOCK.layer.
	skip old table-only specific fields for new_object()
	and let it search the dynapi fields instead.

	doc: fix some more indices
	Now the object appears in the new 2nd index,
	but for pdf not the entities in the first yet.

	doc: dwg_get_ => dwg_getall_

2019-08-05  Reini Urban  <rurban@cpan.org>

	generate dynapi.texi
	for all HEADER, OBJECTS, ENTITIES and internal subfields.
	Not CLASSES yet. Not sure about TABLES.

	TODO The makeinfo for pdf index and menu generation does not work
	for an included file. Maybe include it via gen-dynapi.pl

	Closes #127

2019-08-05  Reini Urban  <rurban@cpan.org>

	generate src/objects.inc
	This attempt is much better than a polluted dwg.spec
	Get rid of all the hacks from the previous commit

	WIP indxf refactor
	define IS_INDXF (not DXF nor ENCODER).
	delete all the FIELD, VALUE and HEADER macros,
	as we only parse dwg.spec to get the OBJECT and ENTITY definitions
	but we don't care about the fields and the additional logic.

	more minor BLOCK_RECORD fixups
	search fields with the right name (and log the error).
	fix color.index value

	add VT_INT64 type to dxf/eed
	e.g. BLL REQUIREDVERSIONS [160] since r2013+

	dynapi: fix utf8 conversion
	is_utf8 denotes an UTF-8 input string, not that
	the target may be unicode. is_utf8 is always on in ascii importers.
	dont convert every string pair to unicode, because some fields
	are just TV or TF. we need to wait for that, dynapi_set_helper does that

	add COMMON_TABLE_FIELDS, handle indxf BLOCK_RECORD tables
	ensure the same binary layout for all but the LAYER table.
	fix the wrong BLOCK_CONTROL.entries[] handle vector, and name confusion.
	fixup the seperation of BLOCK_RECORD tables to BLOCK_HEADER and
	BLOCK_CONTROL objects.

	indxf: fix table common handle vectors
	check and fix CONTROL.num_entries,
	check if in reactors or xdict or ownerhandle,
	implement reactors[], xdicobjhandle.

	dynapi: enable color.index, fix DXF
	indxf: read colors (always "CMC"), seperate from points

	api: rename VPORT.ucs_pre_viewport to UCSVP [65]
	which is bit 0 of VIEWMODE [71].

2019-08-05  Reini Urban  <rurban@cpan.org>

	indxf: more table fields
	don't translate certain header strings to unicode: 0, 2, 9

	Fixup test-data/2000/TS1.dxf to R2000, it was R2018.
	For now done manually in HEADER only.

2019-08-05  Reini Urban  <rurban@cpan.org>

	indxf: points

	indxf: search also in common fields
	add the common fields for obejcts and entities to the dynapi.
	search also point members (like dxf 20 for a 2DPOINT matching dxf 10  in the field)

	indxf: finish most tables, start with BLOCK_RECORD
	only a few fields are unknown, like 20, 30 for 3DPOINT 10,
	and the common object fields.

	indxf: add_eed
	Only for a very limited number of supported EED codes yet,
	and only for handle 1001 ACAD.

	indxf: add table.handle to table_control hdls vector
	allocate and special-case DIMSTYLE_CONTROL.morehandle[]
	allocate and set TABLE_CONTROL.hdls[]

	indxf: NEW_OBJECT and ADD_OBJECT macros

	examples: change handle types

2019-08-05  Reini Urban  <rurban@cpan.org>

	change handle types, add formatting macros
	handle.value is now BITCODE_BL (uint32_t)
	.code and .size are BITCODE_RC (uint8_t)

	Add FORMAT_H, ARGS_H(hdl) and FORMAT_REF, ARGS_REF(ref) macros
	for uniform handle output.

	Add indxf add_handle and add_handleref helpers

2019-08-05  Reini Urban  <rurban@cpan.org>

	dynapi: fix dwg_dynapi_entity_set_value for strings

	adjust dynapi line#

	indxf: more new_table

	indxf: more dxf_tables_read
	new_table and problems with certain *Active_CONTROL tables

	rename HEADER.LINETYPE_CONTROL_OBJECT to LTYPE_CONTROL_OBJECT
	and HEADER.DICTIONARY_NAMED_OBJECTS to DICTIONARY_NAMED_OBJECT
	for consistency, esp. needed by in_dxf

	indxf: start with dxf_tables_read

	indxf: fix dxf_classes_read

	indxf: fix empty strings
	dont scan past the \n

	indxf: handle unknown HEADER fields
	add 2 DXF-only TIME fields.
	most header fields can now be read.

	fix array_push
	need to return the changed hdls

	make Dxf_Pair, array_push, matches_type avail to in_dxfb

	dynapi: export all functions
	also the ones returning fields.
	optimize NULL type checks

	Replace AC_FUNC_STRTOD by AC_CHECK_FUNC
	AC_FUNC_STRTOD broken for cross-compiling

	add AC_FUNC_STRTOD probe

	indxf: postpone header_hdls, accept space in strings
	header_hdls is an array of fields and names, which needs to be
	filled after reading the tables with its handles.
	dxf_read_string failed to read strings with a space, like "Tavolo 3"

	indxf: improve logging

	indxf: fix the sscanf (%f) part
	advance dat (via strtod). Next: handles as string

	indxf: check types, handle points
	but the sscanf (%f) part is still wrong

	add dwg_dynapi_header_field, dwg_dynapi_common_*_field
	needed to do type-checking before setting a value.
	not in in the public API for now.

	indxf: dxf_header_read

2019-08-01  Reini Urban  <rurban@cpan.org>

	OLE2FRAME dynapi dxf values

	revive bd-unknown.inc
	destroyed before

	examples/bits: try all combinations
	avoid stack overflow, always try the next offset.

2019-08-01  Reini Urban  <rurban@cpan.org>

	add -x option to examples/bd|bits
	to easier decode hexdumps

	avoid stack overflow, don't restart with a smaller offset

2019-08-01  Reini Urban  <rurban@cpan.org>

	More OLE2FRAME
	found the MSD-CFB offset in the OLE2FRAME.data at 0x80
	The header before are most likely the missing fields.

2019-08-01  Reini Urban  <rurban@cpan.org>

	Change OLE2FRAME
	remove flag 70, it is a fixed oleversion 70: always 2
	mode is r2000+ DXF 72, tile_mode, 0: mspace, 1: pspace
	unknown is most likely the boolean lock_aspect, DXF 73
	data is DXF type BINARY, 310
	data_length is DXF 90

	data embeds more fields, we do not decode yet:
	oleversion: always 2 (was flag)
	oleclient (e.g. "OLE" or "Paintbrush Picture")
	pt1 DXF 10, upper left corner
	pt2 DXF 11, lower right corner

2019-08-01  Reini Urban  <rurban@cpan.org>

	Fix types in 2 unit-tests
	Not detected by gcc, only clang-7 via -Wformat

2019-07-31  Reini Urban  <rurban@cpan.org>

	fix log out-of-tree

	fix logs-all.sh out-of-tree

2019-07-30  Reini Urban  <rurban@cpan.org>

	fixup dynapi.c generation
	when out-of-tree
	A fix for a51de973e5dca582536d425b28c82cc98165bbc1

	r2007: rename internal unused sections_amount to num_sections

	r2007: more defenses

2019-07-29  Reini Urban  <rurban@cpan.org>

	fix out-of-tree make check-dwg
	and check-dxf, check-dwg-valgrind

	fix leak with Invalid System Section data_size

	fix gen-dynapi.pl out-of-tree
	when configured elsewhere

	WIP decompress_R2004_section: fix one more
	dst overflow. This time better

	Protect from illegal dwg->num _classes

	new error: dwg too small: n bytes

	decompress_R2004_section assert => error
	ERROR: decompress_R2004_section: src offset underflow
	many afl-fuzz cases

	Fix decompress_R2004_section overflow
	when writing to dst. Caught by afl-fuzz.

	Stabilize validate_POLYLINE
	when _obj->vertex[_obj->num_owned - 1]->obj is empty

	Add r2007 system section checks
	checking against a corrupt section map.
	Note that the size factor depends on the compression.
	we kill it when the compression would expand > 10x

	Fix unused page crash
	when we find a page.number < 0 (gap/unused page)
	initialize the next new page with NULL

	r2004 sections: clear on realloc
	otherwise we do have uninitialized chunk there

	renamed Dwg_Section_Info.pagecount to num_sections
	This was always very confusing. num-sections was not used and always 0,
	and pagecount was the number of pages/i.e. Dwg_Section **sections

	unit-testing: fix out-of-tree deps

	examples: fix out-of-tree deps

	afl: re-add more dwg_api functions
	so that the api examples can be built and fuzzed

2019-07-28  Reini Urban  <rurban@cpan.org>

	spec formatting

	Fix dwg_validate_POLYLINE without vertex[]
	Found via afl-fuzz

	Fix a R13 heap-buffer-overflow
	An off-by-one error, detected by afl-fuzz.

	Fix free dwg_class NULL deref
	Fixes part 14 of GH #126

	Fix dwg2svg2 NULL deref
	Fixes part 13 of GH #126

	Check Invalid Header section, skip
	when section[0] is invalid.
	Fixes part 9 and 11 of GH #126

	Check Invalid AuxHeader: buffer overflow
	when section[5] is invalid

	harmonize logging of header.num_sections

	header.spec: formatting

2019-07-28  Reini Urban  <rurban@cpan.org>

	afl: disable most of the old dwg_api
	when compiling via afl-gcc/clang.

	with asan:
	make -j4 -s clean
	export ASAN_OPTIONS="abort_on_error=1:detect_leaks=0:symbolize=0:allocator_may_return_null=1"
	export AFL_CC="gcc"
	PERL=cperl5.30.0-nt \
	CC="afl-gcc" \
	CFLAGS="-m32 -O2 -g -fsanitize=address,undefined -fno-omit-frame-pointer -I/usr/local/include" \
	    ./configure --disable-static --disable-bindings --disable-dxf --disable-write $@
	AFL_USE_ASAN=1 make -j4 -s -C src
	AFL_USE_ASAN=1 make -j4 -s -C programs dwgread
	LD_LIBRARY_PATH=`pwd`/src/.libs afl-fuzz -m none -i .fuzz-in -o .fuzz-out programs/.libs/dwgread @@ /dev/null

	without:
	make -j4 -s clean
	unset ASAN_OPTIONS
	unset AFL_CC
	PERL=cperl5.30.0-nt \
	CC="afl-gcc" \
	CFLAGS="-O2 -g -I/usr/local/include" \
	    ./configure --disable-shared --disable-bindings --disable-dxf --disable-write $@
	make -j4 -s
	afl-fuzz -m none -i .fuzz-in -o .fuzz-out programs/dwgread @@ /dev/null

2019-07-28  Reini Urban  <rurban@cpan.org>

	Protect Invalid XRECORD.num_databytes
	Found via afl-fuzz

2019-07-28  Reini Urban  <rurban@cpan.org>

	Check obj->size overflow
	Throws ERROR: Invalid object size. Would overflow
	Fixes part 7 and 8 of GH #126, thanks to @strongcourage.
	A very hypothetical data corruption issue.

	Closes GH #126

2019-07-28  Reini Urban  <rurban@cpan.org>

	Fix heap-buffer-overflow in decompress_r2007
	check offset underflow, pass thru error.
	Fixes part 5 and 6 of GH #126.
	Thanks to @strongcourage

	Fix heap-buffer-overflow in decompress_R2004_section
	check for dst overflow. Fixes part 4 of GH #126.
	Also check for invalid R134 num_sections.
	Thanks to @strongcourage

	protect bit_check_CRC from buffer overflow
	Fixes part 2 and 3 of GH #126
	Thanks to @strongcourage

	Fix invalid free at decode.c:2289
	part 1 of GH #126. We forgot to reset dat to abs_dat in one branch
	Thanks to @strongcourage

	dxf: fix some MTEXT dxf codes
	a followup to c6c36153ef3ea6fec406dfd53cd6ac8201485b5d

2019-07-27  Reini Urban  <rurban@cpan.org>

	use strEQ helper macros

	add strEQ helper macros

	regen-unknown: add new AEC objects to unknown
	But since AEC doesn't file to DXF, we have no known
	DXF objects/fields. They are parametric blocks, exploding to
	LINE, HATCH, ARC, TEXT, ...

2019-07-26  Reini Urban  <rurban@cpan.org>

	fix json test with new 2018 dwg
	MLINESTYLE.ltype [] was missing the final ]

	fix MTEXT for r2018
	almost. The column_heights vector is still missing.

	new example_2018.dwg, TS1.dxf
	The old dwg was an old version

	add GEOMAPIMAGE as debugging class
	but no coverage

	fix out-of-tree gen-dynapi.pl
	gen-dynapi.pl is in srcdir

	fix unit-testing coverage
	2000/PolyLine2D.dwg was missing from DIST.
	fix out-of-tree builds for one and two levels down, ../configure
	or ../../configure

	Update NEWS, TODO
	Added a lot of coverage and really found some bugs.

	xrecord: skip xdata test
	xdata is still a linked list, not an array

	ole2frame: data != dat_length mismatch TODO

	add 2000/TS1.dwg
	by Guruprasad Rane, 2011 (GPL3)
	needed for more unit-testing coverage

	unit-testing: improve api_common_entity
	dont print the common values, only the handles. speeds it up

	unit-testing: add api_common_object
	check more common handles

	LWPOLYLINE needs to be checked by name
	because it might be a class (535), when being backported to R14.
	Fixes lwpoline unit-test for r14.

	unit-testing: allow NULL handles
	and switch the logic, fail first.
	many layers r2004+ are empty.

	fix unit-tests found with new coverage

	add dynapi coverage, fix dwg_dynapi_common_value
	detected by adding tests for it.

2019-07-25  Reini Urban  <rurban@cpan.org>

	Update NEWS TODO

	Merge branch 'gh124-dejagnu'
	See GH #124
	Now only the unit-testing coverage needs to be improved.

	rm test/testcases
	Closes GH #124

	fix dynapi_test for char** encr_sat_data
	There is no num_encr_sat_data

	unit-testing: allow NULL strings

	unit-testing: fix VERTEX_(MESH|PFACE), 3DSOLID
	VERTEX_(MESH|PFACE) missed the VERTEX_3D typedef.
	3dsolid may fail before, and thus have a NULL history_id.
	Also ensure that unknown_2007 and history_id are only for version 2

	unit-testing: finish the rest

	unit-testing: fix a few text errors
	and add more checks

	unit-testing: dimension

2019-07-24  Reini Urban  <rurban@cpan.org>

	unit-testing: polyline

	windows: fix warning: "alloca" redefined

	unit-testing: enhance coverage

	add pass,fail,ok to unit-testing
	check coverage,
	enhance coverage by checking more dwg's,
	remove INPUT from TESTS_ENVIRONMENT,
	don't exit immediately, collect errors, return error_code at the end.

	more double linkage on windows with dynapi
	and get rid of the -lm dependency

	avoid double linkage on windows with unit-testing
	2 bits functions are exported, which clashes on windows.
	disable the EXPORT attribute there when linked locally.

	change bits_test.cbmc target
	use macros

2019-07-23  Reini Urban  <rurban@cpan.org>

	disable lsan for unit-testing
	just too much work for now to clean up all the copies

	add ATTRIBUTE_MALLOC, probe for FUNC_ATTRIBUTE_FORMAT

	more scan-build warnings
	Potential leak of memory decomp
	Dead assignment
	uninitialized value

	add test/unit-testing/dynapi_test.c
	dont rely in Convert::Binary::C

	Improve dwg_dynapi_handle_name
	Dont convert obj to _obj to obj back & forth

	dwg_dynapi_handle_name return UTF-8 strings
	when the field is a wide-string.
	All the tables use FIELD_T names.
	But the dynapi sometimes misrepresents T types as TV, so only check
	against TF, which is always single-byte.

	add dwg_dynapi_handle_name
	similar to  dwg_obj_table_get_name, which only supports tables.
	This supports all objects and entities with a name field.

	fix xline dynapi
	caught with the new unit-tests

	export dwg.c functions
	in the body also. just to seperate it more clearly from static

2019-07-23  Reini Urban  <rurban@cpan.org>

	more unit-testing entities
	make -C test/unit-testing check \
	  TESTS_ENVIRONMENT='INPUT=../../td/example_2004.dwg' ...

	for most dwg's

2019-07-23  Reini Urban  <rurban@cpan.org>

	enhance unit-testing iterator
	catch also ATTRIB and ATTDEF entities.
	Check more NULL refs

	disable dejagnu
	See GH #124

2019-07-22  Reini Urban  <rurban@cpan.org>

	dynapi_test: simplify pass ()

	move some testcases to unit-testing
	fix some string tests with valid NULL strings.
	get rid of dejagnu there, i.e. roll our own (better one)

	WIP: unit-testing dynapi
	we need to get rid of the old dejagnu testcases,
	get rid of the unit-testing print-only check: compare
	to low-level values, test the new APIs: by object and by type.

	strdup: set the feature at first
	need __STDC_WANT_LIB_EXT2__ set before including any feature.h
	on older glibc's, which do need _USE_BSD instead.

2019-07-21  Reini Urban  <rurban@cpan.org>

	unknown: remove 1 DIMASSOC with invalid handle

	WIP GEOMAPIMAGE fields
	And some more docs

	Update NEWS
	for the new API functions

2019-07-20  Reini Urban  <rurban@cpan.org>

	more GCC30_DIAG fixups
	They are ignored for newer gccs. Use the new decl. also

	decode_r2007: pages_map memory leak on error

	dynapi: null pointer dereference [-Wnull-dereference]

	decode: null pointer dereference [-Wnull-dereference]

	encode: declare strdup
	warning: incompatible implicit declaration of built-in function ‘strdup’

2019-07-20  Reini Urban  <rurban@cpan.org>

	api: Allocator sizeof operand mismatch
	eg wrong string handling:
	dwg_ent_set_UTF8 Result of 'calloc' is converted to a pointer of
	type 'char', which is incompatible with sizeof operand type 'char *'

	make -s scan-build SCAN_BUILD=scan-build-7

2019-07-20  Reini Urban  <rurban@cpan.org>

	dwg_api: potential null pointer dereference [-Wnull-dereference]

2019-07-19  Reini Urban  <rurban@cpan.org>

	Fix warning: declaration of ‘index’ shadows a global declaration
	i.e. the index function. only with older compilers.

	Fix GCC30_DIAG_IGNORE (-Wformat-nonliteral) for older gcc <4.6
	only allowed outside functions until gcc 4.6 (or clang).
	Before gcc-4.6 the pragma needs to be before the function
	in question.

	.c.ii without cc extensions -MT -MD -MP -MF
	pgcc struggles with it

2019-07-19  Reini Urban  <rurban@cpan.org>

	revamp CC_DIAG_IGNORE
	remove unused defines, simplify.

	Note that clang -Wtautological-constant-out-of-range-compare in 3 places
	cannot be suppressed, but we'll get rid of these old overflow checks
	soon, as we do better now.

2019-07-19  Reini Urban  <rurban@cpan.org>

	gcc -Wformat-nonliteral is since 3.0.4 at least
	and in clang also

2019-07-18  Reini Urban  <rurban@cpan.org>

	Merge branch 'gh97-dynapi'
	Closes GH #97, but there are no test-cases for the new API yet.

	dwg2svg2: use the new partially typed API

	missing dynapi utf8text functions (2)
	the simplified dwg_{g,s}et_OBJECT_utf8text() API

	add the missing dynapi functions, add is_utf8 to setters

	update NEWS for 9.0

	add dwg_dynapi_entity_utf8text
	which returns a fresh copy of a TU string converted to
	UTF-8, as with the deprecated API.

2019-07-17  Reini Urban  <rurban@cpan.org>

	dynapi: replace deprecated API functions WIP
	See GH #97

	api: move Dwg_Version_Type to dwg.h
	make dwg->header.version a public enum, not some strange
	unrelated int.
	This also adds documentation to R_* release <> AC* DWG versions.

	minor dwg.spec simplification

	fix a suffix() edgecase, when basename() fails

	darwin fprintf dtoa leak
	and more darwin leaks. not detected via lsan, only via valgrind.
	convert dxf VALUE_RD to a function, too large for a macro.
	maybe add a 0-stripper here later.

	dxf: non-destructive FIELD_BD
	for angles, dont change the field value. convert only
	the printed value on-the-fly rad2deg

	fix logs_all.sh to use parallel version

2019-07-17  Reini Urban  <rurban@cpan.org>

	unknown: disallow TV in r2007+ versions
	cannot try TV fallback in TU dwgs.

	also stabilize PICAT and PARALLEL version probes a bit (space in pathname).
	The logs-all.sh target is still wrong though, fixed in next commit.

2019-07-16  Reini Urban  <rurban@cpan.org>

	unknown: add is_entity flag
	check ENC or CMC based on it (see GH #123)

	fix bd-unknown.pl to be run from examples
	via make. add some new

	unknown: skip some overlarge ACAD_TABLE objects
	leading to picat out-of-memory errors

	fix -Wnull-dereference warnings
	potential null dereferences, detected by -flto -O3

	regen-unknown with fixed hdlsize
	some objects Hdlsize: were missing

	unknown: add hdlsize
	which is needed to find the last handle, to seperate it from the final
	padding until the crc.

	unknown: rename bitsize => num_bits
	use bitsize only for the matching obj->bitsize
	and num_bits for the calculated unknown->num_bits

	unknown: comment sizes
	and add [RL] to the read bitsize (opposite to a calculated value)

	bit_read_ENC: we do have hdl_dat now

	fix unknown bit_ENC for 2+ streams

	run make regen-unknown: with more unknown pairs
	got a couple of more dwg/dxf pairs, with new objects

	fix regen-unknown
	with the changed log format for bitsize.
	also get a few new files

	add generated json.test to .gitignore

2019-07-15  Reini Urban  <rurban@cpan.org>

	bump copyright year to 2019
	to all in 2019 changed files

	stabilize autogen.sh
	See GH #101

	move -version-info upwards

	add -version-info for the shared lib
	was only 0:0:0, now 0:8:0

	fix -Wrestrict in dwg_decode_##token##_private
	warned only by gcc, not clang

	fix ax_python_devel.m4
	wrong -z check

2019-07-15  Reini Urban  <rurban@cpan.org>

	add .c.ic rule, probe for $(CLANG_FORMAT)
	make -C src decode.ic will create an expanded version
	of decode.c in-place, keep a proper backup!
	used to find problems in macros.

	clang-7 started omitting the .0

2019-07-15  Reini Urban  <rurban@cpan.org>

	silence -Wformat-nonliteral
	Closes GH #121

2019-07-15  Reini Urban  <rurban@cpan.org>

	expand [rcount1], [rcount2] to [%d] for LOG_TRACE
	better logging.

	It looks expensive, timings:
	                 without     with
	make check       0m12.034s   0m12.303s
	  (mostly -v2)
	./logs-all.sh    0m35.934s   0m37.324s
	  (only -v4)
	so it's neglectable.
	TODO -Wno-format-nonliteral

2019-07-15  Reini Urban  <rurban@cpan.org>

	Merge branch 'gh85-limitall' into smoke/master
	Closes #85

2019-07-14  Reini Urban  <rurban@cpan.org>

	unrestrict dat before the CRC calculation
	and fix it for the restricted range. The CRC exceeds it,
	do it absolutely.
	We unfortunately start our dat after the obj->size,
	not before, at obj->adress.

	unknown_bits: permit overflow of one byte
	temporary.
	the new restricted streams found this overflow

2019-07-14  Reini Urban  <rurban@cpan.org>

	seperate and restrict the 3 streams
	to catch overflows, put them on the stack.
	See #85
	This enables now interleaving of handles in the spec,
	need not to be at the very end.

	restrict dat at dwg_decode_add_object(),
	keep the 3 streams at the same initial offset, the
	obj->address - obj->size, and also its size,
	and tighten it later as of now (in decode private).
	Previously the hdl_dat 0 and str_dat 0 were at their resp.
	starts, but this way we can compare them easier.
	Calculating the relative stream positions is now trivial, e.g.
	for the padding check in DWG_ENTITY_END.

	add helper function obj_stream_position() which returns
	the furthest handle position (data, handle, string streams)
	set dat position to the max(dat, hdl_dat, str_dat) for the padding
	and crc check.

	harmonize pos and address name suffices
	pos for bit positions, address for absolute byte addresses (objects only)

	There's no need for the offset fields dat_address,
	hdlpos, strpos, only bitsize_pos is needed for encode, to patch-in
	the bitsize.
	Remove unneeded obj->handle_offset (== obj->bitsize)
	and obj->string_offset.

	XRECORD: fixup objid_handles[] hdl_dat loop

2019-07-14  Reini Urban  <rurban@cpan.org>

	fixup crc logging

	fixup logging indentation
	any read value needs to be logged at col 1, and calculated value indented.

	change FIELD_HANDLE @pos logging to INSANE (v5)

	protect NULL ptrs in get_next_owned_entity
	by dwg2dxf example_2007

	add bits dat->opts for loglevel
	this way we can silence known overflows,
	and honor the given loglevel

2019-07-13  Reini Urban  <rurban@cpan.org>

	bits: log overflow errors

	log hdl @pos for each handle

2019-07-12  Reini Urban  <rurban@cpan.org>

	Merge branch 'smoke/asan'
	Fixed all leaks

	travis: re-enable full lsan/asan checks

	fix dwg_ent_get_ltype_name doc

	fix unittest leaks

	fix dwg2svg2 leaks
	a bit more tricky, because dwg_api does not contain the R_2007 enum

	dwg2dxf: fix invalid free

	fix dwggrep leak with pcre2_16

	fix geojson leaks

	travis: re-check without lsan

	lsan fixes: detect asan and call dwg_free then
	Never skip dwg_free when compiled with asan, even if lsan is disabled.
	(i.e. by default under darwin)
	We don't check for getenv(ASAN_OPTIONS) =~ detect_leaks=1

	add dsymutil to log on darwin
	Note: this really should be added to COMPILE somewhen.

	fix 3dsolid leaks
	with version 1 also free the last empty block,
	with version 2 calloc 3 blocks, with size 0 for the last.

	travis: use xenial for pcre2/dwggrep tests

	travis: add asan

2019-07-11  Reini Urban  <rurban@cpan.org>

	protect invalid free

2019-07-09  Reini Urban  <rurban@cpan.org>

	dxf: protect empty last_attrib

	fixup wrong clang-formatting

2019-07-08  Reini Urban  <rurban@cpan.org>

	fixup --enable-debug json nan values
	for json.test. With debug many numeric values are nan.
	use the probed paths for sed and jq.

	See #108, but we don't want to intercept fprintf %f for nan.
	An error is an error.

2019-07-08  Reini Urban  <rurban@cpan.org>

	remove xrecord,proxy get_ownerhandle API

2019-07-07  Reini Urban  <rurban@cpan.org>

	remove unneeded ownerhandle
	and update the dynapi

	Move ownerhandle to parent Object_Object
	along reactors and xdicobjhandle. This field is common to all
	objects. See #118

	fix print FIELD_ENC for color.handle change
	For the change in 84bdc444fc5262c4

2019-07-07  Reini Urban  <rurban@cpan.org>

	START_OBJECT_HANDLE_STREAM #118
	Generalize object handles:
	Rename common field ownerhandle, exp. not NAME_control 330.
	Remove various null_handle fields.

	Rename LTYPE.null_handle to LTYPE.extref_handle
	Add SORTENTSTABLE.dict_handle (previous called ownerhandle,
	it IS the ownerhandle. ok, there we do have both, the parenthandle
	and the ownerhandle)

2019-07-07  Reini Urban  <rurban@cpan.org>

	Add more missing ownerhandle fields
	But that really should be in Dwg_Object_Object instead.
	See #118

2019-07-07  Reini Urban  <rurban@cpan.org>

	Fix FIELDLIST standard handles
	See #118, thanks to normwill-beast.

	This will be simplified to a generic handle stream reader, outside the
	dwg.spec, only carrying object-specific fields there.
	With the handles intermixed, not necessarily at the end.

2019-07-07  Reini Urban  <rurban@cpan.org>

	Fix FIELD.childs and objects
	And add ownerhandle and the other missing standard handles.
	Closes #117, thanks to normwill-beast

	Fix MLINESTYLE.ltype handles
	Read them from the handlestream, after all others.
	Closes #116, thanks to normwill-beast.

2019-07-07  Reini Urban  <rurban@cpan.org>

	Fix MULTILEADER content_block
	And fix invalid free of ctx.content.txt.style.

	Only set ctx.content.blk.block_table with ctx.has_content_block, and move it
	down to the handle stream (will be fixed up later, with a proper hdl_dat)
	Fixes e.g.  ERROR: Invalid 3BD ctx.content.blk.{scale,normal}, because we
	have no hdl_dat setup yet.

	Closes #113, thanks to normwill-beast

2019-07-07  Reini Urban  <rurban@cpan.org>

	Add many missing handles 2007+
	Due to the fixed handle_stream offset, we can now
	reliably read many more handles.

	DIMENSION_ORDINATE
	DIMENSION_LINEAR
	DIMENSION_ALIGNED
	DIMENSION_ANG3PT
	DIMENSION_ANG2LN
	DIMENSION_RADIUS
	DIMENSION_DIAMETER
	MTEXT
	BLOCK_CONTROL
	STYLE
	SORTENTSTABLE

	Closes GH #115, thanks to normwill-beast.

	Renamed STYLE.null_handle to STYLE.extref_handle.
	Kept SORTENTSTABLE.owner_dict name, documented as SORTENTSTABLE.parenthandle.
	owner_dict sounds more specific and less general, but we have no other parenthandle
	fields.

2019-07-07  Reini Urban  <rurban@cpan.org>

	Missing START_HANDLE_STREAM
	in APPID, DICTIONARYVAR, VPORT_ENTITY_HEADER.
	Fixes many missing APPID.app_control and DICTIONARYVAR.ownerhandle.
	and Invalid handleref: warnings.

	Closes GH #114, thanks to normwill-beast

2019-07-07  Reini Urban  <rurban@cpan.org>

	Incorrect object address #112
	handlestream_size is not part of obj->size.
	This fixes the hdlpos += 8 FIXME
	and many Invalid handleref and Invalid handle pointer code errors.
	Also many ownerhandle, and other handle offsets.

	Thanks to normwill-beast

2019-07-06  Reini Urban  <rurban@cpan.org>

	clang-format

2019-07-06  Reini Urban  <rurban@cpan.org>

	defer color.handle to handle_stream
	for >= R_2007 we dont know the handle stream yet, when reading the
	common_entity_data. Defer to the start of the common_entity_handle_data
	reading the common color.handle then.
	Fixes #111, Thanks to normwill-beast.

	And while we are there sanitize the common entity color.handle:
	No extra color_handle needed. Make the handle a real H (ie. ref* to
	the DBCOLOR object).
	Remove the obsolete dwg_ent_get_color_handle API.

	Extend bit_{read,write}_ENC to include
	all 3 streams, but it is still not used yet.

2019-07-06  Reini Urban  <rurban@cpan.org>

	fix EED code 5 as int64
	Incorrect reading of the spec, fixes many MTEXT entities.
	Fixes GH #110. Thanks to normwill-beast

2019-06-26  Reini Urban  <rurban@cpan.org>

	dwg_ref_get_object: error on !ref->obj
	the caller has to resolve it, we have no dwg here

	fix NULL in out_geojson
	Thanks to @UmlauteUeberall
	Closes #107

2019-06-25  Reini Urban  <rurban@cpan.org>

	Release 0.8
	See NEWS

2019-04-26  Reini Urban  <rurban@cpan.org>

	redo build-aux/clang-format-all.sh src test examples programs

	bump copyright years to 2019

	dwgbmp: skip free unless on valgrind
	and add some missing free calls.
	test: make check-valgrind -C programs/ bin_PROGRAMS=dwgbmp

	preR13: initialize more missing TABLE obj fields
	fixing various valgrind errors, esp. with dwg_obj_is_control()

	Partially clang-format include *.h
	Not the typedef's and struct's, as gen-dynapi.pl
	cannot yet parse the changes properly.
	See the work/clang-format-inc branch.

	preR13: fix wrong FIELD_TF check
	preR13 we have no obj->address and obj->size, leading all
	VECTOR_CHKCOUNT to fail. skip that for now.
	only detected with valgrind

2019-04-25  Reini Urban  <rurban@cpan.org>

	EED: fix invalid free on failing EED
	on final free with 2007/Leader.dwg.
	This fails early with No EED[9].handle

	Also fix a double-free when failing dwg_decode_eed_data.

2019-04-25  Reini Urban  <rurban@cpan.org>

	clang-format-all

	fix read_R2004_section_info heap overflow
	on a page gap (info->pagecount++), we need to realloc the sections,
	or info->sections[j] might overflow.

2019-04-24  Reini Urban  <rurban@cpan.org>

	smoke.sh: debian testing broke a few clangs
	clang 3.8, 3.9 and 4.0 are now broken

	get_last_owned_block: fix -Wnull-dereference

	EED: no free with handle errors
	fixes asan errors with #99 cases

2019-04-23  Reini Urban  <rurban@cpan.org>

	EED: add more eed_need_size checks
	Check also individual dwg_decode_eed_data decoded sizes,
	to abort not enough room for wrong codes.
	Fixes #104.

	EED: detect invalid objects earlier

	STYLE: protect from empty font_name
	May be a NULL ptr.
	Fixes case bit_convert_TU@bits.c:1323-3___null-pointer-dereference
	of #99.

	dxf: simplify dxf type 5 vs 105 for DIMSTYLE
	only one write, not two

	dxf: check object types
	which is a more general fix for wrong object, as in
	#99 case dwg_dxf_LTYPE@dwg.spec:2523-11___heap-buffer-overflow

	dxf: protect invalid LTYPE_BYBLOCK
	check LTYPE header reference for the correct type.
	Fixes case dwg_dxf_LTYPE@dwg.spec:2523-11___heap-buffer-overflow at #99

	dwg_block_control: add error handling
	fuzzing created an invalid DWG without initial BLOCK_CONTROL
	object. Check this and error. Fixes case dwg_dxf_BLOCK_CONTROL@dwg.spec:2154-1___out-of-bounds-read of #99

2019-04-22  Reini Urban  <rurban@cpan.org>

	continue with COMMON_ENTITY_HANDLE_DATA
	if possible, and the entity-specific decoding had an
	VECTOR_CHKCOUNT_LV error.
	This is only possible with r2007+ entities

	validate _hdr->endblk_entity in get_last_owned_block
	and add if missing.
	This fixes the problem of the previous commit much better, it is not
	only a DXF-specific hack anymore.
	Closes part 2 of #99, the bit_read_B@___out-of-bounds-read testcase.
	Unlike as with the previous fix, the generated/found ENDBLK entity has
	now the correct groups 5 and 330, and the missing object_ref handle is
	fixed up.

2019-04-21  Reini Urban  <rurban@cpan.org>

	dxf: WIP fix for empty ENDBLK entity
	This from the #99 bit_read_B@___out-of-bounds-read fuzzer case.

	TODO: The real fix should be put into dwg_validate_INSERT
	so that get_last_owned_block can never fail, and always return
	a valid ENDBLK even if it couldn't be found at decode.

2019-04-20  Reini Urban  <rurban@cpan.org>

	fix #99 first SEGV
	dwg_dxf_LEADER@dwg.spec:2034-3___null-pointer-dereference
	This is at FIELD_3DPOINT_VECTOR in LEADER.
	There are illegal size fields (num_points) in LEADER on decode, which are not yet set to 0.
	Add a _LV macro variant for size lvalue, which can be set to 0.

	Also found an entity with entmode 3 but empty ownerhandle.
	Write an empty ownerhandle then.
	Fixed also a typo in writing the mspace block_record with entmode 2: PSPACE => MSPACE

2019-04-20  Reini Urban  <rurban@cpan.org>

	dwg_decode_eed_data: whitespace only

2019-04-19  Reini Urban  <rurban@cpan.org>

	run bash clang-format-all.sh src programs examples test
	excluding include bindings, with clang-format-mp-devel.

	with an older clang-format than devel (i.e. 8.0)
	you can also just run it with the -style=GNU option, but I
	changed three options: SortIncludes:false, SortUsingDeclarations: false,
	IndentPPDirectives: AfterHash

2019-04-19  Reini Urban  <rurban@cpan.org>

	fixup includes and generators a bit
	avoid EXPORT redef after clang-format-all.
	also improve the generated C sources to match the formatting
	more.

	add .clang-format
	created with the undocumented GNU style:
	clang-format -style=GNU -dump-config > .clang-format

2019-04-07  Reini Urban  <rurban@cpan.org>

	cirrus: add branch filter

2019-03-30  Reini Urban  <rurban@cpan.org>

	--disable-python on cygwin
	it's just too broken to be repairable for now.
	python3.6m works on x64 though.

	--enable-python=yes vs check/default
	only die with yes, disable if not found instead

2019-03-29  Reini Urban  <rurban@cpan.org>

	appveyor: cygwin defaulted to python3 now
	/usr/bin/python3 is now the default, but there's still an old /usr/bin/python around.
	it couldn't be linked, because python36-devel was missing.

2019-03-29  Reini Urban  <rurban@cpan.org>

	config.h: silence __XSI_VISIBLE redefined warnings
	guard __XSI_VISIBLE redefinition, only needed for cygwin strdup.

	add config.h.in to git, autoheader does not overwrite it.

2019-03-29  Reini Urban  <rurban@cpan.org>

	patch ax_python_devel.m4 for cygwin
	keep using ac_python_library (esp. for the m suffix)

	patch ax_python_devel.m4 for --enable-framework
	and LOCALMODLIBS. Reapply our old patches

	revert ax_python_devel.m4 to upstream
	skip our python probe improvements, they caught up in between

	windows: fix type warnings
	-Wincompatible-pointer-type, -Wunused-function

	add AX_ADD_FORTIFY_SOURCE probe
	for faster glibc calls, and some compile-time safety

	fix 2 -Wmaybe-uninitialized vars

	api: add some missing deprecation decls
	dwg_api.h is not included into swig at all.

	fix gcc-4.4 -ansi errors
	duplicate typedefs
	shadowed index variable decl

	color.index: signed short
	may be negavtive. Only cygwin gcc emitted this -Wtype-limits warning

2019-03-22  luz.paz  <luzpaz@users.noreply.github.com>

	Misc. typos
	Found via `codespell`

2019-03-01  Reini Urban  <rurban@cpan.org>

	myalloca.h: fixup wrong #if HAVE_ALLOCA_H
	need #ifdef

2019-02-25  Reini Urban  <rurban@cpan.org>

	add section_infohdr struct
	its num_desc replaces num_info

	Fix gen-dynapi.pl for FreeBSD 12

2019-02-25  Reini Urban  <rurban@cpan.org>

	Fix clang support for gen-dynapi.pl (#98)
	Add all the -print-search-dirs, not just the first.
	For clang /usr/lib/gcc/x86_64-linux-gnu/8 is needed also.

	Stabilize clang detection by checking for the include dirs,
	not the executable name (which is cc on FreeBSD e.g.)

	Also remove BITCODE_BS defines clashing with the typedef, leading to
	typedef uint16_t uint16_t; This also fixes many wrong dynapi types
	to proper BITCODE_BS.

	Closes #98

2019-02-25  Reini Urban  <rurban@cpan.org>

	WIP clang support for gen-dynapi.pl (#98)
	Some more defines still needed

2019-02-24  Reini Urban  <rurban@cpan.org>

	section: add more tracing

	section: add one more invalid Section info check
	The addresses must raise.
	Reformat logging a bit

2019-02-22  Reini Urban  <rurban@cpan.org>

	fix some compiler warnings
	and wrong types, esp. encr_sat_data TV => char**

	section: cosmetics
	r2007 calls the SECTION.number id. We call it number because of R11

2019-02-21  Reini Urban  <rurban@cpan.org>

	geojson: encode color as rgb (r2004+) or index
	Closes #95

	json: field_cmc use Dwg_Color* by ref
	don't copy the struct. for consistency

	json: color names are only TV
	no unicode

	json: abstract field_cmc() function
	no macros needed. makes for much smaler code and easier debugging.
	the color struct is passed by copy for now.

	json: print only alpha color names
	many names are still garbled, like VIEWSTYLE.edge_obscured_color
	don't print them if they don't start with an alpha character.

	json: enhance color map
	skip defaults, index default is 0,
	add flag, name and bookname

	geojson: better Layer, use name or Text properties
	Skip empty Text, use name for INSERT

2019-02-20  Reini Urban  <rurban@cpan.org>

	geojson: skip default Linetype
	print color as number

	geojson: skip null properties

	geojson: add color property
	but not the color name, just the index.
	Google Maps expects a name, e.g. blue

	log: accept td/*.dwg symlinks

2019-02-20  Reini Urban  <rurban@cpan.org>

	fix LAYER.on flag (#96)
	set it for r13-r14,
	and fix the flag field also (no color_rs there).
	fix it for r2000+ (reverse).

	use it in dwglayers

2019-02-20  Reini Urban  <rurban@cpan.org>

	regen unknown: depend on bd-unknown.inc
	add bd-unknown.inc generation rule

	decode: advance chain ptr for picture (unused)
	just for consistency.
	the ptr is set absolutely in the next lines for the header.

	replace memcpy with bfr_read

	api: rename section.unknown2 to unknown

	harmonize 2007 section types with 2004
	sizes and addresses are unsigned.
	re-use bfr_read with 2004

	harmonize Dwg_Section_Info, memcpy struct
	similar to 2007 bfr_read()
	rename start_offset to offset,
	use RLd section.number (i.e. int32_t)

2019-02-20  Reini Urban  <rurban@cpan.org>

	Improve/harmonize logging 2004 section sizes (#93)
	read_R2004_section_info still has a problem with wrong page sizes,
	the 2007 variant read_data_section not.
	Continue on fc3fd1c14eb08f6e06f516753bfac1fa59029d3a
	The section_size is uint64, not int32. (ODA p28)

	$ programs/dwgread test/test-big/2004/HARTA_E_PRISHTINES.dwg
	ERROR: read_R2004_section_info out of range
	Warning: Failed to find section_info[13] with type 0x3
	ERROR: Failed to read compressed class section

2019-02-20  Reini Urban  <rurban@cpan.org>

	json: share cquote with geojson

	add myalloca.h and freea(ptr)
	for all the various alloca usages.
	freea() is a noop, only used on old systems without alloca (where
	malloc is used instead).

2019-02-19  Reini Urban  <rurban@cpan.org>

	use AC_FUNC_ALLOCA probe
	and use the recommended prologue, assuming it
	exists everywhere (C99)

2019-02-19  Reini Urban  <rurban@cpan.org>

	more GeoJSON support (#95)
	TEXT, MTEXT: Text feature and insertion point
	proper Layer and Linetype names

	add dwg_ent_get_ltype_name API

2019-02-19  Reini Urban  <rurban@cpan.org>

	geojson: fix undefined behaviour with loop counter
	dwg_geojson_LWPOLYLINE: don't use the counter after the loop.
	fails with ubsan

2019-02-14  Reini Urban  <rurban@cpan.org>

	more gen-dynapi.pl fixups: bsd
	define more new libc-specific macros, for darwin.
	BL is now fixed up again.

	fixup gen-dynapi.pl for cc-specific stddef.h
	and unify uint16_t to BS, uint32_t to BL, needed since
	fcfbe04fd338627e7713c48ddd51cbdc5384dd6c (typedefs)

	GeoJSON: fix json commas
	passes now jq

	add geojson jq tests to json.test

	GeoJSON: LWPOLYLINE also as direct type
	seperate it into its own function to handle it
	directly or as variable type

2019-02-07  Reini Urban  <rurban@cpan.org>

	skip attribute_deprecated_with_message with icc
	The msg arg is not supported with icc 12

	ax_compiler_flags_cflags: set ac_c_werror_flag=yes
	This ensures compilers like icc read the actual stderr
	conftest.err when -Werror=unknown-warning-option is invalid.

	more restrict

2019-02-06  Reini Urban  <rurban@cpan.org>

	dwg.h: fixup RLL confusion

2019-02-06  Reini Urban  <rurban@cpan.org>

	api: change BITCODE defines to typedefs
	This pins down the types, and helps in debugging and the dynapi.
	eg fieldhandles is now a H*

	BITCODE's were added with 19ccf73769024991c43e08c012db010790ffd9dc to
	d28470bcaa61d0ce811aeb8ba8aa77ff6a010f1d

2019-02-06  Reini Urban  <rurban@cpan.org>

	cygwin32: fix include/dwg.h types
	The cygwin probes fail to check HAVE_STDINT_H, and these
	config.h defines are not available in the public header anyway.
	Need to fallback on defines for a pure non-autotooled system.

	on 32bit without HAVE_STDINT_H the sizes are different.
	Should fix the dynapi HEADER tests.

2019-02-06  Reini Urban  <rurban@cpan.org>

	demand C99 stdint.h
	we already demand that via AC_PROG_CC_C99
	assume in dwg.h stdint.h and inttypes.h,
	without demanding autotools HAVE_STDINT_H defines

	e.g. freebsd
	insert.c:21:56: warning: format specifies type 'unsigned int' but the argument has type 'BITCODE_BL' (aka 'unsigned long') [-Wformat]
	printf ("object count for insert : " FORMAT_BL "\n", insert->num_owned);

2019-02-05  Reini Urban  <rurban@cpan.org>

	dwgread: no extra \n

	dxf: add object_entity dxfgroups to dynapi
	and fixup some wrong/missing groups

	dxf.test: honor --enable-debug setting
	works now with and without --enable-debug

	dxf: honor --enable-debug
	to test out_dxf and DXFIN with unstable objects

	configure: document --enable-debug as unstable
	it should have really been called --enable-unstable, but there we are.
	it also disables -O2 and sets -fno-omit-frame-pointer, which makes for
	easier debugging.

2019-02-04  Reini Urban  <rurban@cpan.org>

	dxf: fix ACTION => "dxf" expansion in classes.inc
	fixes detection of UNSTABLE_CLASS in dxf ACTION, and
	force setting of name, dxfname and fixedtype for all varying classes
	with decode and all importers

	override the dxf.test for UNSTABLE_CLASS to expect only the CLASS entry,
	no object entries.

2019-02-03  Reini Urban  <rurban@cpan.org>

	dxf: disable ACTION dxf with UNSTABLE_CLASS
	as acad import might crash with them.
	WIP ACTION needs to be passed 2x as arg to be expanded.
	The other ACTION check is also not working.

	dxf: VISUALSTYLE
	restrict 290, 291 to FIELD_B (not BS)
	They are most likely wrong, and fail to import if not 0/1

	skip dxf_validate_DICTIONARY
	NULL all invalid handles in out_dxf

	dxf_validate_DICTIONARY
	skip invalid ownerhandles

	dxf-roundtrip: fixup outname
	with e.g. example_2000 not being example_2000_2000.dxf

2019-02-02  Reini Urban  <rurban@cpan.org>

	add Dwg_Entity_ARC_DIMENSION with --enable-debug
	yet untested

	dynapi: add dxfgroups (#92) WIP
	also add new RENDERENVIRONMENT, RENDERGLOBAL objects
	(untested, but documented as DXF)

2019-02-01  Reini Urban  <rurban@cpan.org>

	mark endian specific code
	The lib only works on LE (little-endian) so far,
	for BE we would need to abstract some section code to bits_*LE

	read_R2004_section_info: remove unused Oops
	The rootcause is now fixed,
	Closes #93

2019-01-31  Reini Urban  <rurban@cpan.org>

	read_R2004_section_info (#93) num_sections => pagecount
	use uin64_t section_size, not int32.
	remove the wrong num_sections field, which is documented
	as PageCount.

	decode: signed read_R2004_section_info section_number (#93)
	a negative number denotes a gap/unused section

	decode: harmonize r2007 section logging
	mostly whitespace, one wrong 0x6 in the offset

2019-01-31  Reini Urban  <rurban@cpan.org>

	ATTDEF: fix r2007+ STRING_STREAM
	also for ATTRIB, now we get the right style handle
	and for ATTDEF the right prompt.

	{START,END}_STRING_STREAM now only used within header_variables.spec

2019-01-31  Reini Urban  <rurban@cpan.org>

	ATTDEF: add missing ATTRIB fields
	it is defined as ATTRIB plus some 2 more fields

	fix dxf-allcvt.sh
	skip not existing globbed files

	dxf: re-order ATTDEF
	3 prompt needs to be before 2 tag.
	But the prompt is not read properly, TODO

2019-01-30  Reini Urban  <rurban@cpan.org>

	Merge branch 'smoke/dynapi'

2019-01-29  Reini Urban  <rurban@cpan.org>

	dynapi_test: special-case strcmp
	which interestingly only failed on 32bit

	api: not deprecated dwg_obj_layer_get_name
	analog to the other tables

	dynapi_test: include config before public api
	even freebsd-amd64 started failing

	suppress -Wdeprecated-declarations
	on gcc and clang for the unit-tests and testcases

	dynapi_test: disable broken cygwin32 header test
	There the dynapi works fine, but the dwg->header_vars.VAR
	reference is broken somehow (some wrong offset?).

	api: add type getters and setters WIP

2019-01-28  Reini Urban  <rurban@cpan.org>

	api: add dwg_get_HEADER, dwg_set_HEADER by name

	doc: fixup refman
	doxygen: expand macros to generate decls for docs,
	add deprecations

	dynapi: fix EXPORT of internal syms
	need to generate imp_dwg_dynapi_* functions in .dll.a
	for windows

	dynapi: add dwg_get_OBJECT (#59)
	all entites and objects, also all missing typedefs.
	The api should be now complete, sans the common fields

	dynapi: add dwg_get_ENTITY (#59)
	objects not yet

	api: remove wrong nonnull attribs
	we need to allow API NULL args, which we cannot control

	dynapi: add dwg_dynapi_common_value
	and its structs, sorted by name.
	check more dynapi args for NULL

	api: revert dwg_ent_region_get_acis_empty
	we need to pass through the api.
	failed on FreeBSD

	bump copyright years, fixup #lines

	harmonize REPEAT Invalid rcount errors
	print the dxfname and fieldname similar to REPEAT_CHKCOUNT

	dynapi_test: skip count for objid_object_handles
	PROXY.objid_object_handles has a computed count (TODO)

	dynapi_test: skip count for VECTOR_N
	_transform or _transmatrix fields are malloced, but have no countfield.
	they have a fixed size of 12 or 16

	rename LEADER.numpts to num_points
	for consistency with the points* field, and a consistent
	num_ prefix

	api: rename TABLE.attribs to attrib_handles
	for consistency with all other attrib_handles

	dynapi_test: skip more fields without a count

2019-01-28  Reini Urban  <rurban@cpan.org>

	api: rename LTYPE.dash, XRECORD.num_eed
	LTYPE.dash => LTYPE.dashes
	XRECORD.num_eed => RECORD.num_xdata.

	Found those api errors only with dynapi_test

2019-01-28  Reini Urban  <rurban@cpan.org>

	dynapi_test: special-case num_reactors count

	dwg_api.h: finish deprecations and nonnull decls

	doc: improve refman target

	dynapi: fixup some H* fields
	Convert::Binary::C cannot seperate H* from H, both are just Dwg_Object_Ref*
	So we need to parse the defines.
	Fixes the COMMON_TABLE_CONTROL_FIELDS H* fields,
	and COMMON_ENTITY_POLYLINE vertex H*

	dynapi: check countfields
	of arrays.
	copy strings, do the malloc in the API.

	dynapi: extend need_malloc to indirect+malloc+string
	fixed-size structs like H, TIMEBLL, CMC
	don't need malloc, only dynamic arrays like TV, H*.
	add a seperate indirect field for structs ($is_ptr),
	and if it's a null-terminated string (ascii or wide).
	These are needed for the memcpy/strcpy in the getter/setter.

	dynapi_test: undo var++
	fixes invalid free when incr num_textfield

	dynapi: add obj->name field
	not the dxfname, but almost: DICTIONARYDFLT and PLACEHOLDER are e.g. different

	dynapi: more type cleanup
	resolve more  BITCODE types, esp ptrs.
	add need_malloc field, and reserve dxf field.

2019-01-28  Reini Urban  <rurban@cpan.org>

	dwg_api: more refactoring WIP
	add nonnull compile-time checks, add deprecation messages.

	because of the static loglevel we cannot inline the api functions
	with LOG_ERROR

2019-01-28  Reini Urban  <rurban@cpan.org>

	dynapi: refactor dwg_api WIP
	add error handling and logging to dynapi.
	rename dwg_get_OBJECT to dwg_getall_OBJECT
	check entity type for dwg_dynapi_entity_*value()

	dynapi: add setter API (and tests)

	silence dejagnu warnings on clang
	e.g. freebsd. dejagnu.h is long unmaintained

	dynapi: fixup name[4] to types
	is ptr then, and skip the suffix

	dynapi: workaround missing stddef.h
	on cygwin32 stddef.h is missing. provide an offsetof workaround.
	the other possibility would have been to provide static offsets for 64bit
	and 32bit machines, but there are other ABIs, such as x32 (ptrsize 4, intsize 8).

	dynapi: skip gen-dynapi for testcases

	dynapi: fixup sorting of dwg_name_types for _3D
	3DFACE and 3DSOLID are now proper names to be searched for

	dynapi: fixup more types

2019-01-28  Reini Urban  <rurban@cpan.org>

	dynapi_test: add HEADER tests
	sort the header_variables_fields by name, not offset

	still failing: 3DFACE, 3DSOLID

2019-01-28  Reini Urban  <rurban@cpan.org>

	dynapi: fix name* to type*
	fixes compilation of dynapi_test.
	Now just the HEADER dynapi is failing

2019-01-28  Reini Urban  <rurban@cpan.org>

	dynapi: more dynapi_test objects WIP
	add all the entities, objects and fields.

	change MULTILEADER from object to struct _dwg_entity_MULTILEADER
	for internal consistency with the dynapi.

2019-01-28  Reini Urban  <rurban@cpan.org>

	add testcases/dynapi_test WIP
	generated from all fields

	dynapi: move to public dwg_api.h
	allow NULL Dwg_DYNAPI_field *fp, rarely needed to
	get the type, size or offset

	dynapi: test it, refactor a bit

	dynapi: regen

	dynapi: rename TABLE.entry_name field to name

	dynapi: add generic getters, NULL terminate the fields
	and add size to Dwg_DYNAPI_field for easier memcpy
	without the need to lookup the BITCODE_ type.

	dynapi: add api functions
	make dwg_entity_names and dwg_object_names bsearchable (equal size)

	dynapi: add _fields access to dwg_name_types[]
	We need to bsearch the OBJECT to get to the _dwg_OBJECT_fields.

	dynapi: unexpand BITCODE_* macros
	TODO: DIMENSION_COMMON, _3DSOLID_FIELDS macros
	      union _dwg_MLEADER_Content_u

	dynapi: add dynapi.h with OFF macro
	use builtin offsetof(struct,field) and only the default value
	if stddef.h is not found

2019-01-28  Reini Urban  <rurban@cpan.org>

	Add gen-dynapi.pl, dynapi.c WIP
	Generate dwg.h struct names and field types, offsets.
	TODO: types not as string?
	      link _fields[] to some name array,
	        either dwg_name_types or dwg_entity_names

	See #59

2019-01-28  Reini Urban  <rurban@cpan.org>

	dxf: print BL LAYER_INDEX.timestamp1 as float
	out_dxf overflows BL/%u in snprintf

	dxf-allcvt: fix test-big

	fix r2007 XRECORD strings

2019-01-27  Reini Urban  <rurban@cpan.org>

	dxf-roundtrip.sh: support td/example_20*.dwg

	fix HATCH_gradientfill logic
	wrong cond

	dxf: use a better CMC index
	for a given rgb value. The index is still wrong,
	(e.g. 194 instead of 250 for rgb 0xcccccc)
	but helps importing the DXF. The index is mandatory, even for truecolor.

	dxf: mandatory LAYER.flag 70
	may not be left out, even if value 64

	doc: better links

	rename type EMC to ENC (entity color)
	and change some VISUALSTYLE colors from CMC to ENC

2019-01-25  Reini Urban  <rurban@cpan.org>

	configure: skip bindings/python without swig

	dxf: print subclass markers since r13 (#90)
	not just since r2000. Fixes dxf-roundtrip for the #90 example.
	Thanks to @Febfire for the example dwg to find the problem

	dxf: DIMSAV is not in r14

2019-01-17  Reini Urban  <rurban@cpan.org>

	configure: improve PERL_VERSION
	unused, just for printing

2019-01-16  Reini Urban  <rurban@cpan.org>

	dxf-allcvt: add test-big

	added to stable: UNDERLAY entities, UNDERLAYDEFINITION, CAMERA

	regen-unknown without test-big dwgs

	logs-all: add test/test-big
	seperate huge DWGs/logs from the normal test-data.
	there exists no logs-all.sh.in.only the parallel and serial variants
	(parallel ignored)

	improve HATCH_gradientfill: type CMC
	and the double is the shift_value: 0.0 or 1.0.
	also fixes the wrong ODA docs for Repeats # of Gradient Colors

	cirrus freebsd: disable distcheck
	for the failing bindings/python target

2019-01-15  Reini Urban  <rurban@cpan.org>

	free: fix -Wshadow for static dat
	use local dat's

	json: fix asan dynamic-stack-buffer-overflow
	too small alloca, also switch to heap on overlarge alloca (security)

	api: add get_{first,next}_owned_subentity iterator

	.gitignore: more

2019-01-14  Reini Urban  <rurban@cpan.org>

	configure: print PERL version
	not just logging to config.log

	api: add dwg_model_space_object(dwg)
	with all the checks, needed for dxf_blocks_write()

	json: fix \u00XX cquote
	and FIXME/skip surrogate pairs, U+10000+ chars.
	A lone low or high pair is forbidden, TODO.
	These mostly came from invalid binary chunk anyway.
	It fixes the json tests with --enable-debug

	cirrus: try python again
	m distdir: don't know how to make ./LibreDWG.py

	examples: speed-up make distdir
	alldwg.inc doesn't need to be generated there, make regen-unknown is enough.

2019-01-10  Reini Urban  <rurban@cpan.org>

	dxf: EMC color.rgb & 0x00ffffff only
	out_dxf needs to filter the type from the rgb value,
	in_dxf not.

	dxf: color.index & 255
	256 would be 1 then.
	AcDbHatch(1C48E9): Color index 65535
	AcDbVisualStyle(F4): Color index 3368
	...

	MATERIAL: add ownerhandle, REACTORS, XDICOBJHANDLE
	and add the mandatory DXF fields.

2019-01-09  Reini Urban  <rurban@cpan.org>

	alive.test: speed up
	only -v2. not -v4 needed.
	from 32.7s to 11.4s

	dxf: improve mspace dxf_blocks_write
	esp. for some r2010+ dwgs

	regen-unknown
	with the new DXFs

2019-01-09  Reini Urban  <rurban@cpan.org>

	test-data/2007: add missing DXF files
	XRECORD and DICTIONARY circle.dxf is wrong with ODA and our decoder.
	Check against acad versions

	dxf: skip XRECORD xdata 80-90
	These are most likely decode errors, and throw dxfin errors.
	But the circle_2007 XRECORD's all look wrong.

	dxf: _HATCH_gradientfill, fix dxf 91=>93 WIP
	num_polypaths is 93
	add missing str_dat to DWG_ENTITY decls.

2019-01-07  Reini Urban  <rurban@cpan.org>

	python: probe also without swig
	many checks need python.

	alive.test: dwggrep -c now returns 21
	The block_header iterator get_next_owned_entity finds now more.

	fixup get_next_owned_entity
	check the actual entity owner.
	it did fail with some r14-2000 attribs, belonging to 2 separate
	block headers

2019-01-07  Reini Urban  <rurban@cpan.org>

	dxf: skip *Model_Space BLOCK entities
	check ptr and index;
	improves 7cad11cc68887b, the ptr check is sometimes not good enough.

	Skip all block entities which are owned by *Model_Space.
	Some newer entities (UNDERLAY, MLEADER) are under some other blocks
	(e.g. pspace) but owned by mspace.

2019-01-07  Reini Urban  <rurban@cpan.org>

	decode: apply dwg_validate_POLYLINE/INSERT
	after having read the SEQEND, to fill in a missing
	owner->seqend handle.
	Fixes the r2010+ SEQEND errors.

2019-01-05  Reini Urban  <rurban@cpan.org>

	move dxf_is_sorted_POLYLINE to decode
	as dwg_validate_POLYLINE(), yet unused. Needs to be called after the last
	POLYLINE entity was read, which is not clear.

2019-01-05  Reini Urban  <rurban@cpan.org>

	dxf: skip *Model_Space UNDERLAY entities
	The *Model_Space BLOCK contains UNDERLAY's, but they
	only appear in the ENTITIES section, not as BLOCK entity.
	Ditto for all other *Model_Space entities.

	Error with INVALIDDWG when the BLOCK_HEADER contains no BLOCK entity.

2019-01-05  Reini Urban  <rurban@cpan.org>

	dxf: remove is_sorted, always process with subentities
	This logic was too fragile, esp. vs BLOCKS

	api: add dwg_obj_is_subentity

2019-01-05  Reini Urban  <rurban@cpan.org>

	api: rename get_*_owned_object to _entity
	get_next_owned_object only returned the next block entity,
	not any object associated and located in this block, and neither
	any VERTEX/ATTRIB.
	esp. since r2004+ with its BLOCK_HEADER.entities array.
	This skips objects and subentities (ATTRIB, VERTEX).

	Add API docs for these

2019-01-05  Reini Urban  <rurban@cpan.org>

	dxf: process VERTEX r2004+
	get_next_owned_object returns the next main entity, no VERTEX.
	set is_sorted=0 then, forcing dxf_process_* for subentities then.

	api: add get_last_owned_block()
	to return the ENDBLK for a BLOCK_HEADER.
	use it in dxf

	dxf: split BLOCKS and ENTITIES (#88) WIP
	ENTITIES only if owned by MSPACE, all other as BLOCK members.
	BLOCKS contains all pspace entities, and all blocks, but no objects.
	OBJECTS contains all objects but BLOCK_HEADER and *_CONTROL (TABLEs)

2019-01-04  Reini Urban  <rurban@cpan.org>

	--disable-bindings (#86)

	dxf.test: clear *dxf.log

	DICTIONARY: fix hard_owner DXF 350/360
	and emit it for DXF

	dxf: fix XRECORD xdata, no +1000
	XRECORD xdata has normal dxftypes

2019-01-03  Reini Urban  <rurban@cpan.org>

	dxf: BLOCK_NAME via cvt_blockname for pre-R13 names
	$MODEL_SPACE <=> *Model_Space

2019-01-02  Reini Urban  <rurban@cpan.org>

	dxf: fix EED/xdata dxfcode + 1000

2019-01-02  Reini Urban  <rurban@cpan.org>

	VALUE_HANDLE: harmonize to 4 args
	for the name logging.

	Caused by the effort to emit a 340 0 DXF pair
	for a BLOCK_RECORD layout_handle on NULL.

2018-12-31  Reini Urban  <rurban@cpan.org>

	dxf: skip more VERTEX_2D defaults

2018-12-30  Reini Urban  <rurban@cpan.org>

	VPORT: revert shade_plot_handle back to 361 sun_handle
	several DXFs have the sun there

2018-12-28  Reini Urban  <rurban@cpan.org>

	free: protect empty TABLE ent with --enable-debug
	and HANDLE_VECTOR overflow.
	Actually set an invalid size field to 0

	debug: more missing api DECLs
	with --enable-debug classes

	debug: more missing SUB_FIELDs
	with --enable-debug classes

	dwg_dim_blockname: treat DICTIONARY as LAYER
	some DWGs: 2013/gh55-ltype.dwg

	dxf: protect wrong HATCH.num_path
	and cast some NULL ptrs, and wrong formats

	dxf: more codepages
	add ANSI_1253, ANSI_1254, ANSI_936, ANSI_949

2018-12-27  Reini Urban  <rurban@cpan.org>

	multiple definition of alloca
	only complaint on freebsd

	dxf: cquote dxf_fixup_string
	for newlines and such (text 1)
	different quoting rules than json

	dxf: fix VERTEX sub classing
	tested ok

	dxf: fix 3DSOLID, BODY subclass names

	dxf: fix _3DSOLID,_3DFACE dxfname
	special case it in DXF and decoder

	api: add DIMENSION.flag from flag1 and flag2
	calculate the DXF value 70 (some bits from flag1 and 2)
	skip empty DXF user_text (at least ASCII for now)

	dxf: support DIMSTYLE 3

	dxf: add DIMSTYLE 3, skip 52
	move 3 to COMMON (before the subclass)
	skip DXF 52 ext_line_rotation: invalid

	improve dwg_dim_blockname
	sometimes a LAYER is mixed in

	dxf: add FIELD_BINARY for picture 310

	dxf: add HATCH.boundary_handles 330

	out_dxfb: sync with out_dxf

	dxf: HATCH.elevation as pt

2018-12-26  Reini Urban  <rurban@cpan.org>

	dxf: style name 7 before the subclass

	examples: add alldwg.inc to dist
	to avoid regen-unknown on make distcheck, and
	to ship it with the tar

	dxf: fixup empty POLYLINE.seqend with +1 obj
	don't try the other variant then, also to avoid a leak.

	dxf: write empty HANDLE_NAME
	otherwise DXFIN complains. e g $DIMBLK

2018-12-26  Reini Urban  <rurban@cpan.org>

	dxf: destructive i++ for the loop
	the unsorted process handlers need to advance the loop
	variable, otherwise we process some entities them twice.

	Closes #83

2018-12-26  Reini Urban  <rurban@cpan.org>

	dxf: sort INSERT-ATTRIB-SEQEND (#83)
	use one global/static is_sorted variable, for both
	POLYLINE and INSERT, both ended by SEQEND.

	add type and NULL checks in the dxf_process_##token() handler.

	reset is_sorted to the default 1.

2018-12-26  Reini Urban  <rurban@cpan.org>

	dxf.test: extend SEQEND check also to INSERT-ATTRIB (#83)
	which fails on example_20*

	cirrus: only allow master + smoke/*

	cirrus: --disable-python for the xmlsuite/check.py

	fixup empty SEQENDs in dxf is_sorted_POLYLINE
	in the decoder it is too early, so do it in one of the outputters.
	the empty SEQEND is an artefact of the previous decoder shiftup,
	the real fix would be a correct handlestream_offset (#85)

	decode: check_POLYLINE_handles
	check for if vertex[0] is the layer and shift the vertices then.
	since we cannot look forward and resolve unread objects
	its not yet good enough. we really need to check them after the seqend
	or last vertex. or later in out_dxf in the is_sorted_POLYLINE check.

	decode: log relative handle stream offset
	it is still wrong. see #85

	indent common_entity_handle_data.spec

	dxf: protect wrong FIELD_HANDLE_NAME table
	when a handle points to a wrong object

2018-12-25  Reini Urban  <rurban@cpan.org>

	POLYLINE_3D: rename flag2 to curvetype (75)

2018-12-25  Reini Urban  <rurban@cpan.org>

	dxf: WIP is_sorted_POLYLINE shortcut (#83)
	COMMON_ENTITY_POLYLINE: ensure that the common POLYLINE_*
	fields are shared with all 4 types.

	Some vertex[] handles are even worse than a wrong SEQEND,
	check when the first vertex[0] is corrupt and ignore it then.

	enable loglevel LOG in out_dxf, mainly to warn about this
	wrong POLYLINE.vertex[0] handle %lX < %lX

2018-12-25  Reini Urban  <rurban@cpan.org>

	dxf: POLYLINE - SEQEND - VERTEX (#83)
	Some dwg's (r2007, r2018) have the SEQEND following the POLYLINE.
	Iterate over the vertex handles, not over the object id's.

	shellcheck json.test
	and regen-unknowns

2018-12-25  Reini Urban  <rurban@cpan.org>

	bindings: add missing Object APIs
	parallel to the Entity getters and converters,
	recently added to dwg_api.

	remove some DEBUG_CLASS function from the public api (getall, converter)

2018-12-25  Reini Urban  <rurban@cpan.org>

	cirrus: re-enable python, install py36-libxml2 instead

	suffix.inc: _XOPEN_SOURCE 700
	for snprintf on FreeBSD.
	Sets __ISO_C_VISIBLE 1999

	bindings: honor --disable-python

	m4: fix swig and python probes for FreeBSD
	swig defaults to swig3.0 on FreeBSD pkg
	python needs proper LDFLAGS (-lpthread) and SYSLIBS (-lm)
	use $SWIG in Makefile

	dxf.test: bash => sh
	no bashisms, checked with shellcheck

	.cirrus: install bash, --disable-python
	bash needed for dxf.test
	py36-lxml (the libxml2 binding) needed for xmlsuite,
	but the xmlsuite/check.py is failing with python3.6
	with --disable-python only distcheck is failing on binding/python

2018-12-24  Reini Urban  <rurban@cpan.org>

	fix dxf.test for FreeBSD
	where bash is in /usr/local/bin

2018-12-23  Reini Urban  <rurban@cpan.org>

	dxf: emit 62 256
	or 420 rgb if index not 256. See MLINESTYLE

	dxf: reorder MLINESTYLE 3 <-> 70 fields
	it is apparently critical

	dxf: some classes are builtin since r2004+
	ACDBPLACEHOLDER and LAYOUT do not appear in CLASSES anymore,
	but it depends which version exports it.

	dxf.test: add check_acdb_dxfname

	decode: set proper dxfname
	from classes.inc STABLE_CLASS_DXF (also for the importers),
	and from dwg_add_##token (for the API).
	Fixes ACDBDICTIONARYWDFLT DXF object and simplifies out_dxf.

	dxf: use ACDBDICTIONARYWDFLT
	no dxfname set?

	add programs/dxf.test
	a few minor failures, but was important to catch missing layers.
	it doesn't check diff error codes yet.

	dxf: more missing common_entity_handle_data
	r2004+: read layer, ltype (was missing)
	skip dxf color 62 256
	put dxf 330 ownerhandle after reactors
	print empty layer (wrong handle stream e g POLYFACE_MESH) as 0
	handle other .spec fields if undefined (e.g. VALUE_HANDLE in
	  common_entity_handle_data)

	dxf: entity.ownerhandle 330 after ACAD_REACTORS

	test-dxf.sh: no gmake

	log: add [H ] type to handle logs

	api: rename _ent->entity_mode
	to entmode. (as in the ODA docs)
	add proper pspace owner handling in DXF
	fix common_entity_handle_data encoding of ownerhandle:
	  skip if implied by entmode.
	cur_owner tracking is not needed anymore. entmode is enough

	api: replace ENTITY.subentity by ownerhandle 330
	this handle really is the ownerhandle, not the subentity.
	it only appears in subentities (VERTEX, ATT*) pointing to its
	owner.
	Now we don't need the cur_owner/old_owner anymore.

	make regen-unknown
	now with ODA generated 2000_dxf.log counterpairs

	add PolyLine2D .dxg/.dxf pairs
	for VERTEX_2D and VERTEX_3D samples (which crash on DXFIN import)

	decode VALUE_HANDLE_N: [vcount]: NULL HANDLE
	itemhandles[vcount]: NULL HANDLE(2) [0]
	vs
	itemhandles[vcount][15]: 2 HANDLE(2.1.66) absolute:66 [0]

2018-12-22  Reini Urban  <rurban@cpan.org>

	dxf: add dwg_dim_blockname (#81)
	need to out_dxf more blocks: anon. *Dn for DIMENSION.
	Get the name from the BLOCK_HEADER - BLOCK.name, following
	the DIMENSION.

	Now simply dump all BLOCK and BLOCK_RECORD's.

2018-12-22  Reini Urban  <rurban@cpan.org>

	dxf: fixup AcDbBlockTableRecord name (#81)
	for ccd50fd121544c0c3a638b1d5c5512083bdf3df3

	dxf: Error in BLOCK_RECORD Table
	Did not receive AcDbBlockTableRecord name

	dxf: Did not receive AcDbViewportTableRecord flags
	dxfin error. the flag 70 is not optional with COMMON_TABLE_FLAGS

	api: rename parenthandle to ownerhandle (#80)

2018-12-22  Reini Urban  <rurban@cpan.org>

	change _ent->owner to ownerhandle
	entities gets realloced, and thus their pointers invalidated.
	we need to store the BITCODE_H ref instead.
	valgrind: Invalid read of size 8, dwg_dxf_ENDBLK, dxf_blocks_write.

	add reverse dwg_find_objectref lookup: linear search, only done for
	entities with subentities to find the ref for the current object

2018-12-22  Reini Urban  <rurban@cpan.org>

	dwg_dxf_STYLE: fix TU memleak
	free temp. bit_convert_TU result

	dxf: fix dxf_cvt_tablerecord memleak
	free temp. bit_convert_TU result

	decode: use after free
	when dwg_decode_UNKNOWN_ENT failed and freed dat.

	dwg2dxf: call free within valgrind
	fixes some articial memory leaks

	dwg_add_TOKEN: potential obj->tio.object mem leak

	dxf_tables_write: fix potential NULL deref
	very unlikely, but still

	dxf_free_pair: fix NULL deref

	decode: dead increment
	error from obj_string_stream was ignored

	decode: dead assignment

2018-12-21  Reini Urban  <rurban@cpan.org>

	decode HANDSEED: protect from empty handle
	Fixes most dxf roundtrips, where HANDSEED turns up empty.
	Only a few DXFs break now on dxf-roundtrip's

	dxf: use proper AcDbBlockTableRecord name (#81)
	Not the BLOCK_HEADER.name (which is only *Paper_Space)
	but the name of its BLOCK entity (which is *Paper_Space0).
	This fixed most #81 dxfin errors, but not all.

	dxf: all BLOCK_HEADER records
	analog to the pspace BLOCK objects, some are missing.
	Note that the basic dxfs survive now a teigha roundtrip.

	dxf: no r2004+ color 62 index 0
	TODO: lookup the index for rgb color (e.g. 7 for 0xc3000007)
	index is invalid

	dxf: add dxf-roundtrip.sh
	via TeighaFileConverter.
	dwg2dxf for a DWG, convert it back to a DWG via Teigha
	to see if the DXF is somewhat correct, and then read the
	converted DWG. Create Teigha error logs as .dwg.err

	dxf: rename dxf_example to dxf-allcvt
	we are mass-converting all DWGs to DXFs, and then
	use a LSP to DXFIN all those generated DXFs.

	dxf: more missing PSPACE blocks (#81)
	The first attempt 975c8f3deb was unsuccessful.
	There may be unconnected pspace blocks not referenced
	by the BLOCK_CONTROL, such as pspace blocks from a pspace
	LAYOUT, so for simplicity just scan all BLOCK_HEADER's for
	a pspace block.

2018-12-20  Reini Urban  <rurban@cpan.org>

	dxf: rename new ent->parent to ent->owner (#82)
	its confusing both ways. the corresponding object ptr is called
	parenthandle, but the obj->parent is something else: inheritance.

	officially we have hard and soft owners, owning the reference,
	for liveness on deletion.

	in the end it would be just too confusing mixing up the _obj->parent and
	obj->parent with _ent->parent. maybe rename _obj->parenthandle to ownerhandle
	also.

2018-12-20  Reini Urban  <rurban@cpan.org>

	dxf: Support 330 ent->parent->handle (#82)
	which is not always the MSPACE record.
	On subentities (VERTEX, ...) it is the parent.

2018-12-19  Reini Urban  <rurban@cpan.org>

	dxf: add missing PSPACE blocks (#81)
	also iterate over the block_headers array of the
	first BLOCK_CONTROL, which are usually PSPACE blocks.

	api: rename DIMENSION_ORDINATE.ucsorigin_pt to def.pt
	move def_pt to DIMENSION_COMMON, add blockname field

2018-12-19  Reini Urban  <rurban@cpan.org>

	fix bit_convert_TU for >U+800 (#80)
	wrong UCS-2 to UTF-8 converter:
	fix the first byte of a 2 and 3-byte sequences

	only found out with chinese drawings

2018-12-19  Reini Urban  <rurban@cpan.org>

	dxf: more POLYLINE_2D,VERTEX_2D defaults
	default values are left out in DXF

	dxf: more common_entity_data defaults
	default values are left out in DXF

	dxf: more POLYLINE_2D work WIP
	extrusion is a vector on DXF.
	BE can be skipped on DXF if default.
	But acad still crashes on DXFIN (2DVertex)

	make regen-swig-patch

2018-12-19  Reini Urban  <rurban@cpan.org>

	add dxf_cvt_lweight, rename linewidth to linewt (#79)
	The DXF output of CELWEIGHT/linewt needs to be decoded to
	some signed int, the 100th of a mm, and 3 special default values
	-1 .. -3 for dxf. (BYLAYER, BYBLOCK, BYLWDEFAULT)
	This fixes DXF import with lineweights.

	Rename the API to linewt for consistency.

2018-12-18  Reini Urban  <rurban@cpan.org>

	dwg_decode_handleref: obj NULL deref
	Empty obj argument for code >= 6

	suffix: Argument with 'nonnull' attribute passed null
	empty filename

	dwgread: Argument with 'nonnull' attribute passed null
	protect against empty outfile (only a theoretical getopt problem)

	read_R2004_section_info: NULL deref
	Array access (via field 'sections') results in a null pointer dereference

	in_dxf: Argument with 'nonnull' attribute passed null
	protect pair

	clang-analysis: Allocator sizeof operand mismatch
	Result of 'calloc' is converted to a pointer of type 'unsigned char', which
	is incompatible with sizeof operand type 'char'.

2018-12-17  Reini Urban  <rurban@cpan.org>

	json: fix wcquote format tmpl %s => %ls

	dwgwrite: fix wrong infile check (#77)
	Thanks to @shlyakpavel

	fix dwggrep NULL deref (#77)
	Thanks to @shlyakpavel

	fix NULL deref (#77)
	added recently. Thanks to @shlyakpavel

2018-12-17  Reini Urban  <rurban@cpan.org>

	json: add SUB_FIELD, REPEAT_BLOCK. fix LEADER
	Need to separate the parent[i] from the struct field.
	arrays esp. in json should not print field[rcount1]: value, just
	an array of values. With REPEAT an array of structs.

	Also set a few more missing parents,
	and fix LEADER subelements: allow multiple

2018-12-17  Reini Urban  <rurban@cpan.org>

	json: add HANDLES object map
	But not the relative offset, just the absolute offset.
	We don't yet store the DWG relative offset.

	json: add preview, handle, owner, dxfname
	Add some more missing fields

	json: skip duplicate BLOCK.name
	FIELD_T (name, 2) already prints the name
	skip the duplicate dxf group 3 with the name

	doc: enhance json docs

2018-12-16  Reini Urban  <rurban@cpan.org>

	silence gcc -Wlogical-op
	&& len => && len > 0
	warning: logical ‘and’ applied to non-boolean constant

	api: rename TABLE.entry_name field to name
	Closes #76

2018-12-16  Reini Urban  <rurban@cpan.org>

	json: 2007 text fixes
	disable wrong color.name and bookname fields. They are all wrong.
	r14 might have NULL reactors.

	make check passes now

2018-12-16  Reini Urban  <rurban@cpan.org>

	json: probe for jq, add tests

2018-12-15  Reini Urban  <rurban@cpan.org>

	json: more DWG like structure
	Rename ENTITIES to OBJECTS,
	moved preview before header (vars).
	TODO: FILEHEADER sections, object map.

	See #76

2018-12-14  Reini Urban  <rurban@cpan.org>

	fix 2 test/*/ole2frame types
	-Wsign-compare (detected only on cygwin)

2018-12-14  Reini Urban  <rurban@cpan.org>

	json: final fixes
	add more cquote rules, esp. \n
	escape more unicode stuff <0x1f as \u00xx
	skip the very last COMMA in ENTITIES ENDSEC.
	add {} around FIELDs, so that VERSION(R_14) FIELD_RC (hard_owner, 0)
	  will not only skip the PREFIX block.
	add proper PREFIX for FIELD_2DD_VECTOR.

	jq can now read the generated json, when being written to a file,
	not a pipe (NOCOMMA hack skipping the last comma of a list)

2018-12-14  Reini Urban  <rurban@cpan.org>

	Add alloca workaround: _alloca or malloc
	needed for out_json and examples/unknown.
	Windows MSVC defines _alloca in malloc.h

2018-12-13  Reini Urban  <rurban@cpan.org>

	json: cquote strings
	now only Invalid string: control characters from U+0000 through U+001F must be escaped
	are missing

	json: produce better output WIP
	but still not JSON conformant.
	make HEADER a hash.
	better ARRAY, POINTS, VECTORs.
	HACK: skip dquotes on classnames wiich are already in dquotes.
	      TODO escape it properly.

2018-12-13  Reini Urban  <rurban@cpan.org>

	json: use DXF_OR_PRINT blocks (#73)
	Most entities only have DXF, DECODER and ENCODER blocks defined (e.g. LINE)
	but no special PRINT block, which would be needed for all other
	formatter outputs.
	For easier spec go with the DXF_OR_PRINT block then, and
	define it for those formatters IS_PRINT settings.
	This fixes out_json with only IS_PRINT but no IS_DXF action.

	We don't want to duplicate DXF {} blocks for PRINT.
	And those formatters also go into both directions, in and out.

	Thanks to @nick-bull for asking about this.
	Closes #73

2018-12-13  Reini Urban  <rurban@cpan.org>

	encode: add WIP dwg_section_page_checksum
	for writing a r2004+ section map. untested.

	more crc work: crc64 and crc32
	rename 2004_file_header.CRC to crc32,
	format crc64 properly (leading 0),
	add crc32 code (generated crc32 table) for r2004+ (for file header),
	not the crc64 code yet for r2007+ (for compressed pages),
	rename some internal old libdwg vars from crk to crc.

	Add handles section CRC check
	This CRC is LE (not byte-swapped).

	fix testcases/bits_test.c on 32bit
	use better MC/UMC test values: 0x8777 7777 instead of 0x2111 1111
	causing the previous 4bit lossage.
	beware of uint32 wraparound causing an endless loop
	(cygwin32)

2018-12-12  DenisPryt  <denis.chausy@gmail.com>

	Restore dat position in dwg_decode_add_object
	for all return cases

2018-12-12  Reini Urban  <rurban@cpan.org>

	dxf: fix CELWEIGHT values
	from https://sourceforge.net/p/libdwg/tickets/7/
	CELWEIGHT is encoded into special values.
	Thanks to Guruprasad Rane for the value translations.

	Add logging for some calculated values

2018-12-12  Reini Urban  <rurban@cpan.org>

	print HANDSEED as hex handle
	as AUXHEADER RL, and as HEADER handle.
	See #71

2018-12-12  Reini Urban  <rurban@cpan.org>

	change MC back to long
	document and simplify MC bits
	Explain why 4 byte are not enough.
	on 64bit MC offsets just need to be natural.
	Add more MC and UMC tests.

	Closes #70

2018-12-12  DenisPryt  <denis.chausy@gmail.com>

	read/write bit_MC/UMC fix (max byte length change from 4 to 5)
	See #70

2018-12-12  Reini Urban  <rurban@cpan.org>

	fixup read_2004_compressed_section messages
	Fix wrong logging messages for the section types.
	Not Class, but OBJECTS and HANDLES mostly.

2018-12-11  Reini Urban  <rurban@cpan.org>

	swap CRC type to RSx
	not RS_LE.

	Now only the r14,r2000 Section[0] CRC fails, a known problem.
	relax the WRONGCRC error with those.

2018-12-11  Reini Urban  <rurban@cpan.org>

	bits: change BITCODE_MC/MS from long to int32
	we are not on 32bit anymore.
	also add read_200{4,7}_section_handles and breaks

	bits: use BITCODE_* types
	not the intsize dependent long unsigned int

	dxf: guard empty table ctrl objects

2018-12-11  DenisPryt  <denis.chausy@gmail.com>

	Add r2007+ obj_string_stream overflow guard

2018-12-11  Reini Urban  <rurban@cpan.org>

	SPLINE/HELIX: set parents
	We cannot use FIELD_VECTOR with 3BD here unfortunately

	perl: fix make check
	use LD_LIBRARY_PATH, not LD_RUN_PATH to be able to find libredwg.so.0

2018-12-11  Reini Urban  <rurban@cpan.org>

	CLANG_DIAG_IGNORE(-Wpragma-pack)
	-Wpragma-pack is clang-only
	silences test/testcases/decode_test warning:
	warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas]

	The gcc variant would be -Wpragmas, which is not needed here:
	-Wno-pragmas -Wunknown-pragmas

2018-12-11  DenisPryt  <denis.chausy@gmail.com>
	    Reini Urban  <rurban@cpan.org>

	Object-map section_handles: handle is BITCODE_UMC
	unsigned, not signed.
	confirmed with libdxfrw

	encode: obj->handlestream_size needs to be encoded as UMC also.
	(forgotten in encode r2010+)

2018-12-11  Reini Urban  <rurban@cpan.org>

	extend bits_test
	print more bits and fail result

2018-12-11  DenisPryt  <denis.chausy@gmail.com>

	free -> FREE_IF migration

2018-12-10  DenisPryt  <denis.chausy@gmail.com>

	Error on zero section max_decomp_size (#66)

2018-12-10  DenisPryt  <denis.chausy@gmail.com>
	    Reini Urban  <rurban@cpan.org>

	read_R2004_section_info buffer overflow protection (#68)
	Fix decode R2004_header encryption section.

2018-12-10  DenisPryt  <denis.chausy@gmail.com>

	typo fix Pruchkovksy -> Pruchkovsky

2018-12-10  Reini Urban  <rurban@cpan.org>

	r11: add OSMODE
	even if stored in DXF as zeroed value

2018-12-10  Reini Urban  <rurban@cpan.org>

	Revert "Renamed HEADER.MENU to HEADER.MENUNAME"
	The DXF file has it as $MENU, so it was correct.
	The DXF docs are just wrong.

	This reverts commit 419f4eade8d9b32942a1d0a26097081f09a54c71.

2018-12-09  Reini Urban  <rurban@cpan.org>

	Renamed HEADER.MENU to HEADER.MENUNAME
	MENU is the command, but MENUNAME is the variable name

2018-12-07  DenisPryt  <denis.chausy@gmail.com>

	Fix unknown class free problem

2018-12-06  Reini Urban  <rurban@cpan.org>

	Harmonize Dwg_Leader_ subtype names
	Dwg_Leader_* => Dwg_LEADER_*
	Dwg_MLeaderAnnotContext => Dwg_MLEADER_AnnotContext

2018-12-05  Reini Urban  <rurban@cpan.org>

	Release 0.7

	add .cirrus.yml for FreeBSD CI

	fix python 3.6 TabError

	meta: fixup authorship headers
	load_dwg.c: decl strdup

2018-12-05  Reini Urban  <rurban@cpan.org>

	api: convert IMAGE.size.{width,height} to 2RD
	no inline structs in WIPEOUT and IMAGE.
	convert inline struct { width; height } to 2RD (x,y).
	The size is documented as size (u,v),
	not width/height in the AutoCAD DXF docs.

	This is mostly to simplify the dynapi #59

	xmlsuite: simplify newxml.py
	remove unused local var

	xmlsuite: simplify check.py
	remove unused imports

2018-12-04  Reini Urban  <rurban@cpan.org>

	examples/bits: initialize pos
	pos -Wmaybe-uninitialized in return decode(dat, pos, size)

	detab all sources
	some editors are obviously confused about tabs

	Protect from calloc(0,) returning non-NULL (#61)
	when info->num_sections == 0 (on some broken DWG), calloc(0,...)
	might return a non-NULL ptr on some broken libc's (glibc).
	This is a better fix than on PR #61, thanks @DenisPryt
	for finding the problem.

2018-12-03  Reini Urban  <rurban@cpan.org>

	alive.test: use libtool for 2nd dwggrep test

	pre-r13: set LAYER,STYLE flag bits
	set on,frozen,frozen_in_new,locked bits from LAYER flag,
	shape_file,vertical from STYLE flag.

	pre-r13: set BLOCK_HEADER flag bits
	anonymous,hasattrs,blkisxref,xrefoverlaid from flag.
	to unify the api

	smoke: CFLAGS typo

2018-12-02  Reini Urban  <rurban@cpan.org>

	NEWS: add latest changes for 0.7

	guard get_first_owned_object first_entity
	ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f782e1db8b5 bp 0x7fffb
	a38ff70 sp 0x7fffba38ff50 T0)
	The signal is caused by a READ memory access.
	Hint: address points to the zero page.
	 #0 0x7f782e1db8b4 in get_first_owned_object /home/rurban/Software/libredwg/src/dwg.c:748:34
	 #1 0x5048fb in output_BLOCK_HEADER /home/rurban/Software/libredwg/programs/dwg2SVG.c:211:9
	 #2 0x50453d in output_SVG /home/rurban/Software/libredwg/programs/dwg2SVG.c:252:3
	 #3 0x50453d in main /home/rurban/Software/libredwg/programs/dwg2SVG.c:361

	add missing _private decls

	fixup _VECTOR_CHKCOUNT for REACTORS macros
	A minimal HANDLE (i.e. a NULL handle) need much less bits than 8

2018-12-02  DenisPryt  <denis.chausy@gmail.com>

	Add _VECTOR_CHKCOUNT to REACTORS macros.

2018-12-02  DenisPryt  <denis.chausy@gmail.com>

	Add dwg_decode_add_object_ref
	function for adding Dwg_Object_Ref.

	Revert dwg->object_ref pointer to old state if realloc is failed.
	Fix Dwg_Object_Ref leaks.

2018-12-02  Reini Urban  <rurban@cpan.org>

	fixup TABLE DWG_ERR_INVALIDTYPE error
	Table_Value sets DWG_ERR_INVALIDTYPE, check it and return
	the sum of all errors.

2018-12-02  DenisPryt  <denis.chausy@gmail.com>

	call END_REPEAT before return inside a loops

	fix 3dsolid memory leak

	switch dwg_decode_##token##_private function from EXPORT to static

	returned dwg objects non-fixed types values to its original state

	Fix memory leak objects with invalid handleref code

	Guard function in dwg_free_ ##token for all frees
	in DWG_ENTITY_END and DWG_OBJECT_END

	Guard function for free(str_dat) in decode object and entity macros

	DWG_TYPE_FREED collision

	free: several fixes
	Fix eed free on eed decode error.
	Objects with unknown handleref.code don't remove from dwg->object_ref array.
	Fix read_system_page space allocate.
	Free Bit_Chain in read_2007_section_header and other.

2018-11-30  Reini Urban  <rurban@cpan.org>

	LEADER fields
	fixup more fields:
	switch path_type with annot_type
	rename hooklineonxdir to hookline_dir
	rename unknown_bit_4 to hookline_on
	fixup DXF values

	LEADER.endptproj <= r2007
	most likely. there are still discrepancies with the DXF.
	The ODA spec is wrong for sure.
	i.e. box_width,box_height is rather a 213/223/233 3DPOINT
	DXF 340 is also missing

	doc: add dwg_get_ API
	and some more fixups

	rename internal macro GET_DWG_* to DWG_GET_
	to better reflect the external API names
	dwg_get_<OBJECT> and dwg_get_<ENTITY>.

	add GET_DWG_OBJECT for all objects in a DWG
	analog to dwg_get_ENTITY,
	but including all objects, tables, block headers, even if unowned.

2018-11-29  Reini Urban  <rurban@cpan.org>

	fix GET_DWG_ENTITY (#60)
	Either the last member of the array needs to be NULL, or we need to return
	the count.  Since we don't want to change the API, we NULL-terminate it.

	We also need to guard from an empty BLOCK_HEADER argument.

2018-11-29  Reini Urban  <rurban@cpan.org>

	AUTHORS: add Denis Pruchkovsky (Pryt)

2018-11-28  Reini Urban  <rurban@cpan.org>

	fixup VECTOR_CHKCOUNT overflow (#56)
	all values need to stay signed, just promote them to long long
	for the checks.

2018-11-28  DenisPryt  <denis.chausy@gmail.com>

	fix VECTOR_CHKCOUNT overflow (#56)
	VECTOR_CHKCOUNT cast bit size to long.  As result big numbers is multiplied
	by 8 and becomes negative

2018-11-27  Reini Urban  <rurban@cpan.org>

	dwglayers: fix DICTIONARY loop (#51)
	skip a DICTIONARY, but don't skip the loop.
	Fixes #51

	dxf: fix empty paper_space (#52)
	Fixes dxf_blocks_write #52

2018-11-27  DenisPryt  <denis.chausy@gmail.com>
	    Reini Urban  <rurban@cpan.org>

	Fix multileader bug. vertexes should be array.
	Renamed vertexes to points analog to LEADER.

	Closes PR #49

2018-11-27  Reini Urban  <rurban@cpan.org>

	fixup BITCODE_RC* vs char*
	fix -Wpointer-sign and -Wincompatible-pointer-type warnings.
	strings are still char*

	bump to 0.7, prep NEWS ChangeLog
	We had to change the API in the previous commit,
	RC is now unsigned char

	Fix LTYPE.dash, change RC to unsigned char
	avoid such negative values. Fixes #44.
	This changed the API, thus we must bump to 0.7

	fix FIELD_NUM_INSERTS
	Only allow RC 1 bytes, backup when != 1.
	Fix encode for FIELD_NUM_INSERTS, write a vector of 1 bytes.
	Fixes the example from #44 for the first wrong num_inserts
	case.

	decode FIELD_NUM_INSERTS: log -v5 values
	The ODA spec seems to be wrong, see #44

	fixup format type for size
	from the previous PR #48

2018-11-27  DenisPryt  <denis.chausy@gmail.com>

	Fix image decode: rectangle or polygon flag mistake

2018-11-26  Reini Urban  <rurban@cpan.org>

	Fix LTYPE.dash, change RC to unsigned char
	avoid such negative values. Fixes #44.
	This changed the API, thus we must bump to 0.7

	fix FIELD_NUM_INSERTS
	Only allow RC 1 bytes, backup when != 1.
	Fix encode for FIELD_NUM_INSERTS, write a vector of 1 bytes.
	Fixes the example from #44 for the first wrong num_inserts
	case.

	decode FIELD_NUM_INSERTS: log -v5 values
	The ODA spec seems to be wrong, see #44

	fixup format type for size
	from the previous PR #48

2018-11-26  Denis  <DenisPryt@users.noreply.github.com>

	Fix error with eed size (#48)

2018-11-24  Reini Urban  <rurban@cpan.org>

	Enable LGTM support (#46)
	https://lgtm.com/projects/g/LibreDWG/libredwg/

2018-11-23  Reini Urban  <rurban@cpan.org>

	examples: improve load_dwg.py
	don't fail on non-critical errors
	don't import twice

2018-11-23  Reini Urban  <rurban@cpan.org>

	Fix VECTOR_CHKCOUNT segfault
	on unassigned obj->dxfname's (esp. for <=R12). Fixes #44.

	also rename the error message: vcount is only relevant for vectors, but it
	is also used for strings.

2018-11-23  Reini Urban  <rurban@cpan.org>

	free: refactor VALUE_HANDLE
	same logic as in decode. obj is NULL inside header_variables.spec.
	but still some wrong handles are leaking.

	less calloc(0) calls
	these appear in valgrind as 0 size leaks

2018-11-23  DenisPryt  <denis.chausy@gmail.com>
	    Reini Urban  <rurban@cpan.org>

	abstract dwg_decode_eed_data, fix eed segfault #45
	move the inner eed loop into its extra function.
	end ignored last size = bit_read_BS(dat), which must be zero.
	If eed section is present and corrupted, happens seek into end,
	and return inside a while loop.  As result, we missed the last
	size = bit_read_BS(dat) in while condition.

	This also fixes most of the last remaining memory leaks,
	just a few stale handles are left.

2018-11-23  DenisPryt  <denis.chausy@gmail.com>

	Avoid reactors calloc(0)

2018-11-23  Reini Urban  <rurban@cpan.org>

	CONTRIBUTING: add link to (c) assignment form

	in_dxfb: harmonize with in_dxf

2018-11-22  Reini Urban  <rurban@cpan.org>

	unknown: more work on LOFTEDSURFACE

2018-11-20  Reini Urban  <rurban@cpan.org>

	NEWS for latest changes

	free: fix double-free with subentity handle in UNKNOWN_ENT
	such handles are already freed with object_ref[]
	Fixes #43, detected by DenisPryt

	free: fix decompress_R2004_section leak
	in case of critical errors

	check RUNNING_ON_VALGRIND
	and probe for include <valgrind/valgrind.h>
	which is helpful when testing memory leaks with bigger DWGs.
	It formerly just skipped dwg_free.
	Now call dwg_free when running under valgrind

	free: fix R_2007 data_page leaks
	free the data_page's, which can be several KB, even MB on larger DWGs

	free: eed in UNKNOWN_OBJ
	which is still stored into the Dwg_Object_Object struct.
	fixes MATERIAL eed leaks, et al.

	hash: fix Uninitialised value
	valgrind:
	Conditional jump or move depends on uninitialised value(s)
	   at 0x1E006E: hash_set (hash.c:137)
	   by 0x19A9E9: dwg_decode_add_object (decode.c:3813)
	   by 0x1A59A4: read_2004_section_handles (decode.c:2094)
	   by 0x1A59A4: decode_R2004 (decode.c:2224)
	   by 0x1A798F: dwg_decode (decode.c:223)
	   by 0x10A81C: dwg_read_file (dwg.c:186)
	   by 0x10A470: main (dwgread.c:214)
	 Uninitialised value was created by a heap allocation
	   at 0x483577F: malloc (vg_replace_malloc.c:299)
	   by 0x1DFED1: hash_new (hash.c:28)
	   by 0x1A77C7: dwg_decode (decode.c:135)
	   by 0x10A81C: dwg_read_file (dwg.c:186)
	   by 0x10A470: main (dwgread.c:214)

	fix C99 compat, rename null malloc errors
	fix some -Wdeclaration-after-statement from PR #42
	Rename the api null malloc errors to Out of memory for consistency

	free: avoid double-free of obj->tio.unknown
	when it is not a class

	fix LAYOUT memory leak >=R_13
	SINCE R_13 LAYOUT is a class, free it.
	The previous EED double-free cannot happen, as we NULL it now.
	Todo: But there are still missing EED, esp. with UNKNOWN_OBJ

2018-11-20  DenisPryt  <denis.chausy@gmail.com>

	Bit_Chain initialization in programs

2018-11-20  DenisPryt  <denis.chausy@gmail.com>

	Some trivial warning and crash fixes
	bracers in defines (out_geojson.c),
	fix parameters to fwrite,
	add Bit_Chain initialization,
	read section name according to name_length,
	free section name,
	check num_pages for zero avoiding malloc(0),
	fix possible memory leaks in dwg_api.c and reedsolomon.c
	bfr_read_string: add 2nd size argument

	minor fixups

2018-11-07  Reini Urban  <rurban@cpan.org>

	Release 0.6.2
	make regen-man

	.appveyor.yml: post-release version bump

	HACKING: add make release paragraph

	Update NEWS and ChangeLog for 0.6.2 prep

2018-11-06  Reini Urban  <rurban@cpan.org>

	fix minor warnings
	vcount: -Wsign-compare
	case DWG_TYPE_VBA_PROJECT: -Wimplicit-fallthrough

	fix several dxf segv
	with empty ctrl blocks or tables.
	Fixes [GH #39]

	Fix one more 2035 section size limit
	With the example from [GH #39]

	Merge branch 'DenisPryt-master'

2018-11-06  DenisPryt  <denis.chausy@gmail.com>

	Fix section size limit

	Fix eed decoding when end - dat->byte == 1

2018-11-06  Reini Urban  <rurban@cpan.org>

	unknown: regen

2018-11-05  Reini Urban  <rurban@cpan.org>

	Release 0.6.1
	See NEWS

	spec: fix wrong FIELD_2DD_VECTOR in dwg decode
	The 2nd .y coord was wrong. Found by @soundd1 [GH #40].

2018-08-30  luzpaz  <luzpaz@users.noreply.github.com>

	Misc. typos and whitespace fixes
	Found via `codespell -q 3`.

2018-08-13  Reini Urban  <rurban@cpan.org>

	post-release 0.6 doc updates
	This should have been done for 0.6 already...

	Release 0.6
	See NEWS

2018-08-13  Reini Urban  <rurban@cpan.org>

        Release 0.6

2018-08-12  Reini Urban  <rurban@cpan.org>

	free: not the static strings
	but all the others

	free: DECODE_UNKNOWN_BITS
	free the unknown_bits

	free: DEBUG_HERE_OBJ

	decode: clean vectors
	calloc them, not just malloc.

	dxf: more empty vector protections
	in this case ASSOCNETWORK

	dxf: fix -Wpointer-to-int-cast warning

	encode: protect empty vectors
	with DEBUGGING or UNSTABLE classes vectors
	can easily be unallocated

	encode: BITCODE_BL sizes

	configure: keep CFLAGS on --enable-debug
	e.g. -I/usr/local/include is needed for dwgps
	just remove -O2

	dxf: cast SURFACE to 3DSOLID

	dwggrep: add new objects

2018-08-11  Reini Urban  <rurban@cpan.org>

	beautify valgrind version

	fix -Wstringop-truncation in strncpy
	strncpy specified bound 255 equals destination size

	fix -Wdouble-promotion, use our bit_isnan
	don't use the math.h long double promoting isnan check,
	at least on clang.

	add separate signed BLd type #36
	We just changed BL to signed. revert that and add a separate BLd to represent the two such dxf ranges.
	BL as signed is a problem for vcount/rcount overflow detection with negative values.
	Closes GH #36

	unknown: add DEBUGGING ACSH_SWEEP_CLASS ACDBNAVISWORKSMODELDEF
	ACSH_SWEEP_CLASS is probably the dbSweepOptions.h class
	no coverage for ACDBNAVISWORKSMODELDEF (BIM_DICT entries)

	add examples/bits: all possible values/types
	not just the most likely as with bd

	bd: print most possible types and values

	rm duplicate logs.sh and log.sh
	we already have log and logs-all.sh

2018-08-10  Reini Urban  <rurban@cpan.org>

	add examples/bd
	to print the BD value of bits

	move HELIX to UNSTABLE
	found all the missing fields. It's a spline.
	bd-unknown.inc helped a lot.

	unknown: add some bd-unknown doubles
	they do work

2018-08-10  Reini Urban  <rurban@cpan.org>

	add examples/bd-unknown.inc
	to fixup wrong binary repr. of doubles,
	if found by some manual heuristic

	this is the initial empty set of all wrong BDs (with removed
	duplicates)

2018-08-10  Reini Urban  <rurban@cpan.org>

	dwggrep: skip 3DSOLID encr_sat_data
	This makes not much sense, rather search the decrypted variant.
	It also read from uninitialized memory

	make regen-swig-patch

2018-08-09  Reini Urban  <rurban@cpan.org>

	unknown: integrate 3DSOLID into SURFACE
	search for "ACIS BinaryFile" revealed an ordinary ACIS v2 SAB format
	right at the beginning of each SURFACE.
	Ensure a common binary layout for both, as we cast the SURFACE into 3DSOLID
	for decoding.

	Update 0.6 NEWS

2018-08-08  Reini Urban  <rurban@cpan.org>

	unknown: LDADD and LTEXEC fixes for shared
	link to bits and common explicitly. most functions there are not exported.

	fix LTEXEC: use unexpanded \$top_builddir. This is needed for a Makefile and a script.

2018-08-08  Reini Urban  <rurban@cpan.org>

	unknown: LIGHT looks good now
	fix plot_glyph, color,
	no hole left.

	unknown: regen-unknown

	alive.test: skip libtool on --disable-shared

	skip Unstable|Unhandled Class warning
	on print or free action. Only relevant for
	decode or encode really

	support non-decode for common_entity_data.spec
	enable encode and DXF support.
	simplify CMC color fields: rgb and alpha masks

	unknown: re-sort per file
	keep the objects from one file together

	fix parallel picat
	skip libtool --mode=execute on --disable-shared
	fix the dirname of examples/unknown with libtool.
	fix parallel picat

2018-08-07  Reini Urban  <rurban@cpan.org>

	skip incompatible moreutils parallel
	this does not support the {} and ::: syntax,
	rather uses -- for arg separation, and I still have to find out
	the {} and {/.}_{//} macros.

	we want the GNU parallel (in perl)

2018-08-07  Reini Urban  <rurban@cpan.org>

	add log script
	usage: ./log -v5 2004/Leader example_2000

	use parallel and timeout as probed
	use logs-all-serial.sh or logs-all-parallel.sh

	probe for PROGS versions
	not just to the log, display it.
	picat, timeout, parallel, valgrind.
	add timeout, parallel probes.

	more EMC tryouts WIP

	unknown: fix cquote final 0
	cquote forgot to close dest, leaving garbage in some strings.
	e.g. \"%sn\">%..." in ACDBSECTIONVIEWSTYLE.pi

2018-08-07  Reini Urban  <rurban@cpan.org>

	add new EMC color type
	for new truecolor support in entities.

	Also, regen-unknown fixed several wrong xdicobjhandle handles in
	ACDBDETAILVIEWSTYLE objects.

2018-08-07  Reini Urban  <rurban@cpan.org>

	unknown: work on VISUALSTYLE colors WIP
	actually the color.index is always 0 >= r2004.
	the dxf value needs to be derived from the first rbg byte somehow.

2018-08-06  Reini Urban  <rurban@cpan.org>

	trace CMC.flag always
	>=2004 a CMC always contains the index, rgb and flag. print that to detect wrong
	CMC colors, i.e. flags != 0,1 or 2.

	mingw: test too many args

	picat: expect also Most probable result
	which is at the end of definite and probable results.
	we don't want it to be killed before printing any result

	unknown: fix membits overflow
	found when overflowing possible and found bits.
	off-by-one bitsize: when setting 2 bits at 215 with 216 bits avail,
	it needs to set 215 and 216. so we really need to check against 217 (215+2).

	unknown: fix pi_fn stack overflow
	with path + ACDB_DYNAMICBLOCKPURGEPREVENTER_VERSION
	it easily exceeds 80

	unknown: fix the possible/found logic
	set the bits from pos to the end of bitsize

	unknown: fix num_filled stats
	fixing the wrong summary count e.g. 292/281=103.9% for PDFDEFINITION

2018-08-05  Reini Urban  <rurban@cpan.org>

	unknown: re-add missing objects
	we forgot to add DECODE_UNKNOWN_BITS for TABLE* objects.
	just MULTILEADER is now done.

	unknown: harmonize object/entity format
	and bitsize

	unknown: fix HAVE_INSRCDIR check
	for make -C examples regen-unknown.
	builddir is empty, ac_builddir ditto. srcdir=. is enough

	unknown: check picat for Definite result
	otherwise keep the old log. prevents bad logs from overwriting
	old logs

	windows -Wformat: fix type
	REPEAT_CHKCOUNT_LVAL(name,_obj->times,type)
	warning: format '%ld' expects argument of type 'long int', but argument 5
	has type 'long long unsigned int' [-Wformat=]

	unknown: next refactor
	delete pre_bits, this was wrong. It starts uneven already.
	rather store the useful relative handle and string offsets/sizes.

	add ASSOCPLANESURFACEACTIONBODY to UNSTABLE
	similar to ASSOCDEPENDENCY

2018-08-04  Reini Urban  <rurban@cpan.org>

	add 2nd FIELD_CMC dxf2 arg for rgb value
	matching pairs 62-420, ...

	decode: improve color tracing

	work on VISUALSTYLE WIP
	add and set about 50% of the missing fields

	unknown: re-order in-work area in the spec
	separate UNSTABLE from DEBUGGING

2018-08-04  Reini Urban  <rurban@cpan.org>

	unknown: refactor 2/2 and regen-unknown
	now got rid of all the slack, and we can regen-unknown even with DEBUG_CLASSES.
	summary went from 142504/2939403=4.85% to 502764/2623166=19.17%

	regen added VISUALSTYLE and many other UNSTABLE classes

2018-08-04  Reini Urban  <rurban@cpan.org>

	move VISUALSTYLE back to UNSTABLE
	~480 bits missing

	refactor UNKNOWN_FIELDS/DECODE_UNKNOWN_BITS
	dwg_decode_unknown() helper, used not only for UNKNOWN_OBJ/UNKNOWN_ENT
	but for all unstable classes.
	change to one single bits array with pre bits (if it starts not at bit 0),
	and num_bits (the bitsize in bits).

	free: fix UNKNOWN with empty dxfname
	on free checking an empty dxfname leads to SEGV.
	eg:
	{size = 91, address = 416360, type = 515, index = 240, fixedtype = DWG_TYPE_UNUSED,
	  bitsize_address = 0, has_strings = 0 000, stringstream_size = 0, handlestream_size = 0,
	  supertype = DWG_SUPERTYPE_UNKNOWN, tio = {entity = 0x0, object = 0x0, unknown = 0x0},
	  dxfname = 0x0, bitsize = 0, hdlpos = 0, handle = {code = 0, size = 0, value = 0},
	  parent = 0x7fff5fbfe0c0, common_size = 0}
	bypass dwg_free_variable_type for UNKNOWNs.

2018-08-04  Reini Urban  <rurban@cpan.org>

	add signed BLs type (420,440), fix DBCOLOR
	add a special int32_t BLs type just write the codes 420,440,
	i.e. the DBCOLOR rgb value.
	rename FIELD_BLh to FIELD_BLx and add more hex types.

	promote DBCOLOR to UNSTABLE. The remaining unknown bits are bogus,
	there's no CMC color field, no duplicate catalog $ name fields.
	Just the BLx rgb field needs to mask off the first byte for DXF,
	and there's a unknown RC. The DXF color index 21 is missing, this
	might be computed.

2018-08-03  Reini Urban  <rurban@cpan.org>

	unknown: more DBCOLOR work

	unknown DBCOLOR: split 430 name and catalog
	in DXF combined, in the DWG split up

	move DYNAMICBLOCKPURGEPREVENTER to UNSTABLE
	the last remaining handles were bogus, they do not exist
	The fiest code 70 BS looks like a class_version, but this really
	would be code 90. Who knows.

	improve UNKNOWN_{ENT,OBJ} logging to -v3
	no -v5 needed anymore.
	regen-unknown with some changed handles.

	fix bit_write_RL/bit_write_BL
	if <0 > 255 makes not much sense.
	handle large negative values, detected by unknown BL node_edge1 -1 values.

	move LIGHT to UNSTABLE
	just a few unknown internal fields are remaining,
	but the known DXF fields are done.

	unknown: regen with new byte sizes
	and without LIGHT (see next commit).
	less overshoots into the next object

	Fix -v5 overshoot errors
	store the size of the common entity/object data, until the
	object specific fields start. for a proper UNKNOWN_*.num_bytes size.
	Note that bitsize does not include the size of the common handles, so we start
	counting at obj->address, but obj->common_size starts counting after the type,
	so we still overshoot by ~18

	unknown: more work on LIGHT WIP

	fix rad2deg computation
	only needed for dxf and unknown

	unknown: skip common_entity_data
	for alldwg_1.inc. no such layer/color fields, which are
	handled in common_entity_data.spec and are not dumped
	into UNKNOWN_OBJ bytes at all, hindering the search

2018-08-02  Reini Urban  <rurban@cpan.org>

	unknown: finish UNDERLAY
	found remaining fields via picat/unknown,
	some RC/BS confusion.
	simplify clip_boundary and harmonize to clip_verts.

	move to UNSTABLE, passes all PDF coverages.
	but no DGN nor DWF coverage yet.

2018-08-02  Reini Urban  <rurban@cpan.org>

	regen-unknown

	unknown: skip common_entity_data
	there was one case of layer "0" found as TF, which was illegal

	unknown: regen for new Underlay_2004

	rename normal/210 to extrusion
	for consistency

	unknown: work on PDFUNDERLAY
	WIP

	unknown: fix dupl. go1 target

2018-08-01  Reini Urban  <rurban@cpan.org>

	dwgread: declare setenv
	via stdlib.h

2018-08-01  Reini Urban  <rurban@cpan.org>

	Fix dejagnu.h linkage
	probe for -fgnu89-inline and use it.
	See https://gcc.gnu.org/bugzilla//show_bug.cgi?id=63613
	Fixes [GH #2]

	Add dejagnu to cygwin and ubuntu/travis. msys2 dejagnu is not picked up,
	macos not tested on travis.

2018-08-01  Reini Urban  <rurban@cpan.org>

	more bit_write_RL_tests fixes
	this time I got all the swapping right.
	enhance the RL testcase using 4 different bytes

	dxf: implement dxf_classes_read()

	VALGRIND_SUPPRESSIONS: fix make dist
	EXTRA_DIST needs a relative pathname,
	Cannot stat ".//Users/rurban/Software/libredwg/valgrind-darwin.supp",
	note the ./ prefix

	testcases: oops bits_test read_RL
	another off-by-one

	dxf: more null-ptr protections

	check programs: use libtool
	with --enable-shared

2018-08-01  Reini Urban  <rurban@cpan.org>

	add VALGRIND_SUPPRESSIONS, check-valgrind programs
	integrate check-valgrind into alive.test,
	add more valgrind flags to check-dwg-valgrind.

	suppressions:
	on linux-glibc bash leaks like hell:
	  GNU bash, version 4.4.23(1)-release (x86_64-pc-linux-gnu)
	on darwin the libc locale subsystem and objc.

	on the bright side: Most LibreDWG leaks are fixed.

2018-07-31  Reini Urban  <rurban@cpan.org>

	move MULTILEADER to UNSTABLE

	finish MULITLEADER >= 2010
	though there are 92 bits missing before the handle stream

	regen-swig-patch

	change BITCODE_BL/RL to signed int32
	harmonize all vcount/i counters and sizes to BITCODE_BL.

	finished MULTILEADER <2010

	more MULTILEADER work WIP
	share ctx.content.txt and ctx.content.blk: either or.
	2000 works now until end CONTEXT_DATA

	more MULTILEADER work WIP
	multiple breaks.
	start with 2010+ AcDbObjectContextData at the beginning

	more MULTILEADER work WIP
	actually coming closer back to the ODA specs.
	add back num_vertex, num_break

	more MULTILEADER work WIP
	disable to fantasy ODA structs and code.
	favor the DXF docs, structure and reverse-engineered data.

	work on MULTILEADER WIP
	class_version 1 has at first the LEADER_LINE{ points.

	fix entity picture_size BLL type
	lshift one too many. size used as DXF code 160.
	This fixes now 2010+ MULTILEADER entities, which did have a small picture attached.

	regen unknown
	added MLeader*.dwg for MULTILEADER, BoxUnion.dwg for REGION ACIS v2.
	removed UNSTABLE DIMASSOC, ASSOCDEPENDENCY, PERSSUBENTMANAGER.

2018-07-30  Reini Urban  <rurban@cpan.org>

	Improve LOG_TF trace
	Align the 2nd ASCII line to the left of the upper %2x hex line

	Improve {VECTOR,REPEAT}_CHKCOUNT macros
	detect buffer overflows, if AVAIL_BITS() < 0.
	Change AVAIL_BITS to signed long.
	This happens if the previous read (e.g. TF) read past the buffer

	parse the ACIS version 2 format
	It is just the unencrypted binary SAB version.
	Maybe I will decode it to the ASCII variant later, but it is trivial,
	and the binary version has higher precision.

	add handle stream/padding OVERSHOOT warnings
	log OVERSHOOT instead of MISSING when we read too far

	add handle stream/padding overshoots MISSING
	padding between the streams should be max 8.
	display the offset, and add MISSING if >8

	separate WINEPREFIX for wine 32bit
	keep the default 64bit tree at ~/.wine, and create/use
	a new 32bit one.
	This test finds many useful errors.

	in_dxf: fix -Wnull-dereference warning

2018-07-29  Reini Urban  <rurban@cpan.org>

	fix --enable-debug
	overriding AM_CFLAGS is ignored, DEFS also.
	use CFLAGS.
	Just override -g -O2 on gcc --enable-debug, ignore -std=c99 also then.

	rename UNTESTED_CLASS to UNSTABLE_CLASS
	it really is tested, just unstable

	update NEWS - user-visible changes for 0.6
	working on 0.6

	decode: fix wrong has_strings offset
	fixes many skipped r2007+ strings, because of a wrong has_strings
	bit.
	Fixes [GH #34]

2018-07-29  Reini Urban  <rurban@cpan.org>

	decode: check obj_has_strings(type)
	and skip the obj_string_stream() has_strings bit check
	for certain fixed types which do have no strings.
	e.g. LINE and SEQEND entities had the has_strings bit wrongly set,
	they just need to be ignored.

	See [GH #34]. libdxfrw sets their string stream to NULL.

2018-07-28  Reini Urban  <rurban@cpan.org>

	remove unused duplicate reactors/xdicobjhandle
	They are already common object/entity fields.
	Remove them from the specific structs.

	Also remove the wrong dwg_obj_proxy_get_reactors() API,
	use dwg_obj_get_reactors() instead.

2018-07-28  Reini Urban  <rurban@cpan.org>

	MINSERT: harmonize with INSERT
	use SUBCLASS,
	better DXF layout, no attrib_handles without has_attribs

	unknown: more work on LIGHT
	got until attenuation_end_limit

2018-07-28  Reini Urban  <rurban@cpan.org>

	unknown: cquote C strings again
	log_unknown_dxf.pl already quotes " and \,
	but since unknown emits picat code, we need to do it again.

	failed only in ACDB*VIEWSTYLE template strings and MULTILEADER.

2018-07-28  Reini Urban  <rurban@cpan.org>

	smoke.sh: new features
	--enable-write is now default,
	cover the other new features: --disable-write, --disable-dxf, --enable-debug

	semver: separate patch from build number
	the appveyor build number goes into the generated github tag
	which serves as our git generated version number.

2018-07-28  Reini Urban  <rurban@cpan.org>

	fix DIMASSOC
	it has 1-4 reference points, dependent
	on the associativity bitmask. alloc all 4, and
	set only the ones which bit is set.

	Associativity flag [90]:
	1 = First point reference
	2 = Second point reference
	4 = Third point reference
	8 = Fourth point reference

2018-07-27  Reini Urban  <rurban@cpan.org>

	configure: add --enable-debug
	to set DEBUG_CLASSES.
	remove -O2 on gcc.

	api: sort dwg.h add api
	fixes perl bindings compilation errors.
	also add a convencience regen-swig-patch target for python.

	HACKING: improve examples/unknown
	See also https://savannah.gnu.org/forum/forum.php?forum_id=9203

	testcases: fix decode_test_LDADD
	need to link more src objects, similar to bits_test and hash_test

	testcases: fix hash_test_LDADD
	need to link to bits and hash explicitly.
	needed with higher optimizations, when some smaller functions are dropped
	and inlined, esp. with clang >= 5.

	SURFACE: rename num_*data fields
	the size of the encrypted data.

	api: add missing dwg_object_to_TYPE converters
	Dwg_Object -> Dwg_Object_TYPE
	previously only for entities, now also for all objects.

	testcases: fix bits_test
	because of the bit_write_TV changes, adding the \0 to the length.

	alive.test: fix for --disable-dxf

	testcases: fix minor warnings

	promote DIMASSOC to UNTESTED

2018-07-26  Reini Urban  <rurban@cpan.org>

	add DEBUGGING DIMASSOC
	pretty good, just the last intsect_gsmarker: [BS 92]
	and the handles do look wrong in some cases.

	unknown: fix out-of-bounds write
	detected by valgrind

	unknown: no const struct _unknown_field unknown_dxf
	we write to some fields. crashes on some ELF, with this in .rodata

	.gitgnore: add minor files

	unknown: find TV len+1
	A TV testvalue usually includes the final \0.
	Fix that in bit_write_T{VU} and unknown.
	We find now proper TV instead of TF values, e.g. MATERIAL.name

	protect ASSOCACTION VALUEOUTOFBOUNDS
	with DEBUG_CLASSES

	likewise update the docs
	UNTESTED, DEBUGGING, UNHANDLED, ...

	promote ASSOCDEPENDENCY to UNTESTED
	no errors in the covered examples

	unknown: on picat timeout try again with -g go1
	currently for ACAD_TABLE.pi

	add DEBUGGING ASSOCDEPENDENCY
	looks pretty stable to me, needs a bit more testing

	rename SURFACE to PLANESURFACE, regen.
	add to API,
	add coverage (2004/Surface.dwg, 2018/Surface.dwg),
	add UNHANDLED ASSOCPLANESURFACEACTIONBODY,
	regen unknown.

	unknown: skip duplicates
	the same class and unknown bytes.
	This removed 996 entries.

	unknown: add 2000/Helix.dxf

2018-07-25  Reini Urban  <rurban@cpan.org>

	autogen.sh: clean cached VERSION

	swig_python.patch: redo
	fixing Hunk #6 succeeded at 205945 (offset 13869 lines)
	add -b to patch call for easier redoing the difforig.

	r12: fix decode_entity_preR13
	call decode_entity_preR13 from dwg_add_TYPE, the promised preR13 init
	refactoring.

	r12: set more ent fields
	dwg_decode_TYPE calls dwg_add_TYPE, but decode_entity_preR13 needs
	it before and dwg_add_TYPE clears it. Need to refactor preR13 init

	eed: protect from empty appid->apps
	the handle can be empty now. repro: 2013/ground_plane_outline.dwg

2018-07-24  Reini Urban  <rurban@cpan.org>

	decode: don't set bitsize_address
	this is needed by encode DWG_ENTITY_END to write
	the bitsize.
	I hijacked it for decode DEBUGGING, but this broke
	dwgrewrite for example_r14.dwg

	dwglayers: ignore DICTIONARY
	as layer_control member. This has no entry_name

	free: fix NULL handles
	don't allocate illegal null handles at all,
	to be able to decide between global object_ref handles,
	and individual header var handles, and empty refs

2018-07-24  Reini Urban  <rurban@cpan.org>

	free: COMMON UNKNOWN_ENT
	also COMMON_ENTITY_DATA and COMMON_ENTITY_HANDLE_DATA,
	esp. pictures.

	e.g. frees now
	7,308 bytes in 4 blocks are definitely lost in loss record 144 of 144
	   at 0x10016B681: malloc (vg_replace_malloc.c:302)
	   by 0x1000056BD: bit_read_TF (bits.c:1190)
	   by 0x10002DFF4: dwg_decode_entity (common_entity_data.spec:24)
	   by 0x1000C45DC: dwg_decode_UNKNOWN_ENT (dwg.spec:5423)
	   by 0x1000CF3F4: dwg_decode_add_object (decode.c:3644)
	   by 0x100025E12: decode_R13_R2000 (decode.c:1062)
	   by 0x100006A4C: dwg_decode (decode.c:210)
	   by 0x100001A2F: dwg_read_file (dwg.c:186)
	   by 0x10000118E: main (dwgread.c:213)

2018-07-24  Reini Urban  <rurban@cpan.org>

	free: NULL handles
	They were still alloced, but not globally freed, esp. in XRECORD.

	Fixes 8,384 bytes in 262 blocks are definitely lost in loss record 266 of 266
	   at 0x100165D7F: calloc (vg_replace_malloc.c:714)
	   by 0x10002F1BC: dwg_decode_handleref_with_code (decode.c:2747)
	   by 0x1000BEDEC: dwg_decode_XRECORD (dwg.spec:4981)
	   by 0x1000CED60: dwg_decode_add_object (decode.c:3576)
	   by 0x100025ADE: decode_R13_R2000 (decode.c:1062)
	   by 0x100006718: dwg_decode (decode.c:210)
	   by 0x1000016FB: dwg_read_file (dwg.c:186)
	   by 0x100000E5A: main (dwgread.c:213)

2018-07-24  Reini Urban  <rurban@cpan.org>

	add UNDERLAYDEFINITION, DEBUGGING UNDERLAY
	UNDERLAYDEFINITION seems to be ok, UNDERLAY still a hole before flag 280
	and no Boundary coverage yet.

2018-07-23  Reini Urban  <rurban@cpan.org>

	add DEBUGGING *SURFACE entities

	HATCH: is now stable
	Closes [GH #27]

	free: improve eed double-free
	Fixes [GH #33], detected by jinyu00

2018-07-22  Reini Urban  <rurban@cpan.org>

	unknown: log_unknown_dxf
	use different comment style for easier unknown.sh
	helper script to detect all classes.

	unknown: write fieldnames into pi

	add DEBUGGING ASSOCALIGNEDDIMACTIONBODY
	some logic is still missing when to skip some fields

	add DEBUGGING DYNAMICBLOCKPURGEPREVENTER
	fields ok, just after the last handle is an unknown 47bit hole

2018-07-22  Reini Urban  <rurban@cpan.org>

	add --disable-dxf
	Disable DXF and other in/out modules,
	and most helper programs, only dwgread.

	Only useful for faster test/debug cycles.

2018-07-22  Reini Urban  <rurban@cpan.org>

	unknown: more DBCOLOR
	got now the name and color catalog (guide) after a hole of 24bits.
	but there are still 2 big holes.

	add PERSSUBENTMANAGER to UNTESTED
	very low coverage and no known fieldnames.
	but the dxf groups do look stable

2018-07-21  Reini Urban  <rurban@cpan.org>

	unknown: finished fieldnames

	unknown: ignore alldwg.skip
	this is stderr from unknown.
	all classes have now enough information

	disable regen-unknown with !HAVE_INSRCDIR
	Need a configure in srcdir.
	Fixes distcheck errors, and enables proper deps

	unknown: add fieldnames
	and fix some found dxfgroup errors and missing fields

2018-07-21  Reini Urban  <rurban@cpan.org>

	unknown: various improvements
	use the handle code, not just value.
	print the found/notfound fields better.
	print more picat statistics: Found, NotFound ratio, Missing bits.
	add Class,Dxf,Version to the picat data for better constraints checks.

	improve SUN spec

2018-07-20  Reini Urban  <rurban@cpan.org>

	protect dwg_obj_block_control_get_block_headers
	from empty ctrl->block_headers. Fixes [GH #32]

	add DEBUGGING ASSOC2DCONSTRAINTGROUP
	partially, up to AcConstrainedImplicitPoint.
	no names found yet

2018-07-20  Reini Urban  <rurban@cpan.org>

	add picat step to make unknown
	Only done when picat was found in the path by configure.
	Get picat binary or source packages from picat-lang.org

	To skip or override timeout use make unknown TIMEOUT_30=
	timeout is from coreutils.
	https://www.gnu.org/software/coreutils/manual/html_node/timeout-invocation.html

	add a basic description to HACKING

2018-07-20  Reini Urban  <rurban@cpan.org>

	regen-unknown
	catch all the new classes.
	unknown summary: 478284/2967120=16.12%

	add more unhandled classes
	to the header and classes.inc

2018-07-19  Reini Urban  <rurban@cpan.org>

	unknown: more EVALUATION_GRAPH fixes
	but still some unclear options

	gitignore: ignore generated picat files
	.qi is a compiled .pi

	add DEBUGGING ASSOCPERSSUBENTMANAGER
	picat laid out the fields wonderfully, just the names
	are now missing

	configure: probe for picat
	and add more PROG versions to config.log

	unknown: sort alldwg.inc
	new summary: 108570/1028945=10.55%
	much less skips

2018-07-19  Reini Urban  <rurban@cpan.org>

	unknown: better BIT bugfix
	finally we are finding the strings we should be finding all along.
	we still need to sort alldwg.inc by class.

	cannot tell the new summary yet, as it is crashing with overwriting some
	malloc's, but overall it looks significantly better, between 30-40% for many:

	unknown-ACAD_EVALUATION_GRAPH.log:summary: 216/1206=17.91%
	unknown-ACAD_TABLE.log:summary: 272708/1157653=23.56%
	unknown-ACDBASSOC2DCONSTRAINTGROUP.log:summary: 5084/46715=10.88%
	unknown-ACDBASSOCACTION-work.log:summary: 0/193=0.00%
	unknown-ACDBASSOCACTION.log:summary: 400/717=55.79%
	unknown-ACDBASSOCALIGNEDDIMACTIONBODY.log:summary: 282/571=49.39%
	unknown-ACDBASSOCDEPENDENCY.log:summary: 256/571=44.83%
	unknown-ACDBASSOCGEOMDEPENDENCY.log:summary: 4648/11862=39.18%
	unknown-ACDBASSOCNETWORK.log:summary: 1824/3274=55.71%
	unknown-ACDBASSOCOSNAPPOINTREFACTIONPARAM.log:summary: 508/1043=48.71%
	unknown-ACDBASSOCPERSSUBENTMANAGER.log:summary: 732/3457=21.17%
	unknown-ACDBASSOCVERTEXACTIONPARAM.log:summary: 612/1307=46.82%
	unknown-ACDBDETAILVIEWSTYLE.log:summary: 13994/138466=10.11%
	unknown-ACDBPERSSUBENTMANAGER.log:summary: 40/743=5.38%
	unknown-ACDBSECTIONVIEWSTYLE.log:summary: 28194/230930=12.21%
	unknown-ACDB_LEADEROBJECTCONTEXTDATA_CLASS.log:summary: 1624/3443=47.17%
	unknown-ACSH_HISTORY_CLASS.log:summary: 216/368=58.70%
	unknown-ACSH_SWEEP_CLASS.log:summary: 1160/10634=10.91%
	unknown-ARC_DIMENSION.log:summary: 31376/104047=30.16%
	unknown-CSACDOCUMENTOPTIONS.log:summary: 0/6160=0.00%
	unknown-DBCOLOR.log:summary: 400/39784=1.01%
	unknown-DIMASSOC.log:summary: 6036/42548=14.19%
	unknown-HELIX.log:summary: 33820/89830=37.65%
	unknown-LAYOUTPRINTCONFIG.log:summary: 0/1930=0.00%
	unknown-LIGHT.log:summary: 1642/9020=18.20%
	unknown-MATERIAL.log:summary: 21090/276592=7.62%
	unknown-MULTILEADER.log:summary: 20682/90631=22.82%
	unknown-SUN.log:summary: 630/2804=22.47%
	unknown-TABLECONTENT.log:summary: 11160/226312=4.93%
	unknown-TABLEGEOMETRY.log:summary: 0/0=nan%
	unknown-TABLESTYLE.log:summary: 14416/427123=3.38%

2018-07-19  Reini Urban  <rurban@cpan.org>

	unknown.pi: add hole detection
	for the next solver step, to add the leftover fields rests to the holes.
	and to fill in likely dwg-only fields, not in the dxf.

	unknown: shorted HANDLE to H structname

	unknown: whitespace only
	indent class - dxf loop

2018-07-19  Reini Urban  <rurban@cpan.org>

	unknown: create picat data files
	process unknowns per class, not per file anymore.
	change bit_errprint_bits to bit_fprint_bits, without \n.

	TODO: pre-sort alldwg.inc per class.

2018-07-19  Reini Urban  <rurban@cpan.org>

	unknown: picat module and EVALUATION_GRAPH data
	for the picat solver helper to layout unknown fields.
	there's no backtracking with constraints, there's not enough data yet.

2018-07-17  Reini Urban  <rurban@cpan.org>

	bits: add bit_errprint_bits
	print bits to stderr, not stdout

	fix EVALUATION_GRAPH Object bugs
	the fixed unknown revealed some type errors

2018-07-16  Reini Urban  <rurban@cpan.org>

	unknown: fix BIT bug
	10 is the proper representation of BL/BS 0, not 00.
	(gdb) p/t 0x80 => 10000000

	summary: 200166/2972461=6.73%

2018-07-15  Reini Urban  <rurban@cpan.org>

	add DEBUGGING ASSOCOSNAPPOINTREFACTIONPARAM Object
	half-way through

2018-07-15  Reini Urban  <rurban@cpan.org>

	unknown: fix overlap check
	skip the last bit+1.
	and mark as found if num_found == num_dxf, even for >5

	213008/2972461=7.17%

2018-07-15  Reini Urban  <rurban@cpan.org>

	unknown: reformat output
	put bits into col 0
	print each dxf fields at col 0
	put search into one line
	add num of same DXF fields to result
	add + or ? to found

	172488/2972461=5.80%

2018-07-15  Reini Urban  <rurban@cpan.org>

	unknown: skip duplicate handle codes
	and skip searching for EED dxf codes, they are not stored
	in the unknown bytes, and are not stored dupl. as DWG fields

2018-07-15  Reini Urban  <rurban@cpan.org>

	refactor DEBUG_HERE
	needed to print the object offset,
	add DEBUG_HERE_OBJ, DEBUG_POS_OBJ

	note that UNKNOWN_* excludes the EED and common_entity_data

	flip two SUN fields

2018-07-15  Reini Urban  <rurban@cpan.org>

	more DEBUGGING SUN work

	stability: protect print loops
	we bail out earlier now in REPEAT and VECTOR
	leaving the field unallocated. Protect against that in print at least.

	add DEBUGGING EVALUATION_GRAPH Object

	in_dxf: no inline dxf_free_pair
	-Winline warned: call is unlikely and code size would grow

2018-07-14  Reini Urban  <rurban@cpan.org>

	unknown: compile-time multiple matching fields
	pre-calculate the number of potential same DXF fields values,
	same basic type and same string value.
	No need to calc num_dxf() at run-time

	back to the previous 172968/2972461=5.82%

2018-07-14  Reini Urban  <rurban@cpan.org>

	unknown: handle multiple matching fields
	when the same DXF value could lead to the same binary representation.
	e.g. DBCOLOR has 2 equiv. DXF fields 330:handle, or mult. 90:"21" fields.
	mark them as found also.

	check raw numeric types also, if the bitencoded one failed.

	advanced to 172692/2440879=7.07%
	and found several unique hits in previously skipped classes

2018-07-14  Reini Urban  <rurban@cpan.org>

	unknown: fixup DBCOLOR status
	it is DEBUGGING

	add .c.ii rule
	for preprocessed files without line markers. useful for debugging macros.

	stability: more isnan checks

	logs: add GNU parallel usage
	This is of course massively parallel and faster.
	See https://savannah.gnu.org/forum/forum.php?forum_id=9197

2018-07-13  Reini Urban  <rurban@cpan.org>

	unknown: skip empty objects
	unknown prints all empty objects with 0.0% found to alldwg.skip
	which will be subsequently skipped

	unknown: skip some duplicates and 0%
	egrep '0.0%|test/test-data/' unknown-0.5.1027-12-g28982958.log | grep -B1 0.0%

	unknown: regen with DBCOLOR
	fix regen-unknown to include more unknowns, esp. DBCOLOR

	stability: improve REPEAT_CHKCOUNT
	but via sizeof, not minimal bits_size.
	abort HATCH with gradient fill on print

	WIP dbcolor handle
	See [GH #31]

	Untested OBJECT DBCOLOR
	referenced by color handle of some entities WIP
	See 2004/CascoUrbano GH #27

	fix SORTENTSTABLE

2018-07-13  Reini Urban  <rurban@cpan.org>

	stability: improve VECTOR_CHKCOUNT
	add global dwg_bits_size: minimal sizes of all types
	and check each VECTOR or REPEAT before the malloc against overflow.

	move dwg_bits_name from unknown to common.{c,h}

2018-07-13  Reini Urban  <rurban@cpan.org>

	free: protect empty FIELD_VECTOR_N

	check-syntax: add nice -O0
	unknown flycheck lasts too long

	ASSOCNETWORK: demote back to DEBUGGING
	inline the actions, WIP. But coming very close.

	unknown: log pos range
	from-last bits

	handle relative codes 6-c
	relative offset handles do have an ref, even with size 0.
	esp. code 6 (next) and 8 (prev).

	autogen.sh: generate .tarball-version
	this is done by dist-hook, but we are doing some extra work to be clearer

2018-07-12  Reini Urban  <rurban@cpan.org>

	examples: wrong EXTRA_DIST
	we don't need to distribute the unknown sources

	unknown: promote ASSOCNETWORK to UNTESTED
	the action handles are missing, but it looks rather good and stable

	unknown: fix relative c handle
	-3 offset is stored as c.1.3

	unknown: support relative reactors
	from 150616 to 150760

2018-07-12  Reini Urban  <rurban@cpan.org>

	unknown: fix relative handle offsets
	6.0.0 is +1, 8.0.0 is -1
	a.0.1 is +1, ...

	from 150560 to 150616/2490950=6.05%

2018-07-12  Reini Urban  <rurban@cpan.org>

	unknown: more ASSOCACTION work
	compilation fixes with -DDEBUG_CLASSES

	dwg2dxf: free only with mult. infiles

	unknown: fix imprecise RD search
	we added a RD step after BD, changing the type to RD.
	improved from 147660/2490950=5.93% to 150560/2490950=6.04%

	unknown: add --class filter, unknown.sh
	filter by classes.
	add the dxf to the header.
	fix the TU is16 flag for r2010+
	free the temp. chains (to reuse the buffers),
	  our data-structures got bigger over time.

2018-07-12  Reini Urban  <rurban@cpan.org>

	unknown: regen and fix some warnings
	generated a lot of matching DXF's to find more fields.

	new summary: 147594/2490950=5.93%
	prev. 4810/407639=1.18%, 8384/548025=1.53%

2018-07-12  Reini Urban  <rurban@cpan.org>

	unknown: fix restarts, esp. r2010+
	the offset calculation was wrong, leading to wrong
	unknown bytes being logged and analyzed for r2010+

2018-07-11  Reini Urban  <rurban@cpan.org>

	fix git-version-gen for tag releases
	on a tag commit `git describe HEAD` cannot find a description,
	use --tags to avoid an UNKNOWN version, and use the tag.

	dxf: add HEADER_TU LASTSAVEDBY
	and fix a couple of compiler warnings of unused functions

	configure: print generated git version

	perl: fix bash syntax error
	syntax error near unexpected token `;'

	dwg2dxf: fix -Wuninitialized
	though practically not happening

	configure: honor system CFLAGS
	and AC_SUBST(WARN_CFLAGS) is already done by AX_COMPILER_FLAGS

2018-07-11  Reini Urban  <rurban@cpan.org>

	re-enable WARN_CFLAGS
	was disabled when AM_CFLAGS was set in *.am and configure.ac

	fix various minor warnings: -Wshadow, -Wsign-compare, missing-decls
	undefine DEBUGGING_CLASS'es in the spec (-Wunused-function)

2018-07-11  Reini Urban  <rurban@cpan.org>

	win32 static: check ENABLE_SHARED
	some libtool cannot build shared, but __declspec(dllimport)
	is still set there, leading to linker errors.
	the same happens on windows with --disable-shared.

	python: stabilize
	help with empty PYTHON.
	don't make check without python in xmlsuite

	perl: skip make with windows Makefile
	with incompatible command.com/cmd.exe shell
	grep for NOOP = rem and skip then.
	This bug started with the msys update to perl-5.28
	Before the Makefile was properly created from bash for bash.

	perl: fix OBJEXT

	perl: prefer local dwg.h over old installed
	see GH #29.
	Also disable the unused cmdline overrides

	unknown: add CMC support for DXF 63
	only for indexed color values <r2004.
	since r2004 the color struct adds to it, but should be found nevertheless.

	unknown: add SUNSTUDY object fields
	yet unsorted and uncovered
	The SUN object is wrongly documented in the Acad DXF docs as entity.

2018-07-11  Reini Urban  <rurban@cpan.org>

	unknown: regen alldwg.inc
	add more dxf counter-parts, fixed dxf field in alldwg.inc.

	work on MULTILEADER 3BD ctx.content_base -> 3RD at offset 384-576 with example_2000.dwg
	rename leaderstyle 340 handle to mleaderstyle

	summary: 8216/544344=1.51%

2018-07-09  Reini Urban  <rurban@cpan.org>

	patch: add build-aux/swig_python.patch to EXTRA_DIST
	failed in distcheck

	add unknown make target

2018-07-08  Reini Urban  <rurban@cpan.org>

	unknown: try BS-BL, and BL-BS
	from 4720 to 4810

	unknown: try RD when BD failed
	from 2718 to 4720 (precise only, unprecise added no hits)

2018-07-08  Reini Urban  <rurban@cpan.org>

	unknown: restrict relative handles
	only some code 6 and 8 offsethandles are valid,
	only of the new handle has an +1 or -1 offset.
	ditto for a and c: the offset must be positive.

	down to 2718

2018-07-08  Reini Urban  <rurban@cpan.org>

	unknown: add OFFSETOBJHANDLE code>5 variants
	relative (shorter) handle values. yet unsuccessful.
	removed one wrong found handle c: down to 2734

	unknown: try RC for BS and vice versa
	from 2742 to 2782

2018-07-08  Reini Urban  <rurban@cpan.org>

	unknown: fix printing found BD
	print the BD bitmask at the found offset and compare it the
	DXF string (should be <0.001).

	down from 3270 to 3252 bits, and with a crosscheck for <0.001
	even down to 2742.

2018-07-08  Reini Urban  <rurban@cpan.org>

	unknown: more unprecise BD search
	still 3270 bits found

	unknown: add unprecise BD search
	cut the mantissa precision from 52 bit to 44 bit.
	finds now 23 more BD's, e.g. 10.0, 50.0, 2231.000092348011,
	-54.05474532926735, 490.6216519543077, 20.75891407303142

	unknown: try TV if TU fails (unsuccessful)
	add summary stats

	common: explain the MC0.0 magic
	http://www.fourmilab.ch/autofile/www/section2_11_4.html
	http://www.fourmilab.ch/autofile/www/chapter2_14.html

2018-07-07  Reini Urban  <rurban@cpan.org>

	unknown: add coverage stats
	store each found and possibly bit, to continue search
	if already reserved, and get some picture

2018-07-06  Reini Urban  <rurban@cpan.org>

	unknown: try more handle codes
	now found 62 unique handles,
	improved from 140 to 151 found 1.

	stats of found fields:
	    1 151
	    2 118
	    3 37
	    4 20
	    5 93
	    >5 11692

2018-07-06  Reini Urban  <rurban@cpan.org>

	unknown: improve handle codes
	now found 51 unique handles,
	improved from 94 to 140 found 1

2018-07-06  Reini Urban  <rurban@cpan.org>

	unknown: fix bits_BS strtol
	using sscanf is always a bad idea.
	The data looks pretty good and solvable now.

	stats of found fields:
	1 94
	2 109
	3 34
	4 17
	5 101
	>5 11678

2018-07-06  Reini Urban  <rurban@cpan.org>

	unknown: store max 5 found positions
	stats of found fields:
	1  94
	2  109
	3  34
	4  14
	5  101
	>5 11678

	unknown: fix alldxf_1.inc extended fields
	add the missing fields.
	use -1 for not-found pos, not 0. This enables the first field being at first.

2018-07-06  Reini Urban  <rurban@cpan.org>

	unknown: implement membits
	use our own search, which is much easier than handling all the
	memmem corner-cases at the beginning and end, and bit-shifting.

	use strtod instead of sscanf %lf. was buggy.

	print the bits to review the search (and check write API, looks wrong),
	added bit_print_bits to bits.c
	WIP: The doubles BB prefix looks wrong, the double values from strtod
	also. maybe hardcode some string->double conversions.

2018-07-06  Reini Urban  <rurban@cpan.org>

	unknown: add TV and angle_BD types
	non-unicode for 300-309, deg2rad angles for DXF 50 types

	unknown: fix DXF 310 hexstring
	and fix wrong dxf_size vs dxf_bitsize.
	add dwg_bits_name[]

	document libredwg.pc

2018-07-05  Reini Urban  <rurban@cpan.org>

	add libredwg.pc

	unknown: fix search_bits
	convert the bytes/bits to one byte stream.
	add carry logic and remaining dxf->bits

2018-07-05  Reini Urban  <rurban@cpan.org>

	unknown: search_bits
	search for the binary repr in the stream
	and store found position if found only once.
	try for all 8 possible shift positions.

	TODO: we don't handle multiple findings yet, and we didn't find any unique
	pos yet.  the carry logic and the remaining dxf->bits are also missing.

2018-07-05  Reini Urban  <rurban@cpan.org>

	unknown: store the binary repr - bits_format
	for each dxf value

2018-07-05  Reini Urban  <rurban@cpan.org>

	unknown: split up generation of static array of struct
	we need 3 parts to be able to initialize it statically.
	disable alldwg.inc for now. we don't need to find the fields order and pos,
	only for a consistency crosscheck against all DWG's without matching DXF afterwards.

	add 2 fields to the dxf fields: type and pos, resolved by the solver.

2018-07-05  Reini Urban  <rurban@cpan.org>

	unknown: never build alldwg.inc
	unless via regen-unknown.

	generated sources are in builddir, only from there ./logs.sh can be run.

2018-07-05  Reini Urban  <rurban@cpan.org>

	unknown: implemented log_unknown_dxf.pl
	created now alldxf.inc with all the real dxf values to find
	in the unknown bits.

	DEBUGGING_CLASSES ASSOCACTION, ASSOCNETWORK

	add build-aux/swig_python.patch
	for a warnings free swig source, for swig 3.0.12

	regen-man: with version 0.5.1-dev

	dwg2svg2: use getopt_long

	dwg2ps: use getopt_long

	dwgbmp: use getopt_long

	dwg2SVG: use getopt_long

	dwggrep: use getopt_long

	dwglayers: use getopt_long

	dxf2dwg: use getopt_long

	dwg2dxf: use getopt_long
	change -as-rNNNN to --as rNNNN resp. -a rNNNN.

	dwgrewrite: use getopt_long
	change -as-rNNNN to --as rNNNN resp. -a rNNNN.

	dwgwrite: use getopt_long
	change -as-rNNNN to --as rNNNN resp. -a rNNNN.

	dwgread: without HAVE_GETOPT_LONG

	dwgread: use getopt_long
	which is a bit broken for -v3 (optional args), but we hack around it.
	at least we can use all options in any order now.

	stability: no endless loop with small files
	dwgs are normally >1000byte. But with a wrong filename
	avoid an endless hash_new loop with size==0 (/1000)

	Doxyfile: only with doxygen

	fix distcheck uninstall for perl and doc
	the added to perllocal.pod and share/info/dir cannot be uninstalled.

2018-07-05  Reini Urban  <rurban@cpan.org>

	First release 0.5

2018-07-04  Reini Urban  <rurban@cpan.org>

        logging: remove decimal handle value
        handles are hex only

2018-07-03  Reini Urban  <rurban@cpan.org>

        dxf: protect empty vectors
        and fix wrong MATERIAL text types for *map_filename

        api: remove wrong comment
        MULTILEADER spec: more DXF
        and return earlier on errors

2018-06-30  Reini Urban  <rurban@cpan.org>

       Third test release 0.4.938

2018-06-29  Reini Urban  <rurban@cpan.org>

       more format string types

       enable glibc strcasestr
       probed as yes, but not declared. same as on darwin.

       ../../programs/dwggrep.c:213:7: warning: implicit declaration of function ‘strcasestr’ [-Wimplicit-function-declaration]
              if (strcasestr(text, pattern))

2018-06-29  Reini Urban  <rurban@cpan.org>

       alldwg.inc: create from builddir
       ./logs.sh can only be run from the builddir,
       only there are the binaries.
       call make from logs.sh, not gmake. we would really need a MAKE=$(MAKE)
       but this is only done on regen-unknown by the maintainer.
       make the alldwg.inc target a maintainer rule only. test -d ../.git || false

2018-06-28  Reini Urban  <rurban@cpan.org>

       eed: fix max limit from 1024 to obj->size
       And on overlong stringsize just skip it to the end.

       This fixes the error with hatch_color_ref.dwg from [GH #27]
       and several LAYER entities with attached large EED data.

2018-06-28  Reini Urban  <rurban@cpan.org>

	Second test release 0.4.924

2018-06-28  Reini Urban  <rurban@cpan.org>

	common_entity_data: fix has_ds_binary_data
	use instead of nolinks with r2013+

	improve FIELD_2DD_VECTOR logging, print index

2018-06-28  Reini Urban  <rurban@cpan.org>

	try ACIS 2 only with .git (ifndef IS_RELEASE)

	add some FIELD formatting overrides FIELD_RCu lineweight FIELD_BLh rgb_color
	pass thru preR13 decode errors

	add analog VECTOR_CHKCOUNT
	also for HATCH.
	Maybe we should use these checks only for known UNKNOWN_CLASS
	entities. The strcmp check for the classname
	is resolved at compile-time already., if the classname would
	appear in the macro.

	add REPEAT_CHKCOUNT and use it more
	not only since r2010+ also with r2004 for invalid HATCH entities.

	decode BD stability: check bit_isnan
	when decoding bitcode encoded doubles, check for our
	own unique return value of bit_nan (avoiding math.h and -lm).
	return DWG_ERR_VALUEOUTOFBOUNDS in objects and entities then

2018-06-28  Reini Urban  <rurban@cpan.org>

	fix common_entity color ENC encoding
	various serious errors in the color encoding
	for entities, called ENC.

	The bug only occurred with non-indexed colors
	with RGB or transparency values.
	Thanks to @arturredzko for an example DWG.

2018-06-28  Reini Urban  <rurban@cpan.org>

	api: finish docs, more renames
	Take the opportunity that the API should be somewhat sane and stable,
	to harmonize more names:
	align => alignment
	numrows => num_rows
	numcols => num_cols
	flags_  => flag

	remove the dwg_ent_insert scale_flag API. This is DWG internal only.

2018-06-27  Reini Urban  <rurban@cpan.org>

	ChangeLog: update for last month
	with gnulib's gitlog-to-changelog, clustered.

	cluster adjacent commit messages if their headers are the same and
	neither commit message contains multiple paragraphs.

2018-06-27  Reini Urban  <rurban@cpan.org>

	python DISTCLEANFILES

	portability: fix GNU make extensions
	hard-code all our test-data files
	test/Makefile.am:16: warning: :=-style assignments are not portable
	test/Makefile.am:16: warning: shell git ls-tree -r --name-only @ test-data: non-POSIX variable name
	test/Makefile.am:16: (probably a GNU make extension)

	stability: 2004 section map
	the extremely large HARTA_E_PRISHTINES_2004 dwg has an odd last
	AcDb:AcDbObjects section, which is misinterpreted as new section info, not
	the last section.
	It also misses now several section types.
	Only the 2007 variant decodes fine. All 2004 (r2010+) versions not.

	dwggrep: finish object fields
	add all known missing test fields.
	now only the TABLE name matcher is not yet implemented.

	FIELD: fix ODA bug
	value_string_length is of type BL, not T

	automake HAVE_PYTHON check
	skip test/xmlsuite with --disable-python

2018-06-26  Reini Urban  <rurban@cpan.org>

	alive.test: add example_r14.dwg
	This is also a supported version

	fix automake HAVE_LIBPS
	ac_cv_header_libps_pslib_h is set later, by AC_CHECK_HEADERS.
	programs/dwg2ps was never generated

2018-06-25  Reini Urban  <rurban@cpan.org>

	First test release 0.4.900

2018-06-25  Reini Urban  <rurban@cpan.org>

	api: add dwg_block_control, dwg_{model,paper}_space_ref
	dwg_block_control is easy, always the first object,
	and also dwg->block_control.
	but the canonical model and paper space headers are a bit tricky to get
	to iterate over it.
	fix the implementations and docs, and use the new API.

	the old api via dwg_obj_block_control_get_model_space from the block_control
	was awful and wrong.

2018-06-24  Reini Urban  <rurban@cpan.org>

	dwggrep: fix BLOCK_HEADER for r2010+r2013
	with r2010+r2013 the block_control.model_space is different from the original
	BLOCK_RECORD_MSPACE. We rather prefer 1F, the one from the header.
	Many entities went missing there.

	TODO: Fix the API iterators and docs, how to iterate over all entities.

2018-06-24  Reini Urban  <rurban@cpan.org>

	dwggrep: add pcre2 to appveyor

	dwggrep: fixup documentation

	dwggrep: extract print_match
	calling a func is faster than inlining it. less cache bloat.
	remove unneeded re_prepare, no .* embedding needed.
	const and restrict the args

2018-06-24  Reini Urban  <rurban@cpan.org>

	dwggrep: fix the jit, enable --type, --dxf
	PCRE2_PARTIAL_* needs a compiled index [1] or [2] re function, but we
	compiled only a simple (fast) matcher, so the jit always returned
	PCRE2_ERROR_JIT_BADOPTION.
	i.e. the compile options must match the match options.

	also enable the --type and --dxf option.
	for --type we need to set obj->dxfname globally for each object
	to a const string, no threat.

2018-06-24  Reini Urban  <rurban@cpan.org>

	dwggrep: add native pcre2-16 support
	no need to convert r2007+ strings to UTF-8, match them
	directly with the pcre2-16 matcher

	But the JIT matcher is still broken, never worked.
	substring search works fine though.

2018-06-23  Reini Urban  <rurban@cpan.org>

	dwggrep: more entities and features
	and fix strcasestr

	dwggrep: more robust probes and fallbacks
	no regex support when pcre2 is not available. (no gnu regexp, sorry)
	fix the configure probes,
	add my strcasestr fallback

	add dwggrep
	try pcre2 jit, and then simple substring matching.
	not handling prec2-16/r2007+ texts yet.

	doc: texi updates and fixes

	perl: remove generated swig files
	they can be easily generated. it was useful to see
	API changes though

2018-06-23  Reini Urban  <rurban@cpan.org>

	python: case-sensitive LibreDWG name
	renamed from libredwg.

	We've put the module name for consistency into the dwg.i
	I have no idea if the binary can stay lower-case, or needs
	to have the same name, but the comment seems to mandate the
	same case, just a prepended _

2018-06-23  Reini Urban  <rurban@cpan.org>

	distcheck: dwg2ps.1 oddity
	now install it, even if the binary might be not built

	distcheck: *.1 are generated in srcdir
	for a while already

	python: fix libredwg.py distcheck
	Both swig-generated files are put into srcdir, not builddir with swig-3.
	With swig-2 I think they are in builddir, as seen on travis.
	We need at least the .py in builddir.

	perl: add needed deps
	to compile perl XS packages.
	cygwin: libcrypt-devel

	perl: no install req, try LD_RUN_PATH=
	and fix the path to src/.libs from srcdir to builddir

2018-06-22  Reini Urban  <rurban@cpan.org>

	skip check perl
	when the shared libredwg is not installed.
	It is too problematic to link to the uninstalled so: linux, osx, windows

	doc: add Bindings chapter

	TODO: update

2018-06-22  Reini Urban  <rurban@cpan.org>

	configure: allow PERL, check --disable-python
	allow overriding PERL=cperl5.26.1 e.g. for using ccache.
	allow swig bindings for perl when python is disabled,
	because we ship the generated swig_perl.c

	I really need to cache cperl and it's used ccache compiler,
	to be able to use ccache in the perl binding.

	remove bindings/perl/Makefile.in generation. forgot that earlier.

2018-06-22  Reini Urban  <rurban@cpan.org>

	rename swig_wrap_* to swig_*.c
	harmonize the generated swig wrapper names.

	and improve the perl flags a bit.

2018-06-22  Reini Urban  <rurban@cpan.org>

	add perl bindings WIP

2018-06-22  Reini Urban  <rurban@cpan.org>

	swig: smaller API
	we don't need duplicate struct accessors generated by swig
	for all the struct fields and via functions.
	strip the functions.
	also avoid the duplicate API types, only use the dwg.h types.

	bindings/dwg.i            |   169 +-
	bindings/perl/LibreDWG.pm |  1031 +-
	bindings/perl/swig_perl.c | 40775 ++--------------------------------------------------------------
	src/dwg_api.c             |     2 +-
	4 files changed, 1185 insertions(+), 40792 deletions(-) bindings/dwg.i            |   169 +-

2018-06-22  Reini Urban  <rurban@cpan.org>

	fix swig bindings
	do not use -importall, rather include our 2 headers manually.
	once verbatim and once via %include.

2018-06-22  Reini Urban  <rurban@cpan.org>

	api: cleanup by checking the perl swig bindings
	fix _3DSOLID
	and a couple more undefined classes,
	only detected by the new perl binding.

	add many missing dwg_ent_ field functions
	and many other typos or renames.

	add missing variable entity getters
	we can now check fixedtype

	add missing dwg_obj_obj methods and
	more missing or wrong obj methods

2018-06-22  Reini Urban  <rurban@cpan.org>

	api: ref, object rename, harmonization
	rename several API funcs for proper prefixes.
	Dwg_Object* methods are using the dwg_object_ prefix,
	Dwg_Object_Ref* getters use dwg_ref_get_

	dwg_api:
	dwg_obj_polyline_*get_*points(Dwg_Object*) => dwg_object_polyline_*
	dwg_obj_get_*(Dwg_Object*) => dwg_object_get_*
	dwg_obj_object_get_index(Dwg_Object*) => dwg_object_get_index
	dwg_obj_ref_get_object(Dwg_Object_Ref*) => dwg_ref_get_object
	dwg_get_type => dwg_object_get_type
	dwg_get_dxfname => dwg_object_get_dxfname

	Add the dwg_object_get_fixedtype API.

	And then rename two uncommon signatures taking Dwg_Object_Ref*.
	dwg.h:
	dwg_ref_get_object(const Dwg_Data *restrict dwg,
	                   Dwg_Object_Ref *restrict ref)
	=> dwg_ref_object
	which clashed with dwg_ref_get_object taking a Dwg_Object_Ref*,
	which was before named dwg_obj_ref_get_object.

	dwg_ref_get_object_relative(const Dwg_Data *restrict dwg,
	                            Dwg_Object_Ref *restrict ref,
	                            const Dwg_Object *restrict obj)
	=> dwg_ref_object_relative (also unused)

2018-06-22  Reini Urban  <rurban@cpan.org>

	add a Windows paragraph to README

	unknown: add dxf, replace offset with handle
	this is also unique and can identify the object in the matching DXF.
	so we can actually match the proper values and types.

	more regen alldwg.inc fixes

	alive.test: print the failing log

	check-dxf: fix, and add r14
	the second loop was broken

	unknown: skip regen alldwg.inc
	add a special regen-unknown target to generate alldwg.inc
	add missing DIST declarations: logs.sh, alldwg.inc (which triggered
	the generation on distcheck, an out-of-dir configure)

	forgot to EXPORT dwg_absref_get_object
	the fixes SWIG bindings for perl found that out.

2018-06-21  Reini Urban  <rurban@cpan.org>

	add examples/unknown
	a sample program to find the most likely
	fields for all unknown dwg entities and objects.

	gather all binary raw data from all unknown dwg entities and objects
	into examples/alldwg.inc.
	with the available likely fields try permutations of most likely types.

2018-06-21  Reini Urban  <rurban@cpan.org>

	bump DWG_ERR_CRITICAL to CLASSESNOTFOUND
	i.e. VALUEOUTOFBOUNDS will not stop processing DWGs
	and will not report the process as failed.

	error: add 2004,2007 realloc -1 error propagation
	pass back proper error status bits, esp. on r2004 + r2007.
	ignore a return val of -1 for realloced obj's.
	Now most DWG return 0. Some exotic ones still crash though:
	Helix and r11.

	more diagnostics
	print more read values, and skip duplicates earlier read

	decode: no duplicate xdic_missing_flag logging

	r11: check empty object->hdl

2018-06-21  Reini Urban  <rurban@cpan.org>

	better HANDLE diagnostics
	try to accept new code 0xe (REGION.history_id r2007+),
	print codes in hex.
	print failing/invalid handles

	inline dwg_decode_handleref into dwg_decode_handleref_with_code
	to get the original wanted code pointer type.

2018-06-21  Reini Urban  <rurban@cpan.org>

	print: harmonize HANDLE printing

	We log TF and TFF values with -v5
	just add the field name and type

2018-06-21  Reini Urban  <rurban@cpan.org>

	start with ACIS/SAT version 2
	which is most likely a 5 byte link to a blob of their fork of ACIS 7.0
	called now ShapeManager, with all the versions.
	But all the different ACIS data has in version 2 the same content:
	5: BL + 0d254c8109 + 0: BL, so there must be something else.

	There is EED data attached to it, with 0-2 handles and several code 70 and one 71.
	The handles are to APPID instances: ACAD_OBJECT_CHANGE_GUID and ACAD_STEPID.

2018-06-20  Reini Urban  <rurban@cpan.org>

	stability
	fix a few dead stores,
	fix a dwg2SVG INSERT problem,
	propagate more errors back.

	free: a few more minor leaks
	dxfname leak: typically 2Kb
	eed: also about 2Kb

	free: fix the str_dat leak
	typically 20Kb

	free: remove dwg_free_handleref
	just free the ref, and handle the dwg->object_ref[] later.
	re-enable dwg->object_ref[] to catch all dwg_decode_handleref refs.

	free: fix dwg->object_ref
	this is one array. skip the linear seearch in dwg_free_handleref, just free
	the ref, the array is free'd later at once.
	free the classes later, they are need to dispatch var-types.

	free: call hash_free
	7KB typically

	free: enable free for num_objects < 1000
	to catch regressions. Performance is only a problem for big DWGs.
	dwglayers accidentally always used dwg_free.
	improve dwg_free_handleref

	free: improve dwg_free_eed
	handle data, raw and eed uniformly

	silence dwglayers handle errors

	check decompress_R2004_section errors

	change all object indices to BITCODE_BL (2/2)
	forgot some

	change all object indices to BITCODE_BL
	to match the actual serialized data type. long is way to large on 64bit.

	rename idc variables
	to index and i. in encode and decode

	encode: fix critical object_map index bug
	we mixed up index with handle, leading to an object overflow.

	encode: add and fix dwg_encode_eed
	wrong size, leading to subsequent overflows.
	add #ifndef IS_RELEASE VECTOR overflow checks in encode

2018-06-19  Reini Urban  <rurban@cpan.org>

	disable TABLE again
	fails even with r2000-r2007, but not much missing.

	free: fix TABLE subclassing
	check for wrong type

	encode: harmonize EED loop
	there's no dwg_encode_eed() (yet), but at least harmonize
	both code paths. Writing the entity EED is still broken WIP.

2018-06-19  Reini Urban  <rurban@cpan.org>

	encode: fix bit_chain_alloc
	There is one overlarge XRECORD, size 53014 > CHAIN_BLOCK (40960).
	When adding this object to dat, it overflowed the Bit_Chain heap.

	Also remove the superflouos DWG_SUPERTYPE_UNKNOWN logic from the encoder,
	rather do this in classes.inc

2018-06-19  Reini Urban  <rurban@cpan.org>

	harmonize test-data Constraints_*.dwg file names
	Strip the version suffix, which is already defined by the dir.
	This avoids x_2004_2004.log and dxf files also.

	add common_entity_data.spec

	leave with DWG_ERR_VALUEOUTOFBOUNDS early
	on wrong class_versions, which are usually 0-2

2018-06-19  Reini Urban  <rurban@cpan.org>

	add 3BLL type as documented, enable TABLE <= r2007
	BLL uses 3 bits for len, but it is documented to use 3B: 1-3 bits
	stopping at the first 0 bit. Which would leave us with
	0: 0, 10: 2, 110: 6, 111: 7. 100 for 4 or 101 for 5 would be invalid.
	But this documentation is wrong, this encoding is not used for
	REQUIREDVERSIONS, picture_size.

	Add the unused documented variant as 3BLL type.

	Use the old TABLE pre-2010 as STABLE, and as DEBUGGING since r2010+.
	dxf: Use the entity dxfname for variable types: ACAD_TABLE.
	Fixes some entities for the picture_size.
	Trace more common entity data.

2018-06-19  Reini Urban  <rurban@cpan.org>

	refactor: add ACTION, TABLE: call TABLECONTENT
	Now we separated the initializer from the field handler.
	Enable experimental TABLE r2010+ support, by
	allowing calling the sublassed TABLECONTENT decoder, from within
	TABLE.

	All modules define now its ACTION globally for dwg.spec and classes.inc

2018-06-18  Reini Urban  <rurban@cpan.org>

	api: fix the public dwg_add_* decls
	checked against classes.inc and its DEBUG_CLASSES setting

2018-06-18  Reini Urban  <rurban@cpan.org>

	api: separate dwg_decode_OBJECT and dwg_add_OBJECT
	dwg_decode_OBJECT calls now dwg_add_OBJECT, but dwg_add_OBJECT
	can be called separately, for the import modules.
	There's also a new realloced = dwg_add_object(dwg); API.

	Adjust the docs.

	See [GH #19]

2018-06-18  Reini Urban  <rurban@cpan.org>

	smoke.sh: remove arm workarounds
	arm cross can compile now src/out_dxf properly

	docs: update status

	add unhandled LAYOUTPRINTCONFIG class
	but only found the class, no object instance yet.

2018-06-18  Reini Urban  <rurban@cpan.org>

	dwg2svg2: simplify API usage
	searching for the block_header is pretty stupid.
	we need to get the main block_control globally (its always the first object),
	and from this we get its mspace and pspace headers.

	Some DWGs replaced their tables with dictionaries, and there the
	headers will not be found this way.

2018-06-18  Reini Urban  <rurban@cpan.org>

	dxf: protect from empty ENT_REACTORS
	REGION on example_2013 has num_reactors 1 but no attached reactor.
	This could happen on a missing handleref object

2018-06-18  Reini Urban  <rurban@cpan.org>

	disable TABLE entity
	With r2010+ a TABLE needs to jump to the TABLECONTENT object,
	but without the initialization, just the fields.

	we really need to split up DWG_OBJECT into init and fields methods,
	see also [GH #19] where we want to split it up into action_OBJECT
	for the fields and add_OBJECT.

2018-06-18  Reini Urban  <rurban@cpan.org>

	add better example DWG and DXF for test coverage
	Convert the better example_*.* coverage test file to all versions.
	Adjust the coverage TODO report.

2018-06-18  Reini Urban  <rurban@cpan.org>

	dxf: extend 2018/example_2018
	added a couple of missing objects/entities.
	extend classes.inc and DWG_TYPE_ for these.
	Check for invalid TABLE.num_rows (with this 2018 TABLE)
	and mark it UNSTABLE.

	DXFIN import of the converted dxf fails with "Xdata wasn't read"

2018-06-17  Reini Urban  <rurban@cpan.org>

	dxf: add dxf_3dsolid WIP
	print the encrypted 1/3 strings.

	dxf: fix GROUP
	parenthandle 330 as AcDbEntity not in the AcDbGroup subclass

	dxf: fix STYLE flags, IMAGE
	add two missing STYLE bits,
	fix IMAGE group 23, 340, 360
	fix WIPEOUT group 340, 360

	add dxf test scripts

	dxf: handle DIMENSION_ sub objects
	fix dxf groups of ins_scale 41-43
	fix subclass markers

	dwg2dxf: no dxf write on critical dwg read error
	but continue to next input file

	dxf: fix SOLID/AcDbTrace subclass marker
	and the pts groups: 10-13, not 11-14

	api: some more NULL ptr protections
	dwg_next_object, dwg_ref_get_object

	dxf: fix ATTRIB,INSERT subclasses

	dxf: fix ATTDEF subclass

	dxf: fix REGION subclass

2018-06-17  Reini Urban  <rurban@cpan.org>

	fix SPLINE r2013+
	with splineflags1 & 1 the scenario flips to 2
	fixes example_2018

	add -lm dependency to avoid writing nan values into DXF.
	rather skip wrong values then.

	add SPLINE flag DXF 70 support

2018-06-17  Reini Urban  <rurban@cpan.org>

	dxf: SUBCLASS (AcDbText) also for r2018+

	dxf: harmonize dxfb with dxf
	add all the recent dxf improvements,
	dxf: write 5 handle since r11, not r2000+.
	removed unused COMMON_TABLE_CONTROL_FLAGS macro args

	suffix.inc: more strdup decl
	some linux libc still complains about lack of a strdup
	decl.

	dxf: fix asan overflow
	global-buffer-overflow, harmless but asan treats it as fatal

	api: fix Undefined allocation of 0 bytes
	scan-build complains about CERT MEM04-C; CWE-131

	fix various scan-build warnings
	initialize *src at decompress_r2007,
	help hash struct _hashbucket vs 2*uint32_t confusion

	dxf: typo DIMFXLON is B not BD

2018-06-16  Reini Urban  <rurban@cpan.org>

	dxf: fix AcDb3dPolylineVertex
	add subclass markers,
	fix the 0 entity names
	put the flag behind the point.

	but acad crashes on import AcDb3dPolylineVertex

2018-06-16  Reini Urban  <rurban@cpan.org>

	dxf: fix LWPOLYLINE closed flag
	interestingly the flag 70 needs to be after the num_points 90
	to have an effect at the closed flag 70 & 1.
	with 90 after 70 closed is ignored, another acad bug

	dxf: more work on mspace hdr
	try several methods to get the right Model_Space header.
	if there's non, just skip the BLOCKS section then.

	dxf: skip MLINE with out_dxf
	looks good, but crashes on acad import

	api: simplify the iterator APIs
	we don't need the last argument, as we can use the object only.
	Just check its type.

	disable TABLECONTENT, TABLEGEOMETRY
	we do have coverage for those now.
	They fail on out_dxf, but only with wrong geom_data substructure values.
	Nevertheless

	dxf: refactor mspace BLOCKS

	dxf: fix BLOCKS for mspace
	Analog to prev. the ctrl->model_space object did not contain the
	default *Model_Space block records, esp. for AEC dwgs.

2018-06-16  Reini Urban  <rurban@cpan.org>

	dxf: add missing LAYER flags
	add plotflag 290
	and linewidth 370.

	fatal in AEC dwgs

2018-06-16  Reini Urban  <rurban@cpan.org>

	dxf: no DICTIONARY as AcDbLayerTableRecord
	This reveals btw an acad 2018 bug

	Typo in dxfin error message:

	Error in LAYER Table
	Expected 0 LAYER or 0 ENTAB, received 0 DICTIONARY on line 6244.
	Invalid or incomplete DXF input -- drawing discarded.

	0 ENTAB => 0 ENDTAB

2018-06-16  Reini Urban  <rurban@cpan.org>

	dxf: fix BLOCKS for pspace
	the ctrl->paper_space object is empty, we need to use the
	header from the header_vars to get all pspace blocks.

	fixes importing many r2004+ dxfs.

2018-06-16  Reini Urban  <rurban@cpan.org>

	dxf: special-case _B binary
	fix DIMASSOC to 280,
	fix some 290 booleans to 0/1,
	wrap 90-99 int32_t to signed ints. there are some -1, -2 values, i.e. MLEADERSTYLE.

	dxf: importing Entity MLINE crashes WIP
	r2004+

	dxf: special-case VALUE_RD
	and use it with points.
	do not rad2deg LWPOLYLINE bulges.

	dxf: enable DXF groups 80
	needed for some xdata. and warn on invalid or unknown
	xdata dxf groups. This fixes 2007/Spline with 80 and 83 BL xdata groups.

2018-06-15  Reini Urban  <rurban@cpan.org>

	dxf: fix r2018 $ACADMAINTVER, AcDbArc
	Arc is a mandatory subclass of Circle

	dxf: fix xdata handle, enable XRECORD

	dxf: fix r2007+ truetype styles
	needs mandatory 1001, 1000, 1071 fields.
	hard-code the 1071 flag to 34 for now.

2018-06-15  Reini Urban  <rurban@cpan.org>

	dxf: various fixes LWPOLYLINE, MLINESTYLE, ...
	move DXF parenthandles before the subclass markers,

	add r2010+ vertexids to LWPOLYLINE, fix closed flag bit.

	fix the broken REPEAT_CN macro (broke MLINESTYLE)

	simplify out_dxf: VALUE macro. separate fmt from buf and \r\n.

2018-06-15  Reini Urban  <rurban@cpan.org>

	2007: silence the handle stream logging
	on -v4 pre-r2007. This is only really needed for 2007+
	And there make it look better

	.gitignore: more gcov and sample output

2018-06-15  Reini Urban  <rurban@cpan.org>

	dxf: add check-dxf target
	It does not really check the dxf's, but creates a lot,
	for importing checks into acad.

	The real DXF check is in programs.

2018-06-14  Reini Urban  <rurban@cpan.org>

	dxf: fix more header vars
	add HEADER_H, CMATERIAL, INTERFEREOBJVS, ...
	XRECORD still crashes acad, though it does look good now.

	dwg: fix some header_vars mischmasch
	esp. TREEDEPTH was off by one, a whole section was off.

	dxf: improve TABLES stability
	A table layer entry can also be a DICTIONARY, skip that then.
	check all types

	decode: skip invalid hash_set 0
	empty handle values are invalid, only appear with unhandled classes.

	dxf: add 330 parenthandle
	it should be under AcDbObject, but is in some cases under the
	subclass.

	dxf: always write a handle
	even for a null handle value. this is needed for
	DICTIONARY pairs

	dxf: r2007+ header fixes
	add several missing header vars

	dxf: 2004+ header fixes
	various, tested with r2007.
	this imports now until "Updating header seed."
	r2010 goes even until DICTIONARY.

2018-06-14  Reini Urban  <rurban@cpan.org>

	fix make dist, skip unreleased test-data files
	The release is made on travis from a fresh checkout.
	But locally, with .git, there can be many unrelated big
	DWG's lying around under test-data.
	Take only the files which are under git.
	With huge DWGs > 40MB make distcheck became unusable.

	This uses some GNU make extension := and $(shell ).  BSD makes understands
	it also.  Comment this out when your special make does not take that.

2018-06-14  Reini Urban  <rurban@cpan.org>

	dxfb: fix header
	and remove logging

	rm more .bak test dwgs
	These were accidentally committed.

	dxfb: add _REACTORS, _XDICOBJHANDLE
	but it fails much earlier, in the header at address 90 with a r2000 DXFB already

	dxf: skip empty xdicobjhandle
	ACAD_XDICTIONARY fields

2018-06-14  Reini Urban  <rurban@cpan.org>

	dxf: special-case PLACEHOLDER
	this is actually the only fixedtype, not just variable,
	which has no dxfname. checke the type instead.

	DXFIN r2004 still fails, without proper error message.

2018-06-14  Reini Urban  <rurban@cpan.org>

	dxf: add block iterator
	write the dxf BLOCKS section with all BLOCK .. ENDBLK entities,
	for model space and paper space.

	With these changes we can finally DXFIN (i.e. acad import)
	a full r2000 DXF.

2018-06-14  Reini Urban  <rurban@cpan.org>

	add dwg to all object/entity spec handlers
	e.g. to access the header vars or to resolve handles

	dxf: fix BLOCK_CONTROL num_entries

	change resolve_handle warning
	from Object not found to Object handle not found.
	This warning is mostly harmless.

2018-06-14  Reini Urban  <rurban@cpan.org>

	dwg2dxf: allow multiple input files
	add -o to name the output for a single input file only.
	use dwg2dxf *.dwg is so much easier.
	for the single file filter case we already have dwgread.

	restrict regen-man to POSIX only. didn't work without ./ prefix,
	a help2man limitation.

2018-06-14  Reini Urban  <rurban@cpan.org>

	in_dxf: extend scanf double
	we still had compiler warnings

	dxf: improve var types RECORD names
	always use the dxfname, not our internal objectname.
	this keeps our names nice, and DXF correct.

	dxf: dxf_cvt_tablerecord with r13 already
	do the allcaps conversion of builtin table names with r13+

2018-06-13  Reini Urban  <rurban@cpan.org>

	trace: change Unhandled Class object
	to display the object index and handle value, not the position.
	With a handle we can see if it is referenced and compare to the
	subsequent object_map resolver errors

	dxf: remove most minimal
	See [GH #21]. There's not much need for minimal, just
	for writing header and entities. But not for the object fields,
	there are merely version specific.

	dxf: add XDICOBJHANDLE dxf 360

	dwg: move common fields reactors, xdicobjhandle up
	to the common Dwg_Object_Object and Dwg_Object_Entity structs.
	now together with the relevant num_ and binary fields.
	and they don't pollute the entity specific structs.

	dxf: disable XRECORD for now
	and return no error on DUMMY, not DWG_ERR_UNHANDLEDCLASS

	dxf: add reactors to all objects
	even if not used (e.g. not used in each CONTROL table)

	dxf objects: simplify REACTORS
	XDICOBJHANDLE(3) not yet implemented (and unnecessary for now)

	dxf: LWPOLYLINE bulge is also in radian
	I think the DXF group 42 is in degrees. Found no samples yet.

	dxf: convert angles
	add rad2deg to all angles. not yet in_dxf*.c

	dxf: start fixing objects: DICTIONARY*, ...
	fixed DICTIONARY, DICTIONARYWDFLT, PLACEHOLDER, MLINESTYLE (almost).
	set obj->fixedtype when reading.
	ACDBPLACEHOLDER has no SUBCLASS marker in the DXF.
	Some DXF names have a ACDB prefix, maybe rename them back (again).

	dxf: fix REACTORS group -5 => 330
	This fixed reading ENTITIES.
	Now we are struck at the OBJECTS section.

	dxf: move PROXY_OBJECT from variable to switch
	it does not survive the klass 500-num_classes check,
	and leads to an invalid dwg->dwg_class[] access.

	dxf: move 100 AcDbEntity after Reactors

	dxf: BLOCK_RECORD table only r13+
	and check against libdxfrw. oh my, so many mistakes and TODOs.
	we need to get rid of --low again, and fix most minimal checks to
	version checks

	resort the dwg_version_as check
	put the most likely upfront
	as we have a linear search.

	up object_map tracing to -v4 HANDLE

	dwgrewrite: return only critical errors
	as error level result

	fix realloced retval for dirty_refs
	dwg_decode_add_object() does not always realloc anymore.
	only return -1 when it did, otherwise return the uncritical error bits

	ignore CRC mismatch warnings on r2000 for the 1st section
	We really need to know the numbers of setions first, to
	know if its broken or not. These were all false negatives.

	unify CRC mismatch warnings
	print them all in %X hex, not %x or %d

	ignore warnings on invalid handles
	now we get about the same amount of Object not found
	errors as there are unknown/unhandled objects, and someone is
	pointing to it.

2018-06-13  Reini Urban  <rurban@cpan.org>

	dxf: add missing LINE,... pts. POLYLINE special-case
	before r2004 there was no LWPOLYLINE in a DXF,
	only a POLYLINE. need to convert to VERTEX_2D later.

	there was special DXF DECODER/ENCODER logic in the spec
	missing out on the DXF case.

	simplify minimal handling on some objects on the switch,
	not to run into MTEXT again

2018-06-13  Reini Urban  <rurban@cpan.org>

	dxf: fix VIEWPORT
	add missing fields 68 on_off and 69 id.
	both hardcoded to 1 for now, as it is not stored in a DWG r13+

	dwg2dxf: skip free (filename_out) also
	not needed, unless you are a valgrind enthusaist.

	dxf: fix major DICTIONARY --minimal bug
	with --minimal it just skipped over to MTEXT, and crashed there.

	document compile-time strcmp as valid
	The strcmp with a compile-time # pasted token and a constant is
	really being optimized away at compile-time https://godbolt.org/g/AqkhwL
	Impressive.

2018-06-11  Reini Urban  <rurban@cpan.org>

	rename branches, smoke policy
	don't smoke the open work/ branches anymore.
	just master, the tagged pre-releases and any smoke/ branches being worked on.

2018-06-11  Reini Urban  <rurban@cpan.org>

	Fix windows cr cr lf
	Ensure fopen wb mode everywhere for DXF.
	The windows msvcrt fwrite adds a \r before every \n, so we get it twice.

	Fixes [GH #17], thanks to Shing Liu @eryar for the report and screenshot.

2018-06-11  Reini Urban  <rurban@cpan.org>

	skip free with some programs
	time for 40MB DWG went from 3m to 7s, mostly console-out for the errors.
	This is with the new hash object_map. (without it was 2m)

	forget about valgrind reporting leaks. The kernel frees it better.
	The library is still leak-free of course.
	Closes [GH #18]

2018-06-11  Reini Urban  <rurban@cpan.org>

	errors: print even lower errors on success
	don't collapse < CRITICAL to 0 in dwgread, dwgwrite, ...

	stability: low error on obj_string_stream
	which is ignored.
	track dwg_decode_eed and handle errors properly, which could be disturbed by the
	previous obj_string_stream error.

2018-06-11  Reini Urban  <rurban@cpan.org>

	hash: fix the resize logic
	add elems for proper fillrate calculation,
	remove the resize size arg, not needed.
	don't realloc the array at resize, use a fresh zeroed space.
	this fixed getting back random wrong values after resize

	added hash tracing

2018-06-11  Reini Urban  <rurban@cpan.org>

	hash: allow 0 values
	use HASH_NOT_FOUND -1 as special not found return value,
	ie MAX_INT32.

	hash: use the new hash for the object_map WIP
	to speed up dwg_resolve_handle.
	looks a bit unstable though.

	hash: check against out of memory

	add int hash with linear probing
	written from scratch in 30 minutes.
	we disallow keys and values with 0, as they don't appear in the object_ref map.
	we also don't need to delete keys, so the implementation can do without
	tombstones (key -1), or a NOT_FOUND hash_get return value of -1.

	decode: fix free obj->eed[idx].raw
	because this could be a raw from a prev. idx.

	common.h: docs only

	dxf: strange AcDbText class separator expected
	move the AcDbEntity specific TEXT field upwards.
	skip non-public LWPOLYLINE flag values.

	dxf: move COMMON_ENTITY_HANDLE_DATA to the front
	dxf expects common data, like layer name, ltype, ... before the
	entity-specific subclass marker.
	it's a common AcDbEntity property after all.

	dxf: likewise rename section to table
	HANDLE_NAME does the name look in a table record,
	not a section

	dxf: rename dxf_write_handle to dxfb_cvt_tablerecord
	it's not a handle, it a table record entry.
	it's not a writer, it just converts/normalizes some builtin names.

	dxf: empty ctrl->paper_space with r2010+

2018-06-11  Reini Urban  <rurban@cpan.org>

	dxf: LTYPE handle 6 => name, not hex
	Now all tables and blocks can be read by acad.

	What other handles are resolved to their name in DXF?
	We eventually need to replace e.g.
	FIELD_HANDLE (DIMTXSTY, 5, 340)
	with
	FIELD_HANDLE_NAME (DIMTXSTY, 5, 340, STYLE)
	to resolve with DXF to the name in the section.

2018-06-11  Reini Urban  <rurban@cpan.org>

	dxf: adjust control 70, add BLOCK_RECORD
	the BLOCK_RECORD table records are apparently mandatory.
	acad complains when missing.

2018-06-10  Reini Urban  <rurban@cpan.org>

	dxf: always set the global *_control objects
	we need at least the handle for dxf

	dxf: fix TIMEBLL format
	add the double calculation (for the binary dxf).
	fix the trace and DXF output.

	doc: PythonCAD R38 also uses LibreDWG
	http://pythoncad.sourceforge.net/dokuwiki/doku.php?id=r38_roadmap

	dxf: tables are mandatory
	not optional.

	dxf: fix AcDbDimStyleTable
	handle code 105,
	no special-case for num_entries
	add missing group 71

	dxf: progress with tables
	add the missing the layer table subclasses,
	special-case the control handle, and the BLOCK_HEADER name.
	const some objects
	remove all the prev. added RECORD () for the object names.

	dxf: avoid empty numbers
	only strings may be empty. numbers will be changed to 0

	dxf: strip ending .00000000000
	for .0 and .5. It's just a heuristic but catches most cases.
	I don't want to invest much more into this mere beauty issue.

2018-06-10  Reini Urban  <rurban@cpan.org>

	dxf: fix wrong LTYPE type description
	which has DXF type 3, not 48.

	add a check to avoid empty numbers, only allowed for strings.
	rather print 0 then

2018-06-10  Reini Urban  <rurban@cpan.org>

	check-dwg-valgrind: less verbose, small files only
	we only care for segfaults, not the field tracing.
	the log file already gets huge.

	restrict check-dwg-valgrind to DWGs size < 10M,
	check-dwg-valgrind to size < 40M.

2018-06-10  Reini Urban  <rurban@cpan.org>

	alive.test: rm core file
	writers may create core files, which may fail the distuninstall test

2018-06-10  Reini Urban  <rurban@cpan.org>

	fix reading huge files
	Fixes reading DWG files >40MB with many elements exceeding
	the previous hardcoded limits. E.g. this example had
	789388 objects and 2453916 object refs.
	Note that the decompressed sizes are bigger than the filesize,
	roughly by factor 2.0.

	It is really slow though.
	The object_refs hash table really improves it from 2m to 5s.

	See https://savannah.gnu.org/bugs/index.php?28503

2018-06-10  Reini Urban  <rurban@cpan.org>

	section decode stability
	fix some uint32_t types (not unsigned long on amd64),
	fixing some overflows.
	check and abort on more 2004 and 2007 invalid section sizes.
	thanks to llvm scan-build

	CI: remove --enable-write

	2004 stability: skip empty or wrong sections
	I got one broken 2007 DWG, which when saved as r2004 is also broken.
	Don't segfault, at least error gracefully.
	See https://savannah.gnu.org/bugs/index.php?28503

	2007: more file_header logging
	add len2, which is always 0.

	in_dxf: sscanf %lf for double
	clang warning: format specifies type 'float *' but the argument has type 'double *'

2018-06-09  Reini Urban  <rurban@cpan.org>

	dist: add regen-man, fix distcheck
	Stabilize the creation of the man files.
	They are only generated by the maintainer, not generally.
	Copy them from srcdir, not builddir.

	Add temp. logs to CLEANFILES

	Add PACKAGE_URL for bugreports

2018-06-09  Reini Urban  <rurban@cpan.org>

	errors: pass through 2007 errors
	don't report success with Failed to read 2007 meta data

	stability: improve reading broken r2007 files
	got a sample DWG which asserted. Convert assertions to proper errors.

	docs: update
	we are near the first release.

	programs: fix --help features

	default to --enable-write
	switch to --disable-write

	xmlsuite: Helix => HELIX
	and fix another classes overflow.

2018-06-09  Reini Urban  <rurban@cpan.org>

	move classes dispatcher into common.inc
	no various copies around. Now the variable typed classes
	are maintained in one and only place. Just the static ones have
	copied switch tables, but this number is fixed. There will be no
	new ones, so I'm fine with that.

	sort classes.inc by stability, entity, and names.

2018-06-09  Reini Urban  <rurban@cpan.org>

	major varying classes refactor
	abstract away the several types of class stabilities in the switch dispatcher:
	stable, untested, debugging and unhandled.
	In the next commit we will extract the class dispatchers into one single
	classes.inc.
	free is now a bit slower because of the dynamic strcmp dispatcher
	checks, but we win in massive consistency improvements. This could also be
	improved later by switching to dynamic enum/int checks.

	fix typo: DICTIONARYWDLFT => DICTIONARYWDFLT,

	add HELIX

	set obj->fixedtype, to the fixed enum DWG_OBJECT_TYPE, which is
	independent on the class index. then you don't need to check the dxfname
	anymore, and we can possibly get away with all the strcmp dxfname.
	This must be enforced by all importers (in_dxf*, ...) also.

	collapse the various SURFACE types to one SURFACE entity,
	in DXF there's only one SURFACE entity.

	Fixed various dead-code issues in VBA_PROJECT, MULTILEADER. Some latest
	changes were hidden behind DEBUG_*. Now not anymore.

2018-06-09  Reini Urban  <rurban@cpan.org>

	appveyor: deploy as pre-release
	not as draft anymore. They are stable enough to warrant
	official nightlies. Such a pre-release creates a tag,
	which triggers a travis make dist deploy.

	Before I had to manually trigger each drafted release,
	which you didn't see. Now it goes directly to public pre-releases.

2018-06-08  Reini Urban  <rurban@cpan.org>

	dxf: cleanup from prev. errors refactor

2018-06-08  Reini Urban  <rurban@cpan.org>

	rename AcDbField to FIELD, tested ok
	found an example with it.
	Looks broken at childs[0] [H 360]
	and then at evaluation_error_msg [T 300].

	num_childs occurs twice. the first is unreliable. if >0 dec by one.
	but really num_childval 93 is better.

	FIELD and FIELDLIST are now tested ok.

2018-06-08  Reini Urban  <rurban@cpan.org>

	fix TABLE crashes
	with free. The TABLE fields look pretty wrong to me.
	Also add a DATATABLE skeleton

	errors: add to docs

	errors: add DWG_ERR_CRITICAL for programs
	Don't report errors if less severe than DWG_ERR_CRITICAL.
	i.e. DWG_ERR_VALUEOUTOFBOUNDS.
	Same for the high-level dwg API: dwg_read_file, dwg_write_file
	dxf_*_file.

2018-06-08  Reini Urban  <rurban@cpan.org>

	errors: pass through decode/encode/print/...
	The errors are now severity sorted bitmasks, and we pass it all through,
	just not the bits API, as this is functional without *error retval.
	We don't stop on any coding error, we just accumulate the error bits.

	Every dwg_TYPE_##token function returns now an error code.
	Flip the dwg_TYPE_variable_type() logic to return 0 on success
	and DWG_ERR_UNHANDLEDCLASS to switch to UNKNOWN_*

	Fix the annoying in_dxf char** warnings.

2018-06-08  Reini Urban  <rurban@cpan.org>

	errors: add error codes to decode_r2007.c

	errors: add DWG_ERR_CLASSESNOTFOUND

	errors: add error codes to bits.c/dwg.c

	errors: add error codes to encode

	errors: add error codes to decode
	but not yet through the dwg_decode_OBJECT path via dwg_decode_add_object.

	add .drone.yml for tea-ci.org

	Add .gitlab-ci.yml

	NanoSPDS marker classes
	This is a flexlm License Parser.
	Just classes, registered as entity, not found in entities though.
	Found in AEC and MAP dwg's

	dxf: special-case POSITIONMARKER dxf name
	and add some minor stuff

	add unsorted UNDERLAY, fix EXTRUDEDSURFACE
	change DUMMY, LONG_TRANSACTION to objects.
	DUMMY is never a proper object, it is just a generic dwg filer method. (proxies?)
	add some missing COMMON_ENTITY_HANDLE_DATA

2018-06-07  Reini Urban  <rurban@cpan.org>

	add GEOPOSITIONMARKER geojson
	at least rudimentary, with Text

	add unsorted EXTRUDEDSURFACE entity
	with known DXF fields. r2007+
	no coverage in any DWG yet. None of the SURFACE entities

	fix clang's dangling else warning

	.gitignore: ignore more

	TODO: check test coverage
	for missing entities/objects in our catch-all example_2000.dwg
	the best is actually 2018/example_2018.dwg with 21 entities out of 60.
	list all missing entities/objects to be added into a better all.dwg
	for better test coverage

	print: tighter logging
	print UNKNOWN bytes tighter without space.
	print points as (...) list

2018-06-06  Reini Urban  <rurban@cpan.org>

	dwg.h: fix some _RC to _BS
	only done in the spec previously with 323efd78ea,
	so we had a mismatch. only detected on windows.

	fix windows deploy: not the libtool wrappers
	Fixes #15
	The windows make install does not put the proper binaries into bin,
	so we went and copied it manually. But the wrong ones.

2018-06-06  Reini Urban  <rurban@cpan.org>

	extend xmlsuite
	add support for a couple of more elements, in fact
	all elements found in the prepared XMLs used for this test.

	Even some custom class Helix, which doesn't have a graphical
	representation in the DWG, only a class definition.

2018-06-06  Reini Urban  <rurban@cpan.org>

	docs: update Copyright headers
	for all recent significant changes

	windows: add declspec(dllimport)
	for external programs linking to the dll, ie
	where DLL_EXPORT is not set (libtool does this for us).

	doc update
	and rename the CRC field in header_variables
	to crc, to match the docs. Only uppercase matches DXF vars.

	free: FREE_IF objects

	dwgrewrite: default to r2000, stability
	write: don't error on empty fields or handles.

	more objects: GEOPOSITIONMARKER, CAMERA
	and some minor fixes: PLOTSETTINGS, MATERIAL.
	CAMERA should not be in any DWG, but maybe in a DXF or other format.
	rename some PLOTSETTINGS fields for consistency with LAYOUT.
	some crosschecks with the oarx docs.

	more plausible SUN fields
	light reorder. problem is that we don't have a SUN object in any
	DXF yet, just the class. will do that later.

2018-06-06  Reini Urban  <rurban@cpan.org>

	more SUN
	found documentation. it's not a table entry (no name),
	it's rather a singleton.
	now we have 46 bits unknown bits left (some doubles: direction,
	altitude, azimuth?), and the order is yet unknown.

	fix MATERIAL RC to BS types.
	add some more SUBCLASS markers from newer DXFs

2018-06-05  Reini Urban  <rurban@cpan.org>

	add SUN, OBJECT_PTR
	SUN misses 11 byte/3 bit. OBJECT_PTR not yet tested

	add unsorted fields for PLOTSETTINGS, LIGHT
	dxf: add all the missing dxf SUBCLASS markers (with help from the ARX docs),
	  also table control objects.
	add field docs for PROXY_ENTITY, LWPOLYLINE, MLINESTYLE,
	fix dxf output for LWPOLYLINE (with bulges and widths),
	rename WIPEOUTVARIABLE to WIPEOUTVARIABLES

	api: 3dsolid, spline, mline, dictionary
	several api fixes.
	do not use an Entity/_ent prefix for non-entity substructs.

	doc: fixup bits.h endcode

	dxf: fix some MTEXT groups
	and rename some fields, add some docs.

2018-06-04  Reini Urban  <rurban@cpan.org>

	api: more const, restrict, docs
	also replace all BITCODE_BD with double.

	2010: improve stability
	can now read even the prev. failing AEC DWGs.
	fix setting the ent->color.name (not alloced)
	skip invalid EEDs
	skip invalid and unknown objects

	fix some -Wformat warnings

2018-06-04  Reini Urban  <rurban@cpan.org>

	unify REPEAT macros
	move them to the common spec.h. Just decode has different variants,
	with calloc.

	add a couple of unchecked variants, when either the type
	or a constant int make the rcount overflow check useless. To
	avoid compiler warnings.

2018-06-04  Reini Urban  <rurban@cpan.org>

	2010: adjust TODO

2018-06-04  Reini Urban  <rurban@cpan.org>

	2007: fix section_string_stream for overlarge data_size
	The overflow logic with hi_size was wrong. Too small type.

	We can now read many AEC drawings with a data_size > 0x8000
	and >300 classes. E.g. Autodesk Architectural Desktop 2007.
	But some of them are still problematic.

	Allow reading r2010+ now with a tarball release, and enable
	the xmlsuite for it. But programs/alive.text does not work yet with
	Leader_2010+: dwg2dxf

2018-06-04  Reini Urban  <rurban@cpan.org>

	2010+: enhance stability, update docs
	make check and most DWGs pass now.

	stability:
	  skip tables/vectors with more than 0x1000 entries: REPEAT,
	  reactors.
	  fix entity picture size (IMAGE, WIPEOUT) from BLL to BL, but this is
	  still buggy for 2010+. skip it.
	  skip empty table names.
	  dxf: skip unknown objects and tables, i.e. some newer VIEWSTYLE tables.

	test: skip the DXF comparison check, as it is not ready yet.
	the diff became too large.

2018-06-03  Reini Urban  <rurban@cpan.org>

	2010: fix the remaining stream offsets
	harmonize entities with objects.
	Now most fields can be read, just a few are broken.
	The 2010 DWGs itself report success.

	2010: add UMC unsigned type for handlestream_size
	and revert the old object map offsets to signed MC.
	This fixes now most Objects, just one still broken.
	Now Entities are left.

	bits: fix MC type to unsigned
	it cannot be negative at all.
	Fixes the r2010+ objects with negative Hdlsizs,
	but broke many earlier dwgs.

	2010: fix object hdlpos
	+ 8.
	Now just the bit_read_MC is broken, sometimes returning negative values.

	2010: fix object bitsize calculation
	8*size - handlestream_size
	the object string stream is now correct, missing just the handle stream offset.

	2010: fix Header offsets
	The string and handle offsets are also correct now.

2018-06-03  Reini Urban  <rurban@cpan.org>

	2010: fix Classes section_string_stream endbit
	8*24 = 192: bitsize + 191

	Now we can read all the 2010-2018 Classes

2018-06-03  Reini Urban  <rurban@cpan.org>

	dxf: fix XRECORD objid_handles
	wrong order of arguments. Only relevant for out_dxf

	api: add missing restrict

	api: add several table/handle helpers
	rename dwg_obj_ref_get_abs_ref to dwg_ref_get_absref
	       dwg_obj_reference_get_object to dwg_obj_ref_get_object
	add dwg_ref_get_table_name (default: ByLayer), dwg_ent_get_layer_name (default: 0),
	remove dwg_ent_m?insert_get_ref_handle, dwg_ent_m?insert_get_abs_ref,
	  replaced by dwg_ent_m?insert_get_block_header.
	enhance dwg_obj_table_get_name: allow a DICTIONARY (e.g. a material or plotstyle handle)
	also.
	use it in the enhanced xmlsuite for common_entity_attrs().

	xmlsuite: various improvements
	simplify, add vertices, ...

2018-06-02  Reini Urban  <rurban@cpan.org>

	r11: more work on pre-R13 entities
	read all the remaining common entity fields.
	fix INSERT and the entity handle. WIP
	skip entities at an invalid size.

	performance: use the REFS_PER_REALLOC pool
	now also for dwg->object, not just for dwg->object_refs.

2018-06-02  Reini Urban  <rurban@cpan.org>

	after add resolve all objectrefs
	walk through the object_ref array and re-resolve all found objects.
	set dirt_refs when the object array was realloced, to skip using
	the cached handleref->obj, but re-assign it.

	add more restrict to the encode API

2018-06-02  Reini Urban  <rurban@cpan.org>

	testcases: silence -Wpragma-pack

2018-06-02  Reini Urban  <rurban@cpan.org>

	api: use -fvisibility=hidden to export only public funcs
	This mimics the default visibility on windows.
	Closes GH #13.

	Some internal unit-tests failed to work,
	they need to link to the object file also, not just the library.

2018-06-01  Reini Urban  <rurban@cpan.org>

	use $(WARN_CFLAGS)
	do not copy WARN_CFLAGS into AM_CFLAGS, rather
	allow changing it later and using it in CFLAGS.
	Before changing WARN_CFLAGS had no effect at all

2018-06-01  Reini Urban  <rurban@cpan.org>

	parent: change object uplink to objid
	Dwg_Object_{Object,Entity}:
	  change object to objid field. add dwg field.
	add 2 new API functions to return the Dwg_Object from the obj_obj,
	resp. obj_ent via the objid.

	Closes GH #11

2018-06-01  Reini Urban  <rurban@cpan.org>

	parent: SET_PARENT macros
	this doesn't yet fix the moving obj problem from #11, but it looks much
	better now. The next commit will fix the remaining link to the moving obj.

	refman: remove flymake temp.

	parent: move parent to the front for generic
	ensure structural integrity, ent_generic just casts the struct.
	also add a couple of testcases,
	remove the obsolete dummy fields from DUMMY, SEQEND and ENDBLK,
	add testcases for the parent API
	fix more parent setters in some structs, check if the child was even created.
	rename some childs to proper names.

	api: rearrange the c file a bit
	separate generic ent section.
	improve the docs for dwg_get_type.

2018-06-01  Reini Urban  <rurban@cpan.org>

	api: add functions to get the parents
	add dwg_ent_generic, dwg_obj_generic, dwg_tbl_generic types.
	add dwg_ent_generic_to_object, dwg_ent_generic_parent,
	    dwg_obj_generic_to_object, dwg_obj_generic_parent functions.

	Closes [GH #11]

2018-06-01  Reini Urban  <rurban@cpan.org>

	api: link most the complicated parent fields
	TABLE, TABLESTYLE, TABLEGEOMETRY, FIELD, LAYER_INDEX substructs.
	I might have missed some.

	See [GH #11]

2018-06-01  Reini Urban  <rurban@cpan.org>

	api: add parent field to each _dwg_{entity,object}_ENTITY
	See [GH #11].
	We have to jump through absurd hurdles in the API to get around that.
	The parent points to the _dwg_object_{entity, object}, which points
	via the object field to the _dwg_object.

	Also add parent fields to each subentity, such
	as e.g. MLINE_line - > MLINE_vertex -> MLINE,
	and HATCH.

2018-06-01  Reini Urban  <rurban@cpan.org>

	man: bump month to June 2018

	logging: display handles as hex
	to match with the DXF 5 and 330 groups. display the objid index also as hex.

	encode: disable write modules
	don't even compile encode and the DXF in_* modules,
	to save compile-time and object size.
	they are quite large.

2018-06-01  Reini Urban  <rurban@cpan.org>

	dwg: add unsorted MATERIAL fields
	needs CFLAGS="-DDEBUG_MATERIAL"

	so far the first two text fields: name, desc are known, the rest unknown.

2018-05-31  Reini Urban  <rurban@cpan.org>

	dxf: fix LTYPE table

2018-05-31  Reini Urban  <rurban@cpan.org>

	fix compiler warnings
	avoid unused functions warnings, add them to some if(0) {} dead block.
	add a LAYER_TABLE_FLAGS type specialization:
	  because of the LAYER flags RS type, not RC.

	now just the WIP in_dxf.c throws a lot of warnings.

2018-05-31  Reini Urban  <rurban@cpan.org>

	dxf: more loop stuff
	add DXF_BREAK_ENDSEC, SECTION(THUMBNAILIMAGE).

	but we will abandon that und use the alternate approach.

2018-05-31  Reini Urban  <rurban@cpan.org>

	api: add generic table getters
	the name of an entry,
	the entries as array of refs,
	and all the common fields of a table control object.

	rearrange internal layout, use COMMON_TABLE_CONTROL_FIELDS
	to guarantee a common control table layout, to access all entries
	from the obj, not the Dwg_Entity_OBJECT.

2018-05-31  Reini Urban  <rurban@cpan.org>

	api: add more table apis
	so far we only cover block, layer and appid tables.
	add generic dwg_obj_table_get_name, and
	dwg_obj_tablectrl_get_num_entries.

	TODO: dwg_obj_tablectrl_get_entry(index) and dwg_obj_tablectrl_entries - all
	and the API for the special control objects.
	not sure if the layout for all control objects is the same, to access
	the handles.

2018-05-31  Reini Urban  <rurban@cpan.org>

	doc: remove useless Macro call to cast prefix
	its not relevant, and clear to everybody.

2018-05-31  Reini Urban  <rurban@cpan.org>

	api: remove the entity init functions also
	this is the same as memset(0), affecting only the few geometric fields.
	it's distracting that all the common fields are unaffected.

	what would be useful would be to reset/init the common entity and object
	fields and handles, but there's no API for that yet.

2018-05-31  Reini Urban  <rurban@cpan.org>

	api: remove the wrong new/delete/free functions
	these were only entity specific, and didn't add them to the DWG
	an object consists of the generic Dwg_Object, a common-entity
	Dwg_Object_Entity and the specific Dwg_Entity_ENTITY.

	Use the dwg_add_ENTITY and dwg_free_object API instead.
	Closes GH #10

2018-05-31  Reini Urban  <rurban@cpan.org>

	api: add dwg_add_##ENTITY to the public API
	change the return value to the newly created object.
	also add the counterpart dwg_free_object() to the public API.
	src/free.h is now empty and could be removed. (later)

	The next commit will remove the wrong dwg_ent_ENTITY_new/delete/free
	functions from the API.  See [GH #10]

2018-05-31  Reini Urban  <rurban@cpan.org>

	api: warn about useless _new functions
	See [GH #10] and the note in the previous commit.

2018-05-31  Reini Urban  <rurban@cpan.org>

	api + doc: improve dwg_api for CIRCLE,LINE,ARC
	add const, restrict and API docs.
	dwg_ent_*_delete: remove error arg. free can handle NULL just fine.

	FIXME: Note that these new/delete/free functions are basically useless,
	as they don't add the entity to the DWG. We need to add a Dwg_Object
	and the associated Dwg_Object_Entity and then this Dwg_Entity_CIRCLE.
	See encode.c for dwg_add_##ENTITY for the proper API.

2018-05-30  Reini Urban  <rurban@cpan.org>

	api + doc: improve dwg_api for TABLE
	add error checks, and API docs.

	doc: more bit type descriptions

	fixup internal api: cleanup extern and headers
	version_codes may not be duplicated.
	duplicate symbol _version_codes in:
	    .libs/dwg.o
	    .libs/common.o

	*.inc: add emacs c-mode lines

	add -Wchar-subscripts, which is default on cygwin
	prevent signed char from being used as array index, e.g.
	isprintf(*string)

	fix -Wchar-subscripts warnings
	isprint might involve arrays, and a char index might be signed,
	which is UB. Only detected on cygwin.

2018-05-30  Reini Urban  <rurban@cpan.org>

	cygwin: strdup fixes, ...
	strdup is not ANSI, we need some POSIX spec to enable it, esp. on cygwin.

	the spec needs obj_string_stream, which is defined in decode.h (only
	detected by cygwin)

2018-05-30  Reini Urban  <rurban@cpan.org>

	configure: fixup skip valgrind on cross_compiling
	autoconf is a bit too fragile

	TODO: update

	add example_2000.dxfb, a binary DXF

	in_dxf: revise plan (comments only)

2018-05-30  Reini Urban  <rurban@cpan.org>

	windows: fix programs man rules, typo
	first dwgread.exe was built, but then for the .1 page
	dwgread was built, using the internal cross-compiler rules
	which missed AM_CFLAGS.

	since building the .1 pages would need wine for help2man
	I rather skip those rules under HAVE_MINGW_CROSS

2018-05-30  Reini Urban  <rurban@cpan.org>

	configure: skip valgrind on cross_compiling
	avoid setenv warning when --enable-trace was not enabled, as it is not needed
	without tracing.

	improve dejagnu warning. only one of 4 major testsuites are skipped then.

2018-05-30  Reini Urban  <rurban@cpan.org>

	internal api: cleanup extern and headers
	add all resused functions to all internal headers. this was a mess.
	again thanks to mingw-gcc, which is a bit stricter in this regard.

	get rid of wrong extern decl.  we don't use any extern functions, only library
	internal ones.

2018-05-30  Reini Urban  <rurban@cpan.org>

	dxf: use L"" on windows
	for VALUE_TU

2018-05-30  Reini Urban  <rurban@cpan.org>

	fix massive obj_string_stream bug
	I once wrote it to take the bitsize as 2nd arg, and then refactored it
	to take the object. (for the has_string flag).
	Not after carefully readng the mingw gcc warnings, I didn't use it in the header,
	but manually pasted the decl into the c files. but just the old decl!
	Tahts why the string stream offset calculation was so unstable.

	This should improve the r2007+ situation a lot.

	Add reused functions to its headers and use it.
	Add restrict to the dwg_decode_##token methods
	Fix redundant redeclaration of 'dwg_decode_add_object'

2018-05-30  Reini Urban  <rurban@cpan.org>

	appveyor: measure used space/free space
	we have a 80GB quota. see if logs and artefacts affect it.

2018-05-29  Reini Urban  <rurban@cpan.org>

	programs: fix error handling
	fix verbosity num_args
	avoid free of empty dwg,
	zero the struct before returning a file not found error

	decode: more PT tracing
	in shorter lisp fashion:
	DD, 2DD, 2BD_1, 3BD_1

	dxf: fix dwg_dxf_object -Wmissing-prototypes
	fix no previous prototype for function 'dwg_dxf_object'
	[-Wmissing-prototypes]. also for dwg_free_xdata_resbuf.
	This is not useful publicly, so make it static.

	more header_write returns
	they need an int now.
	control reaches end of non-void function [-Wreturn-type]

	api: remove redundant declarations
	of dwg_get_num_objects, dwg_get_num_entities.
	They are already in dwg.h/dwg.c

	travis: sha1sum => sha256sum
	already announced in the ChangeLog but missed it

	in_dxf: more checks and fields

	dxf_read_file: fail on DWG file

	out_dxfb: copy from dxf
	add a couple of restrict
	and remove the unneeded out_dxfb.h header
	in_dxf: more return type fixes.

	in_dxf: fixup return values
	which we need for checking EOF

	in_dxf: restructure loop
	add a few helpers

	in_dxf: add dxf_read_pair
	always read pairs

	in_dxf: sscanf is broken for me
	handroll our own.
	still need to read record pairs, and use a common loop
	to assign the values to the fields.

2018-05-28  Reini Urban  <rurban@cpan.org>

	in_dxf: start reading the dxf WIP
	not from the dat->fh but the chain.
	fails on the first sscanf call.

	abstract away macros with constant strings, because
	we cannot write to those strings:
	SUBCLASS for the readonly subclassmarker 100 group

2018-05-28  Reini Urban  <rurban@cpan.org>

	write: add internal dwg_add_TYPE api
	For dwgwrite/dxf2dwg we need to create/add arbitrary dwg objects. (e.g. from dxf)
	Add all the add functions to encode.c/.h (later eventually to dwg_api.h)

	rename DWG_TYPE_3DSOLID to DWG_TYPE__3DSOLID for consistency (to create it by type)
	ditto for PROXY rename to PROXY_OBJECT (even if the DXF name is only proxy)
	add fixed DWG_TYPE_object enums for all variable objects, they don't
	match the real obj->type field, which is the class id + 500. But the
	type is needed temp. for the add API.

	Create the objects from an empty/zeroed Bit_Chain stream.  Suppress all
	warnings/errors there.  field values and arrays need to be added later.
	This just allocates the room in dwg->objects and set's up the Dwg_Object and
	Dwg_Object_##type, and esp. applies all the encoding default values from dwg.spec.

2018-05-28  Reini Urban  <rurban@cpan.org>

	in_dxf: implement helper structures
	global Dxf_Objs holding all objs (header_vars, entities, objects)
	and its fields.
	add dxf_add_field for FIELD() and dxf_search_field for the 2nd round

	linear search is enough for those 30 objs, and max 20 fields.
	no binary search or hash needed here.
	these can be used for both ascii and binary dxf. (probably also for in_json)

	remove unneeded in_dxfb.h. we share all with in_dxf.h, only the field getters are different.

2018-05-28  Reini Urban  <rurban@cpan.org>

	in_dxf: TODO plan

2018-05-28  Reini Urban  <rurban@cpan.org>

	distcheck: add doc and programs DISTCLEANFILES
	and MAINTAINERCLEANFILES.
	Note that the man's are in git and the dist.

	add more DISTCLEANFILES without libps or enable-write.
	clean it then, because we didn't create it.

2018-05-28  Reini Urban  <rurban@cpan.org>

	doc: more doxygen, add refman, refman-pdf targets
	I tried to include the generated tex files into our texinfo,
	but this is not easily possible. The GNU stdlibc++ tried also
	but eventually uses two separate manuals, the texinfo and the
	doxygen generated.

	TODO: Integrated the doxygen refman html output into our generated
	manual. With html this should be easy.

2018-05-28  Reini Urban  <rurban@cpan.org>

	doxygen: probe and add as make target
	start some documentation effort, still looks horrible.
	the latex parts can then be included into our manual.

	htags is not much better, but at least properly clickable through.

2018-05-28  Reini Urban  <rurban@cpan.org>

	api: empty args check, null malloc
	simplify the boolean empty args checks.
	fix wrong error messages: null malloc when out of memory,
	empty arg when the arg was missing (NULL)

	api: rename api lwpolyline methods back to lwpline
	analog to AutoLISP method names. There it also abbrevated as lwpline

2018-05-27  Reini Urban  <rurban@cpan.org>

	api: rename LWPLINE to LWPOLYLINE
	this is the real entity name, in the AcDb and DXF

2018-05-27  Reini Urban  <rurban@cpan.org>

	dxf: more entities
	the 5 handle is mandatory, also add the common 330 and 100 values.

	temp. disable some broken tables.

2018-05-27  Reini Urban  <rurban@cpan.org>

	dxf: fix minimal HANDSEED crash
	it needs to be a valid value >0.
	disable BLOCK in TABLE
	disable BLOCK,ENDBLK in ENTITIES

	dxf: add 70 flag to all tables, harmonize layer flag
	all tables need a flag, set it in COMMON_TABLE_FLAGS.
	we don't need the extra flag_s short for layers, use one only.

2018-05-27  Reini Urban  <rurban@cpan.org>

	* src/out_dxf.c:
	dxf: add VALUE_BINARY for xdata and THUMBNAILIMAGE
	split into mult. lines of max size 127 (as %02X hex)

        * include/dwg.h, src/dec_macros.h:
	logging: shorten points
	log most 2d/3d points as %g (no ending zeros)
	and in parens as in AutoLISP.

        * src/dec_macros.h:
	decode: trace handle absolute as hex
	in DXF they are only used as hex.
	easier verification

        * src/out_dxf.c:
	dxf: 100 groups only with r2000+

2018-05-27  Reini Urban  <rurban@cpan.org>

	* src/out_dxf.c:
        dxf: more minimal cleanup, and several fixes
	avoid duplicate entity 0 RECORDS,
	fix FIELD_VECTOR: LWPLINE bulges,
	avoid 330 handles and 100 names with minimal.

	but we still get a eNullHandle assertion on ACAD import.

2018-05-27  Reini Urban  <rurban@cpan.org>

	* programs/dwg2dxf.c:
	dwg2dxf: fix -m --minimal arg processing
	on another note: acad will crash with our -m dxf file so far :(
	we need to minimize it a bit more.

        * src/out_dxf.c:
	dxf: skip empty TABLE_CONTROL null_handles

2018-05-27  Reini Urban  <rurban@cpan.org>

	* src/out_dxf.c: dxf: fix duplicate 5 handles
	we emit the owner 5 handle already with DWG_OBJECT for all objects,
	skip it for COMMON_TABLE_CONTROL_FLAGS and COMMON_TABLE_FLAGS.

	acad import still fails at table APPID

2018-05-27  Reini Urban  <rurban@cpan.org>

        * src/decode.c, src/dwg.spec, src/out_dxf.c:
	dxf: add dxf_write_xdata for XRECORD

2018-05-26  Reini Urban  <rurban@cpan.org>

        * src/dwg.spec, src/in_dxf.c, src/out_dxf.c,
        src/spec.h:
	dxf more DICTIONARY and XRECORD fields
	but the 102 names for XRECORD not yet.

2018-05-26  Reini Urban  <rurban@cpan.org>

        * src/out_dxf.c:
	dxf: add DbSaveVer if --as-rNNN
	when a VPORT table was saved in a newer version,
	dxf-out this version as DbSaveVer,1000.

	This is the only table with DbSaveVer. Some objects do have a
	AcDbSavedByObjectVersion tag, for the class version.

2018-05-26  Reini Urban  <rurban@cpan.org>

        * include/dwg.h, src/dec_macros.h, src/decode.c, src/dwg.spec
        src/encode.c, src/free.c, src/out_dxf.c, src/out_json.c,
        src/print.c:
	dxf: rename VIEWMODE, fix table num_entries
	VIEWMODE is a systemvariable, renamed from view_mode in VPORT and VIEW.
	combine UCSFOLLOW with it (for encode and dxf).
	via DXF the num_entries don't count the control entities.
	initialize and DXF the VPORT_CONTROL->flag

        * .appveyor.yml:
	appveyor: decrease disk usage
	delete the deployed zips. I hope this decreases the quota
	which is 80GB per user.

        * src/dwg.spec:
	spec: simplify encode_3dsolid decl
	make it static so we can avoid the decl.
	log the error that encode_3dsolid is nyi (not yet implemented)

2018-05-26  Reini Urban  <rurban@cpan.org>

        * include/dwg_api.h, src/dwg_api.c,
        test/testcases/3dsolid.c, test/testcases/body.c,
        test/testcases/region.c, test/unit-testing/3dsolid.c,
        test/unit-testing/body.c, test/unit-testing/region.c:
	api: rename dwg_ent_<ACIS>_get_{wire,silhouette}
	to get_wires, get_silhouettes.
	It returns the array of all, not just one.

2018-05-26  Reini Urban  <rurban@cpan.org>

        * include/dwg_api.h, src/dwg_api.c:
	api: remove array num setters
	there exist various api functions to change the number of some elements
	without changing the associated array itself, e.g.
	dwg_ent_polyline_mesh_set_num_n_verts without setting the n_verts array.
	all the set_num_ api functions need to go.
	this is unsafe.

	set_num_owned, set_numcols, set_numrows, set_num_lines, ...
	See [GH #9]

	not yet added add_array (i.e. push) and delete_array(at_index) apis yet.

2018-05-26  Reini Urban  <rurban@cpan.org>

        * include/dwg.h, include/dwg_api.h, src/dec_macros.h,
        src/decode.c, src/decode_r2007.c, src/dwg.c, src/dwg.spec, src/dwg_api.c,
        src/encode.c, src/free.c, src/in_dxf.c, src/in_dxfb.c, src/out_dxf.c,
        src/out_dxfb.c, src/out_json.c, src/print.c, test/testcases/insert.c,
        test/testcases/minsert.c, test/testcases/polyline_3d.c,
        test/testcases/polyline_mesh.c, test/testcases/polyline_pface.c,
        test/unit-testing/insert.c, test/unit-testing/minsert.c,
        test/unit-testing/polyline_3d.c, test/unit-testing/polyline_mesh.c:
	api: rename *_count fields to num*,
	owned_obj_count + owned_object_count => num_owned,
	insert_count => num_inserts,
	instance_count => num_instances,
	frozen_layer_count => num_frozen_layers,
	FIELD_INSERT_COUNT => FIELD_NUM_INSERTS,
	object_count => num_objects: dwg_get_num_objects already existed in dwg.h,
	                             remove duplicate from dwg_api.h,
	entity_count => num_entities: dwg_get_num_entities already existed in dwg.h,
		 		      remove duplicate from dwg_api.h,
	m_vert_count => num_m_verts,
	n_vert_count => num_n_verts,
	attr_def_count => num_attr_defs,

	Closes [GH #8]

2018-05-26  Reini Urban  <rurban@cpan.org>

	api: rename VPORT_ENT to VPORT_ENTITY
	for consistency. we don't use the ENT abbreviation in no
	other object, but we do use _ENTITY already

	dxf: oops
	delete a .bak test-data file

	dxf: fix VPORT aspect_ratio 41
	The real aspect_ratio needs to be divided by the viewsize,
	since r13 at least. <=r12 stores the real aspect_ratio already.

	dwg2dxf: fix printing as version
	to stdout not stderr

	dxf: use more dxf_write_handle conversions
	also for the name in COMMON_TABLE_FLAGS, as those names
	also need conversions.
	also add *Active

	dxf: $MEASUREMENT is r14 already
	simplify the logic also

	dxf: $UCSBASE is r2000+ only

	dxf: write even empty names/strings
	don't skip the 1 group of e.g. DIMBLK1
	convert unicode names to utf8
	convert reversed standard names if read from newer and write as older.

2018-05-26  Reini Urban  <rurban@cpan.org>

	dxf: abstract HANDLE_NAME to dxf_write_handle
	since r2000+ some Standard handle names are renamed:
	STANDARD to Standard, BYLAYER to ByLayer, BYBLOCK to ByBlock.

	also check that the table name is really an object, not an entity.

2018-05-26  Reini Urban  <rurban@cpan.org>

	dxf: add examples in more versions
	sample_2000.dwg in r14-2018 DXF formats
	example_2000.dwg in 2018 dwg and dxf formats

	alive.test: add filt_dxf.pl
	to normalize POSIX sprintf("%-16.14f") floating point numbers to
	the format used with MSVC with native AutoCAD, so that we can
	easily compare the output of oursvs them.

2018-05-25  Reini Urban  <rurban@cpan.org>

	restrict: add C99 restrict pointer decls
	just a few pointers might be the same: dat, hdl_dat and str_dat.

	2007: fix unaligned access on copy_n helpers
	1-3 is reverse, 4-8 is straight. 16 is reverse 8-wise.
	just use memcpy

2018-05-25  Reini Urban  <rurban@cpan.org>

	dxf: special-case VPORT field order
	for DXF output.

	fixed some wrong VPORT fields: sun_handle -> shade_plot_handle 333 (vport owns these)
	view_twist_angle -> view_twist for consistency
	aspect_ratio 41 is still wrong
	view_twist 50 -> 51
	back_clip 33 -> 44

	also fix the common table format a bit
	allow DXF groups in the spec

2018-05-25  Reini Urban  <rurban@cpan.org>

	dxf: support Standard in HANDLE_NAME
	the DWG Standard table entry_name is called STANDARD,
	but in the DXF it is translated to Standard.

	Also simplify HANDLE_NAME to avoid the tmp buf,
	names are always strings.

2018-05-25  Reini Urban  <rurban@cpan.org>

	man: fix dependency problem and POSIX/Windows compat
	The .1 files depend on the c and the binary.
	remove the $(*F) gnu make-ism.
	enable windows compat to generate the man pages.
	improve the man target: no submake's, enable proper deps.

	Fixes spurious help2man: can't get `--help' info from ./dwgwrite errors
	when the binary was not generated yet in parallel builds.
	Closes GH #4

2018-05-25  Reini Urban  <rurban@cpan.org>

	appveyor.yml: skip_tags: true
	we tag only already tested and deployed commits.
	avoid double smoking on our slowest smoker.

	on the other hand travis needs the tag to deploy the generated
	dist's to this tag.

2018-05-24  Reini Urban  <rurban@cpan.org>

	fix bit_utf8_to_TU, 3 byte case. detected by gcc-8
	praise the good compiler.
	warning: bitwise comparison always evaluates to false [-Wtautological-compare]

	encode: return early for 2004
	to avoid useless hangs

2018-05-24  Reini Urban  <rurban@cpan.org>

	stability: return 0 on bit overflows
	when a number is wrong we prev. returned -1,
	leading to abnormal high numbers, sizes.
	rather zero it to be able to continue on some unknown data.

	avoid bit_calc_CRC overflows

2018-05-24  Reini Urban  <rurban@cpan.org>

	dwg_decode_handleref_with_code: fix null pointer dereference

	api: fix null pointer dereference

	add build-aux/dejagnu.h.patch
	this header throws too many warnings with newer clang's.
	for now only suppress clang warnings, gcc not yet.
	(only tested until gcc-6 on macports. no idea about gcc-8)

	rename VP_ENT_{HDR,CONTROL}
	to more natural names. AutoCAD used ViewportEntity (r11-r2000).
	Analog to block use VPORT_ENT_CONTROL and VPORT_ENT_HEADER.

	rename {ucs,block,view}_control_handle to *_control
	to harmonize all the control handles, which have no suffix.

2018-05-24  Reini Urban  <rurban@cpan.org>

	rename SHAPEFILE to STYLE
	see [GH #7]
	nobody else names it SHAPEFILE, only the ODA.

	dxf names it STYLE and $TEXTSTYLE,
	AutoCAD names it AcDbTextStyleTable,
	libdxfrw names it STYLE and TEXTSTYLE

2018-05-24  Reini Urban  <rurban@cpan.org>

	geojson: use the new APIs
	for polyline_2d, polyline_3d and add point.

	api: add polyline_3d points api
	and remove the badly named owned_obj_count field api

	api: const most getters

2018-05-24  Reini Urban  <rurban@cpan.org>

	dxf: more table control fields
	each table has at first the control object,
	and then the COMMON_TABLE_FLAGS(owner, acdbname) before
	the other fields, not after.
	special-case this.

	add a new objid to each control object, as link back to the Dwg_Object
	(e.g. for the owner handle).

2018-05-24  Reini Urban  <rurban@cpan.org>

	dxf: add PUCSORTHOREF, fix HANDSEED

	dwg2ps: use the new pline points API

	cbmc: experimental CBMC rule for bits_test.c
	To create coverage testcases.  Does not work so far, and needs an insane
	amount of time.  Should be limited to single functions only.

2018-05-24  Reini Urban  <rurban@cpan.org>

	api: rename pline numpoints, add get_points API
	numpoints is different across versions.

	add a get_points API for various pline types,
	this is also different across versions.

2018-05-24  Reini Urban  <rurban@cpan.org>

	json: new geojson output formatter
	only LINE,LWPLINE,POLYLINE_2D,INSERT (unexploded) entities so far.

	TODO: facetting of curves, ocs/ucs transforms, use the new pline points api.

	TODO: NOCOMMA and \n not with stdout. stdout is line-buffered
	so NOCOMMA cannot backup past the previous \n to delete the comma.
	We really have to add the comma before, not after, and special case the first
	field, not the last to omit the comma.

2018-05-23  Reini Urban  <rurban@cpan.org>

	dwg2ps: fix POLYLINE_2D
	wrong loop index

2018-05-22  Reini Urban  <rurban@cpan.org>

	dxf: remove wrong test dxfs
	we compare now our own created dxfs against {ex,s}ample_2000.dxf
	unfortunately they don't match the versions. create proper ones later,
	the one remaining should be enough for now.

	travis: simplify distcheck
	distcheck already creates the tardists.
	add sha256sum (in ubuntu coreutils), we upload them to github releases.

	travis: deploy releases on tags

2018-05-22  Reini Urban  <rurban@cpan.org>

	appveyor: re-try mingw install
	install-binPROGRAMS is not triggered, do it manually.
	also install examples/*.{c,exe}

	move the dll to the root, together with all the programs. on windows
	they should stay together. the rest is devel stuff.

2018-05-22  Reini Urban  <rurban@cpan.org>

	dwgwrite: improve encoding
	of empty data. alloc empty sections and section_info.
	allow empty handles (null_handle).
	set the default version for dwgwrite to R_2000, support --as-rNNNN
	add the dwgwrite.1 dxf2dwg.1 man pages

	README: write is good enough for r2000
	for most DWG's, some not yet.

2018-05-22  Reini Urban  <rurban@cpan.org>

	add API unicode support (for r2007 strings, optional)
	convert UCS-2 to utf-8 (char*)

	add bit_convert_TU() and bit_utf8_to_TU() converters, bit_convert_TU()
	was prev. only latin-1, now full utf-8. converters written from scratch,
	they are trivial. Ken Thompson designed it that way.
	not rejecting any wrong utf-8 encodings yet.

	add dwg_api_init_version(&dwg) for the version. only needed since r2007,
	utf-8 is backwards compatible. ucs-2 not.

	call inlined dwg_api_init_version on every API function with an
	Dwg_Object or Dwg_Data.

2018-05-21  Reini Urban  <rurban@cpan.org>

	add dwglayers
	Prints all layers in a DWG.

	improve help2man rule, avoid --version warnings.

2018-05-21  Reini Urban  <rurban@cpan.org>

	cmp_dxf.pl: add some basics

	dxf: change float printf format to %-16.14f
	on windows it is different. %g swallows the ending zeros

	dxf: use DOS EOL \r\n

	HACKING: add fuzzing with afl-fuzz
	fast enough on linux without our own loop so far.

2018-05-21  Reini Urban  <rurban@cpan.org>

	dwg_read_file: support - for stdin
	dwgread - now reads from stdin.
	I needed it for afl-fuzz, but should come handy elsewhere.
	dwgwrite already supports reading from stdin.

	* dwg.c (dat_read_stream,dat_read_file): helpers added.
	  (dwg_read_file): use it.

2018-05-21  Reini Urban  <rurban@cpan.org>

	TODO: update practical TODOs
	smoke.sh: delete duplicate python3.6m.

2018-05-20  Reini Urban  <rurban@cpan.org>

	dxf_format: add new DXF codes up to r2014

	bits_test: improve flapping CRC tests
	realloc creates uninitialized memory

	smoke: whitespace only

	bits_test: stabilize
	avoid uninitialized memory, leading
	to problems with -O2

2018-05-20  Reini Urban  <rurban@cpan.org>

	dxf: encode linetype_flags BYLAYER/BYBLOCK/CONTINUOUS
	enable MLINESTYLE which has a similar lines[rcount].ltindex
	flag.

	add a BS 32767 bits test. This was not the problem.

2018-05-20  Reini Urban  <rurban@cpan.org>

	bits_test: add r2004 CMC test
	and fix a stack-overflow, detected by asan

	smoke: add python paths on darwin. no system libxml2, only via macports

2018-05-20  Reini Urban  <rurban@cpan.org>

	man: fix --version output for dwgrewrite
	to help help2man
	help2man: can't get `--version' info from ./dwgrewrite
	Try `--no-discard-stderr' if option outputs to stderr

2018-05-19  Reini Urban  <rurban@cpan.org>

	encode: write empty null_handle
	and simplify common_entity_handle_data.spec: use spec.h
	common_entity_handle_data.spec: set isbylayerlt
	dwg_encode_handleref: resolve handle codes

	dwgrewrite: set --verbose dwg.opts
	and print the objref object fields again only with -v4 (HANDLE) or higher.

	decode: skip TRACE with FIELD_TF, FIELD_TFF
	only log the (overlong) value at the INSANE level

	encode: fix object size calculation
	no Wrong object size: warning anymore

	encode: fix object handle
	wrote the wrong handle for each object

	free: free class->dxfname_u also

	fix bits, enable more testcases/bits_test's
	fix bit_write_DD case BB=3.
	fix bit_read_L, bit_write_L (unused).
	add _H testcases, and many more.

2018-05-18  Reini Urban  <rurban@cpan.org>

	encode: fixed for r2000
	write the object CRC (same seed).
	dwgrewrite works now for sample_2000.dwg

2018-05-18  Reini Urban  <rurban@cpan.org>

	encode: fix bitsize
	no duplicate bitsize fields on Dwg_Object_Object and Dwg_Object, only one.

	patch encode bitsize after the object/entity was written.
	we cannot assume that the encode user knows the bitsize, hence write the
	actual bitsize. use a temp. obj->size*8 value. size change would be at 0x7fff.
	so far we ignore that.

2018-05-17  Reini Urban  <rurban@cpan.org>

	xmlsuite: make it python3 compatible
	tested ok with python 2.7 and 3.6.

	smoke with --enable-python=python3.6m

	fix m4/ax_python_devel.m4 for macports
	which uses the --enable-framework=/opt/local/Library/Frameworks
	prefix, which is not honored in the -L prefixes.
	add a couple of echos

2018-05-16  Reini Urban  <rurban@cpan.org>

	man: make help2man optional
	we ship the .1 files, and help2man is not on all systems.
	only needed to regen the man files.
	e.g. cygwin does not have it. add it there.

	dxf: add BLOCKS
	now only a few minor DXF issues are remaining

	dxf: add ENTITIES and OBJECTS

2018-05-15  Reini Urban  <rurban@cpan.org>

	DEBUG_HERE: silence wrong uninit warning

	free: add dwg_obj_is_control function
	the tables have copies in dwg

2018-05-15  Reini Urban  <rurban@cpan.org>

	dwg, out_dxf: fix TABLES
	as expected we have to copy the CONTROL object fields
	to avoid corruption by realloc.

	also rename SHAPEFILE handles field to styles.

2018-05-15  Reini Urban  <rurban@cpan.org>

	dwg, out_dxf: add TABLES
	and add the table control links to the dwg struct.
	note that these links might be corrupted if objects are realloced.
	if so then we need to copy struct fields.

	remove dwg->num_layers and harmonize with the other tables.

2018-05-15  Reini Urban  <rurban@cpan.org>

	dwg2dxf --help: add r2007, r2010, r2013
	the dxf writer can do that already, i.e. will do that

	add dist_man1_MANS
	we distribute the man1 pages. but no man3, just the info.

	dsymutil: add noinst_PROGRAMS also

	README: Update
	dwg2ps is not so good to be advertised in the README

	dwg2ps: fix compiler warning
	-Wdeclaration-after-statement

	configure: allow CFLAGS overrides
	e.g. for pslib CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib

2018-05-15  Reini Urban  <rurban@cpan.org>

	scan-build: don't wait
	scan-build -V calls scan-view which waits until we are finished
	looking at it in the browser.
	put this into the background, we need to kill scan-view
	later (a python process).

	without make just waits here, but we don't want to test this via smoke.sh

2018-05-15  Reini Urban  <rurban@cpan.org>

	dwgwrite: improve reader format detection
	which reader: either manual -I --format argument, or by the extension of the
	input file.

	fix build-aux/smoke.sh
	syntax error with CC, darwin only

2018-05-14  Reini Urban  <rurban@cpan.org>

	dwg_resolve_handle* not public yet
	move out of dwg.h, it doesn't look stable enough.
	but add a new dwg_ref_get_object_relative
	to find a relative object from an handle and base object

	dwg2ps: add arc and circle

2018-05-14  Reini Urban  <rurban@cpan.org>

	extend dwg_ref_get_object
	to actually search for the object via absolute_ref,
	not just the cached obj.
	use it for polyline vertices in dwg2ps.

	move the handle resolvers from private decode to the public dwg.

2018-05-14  Reini Urban  <rurban@cpan.org>

	dwgwrite: use dxf_read_file
	which decides upon ascii or binary,
	or dwg_read_dxfb directly with the .dxfb extension

2018-05-14  Reini Urban  <rurban@cpan.org>

	move dxf reading from dxf2dwg to in_dxf
	from the sample into the library. dwgwrite will need that also,
	and users also.
	note that the reading implementation is not yet written.
	it's mere copy of the writers (ascii and binary).
	the reader needs to account for unsorted order of items.

	and add a few const's

2018-05-13  Reini Urban  <rurban@cpan.org>

	improve gcov from 1% to 35%
	the true library coverage is about 75%, but we are getting closer.

	alive.test: dash fixes, empty $problems
	115: [: =: unexpected operator
	and more.

	windows: skip dwgrewrite tests
	on mingw. killall does not work there

	configure: add --disable-python
	and work on --enable-python=python3.6

	smoke: more compilers

2018-05-12  Reini Urban  <rurban@cpan.org>

	HACKING: update deps, tips, dates

	dwg_api.h: no double decl of dwg_object_ref
	only clang-4 -std=c99 complained

	POSIX 2008 for strdup, and add M_PI
	several stricter compilers don't have strdup nor M_PI.
	define _POSIX_C_SOURCE to 200809L
	This fixes e.g. clang-4 -std=c99

	add smoke.sh for darwin/linux
	and probe for basename, which fails on my arm cross.
	use POSIX libgen.h before string.h with the GNU extension of basename.
	without basename fall back to fullpath for the outfile.

2018-05-11  Reini Urban  <rurban@cpan.org>

	various -Wall fixes
	detected by the arm cross-compiler, which is a bit stricter

	dwg2svg2: fix a few warnings
	from clang -Weverything

	json: add NOCOMMA, object fields
	looks pretty good now, almost correct.
	NOCOMMA erases the last ,\n of an array/hash

2018-05-11  Reini Urban  <rurban@cpan.org>

	configure: change setenv warning
	tracing works now even without setenv(). Just --enable-trace
	will not work as expected. -v1 does though.

	Also note that we currently need a gmake on BSD's

2018-05-11  Reini Urban  <rurban@cpan.org>

	appveyor: re-enable --enable-write
	we now kill hanging dwgrewrite processes

	dxf: fix windows cast warning

	dxf: unify into header_variables_dxf.spec
	now just some more sections are missing.
	also add some rudimentary dxf content testing.
	add AutoCAD native and libdxfrw dxf's to compare against.
	(no theiga yet)

	dxf: harmonize ascii/binary types more
	and simplify spec.h. add a special DXF (out) block

	travis: add suggested texlive
	suggested by verbose distcheck.
	distcheck passes now on travis, so en-arm it.

	travis: verbose DISTCHECK
	now it fails with make dvi

	travis: add swig

	work over all authors and copyright years

2018-05-10  Reini Urban  <rurban@cpan.org>

	encode: harmonize handle logging

	appveyor: clean tag release names
	don't double add the prefix and suffix.
	stay with the simple tags, ie. the build number.
	the zip has the proper name.

	appveyor: disable write
	it started segfaulting, since we improved it. enable it, when
	it starts becoming more stable.

2018-05-10  Reini Urban  <rurban@cpan.org>

	encode: add RESET_VER
	cur_ver should be reset after after SINCE/... version check block,
	otherwise e.g. handles are not printed.

	We are stuck with this syntax without the block in the macro, so try
	to add these RESET_VER wherever it is missing.

2018-05-10  Reini Urban  <rurban@cpan.org>

	encode: fix HANDLE
	reset wrong cur_ver to allow printing handles

	encode: harmonize HANDLE tracing
	and fix 2 minor issues: reactors have dxf code -5.
	print the type as decode

	dxf: more dxf codes, add dxf_codepage()
	add dxf codes for FIELD and GEODATA.
	support codepage 29: ANSI_1251

	dxfb: more types and harmonize
	the goal should be a header_vars_dxfout.spec, with typed fields, like HEADER_RC.
	but maybe it can even serve for dxfin also, looping over all available names.

2018-05-09  Reini Urban  <rurban@cpan.org>

	encode: fix objects
	advance to the next object, don't reset to start start address.
	previously objects were overwriting each other.
	calculate size, and adjust if wrong. users cannot be expected to
	write both sizes, byte and bits correctly.

	Now only bit_write_handle is broken, and several object sizes are off.

2018-05-09  Reini Urban  <rurban@cpan.org>

	encode: simplify bit_write_MS
	this is just a very simple RLE encoded int, with the highest bit
	announcing a further short. in this case 1 or 2 shorts.

2018-05-08  Reini Urban  <rurban@cpan.org>

	encode: ensure chain size
	when writing objects

	dxf: more header vars
	fix colors,
	fix MLINESTYLE handle name to entry_name for consistency,
	rename the HEADER_VAR and HANDLE_VALUE macros.

	Fix decode WE_CAN only error message
	we can only decode version R13-R2007 (code: AC1012-AC1021) DWG files.
	was -R2004

	decode: improve version file-magic check
	error with Invalid DWG, magic: %s
	or Invalid or unimplemented DWG version code %s

	dxf: add common_entity_handle_data
	and few more minor improvements. only output
	dxf codes != 0. still a lot todo.

	json: indent arrays and hashes
	add abstractions, also useful later for YAML.

	dxf: add and fix more 2007+ vars
	and fix some 2004+ dxf codes.
	add SHADOWPLANELOCATION and REALWORLDSCALE unknowns.

2018-05-08  Reini Urban  <rurban@cpan.org>

	dxf: add REQUIREDVERSIONS as 160
	this is a DXF header value.

	also convert ucs-2 CLASS strings down to ascii for DXF.
	TODO: decode header variable LASTSAVEDBY 2010+

2018-05-08  Reini Urban  <rurban@cpan.org>

	alive.test: simplify dwgrewrite handling
	This does not need an extra argument anymore.

	rename fmt_ to out_
	corresponding to the needed in_ readers:
	json, dxf, dxfb

2018-05-07  Reini Urban  <rurban@cpan.org>

	add dwgwrite skeleton
	corresponding to dwgread. need format readers, not writers.
	dwg_read_json(), dwg_read_dxf(), dwg_read_dxfb()

	doc: fix Decoding API example

	add manual, gendocs.sh
	from gnulib (GPLv3).
	just remove a wrong htmlarg setting.

	dxf: DWGCODEPAGE is since r10

	probe for strcasecmp header
	use AX_INCLUDE_STRCASECMP from autoconf-archive.

	dwg2dxf: use fmt_dxf{,b}

2018-05-07  Reini Urban  <rurban@cpan.org>

	dwgread: add the 3 output formats
	and add -o outfile support and regen the man pages.

	If this turns out nice, add the other output formats also:
	YAML, XML, PS, SVG, ...

2018-05-07  Reini Urban  <rurban@cpan.org>

	add fmt_dxf and fmt_dxfb also

2018-05-07  Reini Urban  <rurban@cpan.org>

	json: start with -O fmt JSON WIP
	various formatter output modules: -O json,yaml,xml,dxf for dwgread.
	maybe even ps and svg. so we will need only a dwgread and dwgwrite,
	not any other helpers.

	add fmt_json.
	for now they all print to stdout as stream,
	but dwg2dxf might want to print to a fh, because this construct outfile from infile.
	The --format arg can also serve for dwggrep as output format for each found entity.

2018-05-04  Reini Urban  <rurban@cpan.org>

	trace: init 2007 loglevel for 2010+
	otherwise some 2007 helper functions, like section_string_stream
	and obj_string_stream do no logging.
	loglevel is module specific, and those helpers don't have dwg as arg.

	TODO: update TODO

	testcases: fix more wrong format types

	ubsan: fix signed integer overflow
	for the hash calc use an unsigned rseed.

	eed: fix asan write error
	when adding the ucs-2 string delimiter it will write 2 byte, past
	the allocated bufsize. hence alloc size+2 to ensure delimited unicode strings.
	and then we can skip writing the last 0, as we already used calloc with size+2.

	trace: enable loglevel via -v
	in encode, decode and free entry points

	examples: add -v[0-9] support

	work over copyright headers, add one AUTHOR
	fix the years, add missing authors.

	trace: independent loglevel per dwg.opts
	pass through the loglevel/--verbosity without --enable-trace, resp.
	without setenv()

2018-05-02  Reini Urban  <rurban@cpan.org>

	read_2004_section_classes: wrong max_num type

	add build-aux/appveyor-deploy.bat
	deploy either a tagged commit or nightly branch, not both

	appveyor: add nightly deployments
	for master branch changes.
	see https://github.com/rurban/libredwg/releases

	windows: add .appveyor.yml deploy
	as zip

	windows: harmonize wchar_t logging
	improve native wchar_t as UCS-2 support (windows),
	printing it natively

	Makefile.am: remove check-wine
	make check can handle wine already, check-wine was broken for a while

	programs: fix wine typo
	the additional ) caused run 'dwgrewrite.exe)' example_2000

	less logging: adjust levels a bit
	log less important info with higher levels.
	add LOG_TF for fixed text for arbitrary levels, use if for binary
	fixed blobs with INSANE, not TRACE.
	log @ positions with level 4 HANDLE.

2018-05-02  Reini Urban  <rurban@cpan.org>

	check-dwg*: use -v3, not -v4
	avoid logging large binary blobs, esp. with unsupported versions.
	some example logs are >2GB

	no double .PHONY targets

2018-05-02  Reini Urban  <rurban@cpan.org>

	check-dwg*: use -v3, not -v4
	avoid logging large binary blobs, esp. with unsupported versions.
	some example logs are >2GB

2018-05-01  Reini Urban  <rurban@cpan.org>

	2007: enable 2007 decoding, now supported.
	enable tests, disarm the decode_R2007 IS_RELEASE check,
	remove the warning, fix the docs.

2018-05-01  Reini Urban  <rurban@cpan.org>

	2010: prepare 2010 classes, fix 2007
	on top of the 2004 section format. copy over the logic from 2017.
	harmonizes classes, and fixes reading the last class (max_num) for 2007+.

	This fixed reading most 2007 DWGs

2018-05-01  Reini Urban  <rurban@cpan.org>

	2010: prepare decode_header_variables
	add bitsize_hi, calc. bitsize.
	separate the 3 streams for 2010.
	can parse now until the individual object bitsizes. (still 0)

	2007: change decode warning message
	handle and string streams are now solved. start working on the
	remaining bugs

2018-04-30  Reini Urban  <rurban@cpan.org>

	2007: fix xrefindex_plus1 ODA doc bug
	xrefdep is before xrefindex_plus1 since r2007+, not r2010+

	rename table flag bit 7 _64_flag to xrefref
	referenced external reference, block code 70, bit 7 (64)

2018-04-29  Reini Urban  <rurban@cpan.org>

	2007: better hdlpos calculation
	no -42 offset. start before reading the type after the size.
	then the handle position naturally aligns.
	add a Dwg_Object address field.
	The r2010 bitsize derives from the obj->size.

2018-04-28  Reini Urban  <rurban@cpan.org>

	2007: adjust hdlpos by -42
	found out error experimentally.
	Most r2007 objects can now be read, just a few remaining errors.

	unify START_HANDLE_STREAM
	esp. it is r2007+ only

	dwg.spec: cosmetics LOG_ERROR
	for invalid DICTIONARY.numitems

	2007: add FIELD_VECTOR_T vcount index
	as <r2007. see DICTIONARY

	2007: trust hdlpos
	and distrust obj->has_strings. hdlpos should be always right.
	some objects seem to ignore has_strings, like ENDBLK

2018-04-28  Reini Urban  <rurban@cpan.org>

	2007: fix obj string stream calc
	fix for negative advance.
	use one more byte offset to the back. data_size is now correct.
	check bit_advance_position also for underflow < 0

	TODO: with no strings don't try to read strings, set them to NULL.
	(MLINESTYLE)

2018-04-28  Reini Urban  <rurban@cpan.org>

	2007: LAYER set flag bits
	2007+ reads only a RS, set the bits for older releases.
	also add some string stream debugging code

	2010: use LAYER handles r2010+

	2007: use COMMON_TABLE_FLAGS entry_name
	FIELD_T, not FIELD_TV

2018-04-27  Reini Urban  <rurban@cpan.org>

	2007: undo START_HANDLE_STREAM has_strings offset

2018-04-27  Reini Urban  <rurban@cpan.org>

	2007: fix the hdlpos offset
	and ignore the still wrong has_string bit.
	Now the handle_stream and string_stream offsets are correct, just the string stream
	length and bit are wrong.
	Thus ignore the has_string bit for now in START_HANDLE_STREAM

	Fixes many 2007 objects.

2018-04-27  Reini Urban  <rurban@cpan.org>

	2007: add FIELD_VECTOR_T
	for 2007 array of TU texts. Fixes DICTIONARY with r2007.

	read/write: allow hard- and symlinks
	not just regular files. just on windows with mingw S_ISLNK is undefined.
	and some minor improvements on write: binary, rename vars.

	programs: crash on notexisting file
	when returning early from dwg_read_file (e.g. not found, not readable) we
	still call dwg_free, which needs the pointers to be NULLed.

	2007: rename some VIEWPORT fields
	def_lighting_type -> default_lighting_type
	use_def_lights -> use_default_lights
	ambient_light_color -> ambient_color

	2007: complete VIEW and VPORT spec fields
	rename Dwg_Color byte to flag

	HACKING: link to CONTRIBUTING and USING_FOREIGN_CODE

	USING_FOREIGN_CODE: add incompatible
	licenses also. From https://www.gnu.org/licenses/license-list.en.html

	add USING_FOREIGN_CODE
	answering the question which code can be used in
	LibreDWG, e.g. a reed-solomon library

	update docs

2018-04-27  Reini Urban  <rurban@cpan.org>

	add manpages and option handling
	option handling is minimal, position sensitive.
	not using getopt_long() yet.

	used help2man to create the initial manpages. (in sync)

	rename dwg_ps program to dwg2ps for consistency

2018-04-27  Reini Urban  <rurban@cpan.org>

	noinst_PROGRAMS: dwg2dxf dxf2dwg
	these are not yet ready.
	we are targettting an early alpha release, and these will
	not be ready for that

	TODO: more TODO

	leak: free the sections chain
	sections is the root, section just the current element in the linked list.
	only in the unlikely case of out of memory.

	leak: free the xdata chain
	and not just the last element, in case of out of memory (very unlikely).

2018-04-26  Reini Urban  <rurban@cpan.org>

	programs: default to LIBREDWG_TRACE 1
	probe for setenv and use it. this is only failing on mingw.
	print the error message when failing.
	Fixes Bugs #31867, #35110, #46175

	leak: set DWG_SUPERTYPE_UNKNOWN
	to avoid double-free of eed data. this is one big chunk only.
	free eed.raw only on size, otherwise it's a continuation with data only.

	leak: fix double-free of LAYOUT eed

	leak: free the eed data
	and COMMON_ENTITY_HANDLE_DATA: all the common handles, reactors.

	analyzer: initialize dwg->header.version
	Logic error	Result of operation is garbage or undefined
	programs/dxf2dwg.c	dwg_read_dxf

	analyzer: fix memory leaks

	analyzer: remove dead initialization
	dwg_encode_common_entity_handle_data does not need dwg (yet).

2018-04-26  Reini Urban  <rurban@cpan.org>

	analyzer: fix clang-analyzer warnings
	using the recent scan-build target.

	Allocator sizeof operand mismatch (wrong malloc casts)
	Branch condition evaluates to a garbage value (uninitialized obj_dat)
	Undefined allocation of 0 bytes (CERT MEM04-C; CWE-131) (for counts=0)

2018-04-26  Reini Urban  <rurban@cpan.org>

	pre-R13: start decoding entities WIP
	move the common pre-R13 entity fields to Dwg_Object_Entity
	and add a spec-local _ent for this.
	add a common decode_entity_preR13() decoder before the
	entity-specific handlers. 70% done.
	decode_preR13_entities: add the entity loop.
	  missing: check DIMENSION opts field for the type.
	dwg.spec: TODO ATTRIB/ATTDEF,
	  add VERTEX_2D, POLYLINE_2D
	  add R11OPTS(n) macro

	silence r11 compilation warnings
	use proper field casts for r11

2018-04-26  Reini Urban  <rurban@cpan.org>

	policy: add #ifndef IS_RELEASE checks
	abort on unsupported DWG versions to avoid segv on
	released packages.
	logic: if a .git directory is present it is not a release.

	also add a new scan-build target, using clang's static analyzer
	clang-analyzer.

2018-04-26  Reini Urban  <rurban@cpan.org>

	add CONTRIBUTING, adjust TODO
	copy CONTRIBUTING from the GCC project and adjust it.  Esp.  important for
	Legal Prerequisites.  This is an official and important GNU package, with
	ownership assigned to the FSF, to able to protect us from legal threats.

	adjust TODO, README and README-alpha.
	Mention that unreleased downloads of the library will crash
	as it will try to decode unsupported DWG versions. Released
	downloads will rather abort then.

2018-04-25  Pero Brbora  <pbrbora@stud.unidu.hr>

	unit-testing: Prevent segfault on error
	Closes Savannah #8628

2018-04-25  Reini Urban  <rurban@cpan.org>

	README: updates

2018-04-24  Reini Urban  <rurban@cpan.org>

	pre-R13: fix STYLE
	add bigfont_name field

	pre-R13 DIMSTYLE vars
	just the DIMBLK_T texts are unsure, and one unknown
	RC var not in DXF: DIMUPT probably

	pre-R13 header vars
	complete the header vars with DXF counterparts.
	missing are the handles (i.e. table indices), and texts.

2018-04-23  Reini Urban  <rurban@cpan.org>

	Improve object tracing
	Print the type even with loglevel 2, but not much more

2018-04-23  Reini Urban  <rurban@cpan.org>

	r11: reset tbl->number on failure
	when we read a non-object table, reset the index
	so we don't increment it in the next line

	   dwg->num_objects += tbl->number;

2018-04-23  Reini Urban  <rurban@cpan.org>

	xmlsuite: only process existing DwgTxtFileName
	protect from skipped dwgs, such as <r13 and >2004

	2007: add klass dxfname_u field
	and use dxfname as the ASCII variant for comparisons.
	This fixes reading all the class objects (>500).

	2007: fix obj_string_stream
	The bitsize calculation starts before reading the bitsize.
	Thus initialize the string stream before reading the bitsize.
	The bit is then always 0, as objects start at bit offset 0

	2007: fix EED code 0
	2007 already uses unicode strings in EED

	2007: add absolute last_offset tracing
	and outcomment last_handle for each object (was used
	for object idx plausibility)

2018-04-23  Reini Urban  <rurban@cpan.org>

	2007: limit string data size, read entity bitsize
	reset the string stream to start at the object offset and limited
	by the object size.

	fix reading the entity bitsize in dwg_decode_entity:
	R_2000 - R_2004 -> R_2000 - R_2010.

2018-04-20  Reini Urban  <rurban@cpan.org>

	harmonize Num Objects tracing
	also for r2007

	auxheader.spec: convert 20x unknown_rc RC to FIELD_TFF
	for more pleasant logging

	LOG_TRACE_TU: harmonize
	with logging of TV

	don't typos

	start separating encode version support
	add a separate encode_preR13(), but not for the other versions.
	they are all basically the same, just the sections maps are different.

	dwg_decode(), dwg_encode()
	harmonize the two main entry points.
	rename dwg_decode_data() to dwg_decode(),
	rename dwg_encode_chains() to dwg_encode()

	comment for dwg_encode_chains refactor
	version specific and rename to dwg_encode_data()

	2010: add BOT type
	use the 2004 format.
	bitcoded object type: single or double byte

	rename APPID_CONTROL->num_apps to num_entries
	for consistency with the other table control objects.

	abstract bit_set_position
	and a new bit_position getter

2018-04-18  Reini Urban  <rurban@cpan.org>

	xmlsuite: skip 2007+ so far

	2007: more handle stream work
	now almost works. we need to set the
	handle stream to the end of the object: pos+bitsize = hdlpos
	after the has_strings bit.

2018-04-16  Reini Urban  <rurban@cpan.org>

	name unknown DIMSTYLE_CONTROL vars
	morehandles

	undo <=2007 parenthandle
	object parenthandles appear also in r2010.
	The pointer to the control object.

	pack _encrypted_section_header also
	is wrong with some compiler settings, e.g. asan.

	replace FIELD_VECTOR RC with FIELD_TF
	esp. for tighter logging.
	array of bytes => fixed length text.

	WIP more 2007 handle stream
	not for entities yet. there we don't have a bitsize.
	initialize hdlpos after reading the object bitsize.
	before 2007 hdl_dat is just the same as dat, ditto str_dat.
	str_dat is a copy then because strings are interleaved.
	hdl_dat just needs one advance, because the handles are only
	at the end.

2018-04-15  Reini Urban  <rurban@cpan.org>

	sprintf %ls for cygwin
	warning: passing argument 2 of fprintf from incompatible pointer type [-Wincompatible-pointer-types]
	   LOG_TEXT_UNICODE(TRACE, (BITCODE_TU)wstr)

	2007: and WIP the handle stream

2018-04-14  Reini Urban  <rurban@cpan.org>

	WIP 2007: start working on 2007 object strings
	don't error on invalid handles (still invalid obj handle stream),
	start with a few 2007 strings

	2004: fix Data Section
	access the right r2004_header.section_info_id.
	e.g. 19 => index 16. 19 would be out of bounds

	fix r11 free empty class
	r11 has no classes at all, but tried
	to deref them

	2007: improve error handling
	when get_page or read_pages_map fails

	fix decompress_r2007: allow length 0
	This is basically a LZ77 decompressor, where the case length=0
	is allowed.

	whitespace cleanup decode.c
	M-x whitespace-mode

	whitespace cleanup decode_r2007.c
	M-x whitespace-mode

	add FIELD_TFF type, pre-allocated fixed string
	which merely makes for better logging.

	use bit_read_fixed helper
	for reading into already allocated fixed length string

	more section_handles harmonizations

	simplify 2004/2007 section_handles
	and harmonize.

	2007: WIP start reading objects and handles

	2007: update TODO plan
	merge decode_r2007 with the 2004 decoder, it is the same.

	more 2007 harmonization
	rename num_descriptions to num_infos, it is the section_info count.
	move read_2007_section_objects into read_2007_section_handles, same as with 2004.

	minor 2004+ section simplifications
	no logical changes

	2007: more sections handles and objects

2018-04-14  Reini Urban  <rurban@cpan.org>

	r2007 header_variables
	HANDSEED is not read from the handle stream, but the data stream.
	PUCSORTHOREF is wrong.
	separate obj_string_stream and section_string_stream:
	SECTION_STRING_STREAM got a prepared str_hdl already,
	START_STRING_STREAM calcs the stream pos from the obj->bitsize.
	encoding >= r2007 not yet started (need to calc. handle and string stream offsets)

	* bits.c,h (bit_set_position): added, set absolute

2018-04-14  Reini Urban  <rurban@cpan.org>

	add separate handle stream for r2007+
	before R2007 those two streams, dat and hdl_dat are the same.

	but no extra string stream yet.
	we handle that in the dwg.spec extra, locally.

2018-04-14  Reini Urban  <rurban@cpan.org>

	decode 2007 string streams
	for now switch dat back and forth, but we really should provide two
	streams: dat and str_dat for easier dwg.spec integration.
	And we'll also need a third handle stream, hdl_dat. See the next commit.

2018-04-11  Reini Urban  <rurban@cpan.org>

	WIP read_2007_section_classes
	missing: string stream.

	change the section lookup by type, not hashcode.
	it should be the same is with 2004 really. TODO merge the code base.

2018-04-11  Reini Urban  <rurban@cpan.org>

	add r2004+ dwg_section_type
	resolve the section wname to the enum DWG_SECTION_TYPE, which we need
	later. to lookup the header, classes, objects sections by index, not by name.

	do the same for preR13 and R13 section types (also as enum).

2018-04-10  Reini Urban  <rurban@cpan.org>

	start encode the r2004 Section Page Map
	Add the 5 r2004 section fields to the dwg->r2004_header and Dwg_Section.
	simplify section maps massively, no system_section union needed.

	Add native LE read/write bits for RL (yet unneeded).

2018-04-09  Reini Urban  <rurban@cpan.org>

	2018 fix for MLINESTYLE

	add 2018 test-data DWGs and matching DXFs
	The 2013 variants saved as 2018.

	Fix programs CC warnings
	with WARN_CFLAGS

	classes >= 2007
	add the missing 2007 class-map fields.

	xmlsuite: write into builddir
	not into srcdir, which could be read-only. e.g. make distcheck

	HACKING: add macports python

	move public headers into include/

2018-04-08  Reini Urban  <rurban@cpan.org>

	add HAVE_NATIVE_WCHAR2
	We can only use wchar.h when on Windows with a sizeof 2.
	On unix wchar_t is a 4-byte UTF-32.
	How to handle these? Use native wchar_t internally
	and convert when reading/writing?

	add ctype.h probe

	fix eed packed struct
	some gccs add intermediate bytes into the Eed_Data struct,
	esp. mingw.

2018-04-07  Reini Urban  <rurban@cpan.org>

	fix wrong encode class checks

	fix -Wsign-compare

	use bits _TF functions
	for larger strings/raw data. esp. for later conversion to FIELD_TF
	and LOG_TRACE_TF.

	eed rewrite
	EED are really a stream of size+app-handle + sequence of app-specific code+value pairs,
	not just one code+value per handle.
	So add a new eed struct per code+value pair, and leave the size empty of subsequent
	eeds, and re-use the handle.

2018-04-02  Reini Urban  <rurban@cpan.org>

	fixed some r14 second header parsing
	adjust for num_sections, which now actually matches the documentation

	more TODO

	Merge branch 'dxf' into work
	separate examples and programs.
	many improvements and fixes, esp. some objects, memory leaks and eed.

	Update TODO for the finished dxf branch

	fix get_first_owned_object
	with no BLOCK_HEADER entities, e.g. empty paperspace.

	fix MLEADERSTYLE eed
	wrong usage of index i, used twice, nested.
	rename the inner appid loop to j,
	the outer eed loop to idx.

	more auxheader: still debugging
	add some helpers: DEBUG_HERE() and LOG_TRACE_TF (fixed string)

	Makefile.am: fix check-dwg targets

	free: add dwg_free_handleref
	where we lookup the handle in the global list of refs
	and delete it there also.
	also free the reactors, defer freeing BLOCK_CONTROL,
	and set a freed obj->type to DWG_TYPE_FREED, to skip
	double-frees

	Fix reamining warnings
	proper casts for preR13 types,
	warp TODO objects into ifdef DEBUG_<OBJECT>
	change IMAGE.clip_mode from BS to B ??

	de-arm CRC check
	allow failing CRCs, just log the error

2018-04-02  Reini Urban  <rurban@cpan.org>

	add dwg_encode_xdata and dwg_free_xdata
	and enhance the xdata linked-list variant to
	r2007 unicode strings.
	simplify the mess a bit.

	XRECORD: write and free the objid_handles
	free the object_ref array.

2018-04-02  Reini Urban  <rurban@cpan.org>

	add check-dwg-valgrind

	free: dup klass->dxfname
	because freeing an object could free the dxfname also.
	and some cases are unhandled.

	VISUALSTYLE tested ok

	test VISUALSTYLE

	harmonize defined but disabled classes
	CELLSTYLEMAP also.

	fix more gcc-7 warnings
	-Wint-in-bool-context: compute the TABLE field num_cells. we use it twice.
	-Wsign-compare in some eed DEBUG sanity checks

	build: document missing check-valgrind
	for the alive.test hack. switch to a normal
	runtest env, which does have valgrind support

	change LAYER.color_rs from RS to signed short
	to check for negative colors <r13

2018-04-02  Reini Urban  <rurban@cpan.org>

	DEBUG_MULTILEADER
	all 4 actions decode/encode/print/free must be consistent
	if to run the handler or not.

	fixed 2004_Leader with empty BLOCK_HEADER->entities[0]
	with dwg2SVG

2018-04-02  Reini Urban  <rurban@cpan.org>

	.gitignore: a few more private files

2018-04-02  Reini Urban  <rurban@cpan.org>

	fix MLEADERSTYLE is_new_format
	add global dwg->appid_control, a list of all registered apps.
	when an MLEADERSTYLE eed handle points to a ACAD_MLEADERVER APPID, then
	use the new MLEADERSTYLE format (because it was imported from a newer version).
	Fixes the text_always_left bit offset.

	add dwg_resolve_handleref helper, a part of the handle decoder.

	rename MLEADER to MULTILEADER, the dxf really has the MULTILEADER name,
	libdwg uses it also.

2018-04-02  Reini Urban  <rurban@cpan.org>

	rename dxfname MLEADER to MULTILEADER
	but keep our object definition the same name as in the docs.
	unlike libdwg.

	also: SCALE has now enough coverage.

2018-04-02  Reini Urban  <rurban@cpan.org>

	remov -lm dependency
	use our own bit_nan()

	bit_read_BD: fix 64bit stackoverflow
	use int32_t, not long int to create nan.
	we still avoid to link against libm,
	even the dwg_api should not do anymore.

	second_header: fix sections overflow
	Leader_2000 has 6 sections there, not just 4

	alive.test: dwgbmp Leader_2004 will always fail
	because it has no embedded picture and it then returns -1

	decode: fix ubsan problems
	avoid *((uint64_t*)ptr) alignment problems (eg. sse).
	crc code: use unsigned properly typed rseed to handle overflows

	free: use default loglevel ERROR

	eed: do away with pesky valgrind overflows
	no idea why it still overflowed

	refactor eed
	make a raw copy, and also read into the eed union.

	separate programs dir
	for bin_PROGRAMS.
	enhance alive.test to test more DWGs

2018-04-02  Reini Urban  <rurban@cpan.org>

	free: add some more
	HANDLE_VECTOR, FIELD_VECTOR (esp. for TV),
	second_header.handlers, FIELD_HANDLE (the dwg_object_ref).

	zero the dwg struct on dwg_read_file() (in case of early free).
	dwg_encode_chains: initialize section_address (detected with -O2)

2018-04-02  Reini Urban  <rurban@cpan.org>

	dwg_bmp: protect from empty picture size
	fixes dwgbmp Leader_2004.dwg

2018-03-31  Reini Urban  <rurban@cpan.org>

	fix make distcheck: add dim_common.exp
	and src/free.h.
	avoid duplicate loglevel symbol.

	Fix r2000 second header
	r2000 has 5 chars before the sections, not 4 as before.

	Merge commit 'afa21732aa095f6a109821e561092748ae851d2e' into work

	finish the API revamp: unit-tests

	fix up the dimension unit tests
	for the new DIMENSION API.
	replace elevation_ecs11 by elevation.

	add new DIMENSION_common subentity
	for the API only, to save a lot of functions

	adjust dim testcases

	disable CELLSTYLEMAP, fix MTEXT style handle
	FIELD_G_TRACE: print the dxf code numerically.

	WIP cleanup the API
	and more

2018-03-31  Reini Urban  <rurban@cpan.org>

	WIP more dxf codes: REPEAT_4, macrofy
	remove _Entity/_Object from structs, which are not entities, objects,
	just parts thereof.

	macrofy common field accessors:
	Table_Value(value)  20.4.99 for FIELD and TABLE
	Cell_Style_Fields(sty)  20.4.101.4 for TABLE, TABLECONTENT and CELLSTYLEMAP
	Content_Format(fmt) 20.4.101.3 for TABLECONTENT and Cell_Style_Field

2018-03-31  Reini Urban  <rurban@cpan.org>

	WIP more dxf codes: almost done
	add END_REPEAT for free.
	fixup some types and errors.

	WIP more dxf codes
	mostly HATCH, MLEADER, TABLE, ...
	add VECTOR_FREE at the end of REPEAT

2018-03-30  Reini Urban  <rurban@cpan.org>

	WIP more dxf codes, and finish more objects
	dwg_decode_handleref_with_code: handle offset pointer codes.

	WIP more dxf codes
	and some typos and more documented objects. esp. the new tables objects.

	WIP add dxf codes to all fields
	and integrate more r11 tables into dwg.spec

	merge UCSICON_0+1 B to UCSICON BB

2018-03-29  Reini Urban  <rurban@cpan.org>

	typo: default_lightining_type
	=> default_lightning_type

	r11: fix free empty objects
	dwg_free_LAYOUT:
	obj->type == obj->parent->layout_number is not true there.

2018-03-29  Reini Urban  <rurban@cpan.org>

	dwg.spec: start adding r11 tables to the spec
	make each FIELD a statement, to allow bracket less
	single fields if statements. 3 lines => 1 line.
	but not for SINCE/UNTIL, since this needs to set cur_ver before.

	add IF_ENCODE_FROM_PRE_R13 r11 defaults, flags <=> bits,
	also needed for dxf.

2018-03-29  Reini Urban  <rurban@cpan.org>

	dwg.spec: reformat
	no functional changes, whitespace and rearrange FIELD macros only.

	r11: implement the tables
	add a BITCODE_TF fixed width text type.
	fixed a few typos:
	VIEW.lens_legth => lens_length
	MLEADER: ctx.text_heigth => ctx.text_height

2018-03-28  Reini Urban  <rurban@cpan.org>

	more r11: outline all tables/sections
	read now until the end

	add TIMEBLL type, more r11 work
	add a special TDCREATE type to simplify dxf handling.
	add Dwg_Section_Type_r11 enum, rename table processing to section,
	because they have similar structure.

	2007: add LOG_TEXT_UNICODE, LIBREDWG_TRACE
	honor LIBREDWG_TRACE on decode_2007.
	beautify the log output a bit.
	we can now print UCS-2 on unix platforms via LOG_TEXT_UNICODE
	update TODO

	R2004 decoding done, start with R2007

	spec: add more unknown templates
	and embed more parenthandle < 2007

2018-03-27  Reini Urban  <rurban@cpan.org>

	fix 2004 Common Entity Data layer
	layer is only for 2000, not 2004.
	add shadow handle: 2007+
	fixes reading all 2004 dwgs

	fix HATCH num_boundary_handles
	only count num_boundary_handles on decoder,
	esp. not when printing it.
	calloc all REPEAT objects to zero-init all counters.

	HATCH: rename z_coord to elevation

	harmonize to parenthandle
	from XRECORD->parent and lots of parent_handle.

	more objects and specs
	complete the r2010+ optional xrefindex_plus1 for all tables,
	add WIPEOUTVARIABLE, add entity_HATCH_DefLine,
	optional null_handle 2010+,
	SHAPEFILE_CONTROL: num_entries BS => BL.

2018-03-27  Reini Urban  <rurban@cpan.org>

	more 2007 specs: go over all objects
	type all FIELDS: FIELD(name,type) => FIELD_type(name)
	some entities have no post common entity data handles 2007+

	DICTIONARY: no itemhandles <r2000
	MTEXT: flip rect_width with rect_height
	SPLINE: fixed 2013+, num_fit_pts BS => BL, read handles later,
	LEADER: associated_annotation since r13, not 14.
	BLOCK_CONTROL: num_entries BS => BL, paper_space <= 2007
	BLOCK_HEADER: 2010+ xrefindex_plus1, rename preview_data fields
	LAYER_CONTROL: num_entries BS => BL, null_handle <= 2007
	LAYER: 2010+ xrefindex_plus1

2018-03-27  Reini Urban  <rurban@cpan.org>

	fix 2004 header_vars
	current_viewport_entity_header is only r13-r2000.

	read_2004_compressed_section: better logging
	and error handling. free the temp. decompression buffer.

	fix ENT_REACTORS encode
	and fix tracelevel for decode_object/entity: honor LOG_TRACE level.

	silence free DIMSTYLE
	some FIELD_CAST values were printed on free

	examples: don't leak suffix filename_out
	and add one missing dwg_free()

	dwgrewrite: warn when num_objects differ
	the previous re-read just checks for a valid structure,
	not if really all objects were written.

	suffix: fix . handling in ext
	when the ext already contains a dot
	don't add another one

	encode: write empty strings
	NULL chains.
	Not yet NULL handles

	2004: second_header since r2004
	is read partially. the sections map and handlers is handled
	elsewhere.

	decode_R2004: logging cosmetics

2018-03-27  Reini Urban  <rurban@cpan.org>

	fix decompress_R2004_section assert
	src may be equal to decomp.
	fixes reading 2004/Leader_2004.dwg and 2004/Drawing_2004.dwg

	all my r11-r2004 dwgs can now be decoded.

2018-03-27  Reini Urban  <rurban@cpan.org>

	Add some of my test DWGs and DXFs
	Produced with my evaluation copy of AutoCAD 2013 for MAC
	and some free library blocks from the internet.

	Add a LEADER, associate MLEADER, a HATCH filled with an image,
	and parametric constraints objects.

2018-03-27  Reini Urban  <rurban@cpan.org>

	add MLEADER and OBJECTCONTEXTDATA
	untested. just taken from the spec.

	add BITCODE_TU UCS-2 DWGCHAR
	not suore yet if the BITCODE_TU is zero-delimited nor not.

2018-03-27  Reini Urban  <rurban@cpan.org>

	Second header: improve, esp. r14
	sanitize second_header, via proper fields.
	esp. the encoder was wrong.

	parsers all of my r2000 and r14 samples.

2018-03-27  Reini Urban  <rurban@cpan.org>

	more common 2010,2013 fields
	handlestream_size, has_ds_binary_data

	tune free calls
	check also the size, not just the pointer.
	free only once, not some classes twice, such as CELLSTYLEMAP,
	VBA_PROJECT
	honor the LIBREDWG_TRACE trace var, to display the free'd object
	pointers.

	fix EED padding and realloc
	use (i+1) *
	padding is normal, not something to warn about.

2018-03-27  Reini Urban  <rurban@cpan.org>

	add free dwg.spec callbacks
	use the spec to free each field, similar to print.

	result: from 23k down to 20k definitely lost.
	Missing: XRECORD xdata ResBuf, DICTIONARY handles,
	common entity data handles.

2018-03-27  Reini Urban  <rurban@cpan.org>

	bits: protect from overflow
	and fix bit overflow, properly wrap around

	disable MLEADERSTYLE
	wrong EED offset

	add FIELDLIST, MLEADERSTYLE
	this is still WIP.
	the first MLEADERSTYLE line_type handle is wrong.

	add SCALE, VBA_PROJECT objects
	VBA_PROJECT still untested. SCALE looks ok

	restart unhandled/untested class objects
	When a variable-type object is unknown/untested,
	restart it to the prev. known address and read in the raw
	bytes from there again.
	Fixes offset problems with testing some new objects: VBA_PROJECT,
	CELLSTYLEMAP which interestingly also is in some R2000 (AC1015) files from
	the internet.
	decode-only so far.

	work on r14 stability
	skip CRC check error with num_sections!=5,
	fix DICTIONARYWDLFT.unknown_r14 to RL (probably some combination of RS,RC,RC)
	r14 DICTIONARY.unknown_r14 is the hard_owner flag.

2018-03-27  Reini Urban  <rurban@cpan.org>

	dwg_encode_variable_type
	sync with dwg_decode_variable_type

	and let untested classes be also encoded as UNKNOWN_OBJ

2018-03-27  Reini Urban  <rurban@cpan.org>

	add check-dwg target
	test all test-data DWG files with dwgread

	fix gcov targets
	we are now at 23.9%

2018-03-27  Reini Urban  <rurban@cpan.org>

	finish UNKNOWN_OBJ
	add the encode and print parts.
	we did for encode after all.

	TODO: we could store the address before trying untested objects
	and reset if for the UNKNOWN_OBJ. that way we can look at
	the union values and still be safe.

2018-03-27  Reini Urban  <rurban@cpan.org>

	WIP UNKNOWN_OBJ
	use dwg_decode_object/entity for eed, reactors, xdic, even for
	unknown objects/entities. So far all of them are class objects.
	store the raw bytes as raw field vector, TODO /8 slack if
	bitsize % 8.

	This fixes the version dependent handling of bitsize, eed, reactors, xdic,
	and should now handle all of the MATERIAL, SCALE, ... objects.

2018-03-27  Reini Urban  <rurban@cpan.org>

	fortify dwg_free, document clearing all of Dwg_Data
	initialize all critical Dwg_Data pointers and counters,
	so that dwg_free will not touch uninitialized data.

	document that all incoming dwg data will be cleared in
	dwg_decode_data and dwg_read_file.

2018-03-27  Reini Urban  <rurban@cpan.org>

	more DXF adjustments
	rename VPORT fields to its DXF names.
	rename Class fields: proxyflag.
	item_class_id really is named Is-an-entity flag: 1f2 for entity, 1f3 for object.
	See http://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf

	more DXF adjustments
	WIREFRAME is not a headervar, DISPSILH is probably meant.
	rename OBSCUREDCOLOR back to DXF OBSCOLOR, likewise
	OBSCUREDLTYPE => OBSLTYPE, IDEXCTL => INDEXCTL.

	dxf2dwg: fix r11-r2000
	and add some more missing header_variables_r11

	decode_preR13 WIP
	added some prelim. header_variables_r11.spec,
	not bit-encoded, just raw.
	add the raw decoding layout, as found out 1995.

	Update TODO

	doc: add Examples and more

	add dxf2dwg.c WIP
	TODO: read DXF, code/name pairs, and look them up in one
	of the specs.

2018-03-27  Reini Urban  <rurban@cpan.org>

	add dwg_version_as
	similar to the acad saveas options,
	to map the the --as-rVER option to our internal Dwg_Version_Type, e.g. R_2000.

	* src/common.c, src/common.h (dwg_version_as): added.
	* src/common.h (Dwg_Version_Type): added R_INVALID (similar to R_BEFORE).
	* examples/dwg2dxf.c, examples/dwgrewrite.c: use dwg_version_as.

2018-03-27  Reini Urban  <rurban@cpan.org>

	add R_12, the same as R_11 but more prominent
	AC1009 is mostly referenced as Saveas R 12 format, not R 11.
	So we do support R_12, with the same AC1009 DWG.

2018-03-27  Reini Urban  <rurban@cpan.org>

	more dwg2dxf work
	add some old defaults, and pre-r13 vars:
	HANDLING, paperspace, ...

	fix option handling a bit

2018-03-27  Reini Urban  <rurban@cpan.org>

	add ole2frame to unit-testing
	was skipped

	add xrecord API and testcase
	set num_eed in the XRECORD object.
	TODO: change the linked list into an array, to unify with the
	generic eed array

	dwgread: simplify

	dwg2svg2: 32bit now fixed

2018-03-27  Reini Urban  <rurban@cpan.org>

	fix 32bit dwg_api
	dwg_api.o didn't load stdint.h, so had a different size than
	dwg*.o

	* src/dwg_api.c: include stdint.h, inttypes.h, fixing 32bit.

2018-03-27  Reini Urban  <rurban@cpan.org>

	testcases: use DEJATOOL
	see https://www.gnu.org/software/automake/manual/html_node/DejaGnu-Tests.html
	and https://www.embecosm.com/appnotes/ean8/ean8-howto-dejagnu-1.0.html

	* test/Makefile.am: : use DEJATOOL, not RUNTESTDEFAULTFLAGS
	* test/testcases/Makefile.am: remove unused RUNTESTDEFAULTFLAGS
	* test/testcases/common.c: remove unused code

2018-03-27  Reini Urban  <rurban@cpan.org>

	configure: fix AC_MSG_WARN quoting

	dwg2svg2: more work on 32bit crashes

	decode_R13_R15: optional section[4]
	only read the measurement section when appropriate.
	though in praxis it always is.

	fixup examples/dwg2SVG.c
	var initialization, dwg global not on stack.

	doc: remove dwg_print_object from API
	it is using the Bit_Chain.
	But add examples how to iterate over all entities,
	in model space and paper space.

2018-03-27  Reini Urban  <rurban@cpan.org>

	add Bit_Chain arg to dwg_print_object
	and remove it from the global _dwg_struct.
	move dwg_print_object from public dwg.h to private print.h,
	because Bit_Chain is not public.

	The bit_chain field was added with commit b24e5329b3e0ae178bb7162a6a492c0f6313899d
	Author: Rodrigo Rodrigues da Silva <pitanga@members.fsf.org>
	Date:   Fri Jan 29 04:43:47 2010 -0200

	Added macro created print functions, made some functions private, increased
	logging trying to fix objectrefs.

2018-03-27  Reini Urban  <rurban@cpan.org>

	unit-testing: move dwg struct from stack to global
	on some 32bit systems the stack might be too small for 2500 byte.

	extend the dwg_api
	dwg: num_classes, num_objects, num_entities, object[], class[],
	eed, bitsize.

2018-03-27  Reini Urban  <rurban@cpan.org>

	dwgbmp: fix use-after-free
	cannot write the picture from the freed dwg.
	free the dwg afterwards.

	darwin: add a dymutil helper target hack, for better symbolization.

2018-03-27  Reini Urban  <rurban@cpan.org>

	load_dwg: silence unused-params warnings

2018-03-27  Reini Urban  <rurban@cpan.org>

	more work on dwg_free
	add dwg_object_free().

	protect from double-free the bit_chain by setting
	bit_chain.size = 0.

2018-03-27  Reini Urban  <rurban@cpan.org>

	.gitignore: add renamed examples

2018-03-27  Reini Urban  <rurban@cpan.org>

	rearrange dwg.h
	rename dwg_ot_layout to layout_number,
	rename second_header.handlerik to second_header.handler.

	free the dwg a bit more.
	the objects and entities are still leaking massively.

2018-03-27  Reini Urban  <rurban@cpan.org>

	dwg2svg2: use global dwg
	not stack allocated.
	printf header after getting the objects.
	zero-fill the dwg struct data.

2018-03-27  Reini Urban  <rurban@cpan.org>

	working on 32bit crashes
	add two helper handles for mspace_block and pspace_block
	BLOCK_HEADER.
	zero-fill new objects.

	TODO:
	someone, maybe CRC, is overwriting the Dwg_Struct after num_classes,
	32bit only. with dwg2svg2 only.

	  CRC = 36953}, num_classes = 4,
	  dwg_class = 0x8153100, num_objects = 61, object = 0x8158398, num_layers = 0,
	  num_entities = 12, num_object_refs = 154, object_ref = 0x8155b78, layer_control = 0x81532a0,
	  mspace_block = 0x8154ff0, pspace_block = 0x8156560,
	=>
	  CRC = 65028}, num_classes = 3086986712,
	  dwg_class = 0xad9f3224, num_objects = 1336173547, object = 0x9059, num_layers = 4,
	  num_entities = 135606528, num_object_refs = 61, object_ref = 0x8158398,
	  layer_control = 0x0, mspace_block = 0xc, pspace_block = 0x9a,

	CRC ... num_entities is wrong.

2018-03-27  Reini Urban  <rurban@cpan.org>

	configure: make python optional
	check for swig, and only then for python.
	and only then build the python bindings.

	allow older 1.11.6 automake, e.g. debian wheezy.
	don't use PKG_CHECK_MODULES, just call if pkg-config.
	CFLAGS: add -fno-omit-frame-pointer to gcc for better 32bit debugging.

2018-03-27  Reini Urban  <rurban@cpan.org>

	improve win32 support
	tested with i686-w64-mingw32 under wine 32bit.
	still failing test case: dwg2svg2 with both dwgs.

	DIMTXSTY: fix typo
	fixes dwg2dxf

	decode: zero-fill fresh memory
	use calloc, not malloc, to be on the safe side.

2018-03-27  Reini Urban  <rurban@cpan.org>

	dwg2dxf headers, rename some header_vars to dxf
	rename *_{M,P}SPACE vars to the canonical dxf names.
	e.g. INSBASE_MSPACE => INSBASE,
	INSBASE_PSPACE => PINSBASE.

	finished header section.

2018-03-27  Reini Urban  <rurban@cpan.org>

	add dwg2dxf WIP
	just the first few header vars yet

	minor cleanup
	remove unused Dwg_Data_Type from src/common.h

	add proper error handling, ...

	AUTHORS: add myself

	README: add needed packages

	calloc entity/object
	zero-fill fresh entities/objects.
	initialize Dwg_Object->bitsize, mostly just the object/entity part is initialized

	dwgrewrite: fix filename_out

	restore C++ compat
	use extern "C"

	extend Dwg_Handle types
	from char to int. codes can go up to 1000, some even higher.

	abstract dwg_decode_eed function
	similar to dwg_decode_xdata for XRECORD.
	add objid_handles code to XRECORD, decode only
	dwg.h: add datbyte offset to dwg_object to know the end from start (=datbyte)
	and bitsize.

	ChangeLog: formatting

	unit-testing: more type fixes
	fix most of the remaining trash code and formatting.

2018-03-27  Reini Urban  <rurban@cpan.org>

	dwg_ps: fix asan crash
	obj->tio.entity->entity_mode is not always defined, only for entities.

	* examples/dwg_ps.c (create_postscript): remove wrong
	  obj->tio.entity->entity_mode check

2018-03-27  Reini Urban  <rurban@cpan.org>

	add FIELD_CAST
	several r13-r14 DIM vars have only type RC.
	store it as BS, and cast it up to BS.
	detected with clang -Wformat, not with gcc.

2018-03-27  Reini Urban  <rurban@cpan.org>

	More fields, start with adding dxfgroup
	FIELDS_G*.
	Also avoid eed[i] overflows.

	Avoid ntoh() dependency, add bit_read_RS_LE().

2018-03-27  Reini Urban  <rurban@cpan.org>

	cross-compiler support
	disable python+swig when cross-compiling.
	disable rpl_malloc replacement, because of
	AC_CHECK_HEADERS malloc.h.
	we don't need it, we just want to know if it's needed.

	add gcov probe and target
	usage with suffix'ed gcc:
	  CC=gcc-mp-6 ./configure --enable-gcov=gcov-mp-6
	  make gcov

	add ole2frame to testcases
	and export its ENTITY

2018-03-27  Reini Urban  <rurban@cpan.org>

	xmlsuite: fix compiler warnings and libxml2 insanity
	they insist on using unsigned char* in their public API, oh my.
	declare all missing funcs, and a lot more.

	properly return the exit code.

2018-03-27  Reini Urban  <rurban@cpan.org>

	dwgbmp: proper error handling
	add perror calls when fwrite failed.
	write to stderr.
	return failing exit code.

	LOG_{ERROR,WARN}: no duplicate ending \n
	LOG_{ERROR,WARN} already adds a \n

	decode: adjust unhandled classes/objects
	fixup the TODO list, add GROUP and WIPEOUT to the handled classes

2018-03-27  Reini Urban  <rurban@cpan.org>

	dwg.h: check HAVE_WCHAR_H, fix DIMTAD, DIMZIN type
	wchar_t is needed for examples, ... rely in HAVE_WCHAR_H.

	change DIMTAD, DIMZIN decl from RC to BS, as used since r2000.
	we need the larger type for the common storage.

2018-03-27  Reini Urban  <rurban@cpan.org>

	testcases/tolerance.c: fix and add extrusion test
	there was a mixup

	dwg_api: add missing common entity/object APIs
	declarations only

2018-03-27  Reini Urban  <rurban@cpan.org>

	decode: LOG_INFO handles when read
	not later when the whole EED and more was read.

	TODO: we already decrypt the raw SAT data. we only might want to
	parse it into some SAT structures.

2018-03-27  Reini Urban  <rurban@cpan.org>

	EED done
	inline the EED char buffers.

	* configure.ac: probe for wchar.h needed for r2007+ text.
	* src/dwg.h (Dwg_Eed_Data): inline the buffers, and comment that the
	  integers need to be endian swapped for the API, if they need to be
	  interpreted. They are still in network order. But mostly just dump the
	  raw. Swap the codepage.
	  (Dwg_Eed): Dwg_Eed_Data *data is now a calloc'd pointer, not inlined.
	* src/bits.h: add <wchar.h>, needed for a unit-test.
	* src/decode.c, src/encode.c: use the changed Dwg_Eed_Data.
	  add length sanity checks and offset deviations. special-case eed_0 strings.

2018-03-27  Reini Urban  <rurban@cpan.org>

	EED: add dwg_encode_{object,entity} to encode WIP
	also write common_entity_handle_data,
	comment out unused objects and the proxy subtype. src compiles now warning free.

2018-03-27  Reini Urban  <rurban@cpan.org>

	rewrite EED (untested), more common entity support
	Fix multiple instances of EED.
	It it either stored as array, but more likely as linked list.
	Anyway, we need to store it as array of structs, not as linked list.
	But for sure not as the next EED overwriting the previous.

	* src/common_entity_handle_data.spec: Add support for more entity
	  fields R_2010+: simplify nolinks, add color_handle, add
	  has_*_visualstyle R_2010+.
	* src/dwg.h: add Dwg_Eed_Data, Dwg_Eed structs, num_eed + Dwg_Eed *eed in
	  entity and object, add color_handle, *_visualstyle.
	* src/decode.c (dwg_decode_entity, dwg_decode_object): add num_eed,
	  minor rewrite of eed.
	  add RLL support for picture_size R_2007+, add has_*_visualstyle R_2010+.
	* src/encode.c (dwg_encode_entity, dwg_encode_object): likewise.

2018-03-27  Reini Urban  <rurban@cpan.org>

	maint: add error messages, copyright header
	* src/reedsolomon.c: add copyright header, if DEBUG unused coe
	* src/decode_r2007.c: add LOG_ERROR messages to the error branches

	fix test/testcases default
	worked ok via make check, but not from the cmdline

	maint of examples/load_dwg.py
	fix the name in usage,
	fix style

	cleanup testcases
	fix the remaining warnings, cleanup the remaining junk
	boilerplate, add decls.

2018-03-27  Reini Urban  <rurban@cpan.org>

	win32: unknown conversion type character h in format
	for RC on mingw64

	* src/dwg.h: special-case FORMAT_RC on windows.

2018-03-27  Reini Urban  <rurban@cpan.org>

	fix examples/dwg2svg2: get the center
	* examples/dwg2svg2.c: circle.center was never initialized.
	  fix the paperspace limits calculation: LIM not EXT.
	  use double, not float.
	* examples/dwg_ps.c: use double, not float.

2018-03-27  Reini Urban  <rurban@cpan.org>

	more work on R2010 objects
	And assert on invalid section/page sizes and counts.
	all r2007_file_header values for r2010 are still invalid.
	for 2007 only some.

	* src/decode.c (dwg_decode_data): enhance version mapper to all.
	  simplify the warn and error messages for unknown versions.
	  (resolve_objectref_vector): return success code.
	  (decode_R2004): delete unused File Header Data fields, now parsed via spec (also encodable).
	* src/decode_r2007.c: add DBG_MAX_COUNT, DBG_MAX_SIZE asserts.
	* src/dwg.h, src/dwg.spec: more R2010+ fields for ATTRIB, ATTDEF, DIMENSION*.

2018-03-27  Reini Urban  <rurban@cpan.org>

	decode: demote some LOG_ERROR to LOG_WARN
	they are harmless mostly. libdxfrw just ignores them and much more.
	And LOG_ERROR should really panic, not continue.

	rename examples, dwg prefix
	all this to be able to use bin_PROGRAMS for faster
	debugging cycles, without tests or long cmdlines.
	anyway: rewrite => dwgrewrite, test => dwgread,
	testSVG => dwg2SVG, testsvg2 => dwg2svg2, get_bmp => dwgbmp

	Makefile.am: build examples before the tests
	often we need to test via an example before running the full
	testsuite

2018-03-27  Reini Urban  <rurban@cpan.org>

	fix the dxfname, no final *
	the last char is always \0, don't replace it with *.
	the len BS includes the final \0, but we keep that.
	we only store the ASCIIZ anyway.

	also don't replace unprintable chars with ~.
	we do support encode and codepages conversion later.
	with codepages isprint() is relative.
	thus unprintable chars can only be replaced in temp. print helpers.

2018-03-27  Reini Urban  <rurban@cpan.org>

	fix auxheader, trace types
	* src/auxheader.spec: RS unknown[10] => RS unknown_rs[6] + RL zero_l[5],
	  print unknown_rs as hex.
	* src/dwg.h: print RC as 0x%hhx and BB as %uc.
	* src/logging.h: add final \n to LOG_ERROR and LOG_WARN.
	* src/dec_macros.h: trace the types also. needed for analysis.

	fixup make distcheck for test-data
	TODO: txttoxml.py: if built from a non-writable srcdir writing
	to the srcdir/test-data/*.xml will fail. eg make distcheck
	The XML must be written into the builddir.

	travis: add python-libxml2

	decode_r2007: use inttypes
	use proper %PRIu64 for %lld format types.
	on 64bit %lld is for long long, but we have only simple uint64_t

2018-03-27  Reini Urban  <rurban@cpan.org>

	add WIPEOUT entity
	not an object, rather a IMAGE.
	also: fix obj->bitsize to BITCODE_RL,

	disable reading some unknown objects/entities, we have better code to deal
	with that.

2018-03-27  Reini Urban  <rurban@cpan.org>

	more unit-testing cleanup
	coding-style, less useless comments,
	fix some types, esp. TEXT vert_align, horiz_align,
	remove some more output_object() funcs.

	rename example.dwg to example_2000.dwg
	use versioned dwg names

	xmlsuite: move txttoxml.py
	move txttoxml.py from test-data to xmlsuite, where it belongs to.
	add skeletons for test-data/{r13,r14,2018}

	dwg.h: rename 4 internal _dwg_bitecode_* to _dwg_bitcode_3bd
	unused internally and in the API

	README, TODO: update
	* README: update outdated info
	* TODO: update outdated info
	* src/dwg.spec: add my name

2018-03-27  Reini Urban  <rurban@cpan.org>

	api: add missing entities
	OLEFRAME, OLE2FRAME, DUMMY, LONG_TRANSACTION, PROXY_ENTITY, IMAGE
	were missing the block extractor and object extractors.

	rename internal 3D_FACE type to 3DFACE for consistency:
	_dwg_entity_3D_FACE => _dwg_entity_3DFACE

2018-03-27  Reini Urban  <rurban@cpan.org>

	encode: limit the scope of obj, _obj
	to the enclosing block only. these are temp. values
	used in the helper macros. Fixes -Wshadow warnings

	src: fix format types
	in LOG calls, detected by the new type strictness

	Fix {vert,horiz}_align type from double to short
	and properly document it

	cleanup testcases
	use proper types, only one error,
	and much less trash.
	it really should have be written with type macros,
	but now this might be too much work for no gain.

	Move test-data DWGs into one global place

	refactor test dirs
	under one single base dir test. dejagnu only used for testcases.
	TODO: test-data

	cleanup unit-tests
	use proper types, only one error,
	and much less trash.
	it really should have be written with type macros,
	but now this might be too much work for no gain.

	dwg.h: better description of the raw types

2018-03-27  Reini Urban  <rurban@cpan.org>

	strict uint32_t/BITCODE_RL types
	not really long on 64bit systems.
	add RLL type support.
	be strict about BITCODE_BS, BITCODE_BL types.

	Note that the raw RS RL ... types are not native raw. They are network-encoded,
	i.e. big-endian. so they need to swap words.

2018-03-27  Reini Urban  <rurban@cpan.org>

	new Dwg_R2004_Header, use r2004_file_header.spec
	* src/decode.c: use new dec_macros.h,
	  avoid -Wshadow, put spec readers into its separate blocks,
	  indentation, unuse _2004_header_data, rather put into the global
	  Dwg_Struct, use the new "r2004_file_header.spec".
	* src/decode_r2007.c (decrypt_block): added
	* src/dwg.h: use stdint types also for BITCODE_BL (not long, uint32_t),
	  add BITCODE_RLL (uint64_t) for decode_r2007,
	  identify some more header fields,
	  add r2004_header, with padding.
	* src/dwg.c: use FORMAT_* types.

	add dec_macros.h, r2004_file_header.spec, spec.h
	decode macros are to be used for src/decode_r2007.c also.
	extract the common spec macros.
	add r2004_file_header.spec for the 2004 File Header,
	and fix two addresses there.

	automake: harmonize LDADD

	decode_r2007.c: import rs_decode_block
	* src/decode_r2007.c: import rs_decode_block
	* src/reedsolomon.c: whitespace, GNU formatted

2018-03-27  Alex Papazoglou  <papazoga@gmail.com>

	Reed-Solomon (255,239) codec.
	Two routines, rs_encode_block() and rs_decode_block() are provided.
	The first will encode a block, depositing the 16 parity bytes in a
	caller-preallocated buffer. The second decodes a block; if there
	are errors it optionally fixes them in place using the Euclidean
	algorithm. Two example programs are provided to demonstrate.

	rurban: guarded malloc.h

	* examples/rsdecode.c: decode a stream
	* examples/rsencode.c: encode a stream
	* Makefile.am: added reedsolomon.c
	* decode_r2007.c: incorporated rs_decode_block()
	* reedsolomon.c: Reed-Solomon codec.

2018-03-27  Reini Urban  <rurban@cpan.org>

	cosmetics

	fix parenthandle code in 2 classes
	with r2000 MLINESTYLE and DICTIONARY parenthandle codes are 8, not 4.

2018-03-27  Reini Urban  <rurban@cpan.org>

	more C99: add stdint.h, inttypes.h
	needed only for the bits_test.c testcase, which
	needs uint16_t.
	But it is used in bits, even publicly, so put it into
	common.h

	* src/common.h: include config.h, <stdint.h>, <inttypes.h>.
	* src/bits.c: include <stdint.h>, <inttypes.h>.

2018-03-27  Reini Urban  <rurban@cpan.org>

	examples: add config.h
	for better inttypes

	* examples/dwg_ps.c: add config.h
	* examples/get_bmp.c: add config.h
	* examples/load_dwg.c: add config.h
	* examples/rewrite.c: add config.h
	* examples/test.c: add config.h
	* examples/testSVG.c: add config.h
	* examples/testsvg2.c: add config.h

2018-03-27  Reini Urban  <rurban@cpan.org>

	add WIPEOUT
	undocumented class, but seen in the wild

	cleanup public headers
	no c++ comments,
	check STDC optionally for better inttypes
	use inttypes for uint16_t vs %hu
	remove logging.h dependency

2018-03-27  Reini Urban  <rurban@cpan.org>

	more automake improvements
	add AM_SILENT_RULES.
	add missing DIST files, fixes distcheck.
	testsuite/testcases: add -lm, failed on linux/gcc, passed on the smokers and
	everywhere else.

	* Makefile.am: add LIBTOOL_DISTCLEAN_FILES.
	* configure.ac: add AM_SILENT_RULES.
	* src/Makefile.am: add EXTRA_HEADERS, esp. the new specs.
	* testsuite/testcases/Makefile.am: add -lm to LDADD
	* testsuite/xmlsuite/Makefile.am: remove CFLAGS exception,
	  it is now globally

2018-03-27  Reini Urban  <rurban@cpan.org>

	.appveyor.yml: skip dejagnu on cygwin for now
	fails to link for some unknwn reason. passes all configure probes tests.
	See https://github.com/rurban/libredwg/issues/1

	rename CELLSTYLEMAP_Cell.class to .type
	a reserved keyword

	more header_vars: FLAGS, ...
	split FLAGS into some known flags,
	set defaults for some new vars,
	BLIPMODE, DIMSAV are used earlier than R13,
	the 4 unknown texts are used only before R_2007

	Fix the DIMJUST bug
	DIMTDEC was missing, a few lines above.

	change RS, BS to uint16_t
	a true short.

	add auxheader.spec
	previously known as unknown section 5

2018-03-27  Reini Urban  <rurban@cpan.org>

	More objects and versions
	Prepare for all the old versions.
	Add most missing new objects/classes.

	Rename IMAGEDEFREACTOR to IMAGEDEF_REACTOR, same as the dxf class name.
	Add CELLSTYLEMAP, FIELD/AcDbField, VISUALSTYLE (undocumented fields, probably
	just a hard pointer to its dictionary).
	Add typed obejcts: OLEFRAME, DUMMY, LONG_TRANSACTION, PROXY_ENTITY, PROXY_OBJECT.
	Class/Object VBA_PROJECT is probably just handled in its own special section.

	Fix the text_area_is_present global variable, only set in decode, and make
	it a private field.

	Use 4BITS for the view_mode.

	Better named warn messages on unknown objects: print the unhandled/unknown name.
	Remove duplicate DIMJUST header_variable !?!

	Find name for TSTACKALIGN, TSTACKSIZE header_variables.
	Add LOG_WARN macro.

2018-03-27  Reini Urban  <rurban@cpan.org>

	Add to ChangeLog
	the missing entries since 2010-07-21

	* ChangeLog: add missing entries

2018-03-27  Reini Urban  <rurban@cpan.org>

	cygwin libtools -no-undefined
	to be able to make a shared lib, without only static.

	* src/Makefile.am (libredwg_la_LDFLAGS): add -no-undefined for cygwin.

2018-03-27  Reini Urban  <rurban@cpan.org>

	abstract common file header into header.spec
	The header is basically the same for all versions.
	we read until num_sections, resp. the first encrypted block

	* src/header.spec: added.
	* src/decode.c (decode_R13_R15,decode_R2004,decode_R2007): use header.spec.
	* src/encode.c: use header.spec.
	* src/dwg.c: fix indentation, rename stk to dwg
	* src/dwg.h: named struct Dwg_Header, add header.spec variables

2018-03-27  Reini Urban  <rurban@cpan.org>

	add read+write r2004 header
	until the encryption at 0x80

	rework file header <=r15
	fill in the missing file header bits, for encode
	to be byte equal.
	rename unknown 1 section to 5 (which it is).

	configure.ac: set CFLAGS=-g
	no optimization yet needed. turn it on later

2018-03-27  Reini Urban  <rurban@cpan.org>

	.travis.yml: debug make distcheck
	only failing remotely. ok locally

	* .travis.yml: fixup make distcheck

2018-03-27  Reini Urban  <rurban@cpan.org>

	Cleanup the CRC error messages

2018-03-27  Reini Urban  <rurban@cpan.org>

	Fix the section 0 crc comparison, add HANDLE logging
	CRC was already read by header_vars.spec into the CRC field.
	Don't read it again. The initial crc check passes now.

	Separate HANDLE from INSANE logging levels. INSANE for the individual
	VECTOR values, i.e. string and binary content.

2018-03-27  Reini Urban  <rurban@cpan.org>

	fix crc, rename bit_ckr8 to bit_calc_CRC
	export bit_calc_CRC: it is used by decode.c
	use uint16_t to guarantee proper overflow.

	rewrite does now write examples/example.dwg successfully.

	translate more bit_datenaro

	* src/bits.c, src/bits.h: use uint16_t for the seed and crc,
	  rename bit_ckr8 to bit_calc_CRC.
	* configure.ac: add AC_TYPE_UINT16_T
	* src/decode.c, testsuite/testcases/bits_test.c: use renamed
	  bit_calc_CRC function

2018-03-27  Reini Urban  <rurban@cpan.org>

	doc: add basic types

	rewrite.exe alive.test fix

	testcases: fix more wrong types

2018-03-27  Reini Urban  <rurban@cpan.org>

	refactor both unit tests
	extract the common function output_object
	into common.c via the arg DWG_TYPE.

	fix some wrong leftover float and int types.

2018-03-27  Reini Urban  <rurban@cpan.org>

	fix more dwg_api int types
	to the BITCODE types.
	There were still several errors, found out in the
	unit tests.

	unit-testing: fix wrong float variables
	to double

	decode_r2007: add missing function declarations
	* src/decode_r2007.c: add missing function declarations.

2018-03-27  Reini Urban  <rurban@cpan.org>

	examples/Makefile.am: add CLEANFILES
	and check-syntax.
	Fixes make distcheck.

	* examples/Makefile.am: add CLEANFILES, check-syntax

2018-03-27  Reini Urban  <rurban@cpan.org>

	fix examples/dwg_ps
	* examples/Makefile.am: fix dwg_ps_LDADD.
	* examples/dwg_ps.c: various fixes.

	print.c: declare assert.h
	used in dwg.spec: assert(FIELD_VALUE(scale_flag) == 0)

	dwg_encode_chains: initialize ckr_missing
	at the beginning, not just in the loop.

	MINSERT spec
	* src/dwg.spec (MINSERT):
	  fix check logic: no multiple x == y == z expr,
	  avoid sequence point problems when initializing:
	  x=y=z=1.0

	dwg_encode_chains: fix handle swap code
	* src/encode (dwg_encode_chains): fixed the handle swap code

	fix detected warnings
	duplicate decarations, unused variables,
	declaration after statement, ...

2018-03-27  Reini Urban  <rurban@cpan.org>

	fix SWIG_LIB windows newline
	mingw64 swig -swiglib prints a newline after each lib,
	there are two:
	SWIG_LIB = C:\msys64\MINGW64\bin\Lib
	C:/msys64/MINGW64/share/swig/3.0.12

	* m4/ax_pkg_swig.m4: strip \r\n in SWIG_LIB

2018-03-27  Reini Urban  <rurban@cpan.org>

	probe for warn, mingw and valgrind
	Add probes for mingw cross-compilation (testing via wine),
	c99, compile-time SIZEOF(size_t) (for BLL, ULL),
	useful warning flags and valgrind.
	This caught a lot of errors.

	* configure.ac: add many probes
	* src/Makefile.am: add @WARN_CFLAGS@
	* testsuite/testcases/Makefile.am: add @WARN_CFLAGS@, @VALGRIND_CHECK_RULES@
	* testsuite/xmlsuite/Makefile.am: add @VALGRIND_CHECK_RULES@
	* unit-testing/Makefile.am: add @WARN_CFLAGS@, @VALGRIND_CHECK_RULES@
	* .gitignore: adjust for m4 changes
	* m4/.placeholder: not longer needed.
	* m4/ax_append_compile_flags.m4: added.
	* m4/ax_append_flag.m4: added.
	* m4/ax_append_link_flags.m4: added.
	* m4/ax_check_compile_flag.m4: added.
	* m4/ax_check_link_flag.m4: added.
	* m4/ax_compile_check_sizeof.m4: added.
	* m4/ax_compiler_flags.m4: added.
	* m4/ax_compiler_flags_cflags.m4: added.
	* m4/ax_compiler_flags_gir.m4: added.
	* m4/ax_compiler_flags_ldflags.m4: added.
	* m4/ax_is_release.m4: added.
	* m4/ax_require_defined.m4: added.
	* m4/ax_valgrind_check.m4: added.

2018-03-27  Reini Urban  <rurban@cpan.org>

	add .appveyor.yml
	Tested at https://ci.appveyor.com/project/rurban/libredwg.
	This is optional, but can be used to create binary releases
	for windows/cygwin

2018-03-27  Reini Urban  <rurban@cpan.org>

	fix make distcheck
	add missing EXTRA_DIST files

	* unit-testing/Makefile.am: add common.c to EXTRA_DIST,
	  fix AM_CFLAGS for make distcheck.

2018-03-27  Reini Urban  <rurban@cpan.org>

	doc: fill in some basics

2018-03-27  Reini Urban  <rurban@cpan.org>

	libredwg.la: direct -lm dependency
	we use now nan() in the API code.

	* src/Makefile.am: add -lm to libredwg_la_LDFLAGS.
	* examples/Makefile.am: remove -lm from LDADD,
	  use LDADD not AM_LDFLAGS,
	  add -Wall to AM_CFLAGS.
	* testsuite/testcases/Makefile.am: remove -lm from LDADD.
	* testsuite/xmlsuite/Makefile.am: remove -lm from LDADD.
	* unit-testing/Makefile.am: remove -lm from LDADD.

2018-03-27  Reini Urban  <rurban@cpan.org>

	unit-testing/Makefile.am: add -lm
	for nan(). clang does not have it, only gcc

	configure.ac: whitespace

	use python_PYTHON
	fixed make distcheck. See https://www.gnu.org/software/automake/manual/html_node/Python.html

	add a .travis.yml
	configured at https://travis-ci.org/rurban/libredwg/
	but you can clone and configure your own. it's optional.

	support rewrite as other version
	when encoding into another version than the original
	dwg version, check and ignore empty handles, and
	use empty strings, and numbers as default.

2018-03-27  Reini Urban  <rurban@cpan.org>

	build: make swig and dejagnu optional
	make python bindings only with swig and python.
	run dejagnu tests only with dejagnu.

	* Makefile.am: optional bindings and testsuite SUBDIRS.
	* testsuite/Makefile.am: optional testcases SUBDIRS.
	* configure.ac: export HAVE_DEJAGNU and HAVE_SWIG_PYTHON to automake.

2018-03-27  Reini Urban  <rurban@cpan.org>

	fix swig with stdint.h
	skip importing from stdint.h, but we need
	dwg.i importing from dwg.h and dwg_api.h.

	* src/dwg.h: no SWIGIMPORTED for stdint.h.
	* bindings/python/Makefile.am (swig_wrap_python.c): remove
	  -I/usr/include.

2018-03-27  Reini Urban  <rurban@cpan.org>

	src/Makefile.am: cleanup
	no functional changes.

	* src/Makefile.am: minor cleanup, no changes.

2018-03-27  Reini Urban  <rurban@cpan.org>

	Fix bit_write_4BITS
	and its testcase bit_write_4BITS_tests.
	simply write 4 bits. used in VIEW view_mode.
	All testcases pass now.

	* src/bits.c (bit_write_4BITS): fix implementation.
	* testsuite/testcases/bits_test.c: enhance tests a bit, print the
	  failing result, no functional changes.

2018-03-27  Reini Urban  <rurban@cpan.org>

	fix testcases/lwpline
	wrong flags type, fix to BITCODE_BS.

	* testsuite/testcases/lwpline.c: fix flags type

2018-03-27  Reini Urban  <rurban@cpan.org>

	testcases: fix wrong float
	testcases used float with too low numeric precision to pass the tests.
	fix to BITCODE_BD ie double.
	Remaining test errors: bit_write_4BITS, lwpline reading flag

	* testsuite/testcases/arc.c,
	  testsuite/testcases/attdef.c,
	  testsuite/testcases/attrib.c,
	  testsuite/testcases/circle.c,
	  testsuite/testcases/ellipse.c,
	  testsuite/testcases/line.c,
	  testsuite/testcases/minsert.c,
	  testsuite/testcases/mline.c,
	  testsuite/testcases/mtext.c,
	  testsuite/testcases/point.c,
	  testsuite/testcases/polyline_2d.c,
	  testsuite/testcases/shape.c,
	  testsuite/testcases/solid.c,
	  testsuite/testcases/text.c,
	  testsuite/testcases/tolerance.c,
	  testsuite/testcases/trace.c: change float to  BITCODE_BD

2018-03-27  Reini Urban  <rurban@cpan.org>

	work on testsuites
	on macports with make check PYTHON=/opt/local/bin/python2.7

	examples/alive.test: TODO the rewrite tests
	until we can fix them

2018-03-27  Reini Urban  <rurban@cpan.org>

	python: depend on src/dwg.h
	and add -I/usr/include for stdint.h (for uint64_t).

	Note that on macports with gcc-mp-x you need to use the
	gcc-specific -I/opt/local/lib/gcc6/gcc/x86_64-apple-darwin15/6.4.0/include
	instead.
	And build with the system python, but run the
	tests with macports python make check PYTHON=/opt/local/bin/python2.7

	* bindings/python/Makefile.am: depend on src/dwg.h, add
	  -I/usr/include for stdint.h

2018-03-27  Reini Urban  <rurban@cpan.org>

	WIP Start R_2013, R_2018 support, stricter types, ...
	add missing types, header variables, ...
	read and write  3B and BLL types, BLL: 64bit only.
	(this drops support for 32bit only, without uin64_t.
	maybe probe for that)

2018-03-15  Reini Urban  <rurban@cpan.org>

	cygwin libtools -no-undefined
	* src/Makefile.am (libredwg_la_LDFLAGS): add -no-undefined for cygwin.

2018-03-15  Reini Urban  <rurban@cpan.org>

	abstract common file header into header.spec
	* src/header.spec: added.
	* src/decode.c (decode_R13_R15,decode_R2004,decode_R2007): use header.spec.
	* src/encode.c: use header.spec.
	* src/dwg.c: fix indentation, rename stk to dwg
	* src/dwg.h: named struct Dwg_Header, add header.spec variables

2018-03-15  Reini Urban  <rurban@cpan.org>

	add read+write r2004 header
	until the encryption at 0x80

2018-03-15  Reini Urban  <rurban@cpan.org>

        * src/dwg.h: rework file header <=r15,
        fill in the missing file header bits, for encode
	to be byte equal.
        * src/decode.c (decode_R13_R15): rename unknown 1 section to 5
        (which it is).
	* src/bits.c: style

2018-03-15  Reini Urban  <rurban@cpan.org>

	configure.ac: set CFLAGS=-g
	no optimization yet needed. turn it on later

2018-03-15  Reini Urban  <rurban@cpan.org>

	.travis.yml: debug make distcheck
	* .travis.yml: fixup make distcheck

2018-03-15  Reini Urban  <rurban@cpan.org>

	Cleanup the CRC error messages

2018-03-15  Reini Urban  <rurban@cpan.org>

	Fix the section 0 crc comparison, add HANDLE logging
	CRC was already read by header_vars.spec into the CRC field.
	Don't read it again. The initial crc check passes now.

	Separate HANDLE from INSANE logging levels. INSANE for the individual
	VECTOR values, i.e. string and binary content.

2018-03-15  Reini Urban  <rurban@cpan.org>

	fix crc, rename bit_ckr8 to bit_calc_CRC
	* src/bits.c, src/bits.h: use uint16_t for the seed and crc,
	  rename bit_ckr8 to bit_calc_CRC.
	* configure.ac: add AC_TYPE_UINT16_T
	* src/decode.c, testsuite/testcases/bits_test.c: use renamed
	  bit_calc_CRC function

2018-03-15  Reini Urban  <rurban@cpan.org>

	doc: add basic types

2018-03-15  Reini Urban  <rurban@cpan.org>

	rewrite.exe alive.test fix

2018-03-15  Reini Urban  <rurban@cpan.org>

	testcases: fix more wrong types

2018-03-15  Reini Urban  <rurban@cpan.org>

	refactor both unit tests
	extract the common function output_object
	into common.c via the arg DWG_TYPE.

	fix some wrong leftover float and int types.

2018-03-15  Reini Urban  <rurban@cpan.org>

	fix more dwg_api int types
	to the BITCODE types.
	There were still several errors, found out in the
	unit tests.

2018-03-15  Reini Urban  <rurban@cpan.org>

	unit-testing: fix wrong float variables
	to double

2018-03-15  Reini Urban  <rurban@cpan.org>

	decode_r2007: add missing function declarations
	* src/decode_r2007.c: add missing function declarations.

2018-03-15  Reini Urban  <rurban@cpan.org>

	examples/Makefile.am: add CLEANFILES
	* examples/Makefile.am: add CLEANFILES, check-syntax

2018-03-15  Reini Urban  <rurban@cpan.org>

	fix examples/dwg_ps
	* examples/Makefile.am: fix dwg_ps_LDADD.
	* examples/dwg_ps.c: various fixes.

2018-03-15  Reini Urban  <rurban@cpan.org>

	print.c: declare assert.h
	used in dwg.spec: assert(FIELD_VALUE(scale_flag) == 0)

2018-03-15  Reini Urban  <rurban@cpan.org>

	dwg_encode_chains: initialize ckr_missing
	at the beginning, not just in the loop.

2018-03-15  Reini Urban  <rurban@cpan.org>

	MINSERT spec
	* src/dwg.spec (MINSERT):
	  fix check logic: no multiple x == y == z expr,
	  avoid sequence point problems when initializing:
	  x=y=z=1.0

2018-03-15  Reini Urban  <rurban@cpan.org>

	dwg_encode_chains: fix handle swap code
	* src/encode (dwg_encode_chains): fixed the handle swap code

2018-03-15  Reini Urban  <rurban@cpan.org>

	fix detected warnings
	duplicate decarations, unused variables,
	declaration after statement, ...

2018-03-15  Reini Urban  <rurban@cpan.org>

	fix SWIG_LIB windows newline
	* m4/ax_pkg_swig.m4: strip \r\n in SWIG_LIB

2018-03-15  Reini Urban  <rurban@cpan.org>

	probe for warn, mingw and valgrind
	* configure.ac: add many probes
	* src/Makefile.am: add @WARN_CFLAGS@
	* testsuite/testcases/Makefile.am: add @WARN_CFLAGS@, @VALGRIND_CHECK_RULES@
	* testsuite/xmlsuite/Makefile.am: add @VALGRIND_CHECK_RULES@
	* unit-testing/Makefile.am: add @WARN_CFLAGS@, @VALGRIND_CHECK_RULES@
	* .gitignore: adjust for m4 changes
	* m4/.placeholder: not longer needed.
	* m4/ax_append_compile_flags.m4: added.
	* m4/ax_append_flag.m4: added.
	* m4/ax_append_link_flags.m4: added.
	* m4/ax_check_compile_flag.m4: added.
	* m4/ax_check_link_flag.m4: added.
	* m4/ax_compile_check_sizeof.m4: added.
	* m4/ax_compiler_flags.m4: added.
	* m4/ax_compiler_flags_cflags.m4: added.
	* m4/ax_compiler_flags_gir.m4: added.
	* m4/ax_compiler_flags_ldflags.m4: added.
	* m4/ax_is_release.m4: added.
	* m4/ax_require_defined.m4: added.
	* m4/ax_valgrind_check.m4: added.

2018-03-15  Reini Urban  <rurban@cpan.org>

	add .appveyor.yml
	Tested at https://ci.appveyor.com/project/rurban/libredwg.
	This is optional, but can be used to create binary releases
	for windows/cygwin

2018-03-14  Reini Urban  <rurban@cpan.org>

	fix make distcheck
	* unit-testing/Makefile.am: add common.c to EXTRA_DIST,
	  fix AM_CFLAGS for make distcheck.

2018-03-14  Reini Urban  <rurban@cpan.org>

	doc: fill in some basics

2018-03-14  Reini Urban  <rurban@cpan.org>

	libredwg.la: direct -lm dependency
	* src/Makefile.am: add -lm to libredwg_la_LDFLAGS.
	* examples/Makefile.am: remove -lm from LDADD,
	  use LDADD not AM_LDFLAGS,
	  add -Wall to AM_CFLAGS.
	* testsuite/testcases/Makefile.am: remove -lm from LDADD.
	* testsuite/xmlsuite/Makefile.am: remove -lm from LDADD.
	* unit-testing/Makefile.am: remove -lm from LDADD.

2018-03-14  Reini Urban  <rurban@cpan.org>

	unit-testing/Makefile.am: add -lm
	for nan(). clang does not have it, only gcc

2018-03-14  Reini Urban  <rurban@cpan.org>

	configure.ac: whitespace

2018-03-14  Reini Urban  <rurban@cpan.org>

	use python_PYTHON.
        fixed make distcheck. See
        https://www.gnu.org/software/automake/manual/html_node/Python.html

2018-03-14  Reini Urban  <rurban@cpan.org>

	add a .travis.yml
	configured at https://travis-ci.org/rurban/libredwg/
	but you can clone and configure your own. it's optional.

2018-03-13  Reini Urban  <rurban@cpan.org>

	support rewrite as other version
	when encoding into another version than the original
	dwg version, check and ignore empty handles, and
	use empty strings, and numbers as default.

2018-03-13  Reini Urban  <rurban@cpan.org>

	build: make swig and dejagnu optional
	* Makefile.am: optional bindings and testsuite SUBDIRS.
	* testsuite/Makefile.am: optional testcases SUBDIRS.
	* configure.ac: export HAVE_DEJAGNU and HAVE_SWIG_PYTHON to automake.

2018-03-13  Reini Urban  <rurban@cpan.org>

	fix swig with stdint.h
	* src/dwg.h: no SWIGIMPORTED for stdint.h.
	* bindings/python/Makefile.am (swig_wrap_python.c): remove
	  -I/usr/include.

2018-03-13  Reini Urban  <rurban@cpan.org>

	src/Makefile.am: cleanup
	* src/Makefile.am: minor cleanup, no changes.

2018-03-13  Reini Urban  <rurban@cpan.org>

	Fix bit_write_4BITS
	* src/bits.c (bit_write_4BITS): fix implementation.
	* testsuite/testcases/bits_test.c: enhance tests a bit, print the
	  failing result, no functional changes.

2018-03-13  Reini Urban  <rurban@cpan.org>

	fix testcases/lwpline
	* testsuite/testcases/lwpline.c: fix flags type

2018-03-13  Reini Urban  <rurban@cpan.org>

	testcases: fix wrong float
	* testsuite/testcases/arc.c,
	  testsuite/testcases/attdef.c,
	  testsuite/testcases/attrib.c,
	  testsuite/testcases/circle.c,
	  testsuite/testcases/ellipse.c,
	  testsuite/testcases/line.c,
	  testsuite/testcases/minsert.c,
	  testsuite/testcases/mline.c,
	  testsuite/testcases/mtext.c,
	  testsuite/testcases/point.c,
	  testsuite/testcases/polyline_2d.c,
	  testsuite/testcases/shape.c,
	  testsuite/testcases/solid.c,
	  testsuite/testcases/text.c,
	  testsuite/testcases/tolerance.c,
	  testsuite/testcases/trace.c: change float to  BITCODE_BD

2018-03-13  Reini Urban  <rurban@cpan.org>

	work on testsuites
	on macports with make check PYTHON=/opt/local/bin/python2.7

2018-03-13  Reini Urban  <rurban@cpan.org>

	examples/alive.test: TODO the rewrite tests
	until we can fix them

2018-03-13  Reini Urban  <rurban@cpan.org>

	python: depend on src/dwg.h
	* bindings/python/Makefile.am: depend on src/dwg.h, add
	  -I/usr/include for stdint.h

2018-03-13  Reini Urban  <rurban@cpan.org>

	WIP Start R_2013, R_2018 support, stricter types, ...
	add missing types, header variables, ...
	read and write  3B and BLL types, BLL: 64bit only.
	(this drops support for 32bit only, without uin64_t.
	maybe probe for that)

2018-03-12  Pero Brbora  <pbrbora@stud.unidu.hr>

	testsuite/testcases/endblk.c (api_process): Compare test values.

2018-03-12  Reini Urban  <rurban@cpan.org>

	dwg.spec: ANYCODE for parent, next, prev
	* src/common_entity_handle_data.spec: prev_entity may be 4 or 8,
	  prev_entity may be 4 or 6, change to ANYCODE.
	* src/dwg.spec: XRECORD whitespace

2018-03-12  Reini Urban  <rurban@cpan.org>

	dwg.spec: handle insert_count
	* src/decode.c, src/encode.c, src/print.c, src/dwg.spec:
	  add FIELD_INSERT_COUNT fixing print and encode of insert_count.
	  add FIELD_TRACE as separate helper.
	  add FIELD_HANDLE_N helper to print the actual vcount index.
	* src/encode.c (FIELD_HANDLE): add assertions and LOG_ERROR
	  when handle_code deviates
	  (HANDLE_VECTOR_N): add assertions.
	  (dwg_encode_add_object): change long unsigned int to unsigned long

2018-03-12  Reini Urban  <rurban@cpan.org>

	dwg.spec: layout_handle in BLOCK_HEADER is code 5

2018-03-12  Reini Urban  <rurban@cpan.org>

	xmlsuite: unsigned char* conversion
	* testsuite/xmlsuite/common.c: replace char with xmlChar as used in libxml2
	* testsuite/xmlsuite/testsuite.c: ditto

2018-03-12  Reini Urban  <rurban@cpan.org>

	fixup examples
	* examples/alive.test: rewrite needs two args
	* examples/rewrite.c: need USE_WRITE, fixup error message
	* examples/testsvg2.c: add log_if_error checks, add argv[1] check,
	    fix c99 block decl, fix handle returning a handle, not struct.
	* get_bmp.c: unsigned char* dwg_bmp

2018-03-12  Reini Urban  <rurban@cpan.org>

	fix dwg_api
	* src/dwg_api.{c,h}:
	  add missing checks for an empty 2nd arg
	  add missing return values in the error case.
	  LOG_ERROR

	  declare all accessors, fixing x86_64
	  E.g. fixing http://lists.gnu.org/archive/html/libredwg/2017-07/msg00000.html
	  caused by the wrong default type being added for the undeclared functions,
          capping pointers at 32bit.

	  change TV from unsigned char* to char*, only the internal
	  methods need to use unsigned char*. harmonized with the external field types.

	  changed *get_block_size accessors to return the natural unsigned
          long * type, not long *.

	  change API to return pointers, not structs for:
          dwg_obj_appid_get_appid_control, dwg_obj_get_handle,
          dwg_ent_insert_get_ref_handle

	* src/api.h, src/api.c: deleted
	* Makefile.am: add .c.i: and check-syntax emacs flymake targets

2018-03-11  Reini Urban  <rurban@cpan.org>

	[maint] Fix compilation errors and warnings
	* configure.ac: probe for malloc.h.
	* src/decode.c: global loglevel, static variable 'loglevel' is used in
	    an inline function with external linkage [-Wstatic-in-inline].
	  dwg_decode_handleref_with_code make global: [-Wstatic-in-inline].
	* src/encode.c: declare dwg_encode_handleref,
	  dwg_encode_handleref_with_code, dwg_encode_common_entity_handle_data,
	  dwg_encode_common_entity_handle_data: declare it as static.
	* src/dwg.c: fix various integer fmt types.
	  get_first_owned_object: error with Unsupported version.
	  get_next_owned_object: error with Unsupported version.
	  declare dwg_encode_chains.
	* src/dwg_api.c: check HAVE_MALLOC_H.
	* .gitignore: add TAGS.

2015-12-11  gaganjyot  <thegaganx@gmail.com>

	[Fix] Memory Errors

2015-03-29  Thien-Thi Nguyen  <ttn@gnu.org>

	[v] Remove "make-check"-generated .xml files from repo.
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Arc.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2000/ConstructionLine.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Donut.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Ellipse.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Helix.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Line.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Multiline.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Point.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2000/PolyLine3D.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Polygon.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Polyline.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2000/RAY.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Spline.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Text.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2000/circle.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Arc.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2004/ConstructionLine.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Donut.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Ellipse.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Helix.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Line.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Multiline.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Point.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2004/PolyLine3D.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Polygon.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Polyline.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2004/RAY.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Spline.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Text.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2004/circle.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Arc.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2007/ConstructionLine.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Donut.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Ellipse.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Helix.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Line.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Multiline.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Point.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2007/PolyLine3D.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Polygon.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Polyline.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2007/RAY.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Spline.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Text.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2007/circle.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Arc.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2010/ConstructionLine.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Donut.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Ellipse.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Helix.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Line.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Multiline.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Point.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2010/PolyLine3D.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Polygon.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Polyline.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2010/RAY.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Spline.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Text.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2010/circle.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Arc.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2013/ConstructionLine.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Donut.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Ellipse.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Helix.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Line.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Multiline.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Point.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2013/PolyLine3D.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Polygon.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Polyline.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2013/RAY.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Spline.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Text.xml
	* testsuite/xmlsuite/DWG/DWG-Files/2013/circle.xml: Delete file.

2015-03-29  Thien-Thi Nguyen  <ttn@gnu.org>

	[v] Remove another xmlsuite "make check"-generated file.
	* testsuite/xmlsuite/result.htm: Delete file.

2015-03-29  Thien-Thi Nguyen  <ttn@gnu.org>

	[v] Remove xmlsuite "make check"-generated files from repo.
	* testsuite/xmlsuite/test_output/2000/ConstructionLine.xml
	* testsuite/xmlsuite/test_output/2000/Donut.xml
	* testsuite/xmlsuite/test_output/2000/Ellipse.xml
	* testsuite/xmlsuite/test_output/2000/Helix.xml
	* testsuite/xmlsuite/test_output/2000/Line.xml
	* testsuite/xmlsuite/test_output/2000/Multiline.xml
	* testsuite/xmlsuite/test_output/2000/Point.xml
	* testsuite/xmlsuite/test_output/2000/PolyLine3D.xml
	* testsuite/xmlsuite/test_output/2000/Polygon.xml
	* testsuite/xmlsuite/test_output/2000/Polyline.xml
	* testsuite/xmlsuite/test_output/2000/RAY.xml
	* testsuite/xmlsuite/test_output/2000/Spline.xml
	* testsuite/xmlsuite/test_output/2000/Text.xml
	* testsuite/xmlsuite/test_output/2000/circle.xml
	* testsuite/xmlsuite/test_output/2004/Arc.xml
	* testsuite/xmlsuite/test_output/2004/ConstructionLine.xml
	* testsuite/xmlsuite/test_output/2004/Donut.xml
	* testsuite/xmlsuite/test_output/2004/Ellipse.xml
	* testsuite/xmlsuite/test_output/2004/Helix.xml
	* testsuite/xmlsuite/test_output/2004/Line.xml
	* testsuite/xmlsuite/test_output/2004/Multiline.xml
	* testsuite/xmlsuite/test_output/2004/Point.xml
	* testsuite/xmlsuite/test_output/2004/PolyLine3D.xml
	* testsuite/xmlsuite/test_output/2004/Polygon.xml
	* testsuite/xmlsuite/test_output/2004/Polyline.xml
	* testsuite/xmlsuite/test_output/2004/RAY.xml
	* testsuite/xmlsuite/test_output/2004/Spline.xml
	* testsuite/xmlsuite/test_output/2004/Text.xml
	* testsuite/xmlsuite/test_output/2004/circle.xml: Delete files.

2015-03-27  Thien-Thi Nguyen  <ttn@gnu.org>

	[v unit] Fix bug: Handle program invocation w/o args.
	* unit-testing/Makefile.am (TESTS_ENVIRONMENT): New var.
	* unit-testing/common.c (main): Don't blindly operate
	on ‘argv[1]’; instead, use the value of env var ‘INPUT’, if
	available, else print error message and exit failurefully.

2015-03-27  Thien-Thi Nguyen  <ttn@gnu.org>

	[dist] Fix bug: Also distribute example.dwg.
	* unit-testing/Makefile.am (EXTRA_DIST): New target.

2015-03-26  Pero Brbora  <pbrbora@stud.unidu.hr>

	[v xml] Fix bug: Avoid segfault: free only in non-error path.
	* testsuite/testcases/common.c (test_code):
	Don't call ‘dwg_free’ unconditionally; instead, call
	it only in the case where there are no errors.

2015-02-21  Thien-Thi Nguyen  <ttn@gnu.org>

	[boot] Bump minimal version of Automake to 1.12.2.
	* configure.ac (AM_INIT_AUTOMAKE): ...here.

2015-02-20  Thien-Thi Nguyen  <ttn@gnu.org>

	[boot] Don't specify $(srcdir) explicitly.
	* bindings/python/Makefile.am (BUILT_SOURCES): Remove ‘$(srcdir)/’.
	(swig_wrap_python.c): Rename target from ‘$(srcdir)/swig_wrap_python.c’.

2015-02-20  Thien-Thi Nguyen  <ttn@gnu.org>

	[v] Add unit-testing/ to "make check" flow.
	* Makefile.am (SUBDIRS): Add unit-testing, immediately after src.
	* configure.ac (AC_CONFIG_FILES): Add unit-testing/Makefile.
	* unit-testing/Makefile: Delete file.
	* unit-testing/Makefile.am: New file.
	* unit-testing/.gitignore: New file.

2015-02-20  Thien-Thi Nguyen  <ttn@gnu.org>

	[v] Do testing serially.
	* configure.ac (AM_INIT_AUTOMAKE): Add option ‘serial-tests’.

2014-12-10  Thien-Thi Nguyen  <ttn@gnu.org>

	[maint] Remove site.exp files from repo.
	* testsuite/site.exp: Delete file.
	* testsuite/testcases/site.exp: Delete file.

2014-12-05  Thien-Thi Nguyen  <ttn@gnu.org>

	[v] Fix bug: Collapse individual tuple-item assignments.
	* testsuite/xmlsuite/check.py <top-level>:
	  Don't assign to ‘result[0]’ and ‘result[1]’ separately;
	  instead, assign a literal 2-tuple to ‘result’, once.

2014-12-04  Thien-Thi Nguyen  <ttn@gnu.org>

	[v] Make testsuite/testcases progs link against in-tree libredwg.la.
	* testsuite/testcases/Makefile.am
	  (LDADD): New var.
	  (AM_CFLAGS): Delete var.

2014-12-03  Thien-Thi Nguyen  <ttn@gnu.org>

	[v] Explicitly name testsuite/testcases support files.
	* testsuite/testcases/Makefile.am
	  (paired, unpaired): New vars.
	  (check_PROGRAMS): Use $(paired) and $(unpaired).
	  (EXTRA_DIST): Add example.dwg, vertex.mesh, common.c,
	  ole2frame.c; replace ‘check_PROGRAMS’ ref w/ ‘paired’.

2014-11-29  Thien-Thi Nguyen  <ttn@gnu.org>

	[v] Distribute testsuite/testcases support files.
	* testsuite/testcases/Makefile.am (EXTRA_DIST): New var.

2014-11-27  Thien-Thi Nguyen  <ttn@gnu.org>

	[v] Declare helper.py encoding.
	* testsuite/xmlsuite/helper.py:
	  Add Emacs-style ‘coding:’ comment as first line.

2014-11-26  Thien-Thi Nguyen  <ttn@gnu.org>

	[maint] Remove *.pyc files from repo.
	* testsuite/xmlsuite/check.pyc: Delete file.
	* testsuite/xmlsuite/helper.pyc: Delete file.

2014-11-26  Thien-Thi Nguyen  <ttn@gnu.org>

	[v] Streamline invocation of sub-program txttoxml.py.
	* testsuite/xmlsuite/Makefile.am (TESTS_ENVIRONMENT):
	  Also set env var ‘PYTHON’.
	* testsuite/xmlsuite/helper.py: Import ‘glob’.
	  (generatexml): Don't invoke txtgenerate.sh; instead, iterate the
	  invocation of program txttoxml.py over the list of */*.txt files.
	* testsuite/xmlsuite/DWG/DWG-Files/txttoxml.py: Do ‘chmod -x’.
	* testsuite/xmlsuite/DWG/DWG-Files/txtgenerate.sh: Delete file.

2014-11-23  Thien-Thi Nguyen  <ttn@gnu.org>

	[v] Use Python interpreter discovered by configure script.
	* testsuite/xmlsuite/Makefile.am (TESTS_ENVIRONMENT): New var.
	* testsuite/xmlsuite/check.py: Remove shebang; chmod -x.

2014-11-21  Thien-Thi Nguyen  <ttn@gnu.org>

	[v] Make xmlsuite data files non-executable.
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Arc.bak:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Arc.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Arc.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Arc.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/ConstructionLine.bak:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/ConstructionLine.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/ConstructionLine.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/ConstructionLine.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Donut.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Donut.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Donut.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Ellipse.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Ellipse.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Ellipse.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Helix.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Helix.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Helix.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Line.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Line.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Line.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Multiline.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Multiline.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Multiline.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Point.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Point.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Point.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/PolyLine3D.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/PolyLine3D.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/PolyLine3D.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Polygon.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Polygon.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Polygon.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Polyline.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Polyline.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Polyline.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/RAY.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/RAY.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/RAY.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Spline.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Spline.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Spline.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Text.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Text.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/Text.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/circle.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/circle.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2000/circle.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Arc.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Arc.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Arc.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/ConstructionLine.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/ConstructionLine.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/ConstructionLine.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Donut.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Donut.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Donut.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Ellipse.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Ellipse.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Ellipse.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Helix.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Helix.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Helix.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Line.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Line.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Line.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Multiline.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Multiline.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Multiline.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Point.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Point.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Point.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/PolyLine3D.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/PolyLine3D.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/PolyLine3D.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Polygon.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Polygon.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Polygon.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Polyline.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Polyline.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Polyline.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/RAY.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/RAY.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/RAY.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Spline.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Spline.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Spline.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Text.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Text.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/Text.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/circle.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/circle.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2004/circle.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Arc.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Arc.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Arc.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/ConstructionLine.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/ConstructionLine.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/ConstructionLine.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Donut.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Donut.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Donut.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Ellipse.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Ellipse.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Ellipse.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Helix.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Helix.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Helix.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Line.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Line.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Line.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Multiline.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Multiline.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Multiline.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Point.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Point.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Point.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/PolyLine3D.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/PolyLine3D.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/PolyLine3D.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Polygon.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Polygon.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Polygon.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Polyline.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Polyline.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Polyline.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/RAY.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/RAY.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/RAY.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Spline.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Spline.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Spline.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Text.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Text.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/Text.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/circle.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/circle.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2007/circle.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Arc.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Arc.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Arc.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/ConstructionLine.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/ConstructionLine.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/ConstructionLine.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Donut.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Donut.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Donut.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Ellipse.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Ellipse.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Ellipse.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Helix.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Helix.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Helix.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Line.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Line.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Line.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Multiline.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Multiline.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Multiline.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Point.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Point.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Point.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/PolyLine3D.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/PolyLine3D.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/PolyLine3D.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Polygon.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Polygon.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Polygon.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Polyline.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Polyline.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Polyline.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/RAY.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/RAY.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/RAY.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Spline.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Spline.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Spline.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Text.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Text.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/Text.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/circle.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/circle.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2010/circle.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Arc.bak:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Arc.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Arc.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Arc.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/ConstructionLine.bak:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/ConstructionLine.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/ConstructionLine.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/ConstructionLine.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Donut.bak:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Donut.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Donut.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Donut.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Ellipse.bak:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Ellipse.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Ellipse.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Ellipse.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Helix.bak:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Helix.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Helix.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Helix.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Line.bak:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Line.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Line.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Line.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Multiline.bak:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Multiline.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Multiline.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Multiline.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Point.bak:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Point.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Point.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Point.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/PolyLine3D.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/PolyLine3D.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/PolyLine3D.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Polygon.bak:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Polygon.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Polygon.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Polygon.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Polyline.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Polyline.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Polyline.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/RAY.bak:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/RAY.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/RAY.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/RAY.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Spline.bak:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Spline.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Spline.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Spline.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Text.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Text.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/Text.txt:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/circle.bak:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/circle.dwg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/circle.jpg:
	* testsuite/xmlsuite/DWG/DWG-Files/2013/circle.txt: Do ‘chmod -x’.

2014-11-21  Thien-Thi Nguyen  <ttn@gnu.org>

	[v] Distribute xmlsuite support files.
	* testsuite/xmlsuite/Makefile.am (EXTRA_DIST):
	Add DWG, header.htm, helper.py, $(TESTS).

2014-11-19  Thien-Thi Nguyen  <ttn@gnu.org>

	[v] Use ‘LDADD’ and full libredwg.la filename.
	* testsuite/xmlsuite/Makefile.am (LDADD): Rename from
	  ‘AM_LDFLAGS’; specify explicit location of libredwg.la.

2014-11-16  Thien-Thi Nguyen  <ttn@gnu.org>

	[v] Don't forget to distribute common.c.
	* testsuite/xmlsuite/Makefile.am (EXTRA_DIST): Add common.c.

2014-11-16  Thien-Thi Nguyen  <ttn@gnu.org>

	[v] Don't forget to distribute suffix.c.
	* testsuite/xmlsuite/Makefile.am (EXTRA_DIST): New var.

2014-10-22  Thien-Thi Nguyen  <ttn@gnu.org>

	[build] Determine libxml2 flags at configure time.
	* configure.ac <checks for libraries>:
	  Don't use ‘AC_CHECK_LIB’; instead, call ‘PKG_CHECK_MODULES’
	  for ‘libxml-2.0’ and update error message to mention that directly.
	  (XML2_CFLAGS, XML2_LIBS): New AC_SUBST.
	* testsuite/xmlsuite/Makefile.am (LIBXML): Delete var.
	  (AM_CPPFLAGS): New var.
	  (AM_CFLAGS): Move everything except ‘-g’ to...
	  (AM_LDFLAGS): ...this new var, and use $(XML2_LIBS).

2014-10-22  Thien-Thi Nguyen  <ttn@gnu.org>

	[build] Make configure script check for pkg-config(1).
	* configure.ac <checks for programs>: Call ‘PKG_PROG_PKG_CONFIG’.

2014-08-18  Piyush  <achyutapiyush@gmail.com>

	Tweaking

2014-08-18  Piyush  <achyutapiyush@gmail.com>

	Removing binaries

2014-08-18  Piyush  <achyutapiyush@gmail.com>

	Final Commit

2014-08-18  Piyush  <achyutapiyush@gmail.com>

	Tweaking

2014-08-18  Piyush  <achyutapiyush@gmail.com>

	Tweaking

2014-08-18  Piyush  <achyutapiyush@gmail.com>

	Updating Doxygen File

2014-08-18  Piyush  <achyutapiyush@gmail.com>

	DOcumentation Updated

2014-08-16  Piyush  <achyutapiyush@gmail.com>

	Improved code formatting

2014-08-16  Piyush  <achyutapiyush@gmail.com>

	DOcumentation Updated

2014-08-16  Piyush  <achyutapiyush@gmail.com>

	Added dependencies. Integrated everything

2014-08-15  Piyush  <achyutapiyush@gmail.com>

	CLeaning

2014-08-14  Piyush  <achyutapiyush@gmail.com>

	Updated Tests

2014-08-13  Piyush  <achyutapiyush@gmail.com>

	Moved to testsuite folder

2014-08-11  Piyush  <achyutapiyush@gmail.com>

	Intregating xmlsuite

2014-08-10  Piyush  <achyutapiyush@gmail.com>

	Updating testsuite

2014-08-09  Piyush  <achyutapiyush@gmail.com>

	Removing unit tests folder

2014-08-07  Piyush  <achyutapiyush@gmail.com>

	Updating files

2014-08-02  Piyush  <achyutapiyush@gmail.com>

	Updated tests

2014-07-31  Piyush  <achyutapiyush@gmail.com>

	Tests for bits.c

2014-07-17  Piyush  <achyutapiyush@gmail.com>

	Moved it to xmlsuite folder for now

2014-07-17  Piyush  <achyutapiyush@gmail.com>

	Test suite with first unit test

2014-07-17  Piyush  <achyutapiyush@gmail.com>

	Moving the XML suite to different folder for now

2014-06-27  Piyush  <achyutapiyush@gmail.com>

	Commit the sample DWG files needed for test suite

2014-06-27  Piyush  <achyutapiyush@gmail.com>

	Removed the Previous DWG Files
	The files were not completely committed and there was error in it. So removed and will add the same files in the next commit

2014-06-27  Piyush  <achyutapiyush@gmail.com>

	Adding the dependent files

2014-06-27  Piyush  <achyutapiyush@gmail.com>

	Adding python script which will generate %age

2014-06-13  Piyush  <achyutapiyush@gmail.com>

	Adding Initial Files

2014-04-13  gaganjyot  <thegaganx@gmail.com>

	API Merge with clean doc folder

2014-04-12  Rodrigo Rodrigues da Silva  <rsilva@metamaquina.com.br>

	[r] ignore Object_Ref resolving when handle is null

2013-09-24  gaganjyot  <thegaganx@gmail.com>

	Documentation updated, Comments added

2013-09-24  gaganjyot  <thegaganx@gmail.com>

	Documentation updated, Comments added

2013-09-23  gaganjyot  <thegaganx@gmail.com>

	Documentation added

2013-09-20  gaganjyot  <thegaganx@gmail.com>

	Comments added, Make clean target for unit testing

2013-09-19  gaganjyot  <thegaganx@gmail.com>

	Comments added

2013-09-18  gaganjyot  <thegaganx@gmail.com>

	check target for unit tests

2013-09-18  gaganjyot  <thegaganx@gmail.com>

	api -> dwg_api

2013-09-18  gaganjyot  <thegaganx@gmail.com>

	removed api.c error from testsvg2.c

2013-09-18  gaganjyot  <thegaganx@gmail.com>

	library with unit-testing

2013-09-17  gaganjyot  <thegaganx@gmail.com>

	complete unit testing with makefile

2013-09-16  gaganjyot  <thegaganx@gmail.com>

	entity functions uncommented

2013-09-15  gaganjyot  <thegaganx@gmail.com>

	unit tests added with comments

2013-09-14  gaganjyot  <thegaganx@gmail.com>

	updated comments for unit tests

2013-09-13  gaganjyot  <thegaganx@gmail.com>

	unit tests added

2013-09-11  gaganjyot  <thegaganx@gmail.com>

	More unit tests added

2013-09-01  gaganjyot  <thegaganx@gmail.com>

	added more unit tests

2013-08-31  gaganjyot  <thegaganx@gmail.com>

	added unit testing, improved testsvg

2013-08-24  gaganjyot  <thegaganx@gmail.com>

	Bugs fixed

2013-08-24  gaganjyot  <thegaganx@gmail.com>

	Bugs removed

2013-08-13  gaganjyot  <thegaganx@gmail.com>

	error in appid fixed

2013-08-01  gaganjyot  <thegaganx@gmail.com>

	Updated code and some comments,Removed un-necassary code

2013-07-31  gaganjyot  <thegaganx@gmail.com>

	code formatted, Minor bug fixes

2013-07-29  gaganjyot  <thegaganx@gmail.com>

	New SVG Converter, Without low level access

2013-07-29  gaganjyot  <thegaganx@gmail.com>

	New SVG converter using the API, Added extra functions for objects and reference object

2013-07-29  gaganjyot  <thegaganx@gmail.com>

	Added extra functions for object, reference and block_header, New SVG converter

2013-07-28  gaganjyot  <thegaganx@gmail.com>

	Table entity support added

2013-07-27  gaganjyot  <thegaganx@gmail.com>

	added support for body, region, 3dsolid and vertex_pface_face with error reporting

2013-07-27  gaganjyot  <thegaganx@gmail.com>

	added support for mline, 3dface

2013-07-27  gaganjyot  <thegaganx@gmail.com>

	Added support for polyline2d, polyline3d, polyline_mesh and polyline_pface

2013-07-27  gaganjyot  <thegaganx@gmail.com>

	Added support for spline, lwpline, ole2frame and viewport

2013-07-26  gaganjyot  <thegaganx@gmail.com>

	added functions for leader, mtext, leader, shape, endblk

2013-07-26  gaganjyot  <thegaganx@gmail.com>

	Total Support For Dimensions with error reporting

2013-07-25  gaganjyot  <thegaganx@gmail.com>

	Updated error handling, added few functions for dimension ordinate

2013-07-24  gaganjyot  <thegaganx@gmail.com>

	Error reporting for all functions added

2013-07-24  gaganjyot  <thegaganx@gmail.com>

	support for error reporting in line,circle,arc

2013-07-23  gaganjyot  <thegaganx@gmail.com>

	More functions for entiies and objects, Comments updated

2013-07-22  gaganjyot  <thegaganx@gmail.com>

	Initial commit

2011-01-20  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[bind] Wrap Object_Data *object as array. Fixes #32186
	* bindings/dwg.i: use carrays.i to generate helper functions
	* examples/load_dwg.py: updated python example with correct usage of array

2011-01-20  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Added missing #ifdef switch to dwg_write_file()'s prototype

2011-01-19  Rob Vermaas  <rob.vermaas@gmail.com>

	use AX_SWIG_PYTHON_CPPFLAGS variable in stead of hardcoded /usr/include/python2.6

2011-01-05  Till Heuschmann  <theuschmann@gmail.com>

	[build] applied patch from Rob Vermaas <rob.vermaas@gmail.com>
	Thanks also to Timo VJ Lähde <timovj.lahde@gmail.com> for reporting this error.

	decode_r2007.c: Do not use sys/malloc.h include

2010-12-28  Till Heuschmann  <theuschmann@gmail.com>

	[r] Decode R2007 Metadata
	Decode Metadata including file header, page map, section map

	dwg.h: Add type for wide character strings
	decode_r2007.c: Decode Metadata

2010-12-27  Till Heuschmann  <theuschmann@gmail.com>

	[build] Add R2007 decoder

2010-12-27  Till Heuschmann  <theuschmann@gmail.com>

	[build] Add R2007 decoder
	decode_r2007.c: Source file for all functions that are only needed to decode R2007 files.

2010-10-30  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[r,w] Fixed typo in sentinel
	* common.c: second byte of DWG_SENTINEL_CLASS_END was typed "5L" instead of "5E"

2010-10-30  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[w] fixed header variables overflow
	* src/encode.c: fixed two-byte overflow after Header Variables section's CRC.

2010-10-30  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[w] Writing objects to bitstream correctly - or at least almost.
	* encode.c: fixed dwg_encode_chains() to call dwg_encode_add_objects() at the correct point, plus various fixes.

	It seems that some files are now written correctly to the bitstream. Although, unknown object types and objects with variable type (>500) are still skipped.
	I have also detected various situations in which the Header Variables and Classes sections of the new file are 2 bytes longer than the original file. Comparing both original and re-written files, I suspect that bit_write_CRC() is writing these two extra bogus bytes.

2010-10-30  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[api] fixed missing prototype in header
	* dwg.h: added missing dwg_write_file() function prototype

2010-10-30  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[w] Adding debug info to rewrite.c
	* rewrite.c: added debug messages

2010-10-05  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[admin] Improve m4 quoting
	* configure.ac: according to Thien-Thi's suggestion at the mailing list, macro
	arguments are sorrounded by brackets to avoid confusion in case they become
	macros themselves.

2010-10-05  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[doc] Explain use of underscore
	* bindings/python/Makefile.am: explain _libredwg_la

2010-10-05  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[bind] Enhanced python example
	* examples/load_dwg.py: read file version and print object list.

2010-09-28  Ivan Radic  <ivnrdc@gmail.com>

	crc check on

2010-09-28  Ivan Radic  <ivnrdc@gmail.com>

	add return keyword

2010-09-28  Ivan Radic  <ivnrdc@gmail.com>

	correct function name

2010-09-28  Ivan Radic  <ivnrdc@gmail.com>

	correct field macros

2010-09-23  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	added missing .m4 file
	*m4/ax_python_devel.m4: required by AX_SWIG_PYTHON

2010-09-22  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[admin] updated TODO list

2010-09-22  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[admin] initial autotoolization of python bindings
	*configure.ac: add SWIG and Python macros
	*bindings/Makefile.am: new file, only points to bindings/python, don't know if
	 it is really necessary, but one day we'll have other bindings and it might be useful
	*bindings/python/Makefile.am: new file, generate wrapper and build python module
	*autogen.sh: add -I m4 flag
	*m4/ax*.m4: swig macros from Autotools archive

2010-09-20  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	added python example
	*examples/load_dwg.py: load a DWG file and print some data

2010-09-20  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[w] added dwg_add_object function
	*src/encode.c: added function that will call delegate object/entity encoding
	 function based on object type. Not sure if works yet since dwg_encode_chains
	 needs to be reviewed to call it at the correct point. Don't merge to trunk,
	 it barely builds.

2010-09-20  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	fixed wrong function prototypes
	*dwg.h: wrong function prototypes - detected by SWIG

2010-09-20  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[b] added python language bindings
	*bindings/dwg.i: SWIG interface to libredwg
	*bindings/python/Makefile: Makefile updated with target to generate wrapper
	 and build Python module (to be removed soon when I will integrate SWIG with
	 Autotools.
	*bindings/python/libredwgmodule.c: removed unnecessary wrapper. Wrapper is
	 automatically generated by SWIG.

2010-08-30  Anderson Pierre Cardoso  <apierre.cardoso@gmail.com>

	applied the patch from Rob Vermaas <rob.vermaas@gmail.com>
	* src/Makefile.am

2010-08-19  Anderson Pierre Cardoso  <apierre.cardoso@gmail.com>

	[w] encode_object now encode non-null stuff
	* src/encode.c

2010-08-18  Anderson Pierre Cardoso  <apierre.cardoso@gmail.com>

	[w] worked more on the dwg_encode_entity function
	* src/encode.c

2010-08-17  Anderson Pierre Cardoso  <apierre.cardoso@gmail.com>

	[w]quick fix in encode_entitys
	* src/encode.c

2010-08-16  Anderson Pierre Cardoso  <apierre.cardoso@gmail.com>

	encoding null objects (OxOO), for validate the file structure
	* src/encode.c

2010-08-13  Anderson Pierre Cardoso  <apierre.cardoso@gmail.com>

	[w]added common_entity_handle in encode.c
	* src/decode.c
	* src/encode.c
	* src/common_entity_handle_data.spec; new

2010-08-13  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[w] fixing handle encoding macros
	*src/encode.c: rewrote FIELD_HANDLE macro, removed dwg_encode_handleref*()

2010-08-10  Anderson Pierre Cardoso  <apierre.cardoso@gmail.com>

	[w] added some entry checking and usage warning for the rewrite.c test
	* examples/rewrite.c

2010-08-10  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[w] cleaning up handle encoding
	*src/encode.c: cleaned up dwg_encode_handleref, write supposedly existing ref->handleref

2010-08-10  Anderson Pierre Cardoso  <apierre.cardoso@gmail.com>

	cleaned the warnings during compiling
	* src/enode.c
	* src/decode.c
	* src/dwg.c

2010-08-09  Anderson Pierre Cardoso  <apierre.cardoso@gmail.com>

	cleaned a duplicated macro (XDICOBJHANDLE)
	* src/encode.c : 125

2010-08-09  Anderson Pierre Cardoso  <apierre.cardoso@gmail.com>

	added some macros and the encode_commom_entity_handle function
	* src/encode.c

2010-08-09  Anderson Pierre Cardoso  <apierre.cardoso@gmail.com>

	cleaned duplicated header
	* src/bits.c

2010-08-09  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[admin] Fixed missing file header
	*src/header_variables.spec: added missing copyright header

2010-08-07  Anderson Pierre Cardoso  <apierre.cardoso@gmail.com>

	started to add some handle functions in encode (not fully working yet)
	* src/encode.c; func: macro FIELD_HANDLE,  dwg_encode_handleref_with_code,  dwg_encode_handleref

2010-08-02  Anderson Pierre Cardoso  <apierre.cardoso@gmail.com>

	minor changes in encode.c and rewrite.c
	* src/encode.c
	* examples/rewrite.c

2010-07-23  Anderson Pierre Cardoso  <apierre.cardoso@gmail.com>

	copy and pasted the header_variables spec on a header file and included it on the encode.c and decode.c
	*  src/encode.c;  changed
	*  src/decode.c;  changed
	*  src/header_variables.spec; added

2010-07-23  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[r] Fix typo in version codes array shape.
	* common.h (version_codes): Say "[8][7]", not "[7][8]".
	* common.c (version_codes): Likewise.

2010-07-23  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[admin] Rename configure.in to configure.ac.
	* configure.ac: Rename from configure.in.

2010-07-23  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[admin] Bump create-changelog version to "1.2".
	* build-aux/create-changelog (version): Bump to "1.2"; augment history.

2010-07-23  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[admin] Add create-changelog option ‘--copyright WHO’.
	* build-aux/create-changelog (copyright-notice): New defvar.
	<option parsing>: Set ‘copyright-notice’ if given ‘-c’ or ‘--copyright’.
	<output>: If set, append ‘copyright-notice’.

2010-07-23  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[admin] Direct create-changelog "Generating..." message to stderr.
	* build-aux/create-changelog (fso): Add docstring.
	Use ‘message’ to output "Generating...".

2010-07-23  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[admin] Filter ChangeLog entries with titles ending in "; nfc" (no dot).
	* build-aux/create-changelog: Filter entries with titles
	ending in "; nfc" (no dot) in addition to "; nfc." (with dot).

2010-07-21  Anderson Pierre Cardoso  <apierre.cardoso@gmail.com>

	added a test program for the write support. It loads a dwg file and try to rewrite it
	*  examples/rewrite.c

2010-07-21  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[r] Initial R2010 support
	*common.h: added R_2010 do version enum
	*common.c: added R2010 version string

2010-07-21  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[r] Fixing error in file structure decoding
	* src/decode.c: checking if links are present (now code complies to spec)

2010-07-07  acardoso  <apierre.cardoso@gmail.com>

	added compiling flag for enable write support (--enable-write), uncommented write functions and added a dwg_encoder_header_variables function

2010-06-07  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[admin] Fix Git portability bug: Use ‘--pretty=format:STR’.
	* build-aux/create-changelog: Use ‘--pretty-format:STR’
	instead of ‘--format=STR’, which is not yet widely supported.

2010-06-05  Till Heuschmann  <theuschmann@gmail.com>

	[admin] updating copyright notices

2010-04-28  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[admin] updating file headers and copyright notices

2010-04-28  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[admin] adding *~ pattern to .gitignore

2010-04-28  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[admin] Update AUTHORS file

2010-03-15  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[admin] Mention Texinfo in HACKING.
	* HACKING (other tools): New section.

2010-03-14  Till Heuschmann  <theuschmann@gmail.com>

	[r] decode DICTIONARYWDLFT and PLACEHOLDER
        * src/decode.c: call decoding functions according to dxf class name
        * src/dwg.h: complete structs (Dwg_Object_DICTIONARYWDLFT,
        Dwg_Object_PLACEHOLDER)
        * src/dwg.spec: add decoding functions

2010-03-14  Till Heuschmann  <theuschmann@gmail.com>

	[r] decode Xrecord
        * src/decode.c: add function dwg_decode_xdata to decode arbitrary data streams
        * src/dwg.h: add the struct Dwg_Resbuf which represents a result buffer

2010-03-03  Till Heuschmann  <theuschmann@gmail.com>

	[r] read objects with fixed types
	* src/decode.c: decode LWPLINE, HATCH, XRECORD, LAYOUT when stored with fixed type
	* src/dwg.h: added values to Dwg_Object_Type
	* src/dwg.spec: fixed LAYOUT decoding (2004 only), fixed LWPLINE decoding
	* src/encode.c: added FIELD_2DD_VECTOR macro
	* src/print.c: added FIELD_2DD_VECTOR macro

2010-02-23  Till Heuschmann  <theuschmann@gmail.com>

	[r] fix Tolerance, View and Ucs decoding
	* src/dwg.h: new field origin (Dwg_Object_UCS)
	  change type of text_string to BITCODE_TV (Dwg_Entity_TOLERANCE)
	* src/dwg.spec: fixed decoding

2010-02-23  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[dist] Arrange to also distribute file README-alpha.
	* README-alpha: New file.
	* Makefile.am (EXTRA_DIST): Add README-alpha.
	* README: Remove version, which is btw incorrect, from first line.

2010-02-23  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build] Arrange for automake to *not* AC_DEFINE `VERSION'.
	* configure.in (AM_INIT_AUTOMAKE): Specify `no-define'.
	* src/common.h (VERSION): No longer #undef this.

2010-02-23  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build] In configure.in, use one-arg AM_INIT_AUTOMAKE form.
	* configure.in (AM_INIT_AUTOMAKE): Use one-arg form.

2010-02-23  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[dist] Update Makefile.am EXTRA_DIST vars.
	* examples/Makefile.am (EXTRA_DIST): Add example.dwg, suffix.c, $(TESTS).
	* src/Makefile.am (EXTRA_DIST): Add dwg.spec, logging.h; remove example.dwg.

2010-02-23  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[test] Avoid segfault in testSVG.
	* examples/testSVG.c (output_BLOCK_HEADER):
	If `ref->obj->tio.object' is NULL, say so
	to stderr and skip the "<g>..</g>" output.

2010-02-23  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build doc] Add texinfo for LibreWDG manual plus infrastructure.
	* doc/LibreDWG.texi: New file.
	* doc/fdl.texi: New file.
	* doc/Makefile.am: New file.
	* configure.in (AC_CONFIG_FILES): Add doc/Makefile.
	* Makefile.am (SUBDIRS): Add doc.

2010-02-23  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[admin] updating TODO file; nfc
	*TODO: remove tasks already done, added new tasks and updated others

2010-02-23  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	[r] fix 3dsolid decoding
	* src/dwg.h: new field for 3dsolid (ACIS_empty_bit)
	* src/dwg.spec: fixed decoding of fields

2010-02-22  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	[r] deobfuscate SAT data from 3dsolid objects
	* src/dwg.spec: de-obfuscation routine
	* src/dwg.h: a new unsigned char* field for storing the raw SAT data

2010-02-23  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[test] Add "make check" support plus aliveness test.
	* examples/Makefile.am (TESTS_ENVIRONMENT, TESTS): New vars.
	* examples/alive.test: New file.
	* README (Building and installing the library): Mention "make check".
	* .gitignore: Update ignorance; nfc.

2010-02-23  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[test] Don't hardcode input/output file names; require `argv[1]'.
	* examples/suffix.c: New file.
	* examples/dwg_ps.c: #include "suffix.c".
	(INPUT_FILE, OUTPUT_FILE): Delete #define:s.
	(main): Use `REQUIRE_INPUT_FILE_ARG', `suffix'.
	* examples/get_bmp.c: #include "suffix.c".
	(INPUT_FILE, OUTPUT_FILE): Delete #define:s.
	(get_bmp): Use `suffix'.
	(main): Use `REQUIRE_INPUT_FILE_ARG'.
	* examples/load_dwg.c: #include "suffix.c".
	(INPUT_FILE): Delete #define.
	(main): Use `REQUIRE_INPUT_FILE_ARG'.
	* examples/test.c: #include "suffix.c".
	(main): Use `REQUIRE_INPUT_FILE_ARG'.
	(FILENAME): Delete #define.
	(test_dwg_c): Don't bother with NULL `filename'.
	* examples/testSVG.c: #include "suffix.c".
	(main): Use `REQUIRE_INPUT_FILE_ARG'.
	(FILENAME): Delete #define.
	(test_SVG): Don't bother with NULL `filename'.

2010-02-23  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[C test] Make sure `main' returns 0 or 1.
	* examples/dwg_ps.c (main): Specify type of return value.
	On failure to read dwg file, return 1.
	* examples/test.c (test_dwg_c): Clamp return value to 0 or 1.
	* examples/testSVG.c (test_SVG): Likewise.

2010-02-22  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[test build] Check for pslib; build examples/dwg_ps only if present.
	* configure.in: Add checks for function `PS_open_file'
	in libps, and header file "libps/pslib.h".
	(HAVE_LIBPS): New AM_CONDITIONAL.
	* examples/Makefile.am (check_PROGRAMS): Remove `dwg_ps'.
	[HAVE_LIBPS] Add `dwg_ps' to `check_PROGRAMS'.
	[HAVE_LIBPS] (dwg_ps_SOURCES, dwg_ps_LDADD):
	Move these variables inside this conditional block.
	* README: Mention pslib non-critical requirement.

2010-02-22  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	[r] fix 3dsolid parsing segfault
	* src/dwg.h: block_size is now a vector
	* src/dwg.spec: store the values of block_size for each sat_data block

2010-02-22  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[test build] Factor common LDFLAGS for examples/.
	* examples/Makefile.am (AM_LDFLAGS): New var.
	(test_LDADD, load_dwg_LDADD, get_bmp_LDADD): Delete vars.
	(testSVG_LDADD, dwg_ps_LDADD): From these vars, remove `-lredwg'.

2010-02-22  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[test build] Enable builddir!=srcdir operation in examples/.
	* examples/Makefile.am (AM_CFLAGS): Use $(top_srcdir), not "..".

2010-02-22  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build w] Add runtime tracing support for write (encode) path.
	* src/encode.c: #include <stdbool.h>.
	(loglevel): Change type to `unsigned int'.
	[USE_TRACING] (DWG_LOGLEVEL): New #define.
	[USE_TRACING] (env_var_checked_p): New static var.
	(dwg_encode_chains) [USE_TRACING]: Before starting,
	set the logging level, but only do so once.

2010-02-22  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build r] Add runtime tracing support for read (decode) path.
	* src/decode.c: #include <stdbool.h>.
	(loglevel): Change type to `unsigned int'.
	[USE_TRACING] (DWG_LOGLEVEL): Move this into conditional
	block; change definition to be the variable `loglevel'.
	[USE_TRACING] (env_var_checked_p): New static var.
	(dwg_decode_data) [USE_TRACING]: Before starting,
	set the logging level, but only do so once.

2010-02-22  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build] Add preliminary "configure --enable-trace" support.
	* configure.in (trace): New AC_ARG_ENABLE.  If specified
	on the configure command-line, do AC_DEFINE([USE_TRACING]).

2010-02-22  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build] Make every .c file #include "config.h".
	* src/common.h (VERSION): #undef it prior to re-#define.
	* src/bits.c: #include "config.h".
	* src/common.c: Likewise.
	* src/decode.c: Likewise.
	* src/dwg.c: Likewise.
	* src/encode.c: Likewise.
	* src/print.c: Likewise.

2010-02-22  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build] Move config.h into src/.
	* configure.in (AM_CONFIG_HEADER): Move to src/config.h; m4-quote.
	* .gitignore: Update ignorance.

2010-02-22  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[admin] Rename directory build/ to build-aux/.
	* configure.in (AC_CONFIG_AUX_DIR): Change to `build-aux'; m4-quote.
	* HACKING: Update; nfc.
	* .gitignore: Update; nfc.

2010-02-22  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[admin] Make create-changelog handle command-line args GNUishly.
	* build/create-changelog (version): Bump to "1.1";
	use `defconst'; keep brief history in docstring.
	<options parsing>: Mention package affiliation in --version output;
	accept -s to mean --since;
	throw error on missing arg for --since;
	no longer accept unadorned arg as output FILENAME;
	instead recognize --output (-o) FILENAME.
	Suggested by Rodrigo Rodrigues da Silva.

2010-02-21  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[admin] Rename create-changelog.el to create-changelog.
	* build/create-changelog: Rename from build/create-changelog.el.
	  Update help text to be implementation-agnostic.
	* HACKING: Update.

2010-02-20  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[admin] Add script to create ChangeLog from "git log" output.
	* build/create-changelog.el: New file.
	* HACKING (change log maintenance): Update.

2010-02-19  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[admin] Add a program to create/publish pre-regenerated tarballs.
	* build/snap.GNUmakefile: New file.
	* build/.placeholder: Delete file -- no longer necessary.
	* .gitignore: Update ignorance.

2010-02-18  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build] Add ACLOCAL_AMFLAGS to top-level Makefile.
	* Makefile.am (ACLOCAL_AMFLAGS): New var.

2010-02-18  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build] Remove spurious AC_SUBST.
	* configure.in (VERSION): Delete AC_SUBST.

2010-02-18  Thien-Thi Nguyen  <ttn@gnuvola.org>

	[build] Add autogen.sh; delete generated files.
	* autogen.sh: New file.
	* build/.placeholder: Likewise.
	* m4/.placeholder: Likewise.
	* INSTALL: Delete file.
	* Makefile.in: Likewise.
	* acinclude.m4: Likewise.
	* aclocal.m4: Likewise.
	* build/config.guess: Likewise.
	* build/config.sub: Likewise.
	* build/depcomp: Likewise.
	* build/install-sh: Likewise.
	* build/ltmain.sh: Likewise.
	* build/missing: Likewise.
	* config.h.in: Likewise.
	* configure: Likewise.
	* examples/Makefile.in: Likewise.
	* src/Makefile.in: Likewise.

2010-02-15  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	fixing version detection for iterator methods

2010-02-11  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	changing my email address on file headers

2010-02-11  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	implement version dependent iterator for owned obects of a BLOCK_HEADER

2010-02-11  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	resolve object references after parsing r2004 and r2007 files

2010-02-11  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	check if some pointers are not null

2010-02-10  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	fix bugs in description of two objects of the spec: SORTENTSTABLE and LEADER were wrongly described

2010-02-06  Till Heuschmann  <theuschmann@gmail.com>

	Fixed confusions in DIMSTYLE decoding

2010-02-01  unknown  <tiu@.(none)>

	Improved R2004 header parsing. Read variables, handles, objects

2010-01-29  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Partially fixed bug #28681, common entity handle data parsed correctly

2010-01-29  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Added macro created print functions, made some functions private, increased logging trying to fix objectrefs

2010-01-27  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Logging test

2010-01-27  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Refactoring log messages: encode.c

2010-01-27  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Refactoring log messages: dwg.c

2010-01-27  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Refactoring log messages: bits.c and decode.c

2010-01-20  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	New logging infrastructure. printf's still need to be refactored
	Signed-off-by: Rodrigo Rodrigues da Silva <pitanga@members.fsf.org>

2010-01-19  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Integrating slightly modified patch #7057, file #19482, by James Michael DuPont <JamesMikeDuPont@googlemail.com>: reviewed typecasting to conform with C++ compiler's strict typechecking

2010-01-12  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Updating TODO

2009-12-25  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Created a TODO file, updated README

2009-12-25  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Created a TODO file

2009-12-24  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	renaming_variables_to_meet_GNU_coding_standards (NoCamelCaps\!)

2009-12-24  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Improved R2004 header parsing by Till Heuschmann <theuschmann@googlemail.com> (patch #7046) + Juca's fixes

2009-12-24  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	More API work. Fixed obvious bug in dwg_get_entities, but it still won't work.

2009-12-22  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Keep track of number of entities processed. More API work: dwg_get_entities, dwg_get_entity_count, dwg_get_entity_layer

2009-12-21  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Fixing dwg_get_layers bug found by Juca

2009-12-21  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	New API function, returns LAYER list

2009-12-21  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	adding NEWS file - required for GNU packages. We must always update this file prior to releases.

2009-12-21  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Fixing unchecked (loglevel) fprintf's (a few fprintf's left though) Keeping track of layers - initial support (new API function)

2009-12-19  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	yes, I know it is a bit wrong, but it is just a test. I am still trying to figure out how to return a class instance from load_file

2009-12-19  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	beginning to write a (still very simple) python binding for LibreDWG

2009-12-19  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	Implement Encoder routine for VERTEX (2D) (10) description.

2009-12-19  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	Partial implementation of SPATIAL_INDEX description.

2009-12-19  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	changing name of macro from GET_FIELD to FIELD_VALUE (which makes more sense!)

2009-12-19  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	Encoder and Decoder routines can be the same in IMAGE description.

2009-12-19  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	REPEAT macro refactoring in IMAGE description -- by Rafael Moretti

2009-12-19  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	REPEAT macro refactoring in LTYPE(57)

2009-12-19  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	third and last iteration of REPEAT macro refactoring on MLINE(47) description. Thanks for support received from Rafael Moretti!

2009-12-19  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	second iteration of REPEAT macro refactoring in MLINE(47) description

2009-12-19  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	first iteration of REPEAT macro refactoring in MLINE (47) description

2009-12-15  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	INSERT encoder

2009-12-15  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	dataflags handling are a responsibility of the user (client application)

2009-11-28  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	fix bug in SPLINE description

2009-11-28  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	using macros in SPLINE description

2009-11-28  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	using BITCODEs in header file

2009-11-27  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	_3dface encoder

2009-11-27  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	boilerplate with TODOs for unimplemented encoders

2009-11-27  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	LINE encoder

2009-11-26  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	now it compiles

2009-11-26  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	broken revision. unfinished refactoring towards write support

2009-11-25  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	starting to move dwg structures description to a dwg.spec file that can be used by both decode.c and encode.c (to avoid code replication)

2009-11-04  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Becoming a GNU package.

2009-11-04  Felipe Correa da Silva Sanches  <juca@members.fsf.org>

	updating my email to juca@members.fsf.org

2009-11-04  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Adding (C) notices to remaining files

2009-11-04  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Trying do debug XRECORD

2009-10-07  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[fixed] bug in bit_read_BS which lead to misinterpretation of raw unsigned chars

2009-09-26  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	updating README. Now in English.

2009-09-26  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Updating my e-mail in AUTHORS

2009-09-26  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	updating ChangeLog and removing useless files

2009-09-24  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	completed TABLE decoder. Needs testing.

2009-09-23  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	another chunk of TABLE decoder

2009-09-23  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	one more chunk of TABLE entity decoder

2009-09-23  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	another chunk of TABLE decoder

2009-09-22  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	another chunk of TABLE entity decoder

2009-09-22  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[new] Decoding of XRECORD object

2009-09-22  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	initial parsing of TABLE entity. Incomplete.

2009-09-22  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Adding missing handles

2009-09-22  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	* [new] adding log call to debug EED parsing * [fixed] adding 3D entities to object type switch

2009-09-22  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Reverting mistaken change from last revision.

2009-09-22  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Refactoring some entities

2009-09-21  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	fix a bug in the DICTIONARYVAR decoder that was due to a typo in the spec, I think.
	field str should be TV instead of BS

2009-09-21  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	now dwg_decode_object and dwg_decode_entity functions return an error code so that we can avoid decoders when these functions fail but we can try to load the rest of the file.

2009-09-21  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	a list of websites that contain dwg files we are using to test our dwg parser

2009-09-21  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Removing deprecated print.{c,h}

2009-09-21  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	implementing a bit more of HATCH decoder. not everything yet.

2009-09-21  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	a couple fixes for R14 based on parsing of this test file: ftp://geodetic.ncdenr.org/maps/yancey14.zip

2009-09-21  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	decode SPATIAL_FILTER

2009-09-21  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	decode SORTENTSTABLE

2009-09-21  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	decode RASTERVARIABLES

2009-09-21  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	partial implementation of PROXY decoder

2009-09-21  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	decode IDBUFFER

2009-09-21  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	a bit more of HATCH decoding. We need to implement a better REPEAT macro so that complex nested REPEAT structures are easier to decode

2009-09-20  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	partial implementation of decoder for HATCH

2009-09-19  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	decode GROUP(72)

2009-09-19  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	decode VIEWPORT_ENTITY_HEADER_CONTROL

2009-09-19  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	decode DIMSTYLE(69)

2009-09-19  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	decode DIMSTYLE_CONTROL(68) and DIMSTYLE(69)

2009-09-19  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	decode APPID(67) and APPID_CONTROL(66)

2009-09-19  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	* decoding of VPORT(65) * implemented an extra (auxiliary) bitcode: BITCODE_4BITS

2009-09-19  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	* decode VPORT_CONTROL * added case entries for some objects (where their respective decoders are invoked)

2009-09-19  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	decoding of REGION/3DSOLID/BODY

2009-09-19  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	* update DWG_OBJECT and DWG_ENTITY macros so that they now include the function prototype declaration * I have sorted object/entity declarations inthe same order they appear in the spec and I also added comments stating object number or page number (where it is described in the spec) * Added boilerplate for the ones we did not implement yet.

2009-09-19  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	some adjustments in handling of model/page coordinates I am still not sure how does that work.

2009-09-18  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	decode LAYER_INDEX

2009-09-18  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	decode IMAGEDEFREACTOR

2009-09-18  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	decode IMAGEDEF

2009-09-18  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	remove a redundant printf

2009-09-18  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	removing dwg_var_map(...) function which is not used anymore

2009-09-18  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	* removed old header variables parser * replaced it by a call to the new one

2009-09-18  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Refactoring entities ELLIPSE, SHAPE, TRACE, SOLID

2009-09-18  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	bring back FIELD_T

2009-09-18  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Refactoring entities POINT, 3D_FACE, POLYLINE({PFACE,MESH})

2009-09-18  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	implementation of a better header variables parser

2009-09-18  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	* Refactoring DIMENSION entities. * [fixed] issue #8

2009-09-18  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Changed bit_write_CMC to take a Dwg_Color* argument

2009-09-18  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	refactoring MTEXT(44)

2009-09-17  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	suppress warning on FIELD_3DPOINT_VECTOR macro

2009-09-17  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	"absolute_ref" instead of "handle"

2009-09-17  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	* Entities MLINETYPE and VP_ENT_HDR * Correct handleref.value parsing, now considering offset codes

2009-09-17  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	fix BLOCK_HEADER parsing bug due to lack of curly braces around HANDLE_VECTOR macro

2009-09-17  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	fixing bug in FIELD_VECTOR_N macro

2009-09-17  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	* bringging back some more lines of code that were mistakenly removed some revisions ago * use fprintf instead of sprintf

2009-09-17  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Translating: skt -> dwg and CKR -> CRC Fixing some mistakes made in header on previous commit due to translation (bitdouble and bitshort)

2009-09-17  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	* decoding UCS and UCS_CONTROL * bringing back code that pitanga mistakenly removed in his prior commit

2009-09-17  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Major translation effort. Seems to have been the last one.

2009-09-17  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	decode VIEW and VIEW_CONTROL

2009-09-17  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	decode LTYPE and LTYPE_CONTROL

2009-09-17  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	decode SHAPEFILE and SHAPEFILE_CONTROL

2009-09-17  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	decode LAYER_CONTROL

2009-09-17  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	decode LAYER

2009-09-17  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	huge refactoring in SVG generator. Now symbols are stored in <defs> (we are using the BLOCK_HEADER handles)
	But I am still not sure about the correct procedure to select the entities that must be put inside a <g>.
	I tried to get all objects from first_entity until last_entity as they appear in the file, but that does not seem to be
	correct. What is the correct way to iterate over entities?

	R_2004+ provides a vector of handles pointing to everything that must go inside a <g>, but prior versions only tell us the
	1st and last entities.

2009-09-16  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	fixing the issue described on previous commit.

2009-09-16  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	refactoring our code that handles handles. I have noticed that we are probably having leak issues here. But I still didn't detect exactly what is wrong. Handles are correctly parsed, but their values are corrupted before they are used by client code. Something is messing with our object_ref vector.

2009-09-16  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	correct decoding of BLOCK_CONTROL.
	Now it will be possible to create <defs> section in SVG because BLOCK_CONTROL keeps handles of all BLOCK_HEADERS in the
	file and so we can loop these and read their BLOCKS and output one <g> for each simbol

	This commit totally ROCKS!!!

	hmmm! And we are in svn revision 256!!!! HAPPY HACKING! :-D

2009-09-16  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	* fix issue in R_2004 where xdicobjhandle might not be present in DICTIONARY * created a new macro XDICOBJHANDLE(code) * moved version macros to common.h

2009-09-16  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	DICTIONARYVAR decoder

2009-09-16  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	LINE

2009-09-16  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	CIRCLE

2009-09-16  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	ARC

2009-09-16  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	POLYLINE 3D

2009-09-16  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	2D_POLYLINE

2009-09-16  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	VERTEX_PFACE_PFACE

2009-09-16  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	macros in VERTEX_*

2009-09-16  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	* disabling print module at all. Our macros are providing a much more consistent way of printing debbuging info. * refactoring VERTEX_2D

2009-09-16  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	fix bugs in INSERT and MINSERT due to typos in the spec

2009-09-16  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	more refactoring on INSERT and MINSERT

2009-09-16  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	* refactoring attdef * boilerplate for dwg_encode_common_entity_handle_data and dwg_encode_handleref

2009-09-15  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	refactored TEXT and ATTRIB

2009-09-15  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	LAYOUT decoding done

2009-09-15  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	using DWG_OBJECT/DWG_ENTITY in the rest of the objects in decode.c

2009-09-15  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	REFACTOR... REFACTOR... REFACTOR... !!!

2009-09-15  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	* fix FIELD_HANDLE macro. * a bit more refactoring

2009-09-15  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	more macro-based refactoring

2009-09-15  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	decoding macros now allow printing of values in verboso mode (loglevel>=2)

2009-09-15  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	using suffix TV instead of T to denote "text value bitcode"

2009-09-14  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	INSERT/MINSERT refactoring using macros

2009-09-14  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	using version macros

2009-09-14  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	more macro usage on decoder

2009-09-14  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	using MACROS on dwg_decode_MLINE. This suggests the need of a LOOP macro...

2009-09-14  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	fix wrong escape code \N due to a typo

2009-09-14  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	* refactoring... * update on AUTHORS list

2009-09-14  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Refactoring to meet GNU code style (thanks to Eclipse's SHIFT+CTRL+F)

2009-09-14  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	using DWG_OBJECT/DWG_ENTITY macros on more objects/entities

2009-09-14  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	HANDLE_VECTOR macro REACTORS macro

2009-09-14  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	fixing segfault from my recent commits

2009-09-14  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Adding binaries and Makefiles to svn:ignore

2009-09-14  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Adding binaries and Makefiles to svn:ignore

2009-09-14  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	HANDLE macro

2009-09-14  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Adding binaries and Makefiles to svn:ignore

2009-09-14  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Some translation

2009-09-14  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	testing some experimental MACROS on decode_DICTIONARY

2009-09-14  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Handle parsing for missing entities (from 0 to 33)

2009-09-14  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	using macro for entity UNUSED

2009-09-14  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	now using the macro I introduced in previous commit

2009-09-14  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	macro for entity decoder init

2009-09-14  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	adding macro to ease handle (Dwg_Object_Ref*) parsing

2009-09-13  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	adding an auxiliary function to check valid handle codes. Now we should use dwg_decode_handleref_with_code whenever possible instead of dwg_decode_handleref.

2009-09-13  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	fix parsing of INSERT

2009-09-13  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	cones placement is broken. I am not sure what is the correct order of applying translate, scale and rotate transforms

2009-09-13  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	clones are partially working, but are misplaced and apparently not transformed yet

2009-09-13  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	fix common entity data parsing

2009-09-13  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	* more work towards clones * better organized debugging info output

2009-09-13  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	more work towards clone feature (BLOCK/BLOCK_HEADER/INSERT)

2009-09-12  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	all log and error messages must be written to stderr

2009-09-12  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	The object handle should be stored in a single place: the Dwg_Object structure.
	Instead of 3 different places: DWG_Object, DWG_Object_Object and
	DWG_Object_Entity structures.

2009-09-12  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	fixing sprintf(stderr, ... into fprintf
	initial implementation of compression codes

2009-09-11  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	partial implementation of the new handleref infrastructure with Dwg_Object_Ref pointers instead of a meaningless array of handles. The core work is done, although some segfaults are still annoying me. I haven't committed to trunk, but I wouldn't recommend working there since it may cause major conflicts. Any help to get this working right will be appreciated.

2009-08-18  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	more verbose output for R2004 header parsing

2009-08-18  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	system section - R2004 header parsing

2009-08-17  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	implementing a bit more of the R_2004 header parsing

2009-08-17  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	sending verbose output to stderr

2009-08-14  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	avoiding a crash

2009-08-14  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	increasing size of vector so that it will be able to store all header variables for R_2007.

2009-08-14  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	number of header variables depends on DWG version...

2009-08-10  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	improving R2007 header parsing

2009-08-10  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	initial R2004 header parsing

2009-08-07  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	starting to implement R2007 header parsing

2009-08-06  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	bolerplate for future implementation of DWG R2004 and R2007 headers

2009-07-03  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	refactor unsupported version message allow it to try parsing versions prior to R_2000 but gives a warning message bout experimental support.

2009-07-03  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	print functions for DIMENSION entities + bug fix in DIMENSION structs

2009-06-26  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Dwg_Encode_DICTIONARY. It's an object, should check common object data encoding

2009-06-26  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	moving testSVG and test to examples. Thanks to Marcos.

2009-06-25  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	removing unnecessary (weird and wrong) checks

2009-06-25  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[fixed] warnings

2009-06-25  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	translation patch which has been held up for a while due to recently fixed bugs

2009-06-25  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	trying to fix the read_CMC issue that gcc was not able to warn us about... Pitanga will check whether it works for him with gcc 4.3.3. It didn't even break for me in gcc 4.2.4...

2009-06-25  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[fixed] missing decode_handleref() in dwg_decode_VIEWPORT

2009-06-24  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	decoding of entity common data for all DWG versions

2009-06-23  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	Implemented initial support for blocks ("symbols") and "clones".
	SVG converter already correctly group drawing elements of a symbol (those between BLOCK_HEADER and ENDBLK) but cloning
	them is still not working because our current implementation of dwg_decode_handlerefs is wrong. The
	block_header_handle in an INSERT object is placed ***after*** "Common Entity Handle Data" section. So, cloning will
	only work after we fix the parsing of this section.

2009-06-19  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	trying to adjust paper size on exported SVG

2009-06-19  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	fixing a bug in the encoding and decoding of DD (BitDouble with Default) Now we have perfect handling of lines. Yuppiiiiieeee!

2009-06-19  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	make switch consistent with new print (boilerplate) functions

2009-06-19  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	handling arcs in dwg2svg

2009-06-19  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	make switch consistent with new print (boilerplate) functions

2009-06-19  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	boilerplate code for print.c - TODO: complete switch with boilerplate functions

2009-06-19  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	print for VERTEX_{MESH,PFACE} and autoreconf to link math lib to testSVG

2009-06-19  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	adding TEXT support to our DWG2SVG converter

2009-06-15  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	dwg2svg: deal with circles, lines and arcs

2009-06-14  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	variable type-code handling + huge boilerplate code

2009-06-12  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translating stuff

2009-06-12  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	decode OLE2FRAME + boilerplate code + spreadsheet update

2009-06-12  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	CMC color read/write. Completed VIEWPORT encoding/decoding. (spreadsheet update)

2009-06-12  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	reviewed SPLINE encoding/decoding (and spreadsheet update)

2009-06-12  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	IMAGE encoding (and spreadsheet update)

2009-06-12  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	IMAGE encoding (and spreadsheet update)

2009-06-12  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	LWPLINE encoding (and spreadsheet update)

2009-06-12  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	LWPLINE decoding (and spreadsheet update)

2009-06-12  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	OLE2FRAME struct (and spreadsheet update)

2009-06-11  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	LWPLINE struct (and spreadsheet update)

2009-06-11  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	struct for IMAGE Entity

2009-06-08  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	updating copyright/licensing headers

2009-06-08  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	MLINE(47) encode/decode

2009-06-08  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Updating copyright notice

2009-06-08  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Some decode and encode fixing/cleaning + updated spreadsheet + updated copyright

2009-06-07  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	TOLERANCE(46) decoding and encoding

2009-06-07  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	LEADER (45) encoding

2009-06-07  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	LEADER (45) decoding

2009-06-07  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	LEADER/TOLERANCE/MLINE boilerplate code

2009-06-07  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	LEADER/TOLERANCE/MLINE boilerplate code

2009-06-07  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	BLOCK_CONTROL r/w

2009-06-07  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	fix SPLINE decode segfault

2009-06-07  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	ELLIPSE encode parser

2009-06-07  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	VIEWPORT encode parser

2009-06-07  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	VIEWPORT decode parser

2009-06-06  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	updating spreadsheet and adding some more boilerplate code

2009-06-06  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	MTEXT decoding, encoding and printing

2009-06-06  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	3DFACE encode --- must review this code

2009-06-06  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Structs for LEADER, TOLERANCE and MLINE

2009-06-06  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	encoders for DIMENSION_* and POINT entities

2009-06-06  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	DIMENSION LINEAR encode

2009-06-06  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	do it the smart way. Duh\!

2009-06-06  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	save the correct version code in DWG header

2009-06-06  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	fixing indentation

2009-06-06  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	DIMENSION_ORDINATE encoding

2009-06-06  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	boilerplate code: adding prototypes for every encoding functions,
        even the ones not implemented yet.

2009-06-06  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	SHAPE(33) encode

2009-06-06  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	SHAPE (32) encode

2009-06-06  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	SOLID (31) encode

2009-06-06  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	POLYLINE (MESH)(30) encode

2009-06-06  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	POLYLINE_PFACE encode

2009-06-06  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	minor translations

2009-06-06  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Adding print labels to new supported entities

2009-06-06  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Read support for SOLID, SHAPE, TRACE and POLYLINE_PFACE/MESH
        entities. Minor code reviews.

2009-06-06  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Completing read support for DIMENSION entities. Minor code reviews.

2009-06-05  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Adding (draft) read support for 3D_FACE entity

2009-06-05  Diego Rabatone Oliveira  <diraol@polignu.org>

	Dimension Ordinate (pg.70/71) feita

2009-06-05  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translating and starting to generalize object parsing to more
        versions of DWG. It needs a code review. It is an initial
        incomplete implementation.

2009-06-05  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Commenting out SPLINE parser due to segfault

2009-06-05  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Adding (draft) write support for many entities. Still needs some
        testing. Check "flag conditions" in some entities.

2009-06-05  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	implementation of multiversion LINE parser

2009-06-05  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	partial implementation of multiversion POLYLINE_2D and POLYLINE_3D parsers

2009-06-05  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	Legitaj valuej -> Read values

2009-06-04  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	partial implementation of multiversion MINSERT parser

2009-06-04  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	partial implementation of multiversion INSERT parser

2009-06-04  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	Ooooops! :-P

2009-06-04  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	multi-version parsing for ATTDEF (3)

2009-06-04  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	translate: largxeco -> width (couldn't resist the daily commit)

2009-06-04  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	implemented DWG version dependent parsing for ATTRIB (2)

2009-06-04  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	incorporating print functions for DICTIONARY and BLOCK_CONTROL
        (ported from libdwg svn revision 26)

2009-06-03  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	adding decoding of Entity_BLOCK_CONTROL and Entity_DICTIONARY
        based on (ported from) recent libdwg svn commit

2009-06-03  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	added initial SPLINE decode support + indentation fix on dwg_decode_TEXT

2009-06-03  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	implemented TEXT entity parsing for DWG R13 and R14

2009-06-03  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	est -> ent

2009-06-03  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	Traktilo -> Handle

2009-06-03  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	*implementing version dependent behaviour for bit-thickness (read
        and write functions) *also (obviously) translating a bit more from
        Esperanto

2009-06-03  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	added structs for new entities: DIMENSION_* and SPLINE (no
        underlying code though)

2009-06-03  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	adding R2000 dependent behaviour to the BitExtrusion write function

2009-06-03  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	more translation

2009-06-03  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	translate and add review fields (R2000 only) of structs - until
        LINE (19) (addition to last review accidentally not committed)

2009-06-03  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	translate and add review fields (R2000 only) of structs - until
        LINE (19)

2009-06-03  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Completing enum DWG_OBJECT_TYPE according to spec

2009-06-03  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	more translation

2009-06-02  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	cetero -> remainder

2009-06-02  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	masko -> mask

2009-06-02  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	more translations

2009-06-02  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	skalo -> scale

2009-06-02  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	some translations

2009-06-02  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	duaheader -> second_header

2009-06-02  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	kiom -> size

2009-06-02  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	bito -> bit

2009-06-02  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	* Moving print functions to a separate file
        * Making all print functions public in the API

2009-06-02  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	* add version field to the Bit_Chain data structure so that bit
        decoding routines can be aware of the current DWG version.
        * Used this information to implement the version dependent
        behaviour of BitExtrusion.

2009-06-02  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	a bunch of translations

2009-06-02  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	NBEGINNATA => UNKNOWN fino => end

2009-06-02  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	DUOHEAD => SECOND_HEADER

2009-06-02  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translating: ESTAJXO -> ENTITY ORDINARAJXO -> OBJECT

2009-06-02  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	adding dwg_free(Dwg_Structure*); to free the dynamically allocated
        Dwg_Section vector

2009-06-02  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translate bajto -> byte

2009-06-02  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translating some comments. removing the limit of only 6 sections
        in the file header. Added dynamic allocation of the vector of
        Dwg_Section structs.

2009-06-01  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	cleaning warnings due to ignored ret-value for fwrite calls

2009-06-01  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	fixing linking of examples => -lredwg instead of -ldwg

2009-06-01  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[fix] for revision 59 (accidentally deleted aclocal)

2009-06-01  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Changing binary names from libdwg.{a,la,so} to libredwg.{a,la,so}
        to avoid conflicts between libdwg and libredwg; upgrading libtool
        macros

2009-06-01  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[translate] Estajxo -> Entity e Ordinarajxo -> Object

2009-06-01  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	incorporating libdwg recent commits:
        * an initial postscript generator
        * a DWG embedded thumbnail fetcher
        * some new public functions in the API to read document and
        drawing dimensions

2009-06-01  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	[NEW] Struct for Viewport Entity (34)

2009-06-01  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	* generalized dwg_var_map so that it works for any DWG version.
        * implemented regression test to assure that it works at least for
        DWG version R2000

2009-05-31  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	* preparing for broader compatibility of further DWG versions
        * throwing error messages to stderr instead of stdout

2009-05-31  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	usage of fprintf( stderr, "error message");

2009-05-31  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	add loglevel options for lib output

2009-05-31  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	incorporating patch from issue #1: simple test that outputs SVG
        content.

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translate mesuro -> measurement

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translate tipo -> type

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	a bunch of translations

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	a bunch of translations

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translate grandeco -> size

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translate varmapo -> var_map; mapo -> map

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translate sentinel related terms

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translate klaso -> class

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translate numero -> number

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	a bunch of translations

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translate sekcio -> section

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translate cxenigi -> chains

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translate Objekto -> Object

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	a bunch of translations

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	End of a 'coding' session at pitanga's home. (translating: nomo ->
        name)

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translating: kodo -> code

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	Comment regarding possible translations of 'gxisrandigo': 'snap'
        or 'trim'

2009-05-30  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Structs for SOLID, TRACE  and SHAPE \n end of coding night for me

2009-05-30  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Structs for POLYLINE PFACE and POLYLINE MESH

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translate: teksto -> text

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translate: adreso -> address

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translate: regximo -> regime

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translate: koloro -> colour

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translate: alteco -> height

2009-05-30  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Struct for 3DFACE (28)

2009-05-30  Rodrigo Rodrigues da Silva  <pitanga@members.fsf.org>

	Adding dummy structs

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translate: objekto -> object

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translate:  radiuso -> radius  dikeco -> thickness

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translate forpusxigo -> extrusion

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translating comments

2009-05-30  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	removing from repository

2009-05-23  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	... :-)

2009-05-23  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	Cxeno -> Chain

2009-05-23  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	cleaning the last warning!

2009-05-23  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	cleaning warnings

2009-05-23  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	warnings

2009-05-19  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	more translations

2009-05-17  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translating some comments and messages

2009-05-17  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	OT_ => TYPE_ OST_ => SUPERTYPE_

2009-05-17  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translating some comments and NEUZATA => UNUSED

2009-05-17  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	* adding encode.c to compile rules (Makefile*) and fixing compile
        of it.
        * translating: DVG => DWG

2009-05-17  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translating: dvg => dwg Dvg => Dwg

2009-05-17  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	fixing 'make check'

2009-05-17  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translating:  malsukceso => error

2009-05-17  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translating:  dvg_dek_ => dwg_decode_

2009-05-17  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translating... :-)

2009-05-16  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	translating:  dwg_read_file  dwg_write_file  Dwg_Structure

2009-05-16  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	removing not needed local files

2009-05-16  Felipe Corrêa da Silva Sanches  <juca@members.fsf.org>

	initial code based on libdwg (http://libdwg.sourceforge.net/en/index.html)

2009-05-16  Felipe Corrêa da Silva Sanches <juca@members.fsf.org>

	Initial directory structure.

----------
