GoUnit

GoUnit

Functions

double go_unit_convert ()
GoUnit const * go_unit_define ()
GoUnit const * go_unit_get ()
GoUnit const * go_unit_get_from_symbol ()
GoUnitId go_unit_get_id ()
char const * go_unit_get_symbol ()
GType go_unit_get_type ()

Types and Values

  GoUnit
enum GoUnitId

Object Hierarchy

    GBoxed
    ╰── GoUnit

Description

Functions

go_unit_convert ()

double
go_unit_convert (GoUnit const *from,
                 GoUnit const *to,
                 double value);

go_unit_define ()

GoUnit const *
go_unit_define (char const *symbol,
                char const *dim,
                double factor_to_SI);

Parameters

symbol

symbol name for unit.

 

dim

dimension measured by unit.

 

factor_to_SI

factor to convert to SI unit.

 

Returns

the named GoUnit. If a GoUnit of that name already exists, the existing is returned. Otherwise a new one is created.

[transfer none]


go_unit_get ()

GoUnit const *
go_unit_get (GoUnitId id);

Parameters

id

GoUnitId for unit to query

 

Returns

the GoUnit corresponding to id .

[transfer none][nullable]


go_unit_get_from_symbol ()

GoUnit const *
go_unit_get_from_symbol (char const *symbol);

go_unit_get_id ()

GoUnitId
go_unit_get_id (GoUnit const *unit);

go_unit_get_symbol ()

char const *
go_unit_get_symbol (GoUnit const *unit);

go_unit_get_type ()

GType
go_unit_get_type (void);

Types and Values

GoUnit

typedef struct _GoUnit GoUnit;

enum GoUnitId

Members

GO_UNIT_UNKNOWN

unknown unit.

 

GO_UNIT_METER

meter.

 

GO_UNIT_CENTIMETER

centimeter.

 

GO_UNIT_INCH

inch.

 

GO_UNIT_POINT

point.

 

GO_UNIT_MAX

first unregistered unit.