]> granicus.if.org Git - strace/commit
Generalise some printing primitives
authorEugene Syromyatnikov <evgsyr@gmail.com>
Tue, 19 Feb 2019 01:46:58 +0000 (02:46 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 20 Feb 2019 00:59:49 +0000 (00:59 +0000)
commitd8b3dd301477bfdfcca764ae4ff2afc3d04f8d2a
tree41fbac0f90f15c28cce770f6a3579c48de0ecc2d
parent84d57f25df323dc1c44a1ae86ecf06a194913560
Generalise some printing primitives

Character class checks and hexadecimal number formatting are open-coded
all over the place, let's try to de-duplicate them a bit.

* print_utils.h: New file.
* Makefile.am (strace_SOURCES): Add it.
* util.c: Include "print_utils.h".
(string_quote, dumpstr): Use sprint_byte_hex and is_print.
* v4l2.c: Include "print_utils.h".
(print_pixelformat): Use is_print and BYTE_HEX_CHARS_PRINTF_QUOTED,
add a note that the routine is rather generic.
Makefile.am
print_utils.h [new file with mode: 0644]
util.c
v4l2.c