Microchip Technology SW006021-1N ユーザーズマニュアル
![Microchip Technology](https://files.manualsbrain.com/attachments/cf42c3c895ef469f06d2e47e97fd98d738fcf5cf/common/fit/150/50/7340124dc8aa983aaf764094e2f06faab86f306c03111c5817f7e4e53fb2/brand_logo.gif)
Library Functions
2012 Microchip Technology Inc.
DS52053B-page 357
SETJMP
Synopsis
#include <setjmp.h>
int setjmp (jmp_buf buf)
Description
The
setjmp()
function is used with longjmp() for non-local goto’s. See longjmp()
for further information.
Example
#include <stdio.h>
#include <setjmp.h>
#include <stdlib.h>
jmp_buf jb;
void
inner (void)
{
longjmp(jb, 5);
}
void
main (void)
{
int i;
if(i = setjmp(jb)) {
printf("setjmp returned %d\n", i);
exit(0);
}
printf("setjmp returned 0 - good\n");
printf("calling inner...\n");
inner();
printf("inner returned - bad!\n");
}
See Also
longjmp()
Return Value
The
setjmp()
function returns zero after the real call, and non-zero if it apparently
returns after a call to longjmp().
SIN
Synopsis
#include <math.h>
double sin (double f)
Description
This function returns the sine function of its argument.