JLObjDynamicLinker¶
jutils.spad line 281 [edit on github]
Generic JL
objects used for dynamically linking shared libraries.
- coerce: % -> JLObject
from JLObjectType
- coerce: % -> OutputForm
from CoercibleTo OutputForm
- convert: % -> String
from ConvertibleTo String
- jdlink: String -> %
jdlink(lib)
opens/loads the dynamic shared librarylib
and returns a reference pointer that can be used to obtain adress to symbols in it using jlDlSym. It is up to the user to unload the shared object when it is no longer necessary using jlDlClose. example{jdlink “libopenlibm”} Throws aJL
error if it is not found. Use jlDlOpen for a version with options and/or withoutJL
errors.
- jlAbout: % -> Void
from JLObjectType
- jlApply: (String, %) -> %
from JLObjectType
- jlApply: (String, %, %) -> %
from JLObjectType
- jlApply: (String, %, %, %) -> %
from JLObjectType
- jlApply: (String, %, %, %, %) -> %
from JLObjectType
- jlApply: (String, %, %, %, %, %) -> %
from JLObjectType
- jlDisplay: % -> Void
from JLObjectType
- jlDlCApply: (%, JLObject) -> JLObject
jlDlCApply(func,x)
applies the function pointerfunc
tox
. TheJL
type ofx
must be compatible with the LibdlJL
module. Type of the returned value is assumed to be the same than the type ofx
. For example: example{libm:= jlDlOpen “libopenlibm”} example{squareRoot:=jlDlSym(libm,jsym(sqrt))} example{jlDlCApply(squareRoot,jobject(“2.”))}
- jlDlCApply: (%, JLObject, JLObject) -> JLObject
jlDlCApply(func,x,y)
applies the function pointerfunc
tox
andy
. Type of the returned value is assumed to be the same than the type ofx
. For example: example{libgsl:= jlDlOpen “libgsl”} example{ipower:=jlDlSym(libgsl, gsl_pow_int)} example{jlDlCApply(ipower,jobject(“2.0”),jobject(“7”))}
- jlDlCApply: (%, JLObject, JLObject, JLObject) -> JLObject
jlDlCApply(func,x,y,z)
applies the function pointerfunc
tox
,y
andz
. Returned value is assumed the same type than type ofx
. Use jlDlCApply with type options if necessary. For example with GSL: example{gsl:= jlDlOpen “libgsl”} example{hypot3:= jlDlSym(gsl,jsym(gsl_hypot3))} example{jlDlCApply(hypot3,jobject(“2.”),jobject(“7.”),jobject(“9.0”))}
- jlDlCApply: (%, String, JLObject, String) -> JLObject
jlDlCApply(func, ctype, x, xctype)
applies the function pointerfunc
tox
given itsJL
C
type (xctype) or its supportedJL
type, for example “Float64” or “Cdouble”. Returned value is assumed to be aC
typectype
(or anyJL
supported types). For example: example{libm:= jlDlOpen “libopenlibm”} example{squareRoot:= jlDlSym(libm,jsym(sqrt)} example{jlDlCApply(squareRoot, “Cdouble” jobject(“2.”), “Cdouble”)} example{sinus:=jlDlSym(libm,jsym(sin))} example{jlDlCApply(sinus,”Float64”), jobject(“2.”), “Float64”)}
- jlDlCApply: (%, String, JLObject, String, JLObject, String) -> JLObject
jlDlCApply(func, ctype, x, xctype, y, xctype)
applies the function pointerfunc
tox
andy
given theirJL
C
type (xctype
andxctype
) or their supportedJL
type, for example “Float64” or “Cdouble”. Returned value is assumed to be aC
typectype
(or anyJL
supported types).
- jlDlCApply: (%, String, JLObject, String, JLObject, String, JLObject, String) -> JLObject
jlDlCApply(func, ctype, x, xctype, y, xctype, z, ztype)
applies the function pointerfunc
tox
given itsJL
C
type (xctype
) or its supportedJL
type, for example “Float64” or “Cdouble”. Returned value is assumed to be aC
typectype
(or anyJL
supported types).
- jlDlClose: % -> Boolean
jlDlClose(libPtr)
unload explicitely the shared library referenced bylibPtr
.
- jlDlFindLib: String -> String
jlDlFindLib(lib)
returns the the librarylib
. Returns an empty string if it is not found.
- jlDlList: () -> JLObject
jlDlList()
returns the list of loaded shared objects by the currect processus in a JLObject referencing aJL
vector of strings.
- jlDlOpen: (String, Boolean) -> %
jlDlOpen(lib, throw)
opens/loads the dynamic shared librarylib
and returns a reference pointer that can be used to obtain adress to symbols in it using jlDlSym. It is up to the user to unload the shared object when it is no longer used. ‘throw’ determines whether or notJL
throws an error if the library can not be loaded. example{jlDlOpen(“libopenlibm”, true)}
- jlDlOpen: (String, JLObject) -> %
jlDlOpen(lib, flags)
opens/loads the dynamic shared librarylib
and returns a reference pointer that can be used to obtain adress to symbols in it using jlDlSym. It is up to the user to unload the shared object when it is no longer used. Does not throw an error if the library can not be loaded by default and returns nothing in this case. Use the nothing? operation on the returned value if necessary. example{jlUsing “Libdl” – for flags} example{jlDlOpen(“libopenlibm”, jobject “Libdl.RTLD_NOW”)} flags can be one or combinaison of: RTLD_DEEPBIND RTLD_FIRST RTLD_GLOBAL RTLD_LAZY RTLD_LOCAL RTLD_NODELETE RTLD_NOLOAD RTLD_NOW Note: the Libdl must be loaded or imported before using these flags.
- jlDlOpen: (String, JLObject, Boolean) -> %
jlDlOpen(lib, flags, throw)
opens/loads the dynamic shared librarylib
and returns a reference pointer that can be used to obtain adress to symbols in it using jlDlSym. It is up to the user to unload the shared object when it is no longer used. Does not throw an error if the library can not be loaded by default and returns nothing in this case. Use the nothing? operation on the returned value if necessary. ‘throw’ determines whether or notJL
throws an error if the library can not be loaded. example{jlDlOpen(“libopenlibm”, jobject “Libdl.RTLD_NOW”, false)}flags
can be one or combinaison of: RTLD_DEEPBIND RTLD_FIRST RTLD_GLOBAL RTLD_LAZY RTLD_LOCAL RTLD_NODELETE RTLD_NOLOAD RTLD_NOW Note: the Libdl must be loaded or imported before using theseflags
.
- jlDlOpen: String -> %
jlDlOpen(lib)
opens/loads the dynamic shared librarylib
and returns a reference pointer that can be used to obtain adress to symbols in it using jlDlSym. It is up to the user to unload the shared object when it is no longer used. Does not throw an error if the library can not be loaded and returns ‘nothing’ in this case. Use the nothing? operation on the returned value if necessary.
- jlDlPath: % -> String
jlDlPath(lib)
returns the path of the loaded librarylib
.
- jlDlPath: String -> String
jlDlPath(lib)
returns the path of the librarylib
.JL
warns if it is not found and returns an empty string.
- jlDlSym: (%, JLSymbol) -> %
jlDlSym(lib, sym)
returns the pointer to the symbolsym
in the library referenced bylib
. See jlDlOpen. example{lnk:=jdlink “libjulia”} example{sym := jlDlSym(lnk,”jl_eval_string”)} example{TODO}
- jlId: % -> JLInt64
from JLObjectType
- jlObject: () -> String
from JLObjectType
- jlRef: % -> SExpression
from JLObjectType
- jlref: String -> %
from JLObjectType
- jlType: % -> String
from JLObjectType
- latex: % -> String
from SetCategory
- mutable?: % -> Boolean
from JLObjectType
- nothing?: % -> Boolean
from JLObjectType
- string: % -> String
from JLObjectType