A helper file for cleanup.c.
[rsync/rsync.git] / case_N.h
1 /*
2  * End-of-run cleanup helper code used by cleanup.c.
3  *
4  * Copyright (C) 2006 Wayne Davison
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20
21 /* The file cleanup.c includes this file multiple times, once for every
22  * time it wants to start a new segment its _exit_cleanup() code.  This
23  * produces the next "case N:" statement in sequence and increments the
24  * cleanup_step variable.  This ensures that our case statements never
25  * get out of whack due to added/removed steps. */
26
27 #if !defined EXIT_CLEANUP_CASE_0
28 #define EXIT_CLEANUP_CASE_0
29         case 0:
30 #elif !defined EXIT_CLEANUP_CASE_1
31 #define EXIT_CLEANUP_CASE_1
32         case 1:
33 #elif !defined EXIT_CLEANUP_CASE_2
34 #define EXIT_CLEANUP_CASE_2
35         case 2:
36 #elif !defined EXIT_CLEANUP_CASE_3
37 #define EXIT_CLEANUP_CASE_3
38         case 3:
39 #elif !defined EXIT_CLEANUP_CASE_4
40 #define EXIT_CLEANUP_CASE_4
41         case 4:
42 #elif !defined EXIT_CLEANUP_CASE_5
43 #define EXIT_CLEANUP_CASE_5
44         case 5:
45 #elif !defined EXIT_CLEANUP_CASE_6
46 #define EXIT_CLEANUP_CASE_6
47         case 6:
48 #elif !defined EXIT_CLEANUP_CASE_7
49 #define EXIT_CLEANUP_CASE_7
50         case 7:
51 #elif !defined EXIT_CLEANUP_CASE_8
52 #define EXIT_CLEANUP_CASE_8
53         case 8:
54 #elif !defined EXIT_CLEANUP_CASE_9
55 #define EXIT_CLEANUP_CASE_9
56         case 9:
57 #elif !defined EXIT_CLEANUP_CASE_10
58 #define EXIT_CLEANUP_CASE_10
59         case 10:
60 #elif !defined EXIT_CLEANUP_CASE_11
61 #define EXIT_CLEANUP_CASE_11
62         case 11:
63 #elif !defined EXIT_CLEANUP_CASE_12
64 #define EXIT_CLEANUP_CASE_12
65         case 12:
66 #elif !defined EXIT_CLEANUP_CASE_13
67 #define EXIT_CLEANUP_CASE_13
68         case 13:
69 #elif !defined EXIT_CLEANUP_CASE_14
70 #define EXIT_CLEANUP_CASE_14
71         case 14:
72 #elif !defined EXIT_CLEANUP_CASE_15
73 #define EXIT_CLEANUP_CASE_15
74         case 15:
75 #elif !defined EXIT_CLEANUP_CASE_16
76 #define EXIT_CLEANUP_CASE_16
77         case 16:
78 #else
79 #error Need to add more case statements!
80 #endif
81                 cleanup_step++;