create a link to an external function - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Calling External Routines : ExternalCalling : ExternalCalling/DefineExternal

ExternalCalling[DefineExternal] - create a link to an external function

Calling Sequence

DefineExternal( fn, extlib )

DefineExternal( fn, extlib, cright )

Parameters

fn

-

string or name; denotes the name of the wrapper function to link

extlib

-

string or name; denotes the name of the external library containing the wrapper function

cright

-

(optional) string; denotes the copyright placed on the returned Maple procedure.

Description

• 

The DefineExternal(fn, extlib) command calls define_external with the MAPLE option and saves the result in a remember table.  The procedure used to prepare the invocation of the external routine fn is returned, optionally with the specified copyright statement cright.

  

Note: Saving the result of DefineExternal in a remember table is essential for the efficient operation of the external linking. Without it, the external communications must be set up every time an external routine is entered.

Examples

withExternalCalling:

extlib:=ExternalLibraryNamemstring

extlib:=libmstring.so

(1)

extcall:=DefineExternal'mstring_uppercase',extlib

extcall:=procoptioncall_external,define_externalmstring_uppercase,MAPLE,LIB=libmstring.so;call_external0,140668924975952,true,false,argsend proc

(2)

extcall:=DefineExternal'mstring_uppercase',extlib,Copyright (c) 2001, ...

extcall:=procoptioncall_external,define_externalmstring_uppercase,MAPLE,LIB=libmstring.so,COPYRIGHT=Copyright (c) 2001, ...,copyright=Copyright (c) 2001, ...;call_external0,140668924975952,true,false,argsend proc

(3)

See Also

CustomWrapper, define_external, external_calling, ExternalCalling, ExternalCalling[ExternalLibraryName]


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam