gtpc2m19 | C/C++ Language Support User's Guide |
This function provides the ability to enter a program and then return to the calling program.
Format
#include <sysapi.h> long int crosc_entrc(const char *segment, int idloc, struct TPF_regs *regs, ...);
TARGET(TPF) only |
---|
If regs is not null, the enter linkage works the same as if the segment had been called with #pragma linkage(name,TPF,N);. If regs is null, #pragma linkage(name,TPF,C) enter linkage is run with the optional parameter list passed to the called segment. |
ISO-C only |
---|
If regs is not NULL, the parameter list (regs) is passed along to the called segment. If regs is NULL, the optional parameter list is passed to the called segment. When regs is NULL and the called segment is a TPF BAL program, an additional NULL should be coded as the first and only optional parameter to indicate no TPF_regs to enter/back. |
Normal Return
The crosc_entrc function returns the value that was returned by the cross-entered function, cast to a (long int). Only integral and pointer values can be returned.
Error Return
Not applicable.
Programming Considerations
Examples
The following example executes the C language program CDEF in subsystem 0xF00F and then executes assembly language program WXYZ in the BSS.
#include <tpfeq.h> #include <sysapi.h> #pragma linkage(WXYZ,TPF,N) #pragma linkage(CDEF,TPF,C) extern void WXYZ(struct TPF_regs *regs); extern char *CDEF(int, double, char *);
·
·
·
/* */ /* call type C segment with 3 parameters: 1, 2.0 and "ABC" */ /* */ char *c = (char *)crosc_entrc("CDEF", 0xF00F, NULL,1, 2.0, "ABC"); struct TPF_regs reg = { 0 }; reg.r1 = 4; crosc_entrc("WXYZ", CROSC_BSS, ®);
·
·
·
Related Information