Lines Matching refs:name
69 #define DEFINE_GLOBALS_AND_CBS(name, ...) \ argument
70 static uv_##name##_t (name)[3]; \
71 static unsigned name##_cb_calls[3]; \
73 static void name##2_cb(__VA_ARGS__) { \
74 ASSERT_PTR_EQ(handle, &(name)[2]); \
75 if (first_handle_number_##name == 2) { \
76 uv_close((uv_handle_t*)&(name)[2], NULL); \
77 uv_close((uv_handle_t*)&(name)[1], NULL); \
79 name##_cb_calls[2]++; \
82 static void name##1_cb(__VA_ARGS__) { \
83 ASSERT_PTR_EQ(handle, &(name)[1]); \
84 ASSERT(0 && "Shouldn't be called" && (&name[0])); \
87 static void name##0_cb(__VA_ARGS__) { \
88 ASSERT_PTR_EQ(handle, &(name)[0]); \
89 if (first_handle_number_##name == 0) { \
90 uv_close((uv_handle_t*)&(name)[0], NULL); \
91 uv_close((uv_handle_t*)&(name)[1], NULL); \
93 name##_cb_calls[0]++; \
96 static const uv_##name##_cb name##_cbs[] = { \
97 name##0_cb, \
98 name##1_cb, \
99 name##2_cb, \
102 #define INIT_AND_START(name, loop) \ argument
105 for (i = 0; i < ARRAY_SIZE(name); i++) { \
107 r = uv_##name##_init((loop), &(name)[i]); \
110 r = uv_##name##_start(&(name)[i], name##_cbs[i]); \
115 #define END_ASSERTS(name) \ argument
117 ASSERT_EQ(1, name##_cb_calls[0]); \
118 ASSERT_OK(name##_cb_calls[1]); \
119 ASSERT_EQ(1, name##_cb_calls[2]); \