Alien-UDUNITS2

 view release on metacpan or  search on metacpan

t/inline.t  view on Meta::CPAN

SKIP: {
	eval { load 'Inline::C' } or do {
		my $error = $@;
		skip "Inline::C not installed", 1 if $error;
	};

	plan tests => 1;


	Inline->import( with => qw(Alien::UDUNITS2) );
	Inline->bind( C => q{
		double convert_inch_to_metre(const char* path_to_xml, double inch_value) {

			ut_system* sys = ut_read_xml(path_to_xml);

			ut_unit* from_in_unit = ut_get_unit_by_name(sys, "inch" );
			ut_unit* to_m_unit    = ut_get_unit_by_name(sys, "metre");

			cv_converter* converter = ut_get_converter(from_in_unit, to_m_unit);

			double m_value = cv_convert_double(converter, inch_value);



( run in 0.471 second using v1.01-cache-2.11-cpan-2398b32b56e )