contentsconceptssyntaxlibrariessampleserrorsindex
Full text search
External functions: declaring
Prerequisite Concepts     Related Syntax  

An external function definition starts out looking like an OmniMark function definition: it has an optional result type, a function name, and an argument list. The keyword external follows define to make it clear that an external function is being declared, but it's what follows the as that really differentiates an external function from internal functions.

For an external function, OmniMark requires an external function name and an optional external function library name, specifying where to find the function. The only other difference between an external function definition and an internal function definition is that external functions cannot have optional or remainder arguments.

How the external function name and the external function libarary name are interpreted depends on the sytem on which the OmniMark program is being run. They have to be constant string expressions in the function definition, but they can be changed by the actions set external-function and set function-library of external-function.

The in function-library part of an external function definition can only be omitted with the declare function-library declaration is used to specify a default library.

It is possible to declare an external function without specifying the function's name and library name. This is not an error, since the name and library name can be determined and specified at a later point in the program using set external-function and set function-library of external-function.

The following is an example of such a function definition:

  define external function get-db-record
     (value stream key, value stream value)
     as "*" in function-library "*"

The set external-function and set function-library of external-function actions could be as follows:

  set external-function get-db-record to "gdbrec"
  set function-library of external-function get-db-record to "mylib.so"

Prerequisite Concepts
     External functions
   Function types and anatomy
 
  Related Syntax
   define function
 
----

Top [CONTENTS] [CONCEPTS] [SYNTAX] [LIBRARIES] [SAMPLES] [ERRORS] [INDEX]

Generated: April 21, 1999 at 2:00:48 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © OmniMark Technologies Corporation, 1988-1999.