EntryApi functions

ITPEntryApiLevelRequired

Function name

ITPAPIR

Input

level

ENTRYAPI version that is required by the calling entry program. Currently 3.

Output

return code

RC_OK
RC_ITPLVLREQ_API_IS_OLDER
RC_ITPLVLREQ_NO_LONGER_SUPPORTED

Remark

This is the first function that must be called from within an entry program. If this function is not called, every other function call to this DLL will fail.

C-prototype

long ITPAPIR( long level_required )

ITPRcvInputParameterBlock

Function name

ITPRCV

Input

buffer

Buffer where the input data (keys) is to be stored

 

buffer_size

Size of the buffer where the input data is to be stored in bytes

Output

return code

RC_ITPRCVDATA_CANNOT_ACCESS_INPUT
RC_ITPRCVDATA_BUFFER_TO_SMALL
RC_ITPRCVDATA_READ_ERROR
RC_OK

Remark

If the function or program is being called for key retrieval, there will be one additional parameter, specifying the maximum number of records to send to ITP. This extra parameter will be the first parameter in the buffer. It is 10 bytes long and contains the number of records to send as text, left padded with zeros.

C-prototype

long ITPRCV(void *buffer, long buffer_size)

The buffer must have the following structure:

Bytes

1

2

3.. l1 + 2

l1 + 3

...

...

...

...

...

Data

number of parameters (n)

length of the first parameter (l1)

the first parameter

length of the second parameter

the second parameter

...

...

length of the n-th parameter

the n-th parameter

ITPOpenOutput

Function name

ITPOPEN

Output

return code

RC_OK

C-prototype

long ITPOPEN(void)

ITPSendData

Function name

ITPSND

Input

buffer

Buffer containing one output record

 

buffer_size

Size of the output record in bytes

Output

return code

RC_ITPSNDDTA_WRITE_ERROR

RC_OK

C-prototype

long ITPSND(void *buffer, long buffer_size)

ITPError

Function name

ITPERR

Input

buffer

Buffer containing error data/message. A fatal error will be displayed while running the model. The running of the model will be stopped.

 

buffer_size

Size of the error data/message in bytes

Output

return code

RC_ITPSNDDTA_WRITE_ERROR

RC_OK

C-prototype

long ITPERR(void *buffer, long buffer_size)

ITPCloseOutput

Function name

ITPCLOSE

Input

return_code

0=no errors occurred, else error code. This error code is returned to ITP. A fatal error will be displayed by the ITP DataManager. The ITP DataManager will be stopped.

Output

return code

RC_OK

C-prototype

long EXPORT ITPCLOSE(long return_code)

Return codes

The return codes used in the previous section have the following numeric values:

RC_OK

0

RC_FATAL_ERROR

1

RC_LVL_UNKNOWN

2

RC_LVL_UNSUPPORTED

3

RC_ITPLVLREQ_API_IS_OLDER

100

RC_ITPLVLREQ_NO_LONGER_SUPPORTED

101

RC_ITPRCVDATA_BUFFER_TO_SMALL

200

RC_ITPRCVDATA_CANNOT_ACCESS_INPUT

201

RC_ITPRCVDATA_READ_ERROR

202

RC_ITPSNDDATA_WRITE_ERROR

300