Exit programs

Top  Previous  Next

Some aspects of the configuration as well as some run-time behaviour of XCICS/TS may be influenced and/or driven by user exit programs.

XCICS/TS supports the following type of exit programs:

odcs_ts
snt_loader
user_signon
user_signoff
user_chpasswd
dfhaid

Exit programs are normally coded by the user in C language routine, compiled and linked in a shared library and declared at configuration time.

General coding rules

The exit programs are normally coded in C language and their entry point must respect the function prototype described in program specific section. These rules should be observed

The source program must include the file "cics_exit.h".
Local routines should be declared "static".
Entry points must be declared as "XCICS_EXIT_PROGRAM"

Example

#include "cics_exit.h"
 
int XCICS_EXIT_PROGRAM my_exit_program();
 
static int my_own_routine();
 
int XCICS_EXIT_PROGRAM my_exit_program() {
  my_own_routine();
  return 0;
}
 
static int my_own_routine() {
  return 1;
}

Compiling & Linking

UNIX/Linux

The exit program sources must be compiled, producing a link-editable PIC object (.o). and then linked into a shared library.

Both compiling and linking require a set of platform and installation dependant options, that must fit the XCICS building options. To facilitate the programmer's work, an include file for the make system is available at $XFRAMEHOME/include/xport.make. Including this file in the user Makefile the correct set of options and command is ready to be used.

Example

#
# makefile
#
COMPILE=$(CC) -I $(XFRAMEHOME)/include \
            -I$(XFRAMEHOME)/xcics/cpy \
            -I$(XFRAMEHOME)/xsdf/cpy
            -I$(XFRAMEHOME)/xvsam6/cpy
all: $(HOME)/lib/libuserexit.$(SHLSUFFIX)
 
$(HOME)/lib/libuserexit.$(SHLSUFFIX): dfhaid.o signon.o
  $(LDSHARED) -o $(HOME)/lib/libuserexit.$(SHLSUFFIX) dfhaid.o signon.o
 
signon.o: signon.c
  $(COMPILE) -c signon.c
 
dfhaid.o: dfhaid.c
  $(COMPILE) -c dfhaid.c

Windows

The exit program sources must be compiled, producing a link-editable object (.o). and then linked into a DLL.

Both compiling and linking require a set of platform and installation dependant options, that must fit the XCICS building options. To facilitate the programmer's work, an include file for the nmake system is available at $XFRAMEHOME/include/xframe.make. Including this file in the user Makefile the correct set of options and command is ready to be used. If XCICS internal APIs are invoked in the user code, it is necessary to link the DLL with libcx.lib.

Example

#
# NMAKE makefile
#
       
XFRAMEHOME=D:\xframe
 
include D:\xframe\include\xframe.nmake
 
all: CPROG01.dll
 
LIBUSER01.dll:     LIBUSER01.c
       cl $(XFRAME_CFLAGS) -c $*.c
       link /dll /out:$*.dll $*.obj $(XFRAMEHOME)/bin/libcx.lib