version.c 766 B

1234567891011121314151617181920212223242526
  1. /*
  2. * Copyright © 2008-2014 Stéphane Raimbault <stephane.raimbault@gmail.com>
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the BSD License.
  6. */
  7. #include <stdio.h>
  8. #include <modbus.h>
  9. int main(void)
  10. {
  11. printf("Compiled with libmodbus version %s (%08X)\n", LIBMODBUS_VERSION_STRING, LIBMODBUS_VERSION_HEX);
  12. printf("Linked with libmodbus version %d.%d.%d\n",
  13. libmodbus_version_major, libmodbus_version_minor, libmodbus_version_micro);
  14. if (LIBMODBUS_VERSION_CHECK(2, 1, 0)) {
  15. printf("The functions to read/write float values are available (2.1.0).\n");
  16. }
  17. if (LIBMODBUS_VERSION_CHECK(2, 1, 1)) {
  18. printf("Oh gosh, brand new API (2.1.1)!\n");
  19. }
  20. return 0;
  21. }