Drizzled Public API Documentation

ut0lst.h File Reference
#include "univ.i"

Go to the source code of this file.

Defines

#define UT_LIST_BASE_NODE_T(TYPE)   int
#define UT_LIST_NODE_T(TYPE)
#define UT_LIST_INIT(BASE)
#define UT_LIST_ADD_FIRST(NAME, BASE, N)
#define UT_LIST_ADD_LAST(NAME, BASE, N)
#define UT_LIST_INSERT_AFTER(NAME, BASE, NODE1, NODE2)
#define UT_LIST_REMOVE_CLEAR(NAME, N)
#define UT_LIST_REMOVE(NAME, BASE, N)
#define UT_LIST_GET_NEXT(NAME, N)   (((N)->NAME).next)
#define UT_LIST_GET_PREV(NAME, N)   (((N)->NAME).prev)
#define UT_LIST_GET_LEN(BASE)   (BASE).count
#define UT_LIST_GET_FIRST(BASE)   (BASE).start
#define UT_LIST_GET_LAST(BASE)   (BASE= NULL)
#define UT_LIST_VALIDATE(NAME, TYPE, BASE, ASSERTION)

Detailed Description

List utilities

Created 9/10/1995 Heikki Tuuri

Definition in file ut0lst.h.


Define Documentation

#define UT_LIST_ADD_FIRST (   NAME,
  BASE,
 
)
Value:
{\
  ut_ad(N);\
  ((BASE).count)++;\
  ((N)->NAME).next = (BASE).start;\
  ((N)->NAME).prev = NULL;\
  if (UNIV_LIKELY((BASE).start != NULL)) {\
    ut_ad((BASE).start != (N));\
    (((BASE).start)->NAME).prev = (N);\
  }\
  (BASE).start = (N);\
  if (UNIV_UNLIKELY((BASE).end == NULL)) {\
    (BASE).end = (N);\
  }\
}\

Adds the node as the first element in a two-way linked list.

Parameters:
NAMElist name
BASEthe base node (not a pointer to it)
Npointer to the node to be added to the list.

Definition at line 96 of file ut0lst.h.

Referenced by buf_flush_relocate_on_flush_list(), buf_LRU_block_free_non_file_page(), buf_LRU_insert_zip_clean(), buf_relocate(), buf_unzip_LRU_add_block(), dict_table_add_to_cache(), mem_area_free(), mem_pool_create(), mutex_create_func(), os_event_create(), os_mutex_create(), que_thr_stop(), read_cursor_view_create_for_mysql(), read_view_open_now(), rw_lock_create_func(), trx_allocate_for_mysql(), trx_start_low(), trx_undo_assign_undo(), trx_undo_insert_cleanup(), trx_undo_update_cleanup(), and ut_malloc_low().

#define UT_LIST_ADD_LAST (   NAME,
  BASE,
 
)
Value:
{\
  ut_ad(N != NULL);\
  ((BASE).count)++;\
  ((N)->NAME).prev = (BASE).end;\
  ((N)->NAME).next = NULL;\
  if ((BASE).end != NULL) {\
    ut_ad((BASE).end != (N));\
    (((BASE).end)->NAME).next = (N);\
  }\
  (BASE).end = (N);\
  if ((BASE).start == NULL) {\
    (BASE).start = (N);\
  }\
}\

Adds the node as the last element in a two-way linked list.

Parameters:
NAMElist name
BASEthe base node (not a pointer to it)
Npointer to the node to be added to the list

Definition at line 118 of file ut0lst.h.

Referenced by buf_unzip_LRU_add_block(), dict_foreign_add_to_cache(), dict_index_add_to_cache(), fil_node_create(), fil_space_create(), ins_node_create_entry_list(), lock_move_reorganize_page(), log_group_init(), opt_find_all_cols(), que_graph_publish(), que_thr_create(), read_view_oldest_copy_or_open_new(), srv_conc_enter_innodb(), srv_que_task_enqueue_low(), sym_tab_add_bound_id(), sym_tab_add_bound_lit(), sym_tab_add_id(), sym_tab_add_int_lit(), sym_tab_add_null_lit(), sym_tab_add_str_lit(), trx_savepoint_for_mysql(), and trx_sig_send().

