📄 gdsl_list.3
字号:
\fBSee also:\fP.RS 4\fBgdsl_list_cursor_move_to_tail()\fP .RE.PP.SS "void gdsl_list_cursor_move_to_tail (\fBgdsl_list_cursor_t\fP C)".PPPut a cursor on the tail of its list. .PPPut the cursor C on the tail of C's list. Does nothing if C's list is empty..PP\fBNote:\fP.RS 4Complexity: O( 1 ) .RE.PP\fBPrecondition:\fP.RS 4C must be a valid gdsl_list_cursor_t .RE.PP\fBParameters:\fP.RS 4\fIC\fP The cursor to use .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_cursor_move_to_head()\fP .RE.PP.SS "\fBgdsl_element_t\fP gdsl_list_cursor_move_to_value (\fBgdsl_list_cursor_t\fP C, \fBgdsl_compare_func_t\fP COMP_F, void * VALUE)".PPPlace a cursor on a particular element. .PPSearch a particular element E in the cursor's list L by comparing all list's elements to VALUE, by using COMP_F. If E is found, C is positionned on it..PP\fBNote:\fP.RS 4Complexity: O( |L| / 2 ) .RE.PP\fBPrecondition:\fP.RS 4C must be a valid gdsl_list_cursor_t & COMP_F != NULL .RE.PP\fBParameters:\fP.RS 4\fIC\fP The cursor to put on the element E .br\fICOMP_F\fP The comparison function to search for E .br\fIVALUE\fP The value used to compare list's elements with .RE.PP\fBReturns:\fP.RS 4the first founded element E in case it exists. .PPNULL in case of element E is not found. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_cursor_move_to_position()\fP .RE.PP.SS "\fBgdsl_element_t\fP gdsl_list_cursor_move_to_position (\fBgdsl_list_cursor_t\fP C, \fBulong\fP POS)".PPPlace a cursor on a element given by its position. .PPSearch for the POS-th element in the cursor's list L. In case this element exists, the cursor C is positionned on it..PP\fBNote:\fP.RS 4Complexity: O( |L| / 2 ) .RE.PP\fBPrecondition:\fP.RS 4C must be a valid gdsl_list_cursor_t & POS > 0 & POS <= |L| .RE.PP\fBParameters:\fP.RS 4\fIC\fP The cursor to put on the POS-th element .br\fIPOS\fP The position of the element to move on .RE.PP\fBReturns:\fP.RS 4the element at the POS-th position .PPNULL if POS <= 0 or POS > |L| .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_cursor_move_to_value()\fP .RE.PP.SS "void gdsl_list_cursor_step_forward (\fBgdsl_list_cursor_t\fP C)".PPMove a cursor one step forward of its list. .PPMove the cursor C one node forward (from head to tail). Does nothing if C is already on its list's tail..PP\fBNote:\fP.RS 4Complexity: O( 1 ) .RE.PP\fBPrecondition:\fP.RS 4C must be a valid gdsl_list_cursor_t .RE.PP\fBParameters:\fP.RS 4\fIC\fP The cursor to use .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_cursor_step_backward()\fP .RE.PP.SS "void gdsl_list_cursor_step_backward (\fBgdsl_list_cursor_t\fP C)".PPMove a cursor one step backward of its list. .PPMove the cursor C one node backward (from tail to head.) Does nothing if C is already on its list's head..PP\fBNote:\fP.RS 4Complexity: O( 1 ) .RE.PP\fBPrecondition:\fP.RS 4C must be a valid gdsl_list_cursor_t .RE.PP\fBParameters:\fP.RS 4\fIC\fP The cursor to use .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_cursor_step_forward()\fP .RE.PP.SS "\fBbool\fP gdsl_list_cursor_is_on_head (const \fBgdsl_list_cursor_t\fP C)".PPCheck if a cursor is on the head of its list. .PP\fBNote:\fP.RS 4Complexity: O( 1 ) .RE.PP\fBPrecondition:\fP.RS 4C must be a valid gdsl_list_cursor_t .RE.PP\fBParameters:\fP.RS 4\fIC\fP The cursor to check .RE.PP\fBReturns:\fP.RS 4TRUE if C is on its list's head. .PPFALSE if C is not on its lits's head. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_cursor_is_on_tail()\fP .RE.PP.SS "\fBbool\fP gdsl_list_cursor_is_on_tail (const \fBgdsl_list_cursor_t\fP C)".PPCheck if a cursor is on the tail of its list. .PP\fBNote:\fP.RS 4Complexity: O( 1 ) .RE.PP\fBPrecondition:\fP.RS 4C must be a valid gdsl_list_cursor_t .RE.PP\fBParameters:\fP.RS 4\fIC\fP The cursor to check .RE.PP\fBReturns:\fP.RS 4TRUE if C is on its lists's tail. .PPFALSE if C is not on its list's tail. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_cursor_is_on_head()\fP .RE.PP.SS "\fBbool\fP gdsl_list_cursor_has_succ (const \fBgdsl_list_cursor_t\fP C)".PPCheck if a cursor has a successor. .PP\fBNote:\fP.RS 4Complexity: O( 1 ) .RE.PP\fBPrecondition:\fP.RS 4C must be a valid gdsl_list_cursor_t .RE.PP\fBParameters:\fP.RS 4\fIC\fP The cursor to check .RE.PP\fBReturns:\fP.RS 4TRUE if there exists an element after the cursor C. .PPFALSE if there is no element after the cursor C. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_cursor_has_pred()\fP .RE.PP.SS "\fBbool\fP gdsl_list_cursor_has_pred (const \fBgdsl_list_cursor_t\fP C)".PPCheck if a cursor has a predecessor. .PP\fBNote:\fP.RS 4Complexity: O( 1 ) .RE.PP\fBPrecondition:\fP.RS 4C must be a valid gdsl_list_cursor_t .RE.PP\fBParameters:\fP.RS 4\fIC\fP The cursor to check .RE.PP\fBReturns:\fP.RS 4TRUE if there exists an element before the cursor C. .PPFALSE if there is no element before the cursor C. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_cursor_has_succ()\fP .RE.PP.SS "void gdsl_list_cursor_set_content (\fBgdsl_list_cursor_t\fP C, \fBgdsl_element_t\fP E)".PPSet the content of the cursor. .PPSet C's element to E. The previous element is *NOT* deallocated. If it must be deallocated, \fBgdsl_list_cursor_get_content()\fP could be used to get it in order to free it before..PP\fBNote:\fP.RS 4Complexity: O( 1 ) .RE.PP\fBPrecondition:\fP.RS 4C must be a valid gdsl_list_cursor_t .RE.PP\fBParameters:\fP.RS 4\fIC\fP The cursor in which the content must be modified. .br\fIE\fP The value used to modify C's content. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_cursor_get_content()\fP .RE.PP.SS "\fBgdsl_element_t\fP gdsl_list_cursor_get_content (const \fBgdsl_list_cursor_t\fP C)".PPGet the content of a cursor. .PP\fBNote:\fP.RS 4Complexity: O( 1 ) .RE.PP\fBPrecondition:\fP.RS 4C must be a valid gdsl_list_cursor_t .RE.PP\fBParameters:\fP.RS 4\fIC\fP The cursor to get the content from. .RE.PP\fBReturns:\fP.RS 4the element contained in the cursor C. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_cursor_set_content()\fP .RE.PP.SS "\fBgdsl_element_t\fP gdsl_list_cursor_insert_after (\fBgdsl_list_cursor_t\fP C, void * VALUE)".PPInsert a new element after a cursor. .PPA new element is created using ALLOC_F called on VALUE. ALLOC_F is the pointer passed to \fBgdsl_list_alloc()\fP. If the returned value is not NULL, then the new element is placed after the cursor C. If C's list is empty, the element is inserted at the head position of C's list..PP\fBNote:\fP.RS 4Complexity: O( 1 ) .RE.PP\fBPrecondition:\fP.RS 4C must be a valid gdsl_list_cursor_t .RE.PP\fBParameters:\fP.RS 4\fIC\fP The cursor after which the new element must be inserted .br\fIVALUE\fP The value used to allocate the new element to insert .RE.PP\fBReturns:\fP.RS 4the newly inserted element in case of success. .PPNULL in case of failure. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_cursor_insert_before()\fP .PP\fBgdsl_list_cursor_remove_after()\fP .PP\fBgdsl_list_cursor_remove_before()\fP .RE.PP.SS "\fBgdsl_element_t\fP gdsl_list_cursor_insert_before (\fBgdsl_list_cursor_t\fP C, void * VALUE)".PPInsert a new element before a cursor. .PPA new element is created using ALLOC_F called on VALUE. ALLOC_F is the pointer passed to \fBgdsl_list_alloc()\fP. If the returned value is not NULL, then the new element is placed before the cursor C. If C's list is empty, the element is inserted at the head position of C's list..PP\fBNote:\fP.RS 4Complexity: O( 1 ) .RE.PP\fBPrecondition:\fP.RS 4C must be a valid gdsl_list_cursor_t .RE.PP\fBParameters:\fP.RS 4\fIC\fP The cursor before which the new element must be inserted .br\fIVALUE\fP The value used to allocate the new element to insert .RE.PP\fBReturns:\fP.RS 4the newly inserted element in case of success. .PPNULL in case of failure. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_cursor_insert_after()\fP .PP\fBgdsl_list_cursor_remove_after()\fP .PP\fBgdsl_list_cursor_remove_before()\fP .RE.PP.SS "\fBgdsl_element_t\fP gdsl_list_cursor_remove (\fBgdsl_list_cursor_t\fP C)".PPRemovec the element under a cursor. .PP\fBNote:\fP.RS 4Complexity: O( 1 ) .RE.PP\fBPrecondition:\fP.RS 4C must be a valid gdsl_list_cursor_t .RE.PP\fBPostcondition:\fP.RS 4After this operation, the cursor is positionned on to its successor. .RE.PP\fBParameters:\fP.RS 4\fIC\fP The cursor to remove the content from. .RE.PP\fBReturns:\fP.RS 4the removed element if it exists. .PPNULL if there is not element to remove. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_cursor_insert_after()\fP .PP\fBgdsl_list_cursor_insert_before()\fP .PP\fBgdsl_list_cursor_remove()\fP .PP\fBgdsl_list_cursor_remove_before()\fP .RE.PP.SS "\fBgdsl_element_t\fP gdsl_list_cursor_remove_after (\fBgdsl_list_cursor_t\fP C)".PPRemovec the element after a cursor. .PP\fBNote:\fP.RS 4Complexity: O( 1 ) .RE.PP\fBPrecondition:\fP.RS 4C must be a valid gdsl_list_cursor_t .RE.PP\fBParameters:\fP.RS 4\fIC\fP The cursor to remove the successor from. .RE.PP\fBReturns:\fP.RS 4the removed element if it exists. .PPNULL if there is not element to remove. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_cursor_insert_after()\fP .PP\fBgdsl_list_cursor_insert_before()\fP .PP\fBgdsl_list_cursor_remove()\fP .PP\fBgdsl_list_cursor_remove_before()\fP .RE.PP.SS "\fBgdsl_element_t\fP gdsl_list_cursor_remove_before (\fBgdsl_list_cursor_t\fP C)".PPRemove the element before a cursor. .PP\fBNote:\fP.RS 4Complexity: O( 1 ) .RE.PP\fBPrecondition:\fP.RS 4C must be a valid gdsl_list_cursor_t .RE.PP\fBParameters:\fP.RS 4\fIC\fP The cursor to remove the predecessor from. .RE.PP\fBReturns:\fP.RS 4the removed element if it exists. .PPNULL if there is not element to remove. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_cursor_insert_after()\fP .PP\fBgdsl_list_cursor_insert_before()\fP .PP\fBgdsl_list_cursor_remove()\fP .PP\fBgdsl_list_cursor_remove_after()\fP .RE.PP.SS "\fBgdsl_list_cursor_t\fP gdsl_list_cursor_delete (\fBgdsl_list_cursor_t\fP C)".PPDelete the element under a cursor. .PPRemove the element under the cursor C. The removed element is also deallocated using FREE_F passed to \fBgdsl_list_alloc()\fP..PPComplexity: O( 1 ).PP\fBPrecondition:\fP.RS 4C must be a valid gdsl_list_cursor_t .RE.PP\fBParameters:\fP.RS 4\fIC\fP The cursor to delete the content. .RE.PP\fBReturns:\fP.RS 4the cursor C if the element was removed. .PPNULL if there is not element to remove. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_cursor_delete_before()\fP .PP\fBgdsl_list_cursor_delete_after()\fP .RE.PP.SS "\fBgdsl_list_cursor_t\fP gdsl_list_cursor_delete_after (\fBgdsl_list_cursor_t\fP C)".PPDelete the element after a cursor. .PPRemove the element after the cursor C. The removed element is also deallocated using FREE_F passed to \fBgdsl_list_alloc()\fP..PPComplexity: O( 1 ).PP\fBPrecondition:\fP.RS 4C must be a valid gdsl_list_cursor_t .RE.PP\fBParameters:\fP.RS 4\fIC\fP The cursor to delete the successor from. .RE.PP\fBReturns:\fP.RS 4the cursor C if the element was removed. .PPNULL if there is not element to remove. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_cursor_delete()\fP .PP\fBgdsl_list_cursor_delete_before()\fP .RE.PP.SS "\fBgdsl_list_cursor_t\fP gdsl_list_cursor_delete_before (\fBgdsl_list_cursor_t\fP C)".PPDelete the element before the cursor of a list. .PPRemove the element before the cursor C. The removed element is also deallocated using FREE_F passed to \fBgdsl_list_alloc()\fP..PP\fBNote:\fP.RS 4Complexity: O( 1 ) .RE.PP\fBPrecondition:\fP.RS 4C must be a valid gdsl_list_cursor_t .RE.PP\fBParameters:\fP.RS 4\fIC\fP The cursor to delete the predecessor from. .RE.PP\fBReturns:\fP.RS 4the cursor C if the element was removed. .PPNULL if there is not element to remove. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_cursor_delete()\fP .PP\fBgdsl_list_cursor_delete_after()\fP .RE.PP
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -