version.go 483 B

1234567891011121314151617181920212223242526
  1. // +build linux,!btrfs_noversion
  2. package btrfs
  3. /*
  4. #include <btrfs/version.h>
  5. // around version 3.16, they did not define lib version yet
  6. #ifndef BTRFS_LIB_VERSION
  7. #define BTRFS_LIB_VERSION -1
  8. #endif
  9. // upstream had removed it, but now it will be coming back
  10. #ifndef BTRFS_BUILD_VERSION
  11. #define BTRFS_BUILD_VERSION "-"
  12. #endif
  13. */
  14. import "C"
  15. func btrfsBuildVersion() string {
  16. return string(C.BTRFS_BUILD_VERSION)
  17. }
  18. func btrfsLibVersion() int {
  19. return int(C.BTRFS_LIB_VERSION)
  20. }