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.

