COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
The cobsetjmp() macro is used with the coblongjmp() function for handling errors and
interrupts encountered in low-level functions of a mixed-language program. The cobsetjmp()
macro provides functionality similar to the standard HP C setjmp() function.
The cobsetjmp() macro cannot be called directly from an HP COBOL program. Applications
must call cobsetjmp() from an HP C module.
NOTES
All restrictions on the use of setjmp() apply to cobsetjmp() also.
EXAMPLES
The following example illustrates the use of cobsetjmp():
#include <cobsetjmp.h>
struct cobjmp_buf buf;
void
c_prog_1(void)
{
if (!cobsetjmp(&buf))
{
..............
/* can call C or COBOL programs here */
..............
}
else
printf("Returned from coblongjmp\n");
}
RELATED INFORMATION
cobsetjmp( ), longjmp(3), setjmp(3)
NOTE: The reference pages for longjmp(3) and setjmp(3) are located in the Open System Services
Library Calls Reference Manual.
coblongjmp function
NAME
coblongjmp() — performs a non-local jump in mixed language applications
SYNOPSIS
#include <cobsetjmp.h>
void coblongjmp (struct cobjmp_buf *buf);
LIBRARY
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCOBDLL
H-series and J-series OSS processes: /G/system/zdllnnn/zcobdll
PARAMETERS
buf
Specifies the buffer in which the execution environment was saved by a call to cobsetjmp().
DESCRIPTION
The coblongjmp() function restores the environment preserved in the buf parameter by a
previous call to the cobsetjmp() macro. The coblongjmp() function provides functionality
similar to the standard HP C longjmp() function.
Non-Local Jumps in HP COBOL Applications 653