#define UT_LIST_BASE_NODE_T (   TYPE)    int

This macro expands to the unnamed type definition of a struct which acts as the two-way list base node. The base node contains pointers to both ends of the list and a count of nodes in the list (excluding the base node from the count).

Parameters:
TYPEthe name of the list node data type

Definition at line 54 of file ut0lst.h.

#define UT_LIST_GET_FIRST (   BASE)    (BASE).start

Gets the first node in a two-way list.

Parameters:
BASEthe base node (not a pointer to it)
Returns:
first node, or NULL if the list is empty

Definition at line 223 of file ut0lst.h.

Referenced by buf_LRU_get_free_only(), ha_innobase::can_switch_engines(), dict_check_tablespaces_and_store_max_id(), dict_create_add_foreigns_to_dictionary(), dict_foreign_parse_drop_constraints(), dict_get_first_table_name_in_db(), dict_index_find_on_id_low(), dict_load_table(), dict_print_info_on_foreign_keys(), dict_startscan_system(), dict_table_get_foreign_constraint(), dict_table_get_referenced_constraint(), dict_table_print_low(), dict_table_remove_from_cache(), dict_table_rename_in_cache(), dict_table_replace_index_in_foreign_list(), dict_truncate_index_tree(), fil_close_all_files(), fil_delete_tablespace(), fil_flush(), fil_flush_file_spaces(), fil_io(), fil_open_log_and_system_tablespace_files(), fil_rename_tablespace(), fil_space_get_flags(), fil_space_get_size(), fil_validate(), fil_write_flushed_lsn_to_data_files(), ha_innobase::get_foreign_key_list(), innodb_mutex_show_status(), lock_get_src_table(), lock_is_table_exclusive(), lock_move_reorganize_page(), lock_number_of_rows_locked(), lock_print_info_all_transactions(), lock_remove_all_on_table(), log_groups_write_checkpoint_info(), log_write_up_to(), logs_empty_and_mark_files_at_shutdown(), mem_area_alloc(), mem_pool_validate(), mutex_create_func(), mutex_free_func(), opt_find_all_cols(), os_sync_free(), pars_sql(), que_fork_error_handle(), que_fork_start_command(), que_graph_free_recursive(), read_cursor_view_create_for_mysql(), read_view_open_now(), recv_recover_page_func(), recv_recovery_from_checkpoint_start_func(), recv_reset_logs(), row_discard_tablespace_for_mysql(), row_drop_table_for_mysql(), row_drop_tables_for_mysql_in_background(), row_ins_index_entry(), row_sel_step(), row_truncate_table_for_mysql(), rw_lock_create_func(), srv_conc_enter_innodb(), srv_conc_force_exit_innodb(), sym_tab_free_private(), sync_close(), trx_end_lock_wait(), trx_finish_rollback_off_kernel(), trx_get_trx_by_xid(), trx_in_trx_list(), trx_lists_init_at_db_start(), trx_recover_for_mysql(), trx_release_savepoint_for_mysql(), trx_roll_savepoints_free(), trx_rollback_or_clean_recovered(), trx_rollback_to_savepoint_for_mysql(), trx_rseg_get_on_id(), trx_rseg_mem_free(), trx_savepoint_for_mysql(), trx_sig_send(), trx_sig_start_handle(), trx_sys_close(), trx_sys_init_at_db_start(), and ut_free_all_mem().

#define UT_LIST_GET_LAST (   BASE)    (BASE= NULL)

Gets the last node in a two-way list.

Parameters:
BASEthe base node (not a pointer to it)
Returns:
last node, or NULL if the list is empty

Definition at line 234 of file ut0lst.h.

Referenced by buf_pool_get_oldest_modification(), dict_table_remove_from_cache(), dict_table_rename_in_cache(), fil_extend_space_to_desired_size(), lock_release_off_kernel(), read_view_oldest_copy_or_open_new(), and trx_purge().

#define UT_LIST_GET_NEXT (   NAME,
 
)    (((N)->NAME).next)

