
CHAPTER 7: Integrating External Libraries Defining entry points for direct access 204
X string
— Must be UTF-8 encoded.
The library must define an entry point ESFreeMem()
, which ExtendScript calls to release a returned
string pointer. If this entry point is missing, ExtendScript does not attempt to release any returned
string data.
X Script — A string to be evaluated by ExtendScript. Use to return small JavaScript scripts that define
arbitrarily complex data.
If, when a function is invoked, a supplied parameter is undefined, ExtendScript sets the data type to
undefined and does not attempt to convert the data to the requested type.
N
OTE: The data type of a return value cannot be predefined; JavaScript functions can return any data type.
The called function is free to return any of the listed data types.
Library initialization
ExtendScript calls ESInitialize() to initialize the library.
X The function receives an argument vector containing the additional arguments passed in to the
ExternalObject constructor.
X The function can return an array of function name-signature strings, which are used to support the
ExtendScript reflection interface
, and to cast function arguments to specific types. You do not need to
define a signature for a function in order to make it callable in JavaScript.
Function signatures
If you choose to return a set of function name-signature strings, each string associates a function name
with that function’s parameter types, if any. For example:
["functionName1_argtypes", "functionName2_argtypes", "functionName3"]
For each function, the string begins with the function name, followed by an underscore character and a list
of argument data types, represented as a single character for each argument. If the function does not have
arguments, you can omit the trailing underscore character (unless there is an underscore in the function
name).
The characters that indicate data types are:
a
Any type. The argument is not converted. This is the default, if no type is supplied or if a type
code is unrecognized.
b
Boolean
d
signed 32 bit integer
u
unsigned 32 bit integer
f
64 bit floating point
s
String
Comentários a estes Manuais