version.c 727 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright © Stéphane Raimbault <stephane.raimbault@gmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <modbus.h>
  7. #include <stdio.h>
  8. int main(void)
  9. {
  10. printf("Compiled with libmodbus version %s (%06X)\n",
  11. LIBMODBUS_VERSION_STRING,
  12. LIBMODBUS_VERSION_HEX);
  13. printf("Linked with libmodbus version %d.%d.%d\n",
  14. libmodbus_version_major,
  15. libmodbus_version_minor,
  16. libmodbus_version_micro);
  17. if (LIBMODBUS_VERSION_CHECK(2, 1, 0)) {
  18. printf("The functions to read/write float values are available (2.1.0).\n");
  19. }
  20. if (LIBMODBUS_VERSION_CHECK(2, 1, 1)) {
  21. printf("Oh gosh, brand new API (2.1.1)!\n");
  22. }
  23. return 0;
  24. }