USB warnings, Sahara ramdump failures, fatal CLI and archive errors,
and packet hex dumps bypass the ux helpers, so they never get a
--debug timestamp and leave gaps in the protocol timeline.
Route them through shared logging via new warn and die helpers that
keep the program-name prefix, errno text, and exit status. Output
without --debug is unchanged and hex dumps stay visible in both modes.
Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
The error prefix comes from __progname, a BSD-ism that glibc and the
Apple libc export but Windows lacks, so qdl.c and every unit test that
links util.c define their own copy. The nbdkit plugin links neither.
Keep the name in ux.c with a "qdl" default and set it through
ux_set_progname(): from argv[0] in main() and from the plugin's load
hook. Move print_version() into qdl.c, its only caller, so util.c and
the tests no longer need the symbol.
Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
decode_backend() (a --backend value to enum) and qdl_split_specifier()
(splitting "<file>::<selector>") were static string parsers trapped in
qdl.c, which cannot be unit-tested because qdl.c defines main(). Move
them to util.c alongside the other argument parsers (parse_storage_
address, decode_storage_type) and declare them in qdl.h. Pure code
move, no behaviour change.
Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
The repository root had accumulated ~45 .c/.h files sitting directly
next to the project files (meson.build, scripts/, tests/, docs).
Move all sources under src/ and the public header to include/ so the
top level reflects the shape of the project rather than its source
file count.
This commit is a pure git mv with no content changes, so git log
--follow keeps working across the move.
Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>