00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef CUFLOW_WIND_H
00019 #define CUFLOW_WIND_H
00020
00021 #include <cuflow/fwd.h>
00022 #include <cu/conf.h>
00023
00024 CU_BEGIN_DECLARATIONS
00025
00026 typedef enum {
00027 cuflow_wind_direction_normal,
00028 cuflow_wind_direction_unwind,
00029 cuflow_wind_direction_rewind,
00030 cuflow_wind_direction_except,
00031 } cuflow_wind_direction_t;
00032
00033 typedef struct cuflowP_windargs *cuflowP_windargs_t;
00034 struct cuflowP_windargs
00035 {
00036 cuflow_wind_direction_t direction;
00037 cu_fnptr_t xc_key;
00038 };
00039
00040 #define CUFLOW_WIND_VARIANT_SETJMP 1
00041 #define CUFLOW_WIND_VARIANT_UNW 2
00042 #define CUFLOWP_IN_WIND_H
00043 CU_END_DECLARATIONS
00044 #if CUCONF_WIND_VARIANT == CUFLOW_WIND_VARIANT_UNW
00045 # include <cuflow/wind_unw.h>
00046 #elif CUCONF_WIND_VARIANT == CUFLOW_WIND_VARIANT_SETJMP
00047 # include <cuflow/wind_setjmp.h>
00048 #else
00049 # error Bad value or undefined CUCONF_WIND_VARIANT.
00050 #endif
00051 CU_BEGIN_DECLARATIONS
00052 #undef CUFLOWP_IN_WIND_H
00053
00054 #define cuflow_wind_gotos() \
00055 cuflowP_wind_gotos(goto unwind, goto rewind, goto except)
00056 #define cuflow_except_goto() \
00057 cuflowP_wind_gotos(cuflow_unwind_return, cuflow_rewind_return, goto except)
00058
00059 CU_END_DECLARATIONS
00060
00061 #endif