Closed horta closed 5 years ago
Yes, that would be useful. If you give us a pull request, it would be ideal if a PR brings in one function at a time, to make it easy for us to review.
I'm not particularly worried about how many functions we make externally visible, particularly since we we use prefixes (esl_
, etc.) to help protect against namespace clashes.
My notes on what I expect from a *_Dump()
function, from codestyle.md
:
_Dump(): print internals of an object compactly, for debugging
int esl_foo_Dump(FILE *fp, const ESL_FOO *obj)
Prints the internals of an object, often in a compact
human-readable tabular form. Useful during debugging and
development to view the entire object at a glance. Returns eslOK
on success. Unlike a more robust _Write()
call, a _Dump()
call may assume that all its writes will succeed, and does not
need to check return status of fprintf()
or other system calls,
because it is not intended for production use.
Easel library has a couple of functions for debugging purposes. In particular, those are for dumping information:
I find those functions very handy to understand the software, and I've found myself writting new ones to help me further understand it. For example,
esl_sq_Dump()
.My question is: would you be interested in the implementation of some of those functions?
My understanding is that those functions are externally visible, which might be wise to keep the number of them minimal...