typedef enum traverse_mode to enable list_traverse() to take traverse_mode as parameter