Auto-registration procedure of the DMPACK Lua API.
The postfix in the name of function luaopen_libdmpack()
must match the
name of the DMPACK shared library. This function is compatible to a
library of the name libdmpack.so
only.
The following procedures are registered by default:
deg2gon(deg)
– degrees to gradiansdeg2rad(deg)
– degrees to radiantsgon2deg(gon)
– gradians to degreesgon2rad(gon)
– gradians to radiantsrad2deg(rad)
– radiants to degreesrad2gon(rad)
– radiants to gradiansAdditionally, error codes, log parameters, and the GeoCOM API for Lua are exported as well.
Import the shared library libdmpack.so
in Lua 5.4, and then call any
of the procedures, for example:
require("libdmpack")
print(deg2gon(360.0))
-- Output: 400.0
Registers the Lua parameters and interfaces of the DMPACK API,
including the GeoCOM API. This function is invoked automatically by
Lua 5.4 if library libdmpack.so
is loaded.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(c_ptr), | intent(in), | value | :: | ptr |
C pointer to Lua interpreter. |
Return code.