setjmp.h revision 18286
177943Sdfr/*- 2218822Sdim * Copyright (c) 1990, 1993 377943Sdfr * The Regents of the University of California. All rights reserved. 477943Sdfr * (c) UNIX System Laboratories, Inc. 577943Sdfr * All or some portions of this file are derived from material licensed 677943Sdfr * to the University of California by American Telephone and Telegraph 777943Sdfr * Co. or Unix System Laboratories, Inc. and are reproduced herein with 877943Sdfr * the permission of UNIX System Laboratories, Inc. 977943Sdfr * 10117676Smarcel * Redistribution and use in source and binary forms, with or without 11117676Smarcel * modification, are permitted provided that the following conditions 12117676Smarcel * are met: 13117676Smarcel * 1. Redistributions of source code must retain the above copyright 14117676Smarcel * notice, this list of conditions and the following disclaimer. 1577943Sdfr * 2. Redistributions in binary form must reproduce the above copyright 1685475Sdfr * notice, this list of conditions and the following disclaimer in the 17117676Smarcel * documentation and/or other materials provided with the distribution. 1877943Sdfr * 3. All advertising materials mentioning features or use of this software 19218822Sdim * must display the following acknowledgement: 20218822Sdim * This product includes software developed by the University of 21218822Sdim * California, Berkeley and its contributors. 22117676Smarcel * 4. Neither the name of the University nor the names of its contributors 23117676Smarcel * may be used to endorse or promote products derived from this software 24117676Smarcel * without specific prior written permission. 25117676Smarcel * 26117676Smarcel * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 27117676Smarcel * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 28117676Smarcel * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2977943Sdfr * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 3077943Sdfr * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 3177943Sdfr * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32117676Smarcel * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3377943Sdfr * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3477943Sdfr * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35218822Sdim * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36218822Sdim * SUCH DAMAGE. 3777943Sdfr * 3885436Sdfr * @(#)setjmp.h 8.2 (Berkeley) 1/21/94 39117676Smarcel */ 40117676Smarcel 4185475Sdfr#ifndef _SETJMP_H_ 42117676Smarcel#define _SETJMP_H_ 43117676Smarcel 44117676Smarcel#if defined(__hp300__) || defined(__luna68k__) 4577943Sdfr#define _JBLEN 17 4677943Sdfr#endif 4777943Sdfr 48117676Smarcel#if defined(__i386__) 4977943Sdfr#define _JBLEN 8 50132435Smarcel#endif 51117676Smarcel 52117676Smarcel#if defined(__mips__) 53117676Smarcel#define _JBLEN 83 5477943Sdfr#endif 55117676Smarcel 56117676Smarcel#if defined(__sparc__) 57117676Smarcel#define _JBLEN 10 58117676Smarcel#endif 59117676Smarcel 60117676Smarcel#if defined(__tahoe__) 61117676Smarcel#define _JBLEN 10 6283078Sdfr#endif 63117676Smarcel 6477943Sdfr#if defined(__vax__) 6577943Sdfr#define _JBLEN 10 66117676Smarcel#endif 6777943Sdfr 68117676Smarcel/* 6977943Sdfr * jmp_buf and sigjmp_buf are encapsulated in different structs to force 70117676Smarcel * compile-time diagnostics for mismatches. The structs are the same 71117676Smarcel * internally to avoid some run-time errors for mismatches. 72117676Smarcel */ 7377943Sdfr#ifndef _ANSI_SOURCE 74typedef struct { int _sjb[_JBLEN + 1]; } sigjmp_buf[1]; 75#endif /* not ANSI */ 76 77typedef struct { int _jb[_JBLEN + 1]; } jmp_buf[1]; 78 79#include <sys/cdefs.h> 80 81__BEGIN_DECLS 82int setjmp __P((jmp_buf)); 83void longjmp __P((jmp_buf, int)) __dead2; 84 85#ifndef _ANSI_SOURCE 86int sigsetjmp __P((sigjmp_buf, int)); 87void siglongjmp __P((sigjmp_buf, int)) __dead2; 88#endif /* not ANSI */ 89 90#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) 91int _setjmp __P((jmp_buf)); 92void _longjmp __P((jmp_buf, int)) __dead2; 93void longjmperror __P((void)); 94#endif /* neither ANSI nor POSIX */ 95__END_DECLS 96 97#endif /* !_SETJMP_H_ */ 98