gtpc2m18 | C/C++ Language Support User's Guide |
This macro creates a low-priority independent ECB for deferred
processing.
A variable number of bytes may be passed to the created ECB's work
area starting at EBW000. The TPF system moves the parameters into 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.
Format
#include <tpfapi.h>
void crexc(int length, const void *parm, void (*segname)());
void __CREXC(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 are to be
passed. A maximum of 104 bytes may be passed.
- parm
- A pointer of type void to the parameters to be passed.
- segname
- For crexc, a pointer to the external function to be
called. For __CREXC, a pointer to the name of the segment to
be called. segname must map to an assembler segment name, a
TARGET(TPF) segment name (or transfer vector), or a TPF ISO-C dynamic link
module (DLM) name.
Migration to ISO-C consideration |
---|
The TARGET(TPF) crexc function can handle segment names that are
#pragma mapped. The ISO-C crexc function
only handles #pragma mapped names if the first 4 characters
are the same as the program name. |
TARGET(TPF) restriction |
---|
Only calls to certain TPF API functions permit the use of function
pointers. Pointers to functions are not supported in TARGET(TPF);
their use normally results in a compiler error. |
Normal Return
Void.
Error Return
Not applicable.
Programming Considerations
- This macro works similarly to credc except that
crexc requires a greater number of available core blocks before the
entry is created. The crexc macro should be used by programs
that create many entries, such as utilities, in order to limit the use of
working storage and creation of entries to minimize the impact on more
time-dependent entries.
- No linkage is provided between the created ECB and the active ECB calling
this macro.
- The ECB calling crexc 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.
- ECBs are started on the I-stream where the create macro was issued.
- The 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
the string VPH as input data to the program.
#include <tpfapi.h>
void COT0();
char *parmstring = "VPH";
·
·
·
crexc(strlen(parmstring),parmstring,COT0);
Related Information