Program Entry and Exit Conditions

Entry Conditions
External commands receive control at a routine called lxmain(). Define this in your program as:

int lxmain(char* parm)

The argument is a pointer to the command parameter string.

The return value is the return code sent back to the Editor. The value -1 is reserved for use by the Editor; you must not return -1 from your external commands. All other return values are allowed.

Exit Conditions
An external command can have an exit clean up routine. Define this in your program as:

int lxexit (char * parms)

This optional subroutine can call other Editor functions (such as lxcmd("find up asis needle")). It should release any Editor storage acquired using lxalloc() or other storage acquired using malloc(), and it should terminate any other processes that have been linked to earlier by the command.


External Subroutines
Program Entry and Exit Conditions
Sample External Command: proto