]> git.draconx.ca Git - cdecl99.git/commit
libcdecl: Rework cdecl_explain output logic.
authorNick Bowler <nbowler@draconx.ca>
Fri, 23 Jun 2023 01:21:46 +0000 (21:21 -0400)
committerNick Bowler <nbowler@draconx.ca>
Fri, 23 Jun 2023 02:02:33 +0000 (22:02 -0400)
commit056280bf2e3188551539d87852ddbdaf322eae52
treeb786c456895752c72290746bbe1d46091285d770
parent6f166c6c36bda84191ed916a52b311ab417a4890
libcdecl: Rework cdecl_explain output logic.

Instead of adjusting the output pointer/length values after each
internal call, tweak all the functions in explain.c to take an
extra level of indirection so they can just directly adjust the
destination as they go.

A new helper, cdecl__emit, is provided to simplify the common pattern
of "print a single C string" followed by "advance pointer/length."
src/cdecl-internal.h
src/explain.c
src/output.c