credc, __CREDC: Create a deferred entry

This macro creates an independent ECB for deferred processing.

The ECB is created in the same subsystem and for the same subsystem user as the creating ECB. Additionally, the ECB is created on the same I-stream as the creating ECB.

A variable number of bytes can be passed to the created ECB work area starting at EBW000. The z/TPF system moves the parameters to an interim block of available storage and adds this block to the deferred list. Operational program zero (OPZERO) initializes an ECB with the parameters in the work area, releases the interim block, and activates the specified program.

Last updated

  • Changed for PUT14 (information only; no code change).
  • Changed for PUT06.
  • Changed for PUT00.

Format

#include   <tpf/tpfapi.h>
void       credc(int length, const void *parm, void (*segname)());
void       __CREDC(int length, const void *parm, const char *segname);
length
An integer containing the number of bytes to be passed to the created ECB. A value of zero indicates that no parameters will be passed. A maximum of 104 bytes may be passed.
parm
A pointer of type void to the parameters to be passed.
segname
For credc, a pointer to the external function to be called. For __CREDC, a pointer to the name of the segment to be called. segname must map to an assembler segment name or a C shared object (CSO) name.
Note: C language migration consideration

The credc function only handles #pragma mapped names if the first 4 characters are the same as the program name.

Normal return

Void.

Error return

Not applicable.

Programming considerations

  • No linkage is provided between the created ECB and the active ECB calling this macro.
  • The ECB calling credc may be forced into a wait if there is insufficient storage available to buffer the parameters. When adequate working storage becomes available, the macro is executed and control is returned.
  • The created ECB begins processing on the same I-stream where the create function was called.
  • Use of this macro should be limited to prevent a depletion of storage.
  • A system error with exit occurs if no block is held on the specified level, or if more than 104 bytes of parameters are passed.

Examples

The following example creates a deferred entry for program COT0, passing string VPH as input data to the program.
#include <tpf/tpfapi.h>
void COT0();
char *parmstring = "VPH";
 :
credc(strlen(parmstring),parmstring,COT0);