beautypg.com

Apple Newton Programmer’s Newton 2.0 (for Newton 2.0) User Manual

Page 833

background image

C H A P T E R 2 3

Endpoint Interface

About the Endpoint Interface

23-5

The different types of data forms and the defaults are described in more detail in
“Data Form Symbols” (Table 20-1 on page 20-2) in Newton Programmer’s
Reference
.

Only a subset of data form values is applicable for any particular operation.
Table 23-1 enumerates the data forms and their applicability to output specs, input
specs, and endpoint option frames.

Template Data Form

23

The

'template

data form enables you to pass data as if you were passing C

structures, and is thus extremely useful in communicating with the lower level
communication tools in getting and setting endpoint options.

When you set options or send data using the

'template

data form, the data is

expected to be a frame containing two slots,

arglist

and

typelist

. The

arglist

slot is an array containing the data, the list of arguments. The

typelist

slot is a corresponding array containing the types that describe the data.

To get endpoint options, the data in the

data

slot must be a frame containing the

arglist

and

typelist

arrays. The

arglist

array should contain placeholder

or default values. The system supplies the actual

arglist

values when the option

list is returned.

In the same manner, to receive data, you must add a

target

slot to your input

spec containing the

arglist

and

typelist

arrays. The

arglist

array contains

Table 23-1

Data form applicability

Data form

Output spec

Input spec

Option frame

'char

default for characters

OK

OK

'number

default for numbers

OK

OK

'string

default for strings

default

OK

'bytes

OK OK

OK

'binary

default for binary objects;
output spec can include
optional

target

slot

OK; input spec
must include

target

slot

OK

'template

OK

OK; input spec
must include

target

slot

default

'frame

OK

OK

not applicable