HP-UX SNAplus2 R7 LUA Programmer's Guide

Designing and Writing LUA Applications
LUA Entry Points for HP-UX Applications
2.1.1 RUI Function Call
void RUI(verb)
LUA_VERB_RECORD * verb;
2.1.2 SLI Function Call
AP_UINT32 SLI(verb)
LUA_VERB_RECORD * verb;
2.1.3 Supplied Parameters
Supplied parameter is:
verb
Pointer to a Verb Control Block (VCB) that contains the parameters for the verb being issued. The VCB
structure is dened in the LUA header le
/usr/include/sna/lua_c.h, and is described in Chapter
3, LUA VCB Structure.
Note
The LUA VCB contains many parameters marked as reserved; some of these are
used internally by the SNAplus2 software, and others are not used in this version
but may be used in future versions. Your application must not attempt to access any
of these reserved parameters; instead, it must set the entire contents of the VCB to
zero to ensure that all of these parameters are zero, before it sets other parameters
that are used by the verb. This ensures that SNAplus2 will not misinterpret any of
its internally-used parameters, and also that your application will continue to work
with future SNAplus2 versions in which these parameters may be used to provide
new functions.
To set the VCB contents to zero, use memset:
memset(vcb, 0, sizeof(vcb));
2.1.4 Returned Values
For RUI, and for all SLI verbs except for SLI_OPEN, the entry point does not return a value. The returned
parameters in the VCB indicate whether the verb has completed synchronously or will complete asynchronously;
after the verb has completed, the VCB contains the results of the verb.
For SLI_OPEN, the entry point returns a value indicating whether the VCB passed LUAs initial checks:
A return value of 0 (zero) indicates that the verb failed LUAs initial checks (for example because the application
supplied incorrect parameters). SNAplus2 will not call the application-supplied callback routine.
A non-zero value represents the session ID of the new session that SLI_OPEN will start.
This return value does not indicate that the verb has completed. SNAplus2 will call the application-supplied
callback routine to indicate SLI_OPEN completion when the session has been set up.
For more information, see Section 2.1.5, Usage.
2.1.5 Usage
Sometimes LUA is sometimes able to complete all the processing for a verb as soon as it is issued. This applies
particularly if the verb failed LUAs initial parameter checks or state checks and so cannot be acted on. When this
25