File: version.go

package info (click to toggle)
golang-github-containers-storage 1.50.2%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,032 kB
  • sloc: sh: 641; ansic: 388; makefile: 140; awk: 12
file content (27 lines) | stat: -rw-r--r-- 531 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//go:build linux && !btrfs_noversion && cgo
// +build linux,!btrfs_noversion,cgo

package btrfs

/*
#include <btrfs/version.h>

// around version 3.16, they did not define lib version yet
#ifndef BTRFS_LIB_VERSION
#define BTRFS_LIB_VERSION -1
#endif

// upstream had removed it, but now it will be coming back
#ifndef BTRFS_BUILD_VERSION
#define BTRFS_BUILD_VERSION "-"
#endif
*/
import "C"

func btrfsBuildVersion() string {
	return string(C.BTRFS_BUILD_VERSION)
}

func btrfsLibVersion() int {
	return int(C.BTRFS_LIB_VERSION)
}