Gets the next node in a two-way list.

Parameters:
NAMElist name
Npointer to a node
Returns:
the successor of N in NAME, or NULL

Definition at line 200 of file ut0lst.h.

Referenced by buf_LRU_free_block(), buf_LRU_insert_zip_clean(), buf_relocate(), dict_create_add_foreigns_to_dictionary(), dict_foreign_parse_drop_constraints(), dict_index_find_on_id_low(), dict_print_info_on_foreign_keys(), dict_table_get_foreign_constraint(), dict_table_get_referenced_constraint(), dict_table_print_low(), dict_table_remove_from_cache(), dict_table_rename_in_cache(), dict_table_replace_index_in_foreign_list(), dict_truncate_index_tree(), fil_close_all_files(), fil_flush(), fil_flush_file_spaces(), fil_io(), fil_open_log_and_system_tablespace_files(), fil_validate(), fil_write_flushed_lsn_to_data_files(), ha_innobase::get_foreign_key_list(), innodb_mutex_show_status(), lock_get_src_table(), lock_is_table_exclusive(), lock_move_reorganize_page(), lock_number_of_rows_locked(), lock_print_info_all_transactions(), lock_remove_all_on_table(), log_groups_write_checkpoint_info(), log_write_up_to(), mem_pool_validate(), mutex_free_func(), opt_find_all_cols(), pars_sql(), que_fork_error_handle(), que_fork_start_command(), que_graph_free_recursive(), read_cursor_view_create_for_mysql(), read_view_open_now(), recv_recover_page_func(), recv_recovery_from_checkpoint_start_func(), recv_reset_logs(), row_discard_tablespace_for_mysql(), row_drop_table_for_mysql(), row_truncate_table_for_mysql(), rw_lock_free_func(), srv_conc_force_exit_innodb(), sym_tab_free_private(), sync_close(), trx_finish_rollback_off_kernel(), trx_get_trx_by_xid(), trx_in_trx_list(), trx_lists_init_at_db_start(), trx_recover_for_mysql(), trx_release_savepoint_for_mysql(), trx_roll_savepoints_free(), trx_rollback_or_clean_recovered(), trx_rollback_to_savepoint_for_mysql(), trx_rseg_get_on_id(), trx_rseg_mem_free(), trx_savepoint_for_mysql(), trx_sys_close(), and trx_sys_init_at_db_start().

#define UT_LIST_GET_PREV (   NAME,
 
)    (((N)->NAME).prev)

Gets the previous node in a two-way list.

Parameters:
NAMElist name
Npointer to a node
Returns:
the predecessor of N in NAME, or NULL

Definition at line 208 of file ut0lst.h.

Referenced by buf_flush_relocate_on_flush_list(), buf_LRU_free_block(), buf_LRU_insert_zip_clean(), buf_relocate(), lock_queue_iterator_get_prev(), lock_remove_all_on_table(), mutex_free_func(), and rw_lock_free_func().

#define UT_LIST_INSERT_AFTER (   NAME,
  BASE,
  NODE1,
  NODE2 
)
Value:
{\
  ut_ad(NODE1);\
  ut_ad(NODE2);\
  ut_ad((NODE1) != (NODE2));\
  ((BASE).count)++;\
  ((NODE2)->NAME).prev = (NODE1);\
  ((NODE2)->NAME).next = ((NODE1)->NAME).next;\
  if (((NODE1)->NAME).next != NULL) {\
    ((((NODE1)->NAME).next)->NAME).prev = (NODE2);\
  }\
  ((NODE1)->NAME).next = (NODE2);\
  if ((BASE).end == (NODE1)) {\
    (BASE).end = (NODE2);\
  }\
}\

Inserts a NODE2 after NODE1 in a list.

Parameters:
NAMElist name
BASEthe base node (not a pointer to it)
NODE1pointer to node after which NODE2 is inserted
NODE2pointer to node being inserted after NODE1

Definition at line 141 of file ut0lst.h.

Referenced by buf_flush_relocate_on_flush_list(), buf_LRU_free_block(), buf_LRU_insert_zip_clean(), and buf_relocate().

