X-Git-Url: http://git.samba.org/?a=blobdiff_plain;f=case_N.h;h=f15d1d607efa7d7c1f7b6dda7e68a954d1feeb79;hb=79332c0d66d933369a28c63b096addb67514cb38;hp=b43f839101c58cfcc1f49614759160fb6c94a6e9;hpb=fdd10da6f7995296f6bb5ee3dd7231d6dbc20b5e;p=rsync.git diff --git a/case_N.h b/case_N.h index b43f8391..f15d1d60 100644 --- a/case_N.h +++ b/case_N.h @@ -1,11 +1,11 @@ /* - * End-of-run cleanup helper code used by cleanup.c. + * Allow an arbitrary sequence of case labels. * - * Copyright (C) 2006 Wayne Davison + * Copyright (C) 2006-2018 Wayne Davison * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -14,68 +14,79 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + * with this program; if not, visit the http://fsf.org website. */ -/* The file cleanup.c includes this file multiple times, once for every - * time it wants to start a new segment its _exit_cleanup() code. This - * produces the next "case N:" statement in sequence and increments the - * cleanup_step variable. This ensures that our case statements never - * get out of whack due to added/removed steps. */ +/* This is included multiple times, once for every segement in a switch statement. + * This produces the next "case N:" statement in sequence. */ -#if !defined EXIT_CLEANUP_CASE_0 -#define EXIT_CLEANUP_CASE_0 +#if !defined CASE_N_STATE_0 +#define CASE_N_STATE_0 case 0: -#elif !defined EXIT_CLEANUP_CASE_1 -#define EXIT_CLEANUP_CASE_1 +#elif !defined CASE_N_STATE_1 +#define CASE_N_STATE_1 + /* FALLTHROUGH */ case 1: -#elif !defined EXIT_CLEANUP_CASE_2 -#define EXIT_CLEANUP_CASE_2 +#elif !defined CASE_N_STATE_2 +#define CASE_N_STATE_2 + /* FALLTHROUGH */ case 2: -#elif !defined EXIT_CLEANUP_CASE_3 -#define EXIT_CLEANUP_CASE_3 +#elif !defined CASE_N_STATE_3 +#define CASE_N_STATE_3 + /* FALLTHROUGH */ case 3: -#elif !defined EXIT_CLEANUP_CASE_4 -#define EXIT_CLEANUP_CASE_4 +#elif !defined CASE_N_STATE_4 +#define CASE_N_STATE_4 + /* FALLTHROUGH */ case 4: -#elif !defined EXIT_CLEANUP_CASE_5 -#define EXIT_CLEANUP_CASE_5 +#elif !defined CASE_N_STATE_5 +#define CASE_N_STATE_5 + /* FALLTHROUGH */ case 5: -#elif !defined EXIT_CLEANUP_CASE_6 -#define EXIT_CLEANUP_CASE_6 +#elif !defined CASE_N_STATE_6 +#define CASE_N_STATE_6 + /* FALLTHROUGH */ case 6: -#elif !defined EXIT_CLEANUP_CASE_7 -#define EXIT_CLEANUP_CASE_7 +#elif !defined CASE_N_STATE_7 +#define CASE_N_STATE_7 + /* FALLTHROUGH */ case 7: -#elif !defined EXIT_CLEANUP_CASE_8 -#define EXIT_CLEANUP_CASE_8 +#elif !defined CASE_N_STATE_8 +#define CASE_N_STATE_8 + /* FALLTHROUGH */ case 8: -#elif !defined EXIT_CLEANUP_CASE_9 -#define EXIT_CLEANUP_CASE_9 +#elif !defined CASE_N_STATE_9 +#define CASE_N_STATE_9 + /* FALLTHROUGH */ case 9: -#elif !defined EXIT_CLEANUP_CASE_10 -#define EXIT_CLEANUP_CASE_10 +#elif !defined CASE_N_STATE_10 +#define CASE_N_STATE_10 + /* FALLTHROUGH */ case 10: -#elif !defined EXIT_CLEANUP_CASE_11 -#define EXIT_CLEANUP_CASE_11 +#elif !defined CASE_N_STATE_11 +#define CASE_N_STATE_11 + /* FALLTHROUGH */ case 11: -#elif !defined EXIT_CLEANUP_CASE_12 -#define EXIT_CLEANUP_CASE_12 +#elif !defined CASE_N_STATE_12 +#define CASE_N_STATE_12 + /* FALLTHROUGH */ case 12: -#elif !defined EXIT_CLEANUP_CASE_13 -#define EXIT_CLEANUP_CASE_13 +#elif !defined CASE_N_STATE_13 +#define CASE_N_STATE_13 + /* FALLTHROUGH */ case 13: -#elif !defined EXIT_CLEANUP_CASE_14 -#define EXIT_CLEANUP_CASE_14 +#elif !defined CASE_N_STATE_14 +#define CASE_N_STATE_14 + /* FALLTHROUGH */ case 14: -#elif !defined EXIT_CLEANUP_CASE_15 -#define EXIT_CLEANUP_CASE_15 +#elif !defined CASE_N_STATE_15 +#define CASE_N_STATE_15 + /* FALLTHROUGH */ case 15: -#elif !defined EXIT_CLEANUP_CASE_16 -#define EXIT_CLEANUP_CASE_16 +#elif !defined CASE_N_STATE_16 +#define CASE_N_STATE_16 + /* FALLTHROUGH */ case 16: #else #error Need to add more case statements! #endif - cleanup_step++;