diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2019-01-14 23:32:53 +0100 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2019-01-28 23:58:53 +0000 |
commit | 0423b61aa8dd75b3141e13cf9276b8fa14ceb473 (patch) | |
tree | 8437f60dc6f6f817f96f3118db61bf91383cbd7a /include/osmocom/gsm/protocol | |
parent | d01ef75ab876d79c9a0a73cdefb4ccfc60bb47f8 (diff) |
add osmo_hexdump_buf() and test
Add osmo_hexdump_buf() as an all-purpose hexdump function, which all other
osmo_hexdump_*() implementations now call. It absorbs the static
_osmo_hexdump(). Add tests for osmo_hexdump_buf().
Rationale: recently during patch review, a situation came up where two hexdumps
in a single printf would have been useful. Now I've faced a similar situation
again, in ongoing development. So I decided it is time to provide this API.
The traditional osmo_hexdump() API returns a non-const char*, which should
probably have been a const instead. Particularly this new function may return a
string constant "" if the buf is NULL or empty, so return const char*. That is
why the older implementations calling osmo_hexdump_buf() separately return the
buffer instead of the const return value directly.
Change-Id: I590595567b218b24e53c9eb1fd8736c0324d371d
Diffstat (limited to 'include/osmocom/gsm/protocol')
0 files changed, 0 insertions, 0 deletions