HP-UX SNAplus2 R7 LUA Programmer's Guide

Designing and Writing LUA Applications
LUA Entry Points for HP-UX Applications
2 Designing and Writing LUA Applications
The information contained in this chapter will help you write LUA application programs. The following topics are
covered:
LUA entry points for HP-UX applications
LUA entry points for Windows applications
Issuing an LUA verb
SNA information
Conguration information
HP-UX environment considerations
Windows environment considerations
Writing portable applications
2.1 LUA Entry Points for HP-UX Applications
UNIX
HP-UX Applications access LUA using the RUI or SLI function call, specifying the address of a Verb Control
Block (VCB) containing information for an LUA verb. SNAplus2 returns control to the application immediately.
The returned VCB contains a value indicating whether verb processing is still in progress or has completed.
In some cases, verb processing is still in progress when control returns to the application; SNAplus2 then uses
an application-supplied callback routine to return the results of the verb processing.
In other cases, verb processing is complete when SNAplus2 returns control to the application; SNAplus2 does
not use the applications callback routine. This applies particularly if the verb failed LUAs initial parameter
checks or state checks and so cannot be acted on.
For SLI_OPEN, if the initial checks succeed, the SLI function call returns a non-zero value representing the
session ID of the new session. SNAplus2 then uses the application-supplied callback routine in the same way
as for other verbs. The application can use the new session ID to issue a limited range of subsequent verbs on
the session, without waiting for the callback routine to be called. For details of which verbs can be issued in
this situation, see Section 5.3.4, Interaction with Other Verbs.
Note
Because of the way HP-UX callback routines operate, it is possible that the applications
callback routine will be called before control returns to the application from its initial
function call for the verb. This means that, if the callback routine modies or deletes the
returned VCB, the programs main thread of execution may be unable to check the VCB
parameters to determine that the verb is operating asynchronously. You may need to take
account of this in your application design.
The entry points RUI and SLI are dened in the LUA header le /usr/include/sna/lua_c.h.
24