#define UT_LIST_NODE_T (   TYPE)
Value:
struct {\
  TYPE *  prev; \
  TYPE *  next; \
}\

This macro expands to the unnamed type definition of a struct which should be embedded in the nodes of the list, the node type must be a struct. This struct contains the pointers to next and previous nodes in the list. The name of the field in the node struct should be the name given to the list.

Parameters:
TYPEthe list node type name

Definition at line 73 of file ut0lst.h.

#define UT_LIST_REMOVE (   NAME,
  BASE,
 
)
Value:
do {                  \
  ut_ad(N);             \
  ut_a((BASE).count > 0);           \
  ((BASE).count)--;           \
  if (((N)->NAME).next != NULL) {         \
    ((((N)->NAME).next)->NAME).prev = ((N)->NAME).prev; \
  } else {              \
    (BASE).end = ((N)->NAME).prev;        \
  }               \
  if (((N)->NAME).prev != NULL) {         \
    ((((N)->NAME).prev)->NAME).next = ((N)->NAME).next; \
  } else {              \
    (BASE).start = ((N)->NAME).next;      \
  }               \
  UT_LIST_REMOVE_CLEAR(NAME, N);          \
} while (0)

Removes a node from a two-way linked list.

Parameters:
NAMElist name
BASEthe base node (not a pointer to it)
Npointer to the node to be removed from the list

Definition at line 177 of file ut0lst.h.

Referenced by buf_flush_relocate_on_flush_list(), buf_flush_remove(), buf_LRU_get_free_only(), buf_page_get_gen(), buf_relocate(), dict_foreign_add_to_cache(), dict_index_remove_from_cache(), dict_table_remove_from_cache(), fil_flush(), mem_area_alloc(), mem_area_free(), mutex_free_func(), os_event_free(), os_mutex_free(), read_view_close(), row_drop_tables_for_mysql_in_background(), rw_lock_free_func(), srv_conc_enter_innodb(), trx_cleanup_at_db_startup(), trx_commit_off_kernel(), trx_end_lock_wait(), trx_free_for_mysql(), trx_roll_savepoint_free(), trx_rseg_mem_free(), trx_savepoint_for_mysql(), trx_sig_remove(), trx_sig_reply(), trx_sys_close(), trx_undo_insert_cleanup(), trx_undo_update_cleanup(), ut_free(), and ut_free_all_mem().

#define UT_LIST_REMOVE_CLEAR (   NAME,
 
)

Invalidate the pointers in a list node.

Parameters:
NAMElist name
Npointer to the node that was removed

Definition at line 168 of file ut0lst.h.

#define UT_LIST_VALIDATE (   NAME,
  TYPE,
  BASE,
  ASSERTION 
)
Value:
do {                  \
  ulint ut_list_i_313;            \
  TYPE* ut_list_node_313;         \
                  \
  ut_list_node_313 = (BASE).start;        \
                  \
  for (ut_list_i_313 = (BASE).count; ut_list_i_313--; ) {   \
    ut_a(ut_list_node_313);         \
    ASSERTION;            \
    ut_ad((ut_list_node_313->NAME).next || !ut_list_i_313); \
    ut_list_node_313 = (ut_list_node_313->NAME).next; \
  }               \
									\
	ut_a(ut_list_node_313 == NULL);          \
                  \
  ut_list_node_313 = (BASE).end;          \
                  \
  for (ut_list_i_313 = (BASE).count; ut_list_i_313--; ) {   \
    ut_a(ut_list_node_313);         \
    ASSERTION;            \
    ut_ad((ut_list_node_313->NAME).prev || !ut_list_i_313); \
    ut_list_node_313 = (ut_list_node_313->NAME).prev; \
  }               \
									\
	ut_a(ut_list_node_313 == NULL);          \
} while (0)

Checks the consistency of a two-way list.

Parameters:
NAMEthe name of the list
TYPEnode type
BASEbase node (not a pointer to it)
ASSERTIONa condition on ut_list_node_313

Definition at line 243 of file ut0lst.h.

Referenced by buf_relocate(), fil_validate(), and mem_pool_validate().