-/** Get the next node if available or the same node again.
- *
- * \param type The type of the containing data structure
- *
- * \param node The variable name for current node in the iteration;
- * this will be declared as a pointer to \p type
- *
- * \param field The rb_node field in containing data structure
- */
-#define rb_tree_node_next_if_available(type, node, field) \
- (&node->field != NULL) ? rb_node_data(type, rb_node_next(&node->field), field) : node
-
-/** Get the previous node if available or the same node again.
- *
- * \param type The type of the containing data structure
- *
- * \param node The variable name for current node in the iteration;
- * this will be declared as a pointer to \p type
- *
- * \param field The rb_node field in containing data structure
- */
-#define rb_tree_node_prev_if_available(type, node, field) \
- (&node->field != NULL) ? rb_node_data(type, rb_node_prev(&node->field), field) : node
+#define rb_node_next_or_null(n) ((n) == NULL ? NULL : rb_node_next(n))
+#define rb_node_prev_or_null(n) ((n) == NULL ? NULL : rb_node_prev(n))