version.c 693 B

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