You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mosquitto/client
Michał Łyszczek 91bca8899c mosquitto_sub: add support to print floats
This patch adds support for two new format specifiers (%f and %d)
to print float and double data.

Generally it's not save to directly take native binary data of one machine and
print it on another one (since mosquitto is multiarch). But in case of floats
it's save to print representation of it, if __STDC_IEC_559__ is defined.

In C99 Annex F, standard we can read:
> This annex specifies C language support for the
> IEC 60559 floating-point standard.
> (...)
> An implementation that defines __STDC_IEC_559__
> shall conform to the specifications in this annex

All float printing code is behind __STDC_IEC_559__, so if that is not
defined, floating print will be disabled and error returned to user.

Documentation also describes restrictions about printing floats.

Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
3 years ago
..
CMakeLists.txt Update threaded builds. 4 years ago
Makefile Use path vars in Makefiles. 4 years ago
args.txt mosquitto_sub `--watch` can now be called as `-w`. 4 years ago
client_props.c Bump copyrights. 4 years ago
client_shared.c mosquitto_sub: add support to print floats 3 years ago
client_shared.h Bump copyrights. 4 years ago
pub_client.c Bump copyrights. 4 years ago
pub_shared.c Bump copyrights. 4 years ago
pub_shared.h Bump copyrights. 4 years ago
pub_test_properties Helper test scripts for client properties. 7 years ago
rr_client.c Bump copyrights. 4 years ago
sub_client.c Bump copyrights. 4 years ago
sub_client_output.c mosquitto_sub: add support to print floats 3 years ago
sub_client_output.h Bump copyrights. 4 years ago
sub_test_fixed_width mosquitto_sub now supports extra format specifiers. 5 years ago
sub_test_properties Helper test scripts for client properties. 7 years ago