IMO, writing an exit in LE C/C++ just isn't worth the hassle. To write a proper glue code stub you will need to call your C program via the LE CEEPIPI service. Trying to get the CAA from the TCB is a shot in the dark as each ISPF screen runs in a subtask, and IIRC using the SELECT CMD(...) service will use ATTACH. I'm not sure what TCB in the hierarchy LE stores the CAA.

Check out the Metal/C or Systems Programming C (SPC) features of the compiler, both of which will suffice for writing an exit.

Tom Quarendon wrote:
Anyone have any wisdom or experience of writing a VDEFINE user exit for ISPF in 
C?

My experience so far is mixed, it certainly isn't as easy as writing a C 
function and making it

#pragma linkage(OS)

and passing its entry point to ISPF.

At least one problem seems to be that when running "interactively" from TSO 
your exit gets called on a different subtask. Don't know whether the terminology there is 
right, but either way the Language Environment isn't initialised - getting the LE anchor 
pointer from the TCB fails. Running from batch seems better, the LE anchor seems to be 
present - so exit seems to be run on same task(?).

You seem to have to write the exit in assembler and use the CEEENTRY macro to 
define the prolog/epilog of the function in order to get LE initialised and to 
be able to call to other C functions.

Anyway I've got a fair way, but it all seems rather a battle, so I was hoping 
there was something simple I'd missed. I'm also worried that if I'm creating a 
new LE enclave each time (as the CEEENTRY macro will do in the TSO case) it's 
going to be hopelessly inefficient, even if it does work. Having a separate LE 
enclave is really not helpful anyhow as I want access to the global variables 
that I might have set before I called into ISPF.



Any wisdom would be gratefully received.



Tom Quarendon.





----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to