⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gdsl_list.3

📁 书籍上的数据结构源代码
💻 3
📖 第 1 页 / 共 3 页
字号:
.SS "\fBgdsl_element_t\fP gdsl_list_remove_tail (\fBgdsl_list_t\fP L)".PPRemove the tail of a list. .PPRemove the element at the tail of the list L..PP\fBNote:\fP.RS 4Complexity: O( 1 ) .RE.PP\fBPrecondition:\fP.RS 4L must be a valid gdsl_list_t .RE.PP\fBParameters:\fP.RS 4\fIL\fP The list to remove the tail from .RE.PP\fBReturns:\fP.RS 4the removed element in case of success. .PPNULL in case of L is empty. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_insert_head()\fP .PP\fBgdsl_list_insert_tail()\fP .PP\fBgdsl_list_remove_head()\fP .PP\fBgdsl_list_remove()\fP .RE.PP.SS "\fBgdsl_element_t\fP gdsl_list_remove (\fBgdsl_list_t\fP L, \fBgdsl_compare_func_t\fP COMP_F, const void * VALUE)".PPRemove a particular element from a list. .PPSearch into the list L for the first element E equal to VALUE by using COMP_F. If E is found, it is removed from L and then returned..PP\fBNote:\fP.RS 4Complexity: O( |L| / 2 ) .RE.PP\fBPrecondition:\fP.RS 4L must be a valid gdsl_list_t & COMP_F != NULL .RE.PP\fBParameters:\fP.RS 4\fIL\fP The list to remove the element from .br\fICOMP_F\fP The comparison function used to find the element to remove .br\fIVALUE\fP The value used to compare the element to remove with .RE.PP\fBReturns:\fP.RS 4the founded element E if it was found. .PPNULL in case the searched element E was not found. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_insert_head()\fP .PP\fBgdsl_list_insert_tail()\fP .PP\fBgdsl_list_remove_head()\fP .PP\fBgdsl_list_remove_tail()\fP .RE.PP.SS "\fBgdsl_list_t\fP gdsl_list_delete_head (\fBgdsl_list_t\fP L)".PPDelete the head of a list. .PPRemove the header element from the list L and deallocates it using the FREE_F function passed to \fBgdsl_list_alloc()\fP..PP\fBNote:\fP.RS 4Complexity: O( 1 ) .RE.PP\fBPrecondition:\fP.RS 4L must be a valid gdsl_list_t .RE.PP\fBParameters:\fP.RS 4\fIL\fP The list to destroy the head from .RE.PP\fBReturns:\fP.RS 4the modified list L in case of success. .PPNULL if L is empty. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_alloc()\fP .PPgdsl_list_destroy_tail() .PPgdsl_list_destroy() .RE.PP.SS "\fBgdsl_list_t\fP gdsl_list_delete_tail (\fBgdsl_list_t\fP L)".PPDelete the tail of a list. .PPRemove the footer element from the list L and deallocates it using the FREE_F function passed to \fBgdsl_list_alloc()\fP..PP\fBNote:\fP.RS 4Complexity: O( 1 ) .RE.PP\fBPrecondition:\fP.RS 4L must be a valid gdsl_list_t .RE.PP\fBParameters:\fP.RS 4\fIL\fP The list to destroy the tail from .RE.PP\fBReturns:\fP.RS 4the modified list L in case of success. .PPNULL if L is empty. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_alloc()\fP .PPgdsl_list_destroy_head() .PPgdsl_list_destroy() .RE.PP.SS "\fBgdsl_list_t\fP gdsl_list_delete (\fBgdsl_list_t\fP L, \fBgdsl_compare_func_t\fP COMP_F, const void * VALUE)".PPDelete a particular element from a list. .PPSearch into the list L for the first element E equal to VALUE by using COMP_F. If E is found, it is removed from L and deallocated using the FREE_F function passed to \fBgdsl_list_alloc()\fP..PP\fBNote:\fP.RS 4Complexity: O( |L| / 2 ) .RE.PP\fBPrecondition:\fP.RS 4L must be a valid gdsl_list_t & COMP_F != NULL .RE.PP\fBParameters:\fP.RS 4\fIL\fP The list to destroy the element from .br\fICOMP_F\fP The comparison function used to find the element to destroy .br\fIVALUE\fP The value used to compare the element to destroy with .RE.PP\fBReturns:\fP.RS 4the modified list L if the element is found. .PPNULL if the element to destroy is not found. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_alloc()\fP .PPgdsl_list_destroy_head() .PPgdsl_list_destroy_tail() .RE.PP.SS "\fBgdsl_element_t\fP gdsl_list_search (const \fBgdsl_list_t\fP L, \fBgdsl_compare_func_t\fP COMP_F, const void * VALUE)".PPSearch for a particular element into a list. .PPSearch the first element E equal to VALUE in the list L, by using COMP_F to compare all L's element with..PP\fBNote:\fP.RS 4Complexity: O( |L| / 2 ) .RE.PP\fBPrecondition:\fP.RS 4L must be a valid gdsl_list_t & COMP_F != NULL .RE.PP\fBParameters:\fP.RS 4\fIL\fP The list to search the element in .br\fICOMP_F\fP The comparison function used to compare L's element with VALUE .br\fIVALUE\fP The value to compare L's elemenst with .RE.PP\fBReturns:\fP.RS 4the first founded element E in case of success. .PPNULL in case the searched element E was not found. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_search_by_position()\fP .PP\fBgdsl_list_search_max()\fP .PP\fBgdsl_list_search_min()\fP .RE.PP.SS "\fBgdsl_element_t\fP gdsl_list_search_by_position (const \fBgdsl_list_t\fP L, \fBulong\fP POS)".PPSearch for an element by its position in a list. .PP\fBNote:\fP.RS 4Complexity: O( |L| / 2 ) .RE.PP\fBPrecondition:\fP.RS 4L must be a valid gdsl_list_t & POS > 0 & POS <= |L| .RE.PP\fBParameters:\fP.RS 4\fIL\fP The list to search the element in .br\fIPOS\fP The position where is the element to search .RE.PP\fBReturns:\fP.RS 4the element at the POS-th position in the list L. .PPNULL if POS > |L| or POS <= 0. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_search()\fP .PP\fBgdsl_list_search_max()\fP .PP\fBgdsl_list_search_min()\fP .RE.PP.SS "\fBgdsl_element_t\fP gdsl_list_search_max (const \fBgdsl_list_t\fP L, \fBgdsl_compare_func_t\fP COMP_F)".PPSearch for the greatest element of a list. .PPSearch the greatest element of the list L, by using COMP_F to compare L's elements with..PP\fBNote:\fP.RS 4Complexity: O( |L| ) .RE.PP\fBPrecondition:\fP.RS 4L must be a valid gdsl_list_t & COMP_F != NULL .RE.PP\fBParameters:\fP.RS 4\fIL\fP The list to search the element in .br\fICOMP_F\fP The comparison function to use to compare L's element with .RE.PP\fBReturns:\fP.RS 4the highest element of L, by using COMP_F function. .PPNULL if L is empty. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_search()\fP .PP\fBgdsl_list_search_by_position()\fP .PP\fBgdsl_list_search_min()\fP .RE.PP.SS "\fBgdsl_element_t\fP gdsl_list_search_min (const \fBgdsl_list_t\fP L, \fBgdsl_compare_func_t\fP COMP_F)".PPSearch for the lowest element of a list. .PPSearch the lowest element of the list L, by using COMP_F to compare L's elements with..PP\fBNote:\fP.RS 4Complexity: O( |L| ) .RE.PP\fBPrecondition:\fP.RS 4L must be a valid gdsl_list_t & COMP_F != NULL .RE.PP\fBParameters:\fP.RS 4\fIL\fP The list to search the element in .br\fICOMP_F\fP The comparison function to use to compare L's element with .RE.PP\fBReturns:\fP.RS 4the lowest element of L, by using COMP_F function. .PPNULL if L is empty. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_search()\fP .PP\fBgdsl_list_search_by_position()\fP .PP\fBgdsl_list_search_max()\fP .RE.PP.SS "\fBgdsl_list_t\fP gdsl_list_sort (\fBgdsl_list_t\fP L, \fBgdsl_compare_func_t\fP COMP_F)".PPSort a list. .PPSort the list L using COMP_F to order L's elements..PP\fBNote:\fP.RS 4Complexity: O( |L| * log( |L| ) ) .RE.PP\fBPrecondition:\fP.RS 4L must be a valid gdsl_list_t & COMP_F != NULL & L must not contains elements that are equals .RE.PP\fBParameters:\fP.RS 4\fIL\fP The list to sort .br\fICOMP_F\fP The comparison function used to order L's elements .RE.PP\fBReturns:\fP.RS 4the sorted list L. .RE.PP.SS "\fBgdsl_element_t\fP gdsl_list_map_forward (const \fBgdsl_list_t\fP L, \fBgdsl_map_func_t\fP MAP_F, void * USER_DATA)".PPParse a list from head to tail. .PPParse all elements of the list L from head to tail. The MAP_F function is called on each L's element with USER_DATA argument. If MAP_F returns GDSL_MAP_STOP, then \fBgdsl_list_map_forward()\fP stops and returns its last examinated element..PP\fBNote:\fP.RS 4Complexity: O( |L| ) .RE.PP\fBPrecondition:\fP.RS 4L must be a valid gdsl_list_t & MAP_F != NULL .RE.PP\fBParameters:\fP.RS 4\fIL\fP The list to parse .br\fIMAP_F\fP The map function to apply on each L's element .br\fIUSER_DATA\fP User's datas passed to MAP_F .RE.PP\fBReturns:\fP.RS 4the first element for which MAP_F returns GDSL_MAP_STOP. .PPNULL when the parsing is done. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_map_backward()\fP .RE.PP.SS "\fBgdsl_element_t\fP gdsl_list_map_backward (const \fBgdsl_list_t\fP L, \fBgdsl_map_func_t\fP MAP_F, void * USER_DATA)".PPParse a list from tail to head. .PPParse all elements of the list L from tail to head. The MAP_F function is called on each L's element with USER_DATA argument. If MAP_F returns GDSL_MAP_STOP then \fBgdsl_list_map_backward()\fP stops and returns its last examinated element..PP\fBNote:\fP.RS 4Complexity: O( |L| ) .RE.PP\fBPrecondition:\fP.RS 4L must be a valid gdsl_list_t & MAP_F != NULL .RE.PP\fBParameters:\fP.RS 4\fIL\fP The list to parse .br\fIMAP_F\fP The map function to apply on each L's element .br\fIUSER_DATA\fP User's datas passed to MAP_F .RE.PP\fBReturns:\fP.RS 4the first element for which MAP_F returns GDSL_MAP_STOP. .PPNULL when the parsing is done. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_map_forward()\fP .RE.PP.SS "void gdsl_list_write (const \fBgdsl_list_t\fP L, \fBgdsl_write_func_t\fP WRITE_F, FILE * OUTPUT_FILE, void * USER_DATA)".PPWrite all the elements of a list to a file. .PPWrite the elements of the list L to OUTPUT_FILE, using WRITE_F function. Additionnal USER_DATA argument could be passed to WRITE_F..PP\fBNote:\fP.RS 4Complexity: O( |L| ) .RE.PP\fBPrecondition:\fP.RS 4L must be a valid gdsl_list_t & OUTPUT_FILE != NULL & WRITE_F != NULL .RE.PP\fBParameters:\fP.RS 4\fIL\fP The list to write. .br\fIWRITE_F\fP The write function. .br\fIOUTPUT_FILE\fP The file where to write L's elements. .br\fIUSER_DATA\fP User's datas passed to WRITE_F. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_write_xml()\fP .PP\fBgdsl_list_dump()\fP .RE.PP.SS "void gdsl_list_write_xml (const \fBgdsl_list_t\fP L, \fBgdsl_write_func_t\fP WRITE_F, FILE * OUTPUT_FILE, void * USER_DATA)".PPWrite the content of a list to a file into XML. .PPWrite the elements of the list L to OUTPUT_FILE, into XML language. If WRITE_F != NULL, then uses WRITE_F to write L's elements to OUTPUT_FILE. Additionnal USER_DATA argument could be passed to WRITE_F..PP\fBNote:\fP.RS 4Complexity: O( |L| ) .RE.PP\fBPrecondition:\fP.RS 4L must be a valid gdsl_list_t & OUTPUT_FILE != NULL .RE.PP\fBParameters:\fP.RS 4\fIL\fP The list to write. .br\fIWRITE_F\fP The write function. .br\fIOUTPUT_FILE\fP The file where to write L's elements. .br\fIUSER_DATA\fP User's datas passed to WRITE_F. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_write()\fP .PP\fBgdsl_list_dump()\fP .RE.PP.SS "void gdsl_list_dump (const \fBgdsl_list_t\fP L, \fBgdsl_write_func_t\fP WRITE_F, FILE * OUTPUT_FILE, void * USER_DATA)".PPDump the internal structure of a list to a file. .PPDump the structure of the list L to OUTPUT_FILE. If WRITE_F != NULL, then uses WRITE_F to write L's elements to OUTPUT_FILE. Additionnal USER_DATA argument could be passed to WRITE_F..PP\fBNote:\fP.RS 4Complexity: O( |L| ) .RE.PP\fBPrecondition:\fP.RS 4L must be a valid gdsl_list_t & OUTPUT_FILE != NULL .RE.PP\fBParameters:\fP.RS 4\fIL\fP The list to write. .br\fIWRITE_F\fP The write function. .br\fIOUTPUT_FILE\fP The file where to write L's elements. .br\fIUSER_DATA\fP User's datas passed to WRITE_F. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_write()\fP .PP\fBgdsl_list_write_xml()\fP .RE.PP.SS "\fBgdsl_list_cursor_t\fP gdsl_list_cursor_alloc (const \fBgdsl_list_t\fP L)".PPCreate a new list cursor. .PP\fBNote:\fP.RS 4Complexity: O( 1 ) .RE.PP\fBPrecondition:\fP.RS 4L must be a valid gdsl_list_t .RE.PP\fBParameters:\fP.RS 4\fIL\fP The list on wich the cursor is positionned. .RE.PP\fBReturns:\fP.RS 4the newly allocated list cursor in case of success. .PPNULL in case of insufficient memory. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_cursor_free()\fP .RE.PP.SS "void gdsl_list_cursor_free (\fBgdsl_list_cursor_t\fP C)".PPDestroy a list 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 list cursor to destroy. .RE.PP\fBSee also:\fP.RS 4\fBgdsl_list_cursor_alloc()\fP .RE.PP.SS "void gdsl_list_cursor_move_to_head (\fBgdsl_list_cursor_t\fP C)".PPPut a cursor on the head of its list. .PPPut the cursor C on the head 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

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -