]> git.ipfire.org Git - thirdparty/bash.git/blame - unwind_prot.h
Bash-4.3 patch 7
[thirdparty/bash.git] / unwind_prot.h
CommitLineData
726f6388
JA
1/* unwind_prot.h - Macros and functions for hacking unwind protection. */
2
3185942a 3/* Copyright (C) 1993-2009 Free Software Foundation, Inc.
726f6388
JA
4
5 This file is part of GNU Bash, the Bourne Again SHell.
6
3185942a
JA
7 Bash is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
726f6388 11
3185942a
JA
12 Bash is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
726f6388 16
3185942a
JA
17 You should have received a copy of the GNU General Public License
18 along with Bash. If not, see <http://www.gnu.org/licenses/>.
19*/
726f6388
JA
20
21#if !defined (_UNWIND_PROT_H)
22#define _UNWIND_PROT_H
23
24/* Run a function without interrupts. */
f73dda09
JA
25extern void begin_unwind_frame __P((char *));
26extern void discard_unwind_frame __P((char *));
27extern void run_unwind_frame __P((char *));
28extern void add_unwind_protect (); /* Not portable to arbitrary C99 hosts. */
29extern void remove_unwind_protect __P((void));
30extern void run_unwind_protects __P((void));
31extern void clear_unwind_protect_list __P((int));
3185942a 32extern int have_unwind_protects __P((void));
7117c2d2 33extern void uwp_init __P((void));
726f6388
JA
34
35/* Define for people who like their code to look a certain way. */
36#define end_unwind_frame()
37
f73dda09
JA
38/* How to protect a variable. */
39#define unwind_protect_var(X) unwind_protect_mem ((char *)&(X), sizeof (X))
40extern void unwind_protect_mem __P((char *, int));
726f6388 41
f73dda09
JA
42/* Backwards compatibility */
43#define unwind_protect_int unwind_protect_var
44#define unwind_protect_short unwind_protect_var
45#define unwind_protect_string unwind_protect_var
46#define unwind_protect_pointer unwind_protect_var
47#define unwind_protect_jmp_buf unwind_protect_var
726f6388
JA
48
49#endif /* _UNWIND_PROT_H */