[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

950807: UDUNITS conversion software



Terry,

> Subject: UDUNITS conversion software
> To:       address@hidden
> From: Terry Jarrett <address@hidden>
> Keywords: 199508071916.AA20783

In the above message you wrote:
 
> We'd like to use UDUNITS noninteractively. We have a 
> program in which the user enters a value and specifies
> the units. We want to convert these user entries to a
> system standard set of units by calling your conversion
> library. Can we bypass the UDUNITS.C file by including
> a calling routine in our code so that the conversion
> occurs transparently to the user? 

A program can use the UDUNITS library to convert between units.  This
is exactly what the udunits(1) utility does.  Whether or not a program
is interactive is irrelevant to using the UDUNITS library.  See the
installed manual page, udunits(3), for information on using the library
and the udunits(1) utility (which comes with the distribution) for a
example on using the library.  For what you want to do, the following
sequence of calls will, in general, be made:

    utInit(path)

    utScan(spec, &unit)

    utPrint(&unit, buf)

    utTerm()

--------
Steve Emmerson   <address@hidden>