11.07.2015 Views

Advanced Programming Guide

Advanced Programming Guide

Advanced Programming Guide

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

7.2 Using Compiled Code in Maple • 297r := 44Procedures generated in this manner contain run-time informationand thus cannot be saved. The define_external command must be reissuedafter exiting or restarting Maple.The following subsections provide additional information for Step 2,the function specification.External DefinitionThe define_external function constructs and returns another functionwhich can be used to make the actual call. The define_external functionis called as follows.define_external( functionName, LANGUAGE, arg1::type1, ...,argN::typeN, options, ‘LIB‘=dllName)define_external( functionName, ‘MAPLE‘,options, ‘LIB‘=dllName )• The functionName parameter specifies the name of the actual externalfunction to be called. This name can be specified as a Maple string orname.• The LANGUAGE parameter denotes the programming language usedto compile the DLL. The default is C. Other recognized languages areJAVA and FORTRAN.• The parameters arg1 through argN describe the arguments of thefunction to be called. These should be specified in the order theyappear in the documentation or source code for the external function,without regard to issues such as actual passing order (left toright versus right to left). The intent is that the Maple proceduredefine_external returns has the same calling sequence as the actualexternal function when used in the language for which it waswritten. The only exception is that one argument may be given thename RETURN. This specifies the type returned by the function ratherthan a parameter passed to the function. For more information abouthow each argi is specified, see the Type Specification section onpage 298.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!