JLObjDynamicLinker

jutils.spad line 281 [edit on github]

Generic JL objects used for dynamically linking shared libraries.

=: (%, %) -> Boolean

from BasicType

~=: (%, %) -> Boolean

from BasicType

coerce: % -> JLObject

from JLObjectType

coerce: % -> OutputForm

from CoercibleTo OutputForm

convert: % -> String

from ConvertibleTo String

jdlink: String -> %

jdlink(lib) opens/loads the dynamic shared library lib 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 a JL error if it is not found. Use jlDlOpen for a version with options and/or without JL 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 pointer func to x. The JL type of x must be compatible with the Libdl JL module. Type of the returned value is assumed to be the same than the type of x. 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 pointer func to x and y. Type of the returned value is assumed to be the same than the type of x. 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 pointer func to x, y and z. Returned value is assumed the same type than type of x. 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 pointer func to x given its JL C type (xctype) or its supported JL type, for example “Float64” or “Cdouble”. Returned value is assumed to be a C type ctype (or any JL 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 pointer func to x and y given their JL C type (xctype and xctype) or their supported JL type, for example “Float64” or “Cdouble”. Returned value is assumed to be a C type ctype (or any JL supported types).

jlDlCApply: (%, String, JLObject, String, JLObject, String, JLObject, String) -> JLObject

jlDlCApply(func, ctype, x, xctype, y, xctype, z, ztype) applies the function pointer func to x given its JL C type (xctype) or its supported JL type, for example “Float64” or “Cdouble”. Returned value is assumed to be a C type ctype (or any JL supported types).

jlDlClose: % -> Boolean

jlDlClose(libPtr) unload explicitely the shared library referenced by libPtr.

jlDlFindLib: String -> String

jlDlFindLib(lib) returns the the library lib. 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 a JL vector of strings.

jlDlOpen: (String, Boolean) -> %

jlDlOpen(lib, throw) opens/loads the dynamic shared library lib 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 not JL 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 library lib 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 library lib 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 not JL 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 these flags.

jlDlOpen: String -> %

jlDlOpen(lib) opens/loads the dynamic shared library lib 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 library lib.

jlDlPath: String -> String

jlDlPath(lib) returns the path of the library lib. JL warns if it is not found and returns an empty string.

jlDlSym: (%, JLSymbol) -> %

jlDlSym(lib, sym) returns the pointer to the symbol sym in the library referenced by lib. 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

BasicType

CoercibleTo OutputForm

ConvertibleTo String

JLObjectType

JLType

SetCategory