HP-UX SNAplus2 R7 LUA Programmer's Guide

Designing and Writing LUA Applications
Issuing an LUA Verb
UNIX
rui_init.common.lua_post_handle = (unsigned long) callback;
WINDOWS
The rui_init.common.lua_post_handle parameter is reserved; leave it as 0 (zero).
The values LUA_VERB_RUI and LUA_OPCODE_RUI_INIT are symbolic constants. These constants are
dened in the header le /usr/include/sna/lua_c.h (HP-UX applications) or sdk/winlua.h
(Windows applications); you are recommended to use the symbolic constants and not the integer values, for
portability between different systems. (For more information, see Section 2.9, Writing Portable Applications.)
6. Invoke LUA. The address of the VCB structure is a parameter to the function call.
UNIX
RUI ( &rui_init );
WINDOWS
The WinRUI entry point requires an additional parameter, which is a window handle for the window to which
LUA will post a message indicating asynchronous completion of the verb.
WinRUI ( handle, (LUA_VERB_RECORD far * ) &rui_init );
7. Check the lua_ag2.async parameter to nd out whether the verb has completed synchronously or will complete
asynchronously.
if (rui_init.common.lua_flag2.async )
{
/* verb will complete asynchronously */
/* using the supplied callback routine */
/* continue with other processing */
.
.
.
}
else
{
/* verb has completed synchronously */
/* callback routine will not be called */
/* process the returned values here */
.
.
.
}
If the lua_ag2.async parameter indicates that the verb will complete asynchronously, the programs main thread
of execution should not access any other parameters in the VCB at this point. When LUA calls the callback
routine, the application can then access the VCB parameters.
8. Use the variables returned by LUA. If Step 7 indicates that the verb will complete asynchronously, this step
must not be performed until the verb has completed; on HP-UX systems, the processing is typically done by
the callback routine. If Step 7 indicates that the verb has completed synchronously, the processing should be
done by the main code path because the callback routine will not be called.
43